[chromium] Replace destRect with destOffset in texture upload
authorcommit-queue@webkit.org <commit-queue@webkit.org@268f45cc-cd09-0410-ab3c-d52691b4dbfc>
Thu, 16 Aug 2012 23:43:29 +0000 (23:43 +0000)
committercommit-queue@webkit.org <commit-queue@webkit.org@268f45cc-cd09-0410-ab3c-d52691b4dbfc>
Thu, 16 Aug 2012 23:43:29 +0000 (23:43 +0000)
commit32135a1cc91ba0a2e07a62dab11e1ad85f9ef57c
treeaf34c2acf567440f572be3f075cf4bd298819817
parenta1b9fac04e45b82851193793d6892361fb4e70a5
[chromium] Replace destRect with destOffset in texture upload
https://bugs.webkit.org/show_bug.cgi?id=94154

Patch by Alexandre Elias <aelias@google.com> on 2012-08-16
Reviewed by James Robinson.

Previously, texture upload code implicitly assumed that sourceRect and
destRect have the same size. The behavior is undefined if they are
different, since they are used interchangeably and there's no support
for scaling from one rect to the other. This patch enforces that
constraint at the interface level by replacing all instances of
"IntRect destRect" by "IntSize destOffset".

Source/WebCore:

No new tests (no-op refactoring).

* platform/graphics/chromium/BitmapCanvasLayerTextureUpdater.cpp:
(WebCore::BitmapCanvasLayerTextureUpdater::Texture::updateRect):
(WebCore::BitmapCanvasLayerTextureUpdater::updateTextureRect):
* platform/graphics/chromium/BitmapCanvasLayerTextureUpdater.h:
(Texture):
(BitmapCanvasLayerTextureUpdater):
* platform/graphics/chromium/BitmapSkPictureCanvasLayerTextureUpdater.cpp:
(WebCore::BitmapSkPictureCanvasLayerTextureUpdater::Texture::updateRect):
* platform/graphics/chromium/BitmapSkPictureCanvasLayerTextureUpdater.h:
(Texture):
* platform/graphics/chromium/FrameBufferSkPictureCanvasLayerTextureUpdater.cpp:
(WebCore::FrameBufferSkPictureCanvasLayerTextureUpdater::Texture::updateRect):
(WebCore::FrameBufferSkPictureCanvasLayerTextureUpdater::updateTextureRect):
* platform/graphics/chromium/FrameBufferSkPictureCanvasLayerTextureUpdater.h:
(Texture):
(FrameBufferSkPictureCanvasLayerTextureUpdater):
* platform/graphics/chromium/ImageLayerChromium.cpp:
(WebCore::ImageLayerTextureUpdater::updateTextureRect):
* platform/graphics/chromium/LayerRendererChromium.cpp:
* platform/graphics/chromium/LayerTextureSubImage.cpp:
(WebCore::LayerTextureSubImage::upload):
(WebCore::LayerTextureSubImage::uploadWithTexSubImage):
(WebCore::LayerTextureSubImage::uploadWithMapTexSubImage):
* platform/graphics/chromium/LayerTextureSubImage.h:
(LayerTextureSubImage):
* platform/graphics/chromium/LayerTextureUpdater.h:
(Texture):
* platform/graphics/chromium/ScrollbarLayerChromium.cpp:
(WebCore::ScrollbarLayerChromium::updatePart):
* platform/graphics/chromium/TextureUploader.h:
(Parameters):
* platform/graphics/chromium/ThrottledTextureUploader.cpp:
(WebCore::ThrottledTextureUploader::uploadTexture):
* platform/graphics/chromium/TiledLayerChromium.cpp:
(WebCore::TiledLayerChromium::updateTileTextures):
* platform/graphics/chromium/cc/CCHeadsUpDisplayLayerImpl.cpp:
(WebCore::CCHeadsUpDisplayLayerImpl::willDraw):
* platform/graphics/chromium/cc/CCPrioritizedTexture.cpp:
(WebCore::CCPrioritizedTexture::upload):
* platform/graphics/chromium/cc/CCPrioritizedTexture.h:
(CCPrioritizedTexture):
* platform/graphics/chromium/cc/CCResourceProvider.cpp:
(WebCore::CCResourceProvider::upload):
* platform/graphics/chromium/cc/CCResourceProvider.h:
(CCResourceProvider):
* platform/graphics/chromium/cc/CCVideoLayerImpl.cpp:
(WebCore::CCVideoLayerImpl::copyPlaneData):

Source/WebKit/chromium:

* tests/CCResourceProviderTest.cpp:
(WebKit::TEST_F):
* tests/CCTextureUpdateControllerTest.cpp:
* tests/CCTiledLayerTestCommon.cpp:
(WebKitTests::FakeLayerTextureUpdater::Texture::updateRect):
* tests/CCTiledLayerTestCommon.h:
(Texture):
(WebKitTests::FakeTextureUploader::uploadTexture):

git-svn-id: https://svn.webkit.org/repository/webkit/trunk@125827 268f45cc-cd09-0410-ab3c-d52691b4dbfc
28 files changed:
Source/WebCore/ChangeLog
Source/WebCore/platform/graphics/chromium/BitmapCanvasLayerTextureUpdater.cpp
Source/WebCore/platform/graphics/chromium/BitmapCanvasLayerTextureUpdater.h
Source/WebCore/platform/graphics/chromium/BitmapSkPictureCanvasLayerTextureUpdater.cpp
Source/WebCore/platform/graphics/chromium/BitmapSkPictureCanvasLayerTextureUpdater.h
Source/WebCore/platform/graphics/chromium/FrameBufferSkPictureCanvasLayerTextureUpdater.cpp
Source/WebCore/platform/graphics/chromium/FrameBufferSkPictureCanvasLayerTextureUpdater.h
Source/WebCore/platform/graphics/chromium/ImageLayerChromium.cpp
Source/WebCore/platform/graphics/chromium/LayerRendererChromium.cpp
Source/WebCore/platform/graphics/chromium/LayerTextureSubImage.cpp
Source/WebCore/platform/graphics/chromium/LayerTextureSubImage.h
Source/WebCore/platform/graphics/chromium/LayerTextureUpdater.h
Source/WebCore/platform/graphics/chromium/ScrollbarLayerChromium.cpp
Source/WebCore/platform/graphics/chromium/TextureUploader.h
Source/WebCore/platform/graphics/chromium/ThrottledTextureUploader.cpp
Source/WebCore/platform/graphics/chromium/TiledLayerChromium.cpp
Source/WebCore/platform/graphics/chromium/cc/CCHeadsUpDisplayLayerImpl.cpp
Source/WebCore/platform/graphics/chromium/cc/CCPrioritizedTexture.cpp
Source/WebCore/platform/graphics/chromium/cc/CCPrioritizedTexture.h
Source/WebCore/platform/graphics/chromium/cc/CCResourceProvider.cpp
Source/WebCore/platform/graphics/chromium/cc/CCResourceProvider.h
Source/WebCore/platform/graphics/chromium/cc/CCVideoLayerImpl.cpp
Source/WebKit/chromium/ChangeLog
Source/WebKit/chromium/tests/CCLayerTreeHostTest.cpp
Source/WebKit/chromium/tests/CCResourceProviderTest.cpp
Source/WebKit/chromium/tests/CCTextureUpdateControllerTest.cpp
Source/WebKit/chromium/tests/CCTiledLayerTestCommon.cpp
Source/WebKit/chromium/tests/CCTiledLayerTestCommon.h