[Cairo] Avoid extra copy when drawing images
authorcommit-queue@webkit.org <commit-queue@webkit.org@268f45cc-cd09-0410-ab3c-d52691b4dbfc>
Thu, 14 Nov 2013 23:15:24 +0000 (23:15 +0000)
committercommit-queue@webkit.org <commit-queue@webkit.org@268f45cc-cd09-0410-ab3c-d52691b4dbfc>
Thu, 14 Nov 2013 23:15:24 +0000 (23:15 +0000)
commit0592623e2c02725a414be6cb705ae1211814fe97
tree59b1c4ae6b5c3170e164c38d33ea6a550a0dbc4e
parent860be1ec5c6616058198a2faf5f88291572aa08f
[Cairo] Avoid extra copy when drawing images
https://bugs.webkit.org/show_bug.cgi?id=124209

Patch by Aloisio Almeida Jr <aloisio.almeida@openbossa.org> on 2013-11-14
Reviewed by Martin Robinson.

To solve the bug #58309 a cairo subsurface is being used to limit the
source image boundaries.
In many cases, when a cairo subsurface is used for drawing an image,
it occurs an image copy, causing performance penalty. In the case of
the function PlatformContextCairo::drawSurfaceToContext, the image
copy always happens.
So, we should use the subsurface only when it's really necessary.
In cases where we're drawing the whole image, the subsurface is
unnecessary.

The proposed patch avoid the use of subsurfaces when sampling the whole
image.

No new tests. It's an enhancement. Already covered by existing tests.

* platform/graphics/cairo/PlatformContextCairo.cpp:
(WebCore::PlatformContextCairo::drawSurfaceToContext):

git-svn-id: https://svn.webkit.org/repository/webkit/trunk@159314 268f45cc-cd09-0410-ab3c-d52691b4dbfc
Source/WebCore/ChangeLog
Source/WebCore/platform/graphics/cairo/PlatformContextCairo.cpp