Opened 19 years ago

Closed 17 years ago

#503 closed bug (fixed)

[BColorControl] flickering and cpu eater

Reported by: diver Owned by: jackburton
Priority: low Milestone: R1
Component: Kits/Interface Kit Version:
Keywords: Cc: cl21
Blocked By: Blocking:
Platform: All

Description (last modified by axeld)

It most noticable in Menu pref. Start Pulse. In Menu open Select Color Scheme and start to move sliders and you will see much flickering and in the same time it will eat all your cpu time.

Attachments (1)

patch-bug#503.diff (1.6 KB ) - added by cl21 17 years ago.
Only the rectangles containing the selectors are invalidated on color change. Reduces the flickering.

Download all attachments as: .zip

Change History (14)

comment:1 by axeld, 18 years ago

Component: GeneralUser Interface/Interface Kit
Description: modified (diff)
Platform: All
Priority: normallow

by cl21, 17 years ago

Attachment: patch-bug#503.diff added

Only the rectangles containing the selectors are invalidated on color change. Reduces the flickering.

comment:2 by jackburton, 17 years ago

Owner: changed from axeld to jackburton

I'll apply the patch. Thank you for your work!

comment:3 by jackburton, 17 years ago

Resolution: fixed
Status: newclosed

I've applied the patch in hrev23192. The bug is fixed. Thank you!

comment:4 by diver, 17 years ago

Resolution: fixed
Status: closedreopened

Reopening as some flickering remains while moving slider. Also cpu usage still the same (~100%). Tested under vmware on linux with hrev23367.

comment:5 by diver, 17 years ago

Cc: cl21 added

comment:6 by aldeck, 17 years ago

I'm working on a patch for BColorControl (see #1701), i'll have a look at this. If i'm not wrong, the color ramps redraw doesn't take into account the update rect.

comment:7 by jackburton, 17 years ago

What do you think about having the color ramps cached in the offscreen bitmap, and the selectors drawn directly on the view ?

comment:8 by stippi, 17 years ago

+1!

comment:9 by aldeck, 17 years ago

Definitely! I could do it :) But i'm a little perplex right now :

I've implemented partial redraw of the ramps, but didn't get enough performance gain. I've looked at the code of BSlider, it doesn't (as of now) use an offscreen bitmap (ifdefed) but is much more responsive under system load. I wonder if there isn't a mouse tracking issue that would cause a lot of unnecessary redraws. Also, since i was mostly testing trough prefs/Menu/ColorScheme, there might also be a slowdown due to the sample menu updates (changing menu color in real time).

I also investigated why do we see the invalidate rect in white when moving fast. I tried everything, without success...

Unfortunately i won't have much time this week.. I'll keep you updated :-)

comment:10 by aldeck, 17 years ago

jackburton: Your last commit, hrev23518 "using B_NO_POINTER_HISTORY in SetMouseEventMask()" did the trick for the cpu eating issue. It's now much more responsive even under load, even without offscreen drawing.

I've got a patch, almost ready for submission, which implements the 8bit palette mode and corrects other minor issues. I need to reimplement offscreen drawing since i postponed the question until the palette mode was finished. (optimize only when everything works :) ) BColorControl only lacks keyboard navigation now!

in reply to:  10 ; comment:11 by jackburton, 17 years ago

Replying to aldeck:

jackburton: Your last commit, hrev23518 "using B_NO_POINTER_HISTORY in SetMouseEventMask()" did the trick for the cpu eating issue. It's now much more responsive even under load, even without offscreen drawing.

Ok, that's good. I didn't do extensive testing after that, it seemed that the cpu was still under heavy load when moving the mouse too fast, although at least the control didn't lag anymore. B_NO_POINTER_HISTORY is a must for most controls anyway.

I've got a patch, almost ready for submission, which implements the 8bit palette mode and corrects other minor issues. I need to reimplement offscreen drawing since i postponed the question until the palette mode was finished. (optimize only when everything works :) ) BColorControl only lacks keyboard navigation now!

Very nice! Thank you for your work! Just attach the patch here when it's ready, and I'll apply it.

Shall we keep this bug opened ? And what about #1701 ? I'm for closing this and track #1701 since it holds a better description for the various tracking issues.

in reply to:  11 comment:12 by aldeck, 17 years ago

Replying to jackburton:

Shall we keep this bug opened ? And what about #1701 ? I'm for closing this and track #1701 since it holds a better description for the various tracking issues.

Yes, although there's still the invalidate rect that flickers a bit, close it and let's move on to 1701 :)

comment:13 by jackburton, 17 years ago

Resolution: fixed
Status: reopenedclosed

Closing. The remaining bugs will be tracked in #1701

Note: See TracTickets for help on using tickets.