RESOLVED FIXED Bug 35544
[OpenVG] Use masks to implement non-rectilinear clipping
https://bugs.webkit.org/show_bug.cgi?id=35544
Summary [OpenVG] Use masks to implement non-rectilinear clipping
Jakob Petsovits
Reported 2010-03-01 14:03:51 PST
Rectilinear regions (a.k.a. upright rectangles) can be clipped in OpenVG using its scissoring functionality. For all other shapes (i.e. paths and rotated rectangles), we want mask clipping instead. Only OpenVG >= 1.1 provides the required functions for managing masks, so all the masking code in this patch is put into an #ifdef. Mask layers (which are bitmaps of 1 or 8 bit depth per pixel) are a bit hairy because, unlike the other state that we're keeping track of, they can't easily be captured like colors, boolean enable-blah values, or stuff. Also, OpenVG implementations can optimize on the plain bitmap concept by storing masks and mask layers as set of paths. So we don't really want to read out mask layers in memory for context state storage, we keep them as native VGMaskLayer. That requires us to make sure the correct surface is current when the painter state is stored (which we didn't ensure before) so a bit of surface management code is added here as well. vgRenderToMask() is affected by the current OpenVG path transformation, so we don't have to manually transform the path like we do for scissor rectangles. PainterOpenVG restricts the clipping modes to Intersect and Subtract, because additive clipping a.k.a. removing clip regions would require too much (and unnecessary) overhead for scissor rectangles which would need to be "unclipped" as well. Right now PainterOpenVG can only add clips but never remove them (except with restore()), and that's in line with GraphicsContext's functionality.
Attachments
Patch (13.44 KB, patch)
2010-03-01 14:05 PST, Jakob Petsovits
krit: review+
Jakob Petsovits
Comment 1 2010-03-01 14:05:54 PST
Dirk Schulze
Comment 2 2010-03-09 11:21:27 PST
Comment on attachment 49749 [details] Patch lgtm r=me
Jakob Petsovits
Comment 3 2010-03-12 11:25:49 PST
Eric Seidel (no email)
Comment 4 2010-03-12 18:17:29 PST
Dirk Schulze
Comment 5 2010-03-12 22:35:59 PST
(In reply to comment #4) > This appears to have broken the Gtk build: > http://build.webkit.org/builders/GTK%20Linux%2064-bit%20Debug/builds/3889 How? There is no core code touched and also no Gtk code. Only files in the openvg folder.
Dirk Schulze
Comment 6 2010-03-12 23:02:27 PST
(In reply to comment #4) > This appears to have broken the Gtk build: > http://build.webkit.org/builders/GTK%20Linux%2064-bit%20Debug/builds/3889 http://trac.webkit.org/changeset/55927 broke the gtk bots.
Note You need to log in before you can comment on or make changes to this bug.