[haiku-commits] Re: BRANCH orangejua-github.app_server [551438b9be6b] in src: servers/app tests/servers/app/unit_tests servers/app/drawing/Painter
- From: looncraz <looncraz@xxxxxxxxxxx>
- To: haiku-commits@xxxxxxxxxxxxx
- Date: Sun, 26 Jul 2015 07:27:57 -0500
On 7/26/2015 01:34, Julian Harnath wrote:
As a simple example, consider drawing a filled rect with alpha=255
into a view. And then you paint over that same rect several times. If
you now wrap all these FillRects in a Begin/EndLayer with opacity 100,
the resulting opacity of the rectangle must be exactly 100, no matter
how often you painted it over. If you created something like
"SetDrawOpacity" which simply altered the alpha of the FillRect
on-the-fly, you'd have several FillRects with alpha=100 over one
another, and the resulting rectangle would have an opacity > 100,
which would not be the expected result. So you need to redirect
drawing into intermediate layer bitmaps to get the correct saturation
behaviour, and only composite a layer when it's finished.
AHA! It took me a minute, but now I see what you're saying, LOL! I
even had to erase my response and begin again... ;-)
I can certainly see why you would find that to be very useful (and much
faster than emulating it client-side), even without any ability to
recall an individual layer's contents for manipulation. It also makes
more sense to call it a layer, my mind was stuck on the lack of
additional functionality (unneeded as it is for most uses - especially
with compositing). Been doing a bit too much graphics work, perhaps ;-)
Yes, it works pretty fine [...]
Yeah, did all that, never seemed to work, but I only messed around with
it for a short while - and I subsequently discovered corruption, so it
could very easily have been the corruption issue messing things up
earlier than I thought. Will have to give it another go, good to know
it works for someone - and to hold off on pulling in he launch_daemon ;-)
--The loon
Other related posts: