[Webkit-unassigned] [Bug 124209] [Cairo] Avoid extra copy when drawing images

bugzilla-daemon at webkit.org bugzilla-daemon at webkit.org
Mon Dec 2 00:26:42 PST 2013


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





--- Comment #10 from Carlos Garcia Campos <cgarcia at igalia.com>  2013-12-02 00:25:03 PST ---
(From update of attachment 216982)
View in context: https://bugs.webkit.org/attachment.cgi?id=216982&action=review

> Source/WebCore/platform/graphics/cairo/PlatformContextCairo.cpp:176
> +    RefPtr<cairo_surface_t> subsurface;

This doesn't seem to be used outside the if context, I think it could be moved to the if block.

> Source/WebCore/platform/graphics/cairo/PlatformContextCairo.cpp:179
> +    if (srcRect.x() || srcRect.y() || srcRect.size() == cairoSurfaceSize(surface)) {

If I understood correctly the commit message, you want to use a subsurface when source size is different to surface size, right?

> Source/WebCore/platform/graphics/cairo/PlatformContextCairo.cpp:187
> +        subsurface = adoptRef(cairo_surface_create_for_rectangle(surface, expandedSrcRect.x(),
> +            expandedSrcRect.y(), expandedSrcRect.width(), expandedSrcRect.height()));
> +        patternSurface = subsurface.get();

Maybe you don't even need to subsurface variable if you use a single lines here:

patternSurface = adoptRef(cairo_surface_create_for_rectangle(surface, expandedSrcRect.x(), expandedSrcRect.y(), expandedSrcRect.width(), expandedSrcRect.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