[Webkit-unassigned] [Bug 23526] clipToImageBuffer() for all platforms

bugzilla-daemon at webkit.org bugzilla-daemon at webkit.org
Wed Feb 23 03:13:12 PST 2011


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





--- Comment #30 from Carlos Garcia Campos <cgarcia at igalia.com>  2011-02-23 03:13:12 PST ---
(In reply to comment #29)
> > Source/WebCore/platform/graphics/cairo/GraphicsContextCairo.cpp:1185
> > +    cairo_surface_t* currentTarget = cairo_get_target(cr);
> 
> This should be cairo_get_group_target(cr);
> cairo_get_target() will always reference the original surface that was passed to cairo_create(), not the one that's currently painted to.
> 
> >> Source/WebCore/platform/graphics/cairo/GraphicsContextCairo.cpp:1193
> >> +    cairo_fill(currentContentsContext.get());
> > 
> > I think this can be done with a cairo subsurface, all this block could be just:
> > RefPtr<cairo_surface_t> currentContents(adoptRef(cairo_surface_create_for_rectangle(cairo_get_target(cr),
> >                                                                                         rect.x(), rect.y(),
> >                                                                                         rect.width(), rect.height())));
> 
> If that block was meant to get around the problem with self-copies, then no, this cannot be done with subsurfaces, because subsurfaces are just a bit of shim that still proxies all calls to the original surface.

In this case the subsurface it's only used as a source, so it shouldn't affect the original surface, just to avoid having to create a new surface and fill with current contents.

> > Source/WebCore/platform/graphics/cairo/GraphicsContextCairo.cpp:1199
> > +    cairo_set_source_surface(cr, currentContents.get(), rect.x(), rect.y());
> 
> You could just do cairo_set_source_surface(cr, currentTarget, rect.x(), rect.y()); here and avoid the whole currentContents surface, unless I'M not understanding why you do the currentContents thing.

-- 
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