[Webkit-unassigned] [Bug 23526] [CAIRO] Support ImageBuffers clip operation on all Cairo ports
bugzilla-daemon at webkit.org
bugzilla-daemon at webkit.org
Thu Feb 24 08:36:02 PST 2011
https://bugs.webkit.org/show_bug.cgi?id=23526
--- Comment #43 from Martin Robinson <mrobinson at webkit.org> 2011-02-24 08:36:02 PST ---
(In reply to comment #39)
Thanks for the comments. :)
> Source/WebCore/platform/graphics/cairo/GraphicsContextCairo.cpp:1209
> + cairo_t* cr = m_data->cr;
> + cairo_surface_t* currentTarget = cairo_get_target(cr);
> + cairo_surface_flush(currentTarget);
> +
> + // Pushing a new group ensures that only things painted after this point are clipped.
> + cairo_push_group(cr);
> + cairo_set_operator(cr, CAIRO_OPERATOR_SOURCE);
> +
> + cairo_set_source_surface(cr, currentTarget, 0, 0);
> + cairo_rectangle(cr, rect.x(), rect.y(), rect.width(), rect.height());
> + cairo_fill(cr);
Is this faster than cairo-mask-surface? (http://cairographics.org/manual/cairo-cairo-t.html#cairo-mask-surface)
Since cairo_mask_surface is immediate it cannot affect anything that's painted later. I use cairo_mask_surface in platformRestoreContext to mask the group, but if I had not pushed a group here, it would mask everything that was painted before pushMaskSurface and everything after.
(In reply to comment #40)
> > Btw. Can we rename the bug report to "[CAIRO] clipToImageBuffer implementation for Cairo ports"?
> Oops, forgot that clipToImageBuffer was replaced. So maybe "[CAIRO] Support ImageBuffers clip operation on all Cairo ports"?
Done!
--
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