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

bugzilla-daemon at webkit.org bugzilla-daemon at webkit.org
Wed Feb 23 02:12:28 PST 2011


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





--- Comment #28 from Carlos Garcia Campos <cgarcia at igalia.com>  2011-02-23 02:12:28 PST ---
(From update of attachment 83097)
View in context: https://bugs.webkit.org/attachment.cgi?id=83097&action=review

> Source/WebCore/platform/graphics/cairo/GraphicsContextCairo.cpp:1193
> +    RefPtr<cairo_surface_t> currentContents(adoptRef(cairo_surface_create_similar(currentTarget,
> +                                                                                  CAIRO_CONTENT_COLOR_ALPHA,
> +                                                                                  rect.width(), rect.height())));
> +    RefPtr<cairo_t> currentContentsContext(adoptRef(cairo_create(currentContents.get())));
> +    cairo_surface_flush(currentTarget);
> +    cairo_set_source_surface(currentContentsContext.get(), currentTarget, -rect.x(), -rect.y());
> +    cairo_rectangle(currentContentsContext.get(), 0, 0, rect.width(), rect.height());
> +    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())));

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