[Webkit-unassigned] [Bug 43259] Add the shadow offset as a parameter to the GraphicsContext::setShadow

bugzilla-daemon at webkit.org bugzilla-daemon at webkit.org
Tue Aug 3 09:06:17 PDT 2010


https://bugs.webkit.org/show_bug.cgi?id=43259





--- Comment #9 from Alejandro G. Castro <alex at igalia.com>  2010-08-03 09:06:17 PST ---
(In reply to comment #7)
> (In reply to comment #6)
> > (In reply to comment #5)
> > > What is “shadow offset” in this context?
> > 
> > The distance between the border of the shadow and the border of the figure, the information is interesting to know what part of the shadow is visible.
> 
> Can you give an example? Can this be derived from the size and blur radius?

It can't be derived AFAIK, even with the size of the shadow and the blur radius we would need the position and size of the original figure to get it. And another problem is that the size it is not actually the size in some situations, for instance RenderBoxModelObject.cpp:1611

...
            // Move the fill just outside the clip, adding 1 pixel separation so that the fill does not
            // bleed in (due to antialiasing) if the context is transformed.
            IntSize extraOffset(w + max(0, shadowOffset.width()) + shadowBlur + 2 * shadowSpread + 1, 0);
            shadowOffset -= extraOffset;
            fillRect.move(extraOffset);

            context->setShadow(shadowOffset, shadowBlur, shadowColor, s->colorSpace());
...

I do not know much about mac implementation but I guess shadowSize in this case is being used to store a prepared value to render the shadow outside the figure, that way they can use the GC API: CGContextSetShadow. In this case we will have a shadowSize (shadowOffset variable in the call to setShadow) with the correct offset in the height but a complete different value in the width, actually as you can see the shadowOffset.width() is substracted from the shadowOffset. In this case we want to render the shadow just in the locations where is is showed to avoid rendering big shadows blurs that will be under the figure, in order to do that we need to know the offset to calculate where we have to draw the shadow.

-- 
Configure bugmail: https://bugs.webkit.org/userprefs.cgi?tab=email
------- You are receiving this mail because: -------
You are the assignee for the bug.


More information about the webkit-unassigned mailing list