[webkit-dev] Cairo and "-webkit-mask-clip: text"

Dirk Schulze vbs85 at gmx.de
Wed Jun 23 10:30:49 PDT 2010


Hi Andrei,

this kind of question should be asked in a bug report. Bug 23526 is the
best location, since it is a general issue with clipToImageBuffer on the
Cairo ports.

I'm interessted in a test case, where the patch on the mentioned bug
report does not work. I don't know of an example, that didn't work with
the current patch, neither on CSS mask nor SVG mask or filter.
But let us move the discussion to the bug report.

Greetings,
Dirk

Am Mittwoch, den 23.06.2010, 19:45 +0300 schrieb Andrei Bucur:
> Hello!
> 
> 
> 
> I'm trying to implement this CSS value on the Cairo backend and I'm
> stuck with a problem regarding the Porter-Duff composition operators
> (why is CAIRO_OPERATOR_DEST_IN unbound?). I've made the following
> changes to reach this point:
> 
> 
> 1. I implemented a version of GraphicsContext::clipToImageBuffer
> starting from this patch:
> https://bugs.webkit.org/show_bug.cgi?id=23526 , but saving the image
> mask and the masking rect on a stack and pushing only a group for the
> masked content.
> 2. In GraphicsContext::restorePlatformState when the save count is 0
> for the current mask, I recover the masked content as a pattern, I
> clip it using the mask from the stack (I used a new group and operator
> CAIRO_OPERATOR_IN) and then I should apply the result on the
> destination surface using CAIRO_OPERATOR_DEST_IN, but bounded to the
> current mask. The problem here is that CAIRO_OPERATOR_DEST_IN is
> unbounded so it doesn't take into account the mask, thus affecting all
> the surface.
> 3. I modify RenderBoxModelObject::paintFillLayerExtended so that when
> drawing the background image to use the bgLayer->composite() operator
> if the clip is TextFillBox. Using CompositeSourceIn can't work because
> clipToImageBuffer started a new group which uses a different surface
> for drawing (so there is no destination text to composite with). This
> way the composition will be done in restorePlatformState.
> 
> 
> I know this is ugly and that it's highly unlikely to work in this form
> with SVG masking. For now I just need a hook to make this work. Do you
> have any other suggestions to make this CSS value work with Cairo?
> 
> 
> Thanks,
> Andrei.
> _______________________________________________
> webkit-dev mailing list
> webkit-dev at lists.webkit.org
> http://lists.webkit.org/mailman/listinfo.cgi/webkit-dev




More information about the webkit-dev mailing list