[chromium] Refactor opaque content transform out of Skia context
authorenne@google.com <enne@google.com@268f45cc-cd09-0410-ab3c-d52691b4dbfc>
Sat, 21 Apr 2012 01:48:26 +0000 (01:48 +0000)
committerenne@google.com <enne@google.com@268f45cc-cd09-0410-ab3c-d52691b4dbfc>
Sat, 21 Apr 2012 01:48:26 +0000 (01:48 +0000)
commit0bc0ad205b2eab6bfdd3e53aad83c599d23deda8
tree44fe98fc266dfeb3a69761097a4e688b84b45042
parentd6716375a7f121448b60370a9d7e8b240b7b5429
[chromium] Refactor opaque content transform out of Skia context
https://bugs.webkit.org/show_bug.cgi?id=83608

Reviewed by James Robinson.

Source/WebCore:

Having PlatformContextSkia know about the transform into content space
for a layer is a layering violation. This change lets the
PlatformContextSkia deal with opaque rects in its own space and lets
the caller handle transforming it into its own space. This also
prevents a matrix multiply per draw into the Skia canvas and does it
just once at the end to transform the final rect.

This is an incremental refactoring so that additional tracking for
text rects can be added and use the same space as opaque rects.

Tests: LayerTextureUpdaterTest.testPartialOpaqueRectNoTransform
       LayerTextureUpdaterTest.testPartialOpaqueRectTranslation
       LayerTextureUpdaterTest.testPartialOpaqueRectScale

* platform/graphics/chromium/BitmapCanvasLayerTextureUpdater.cpp:
(WebCore::BitmapCanvasLayerTextureUpdater::prepareToUpdate):
* platform/graphics/chromium/BitmapCanvasLayerTextureUpdater.h:
(BitmapCanvasLayerTextureUpdater):
* platform/graphics/chromium/BitmapSkPictureCanvasLayerTextureUpdater.cpp:
(WebCore::BitmapSkPictureCanvasLayerTextureUpdater::prepareToUpdate):
* platform/graphics/chromium/BitmapSkPictureCanvasLayerTextureUpdater.h:
(BitmapSkPictureCanvasLayerTextureUpdater):
* platform/graphics/chromium/CanvasLayerTextureUpdater.cpp:
(WebCore::CanvasLayerTextureUpdater::paintContents):
* platform/graphics/chromium/CanvasLayerTextureUpdater.h:
(CanvasLayerTextureUpdater):
* platform/graphics/chromium/LayerTextureUpdater.h:
(WebCore::LayerTextureUpdater::prepareToUpdate):
* platform/graphics/chromium/SkPictureCanvasLayerTextureUpdater.cpp:
(WebCore::SkPictureCanvasLayerTextureUpdater::prepareToUpdate):
* platform/graphics/chromium/SkPictureCanvasLayerTextureUpdater.h:
(SkPictureCanvasLayerTextureUpdater):
* platform/graphics/chromium/TiledLayerChromium.cpp:
(WebCore::TiledLayerChromium::updateTiles):
* platform/graphics/skia/OpaqueRegionSkia.cpp:
(WebCore::OpaqueRegionSkia::didDrawRect):
(WebCore::OpaqueRegionSkia::didDrawPath):
(WebCore::OpaqueRegionSkia::didDrawPoints):
(WebCore::OpaqueRegionSkia::didDrawBounded):
(WebCore::OpaqueRegionSkia::didDraw):
* platform/graphics/skia/OpaqueRegionSkia.h:
(OpaqueRegionSkia):
* platform/graphics/skia/PlatformContextSkia.cpp:
(WebCore::PlatformContextSkia::didDrawRect):
(WebCore::PlatformContextSkia::didDrawPath):
(WebCore::PlatformContextSkia::didDrawPoints):
(WebCore::PlatformContextSkia::didDrawBounded):
* platform/graphics/skia/PlatformContextSkia.h:
(PlatformContextSkia):

Source/WebKit/chromium:

Add tests for opaque tracking in LayerTextureUpdater, since the
transform logic has moved there.

* tests/CCTiledLayerTestCommon.cpp:
(WebKitTests::FakeLayerTextureUpdater::prepareToUpdate):
* tests/CCTiledLayerTestCommon.h:
(FakeLayerTextureUpdater):
* tests/LayerTextureUpdaterTest.cpp:
(WebCore::PaintFillPartialOpaque::PaintFillPartialOpaque):
(PaintFillPartialOpaque):
(WebCore::PaintFillPartialOpaque::operator()):
(WebCore):
(WebCore::TEST):
* tests/PlatformContextSkiaTest.cpp:
(WebCore::TEST):

git-svn-id: https://svn.webkit.org/repository/webkit/trunk@114827 268f45cc-cd09-0410-ab3c-d52691b4dbfc
20 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/CanvasLayerTextureUpdater.cpp
Source/WebCore/platform/graphics/chromium/CanvasLayerTextureUpdater.h
Source/WebCore/platform/graphics/chromium/LayerTextureUpdater.h
Source/WebCore/platform/graphics/chromium/SkPictureCanvasLayerTextureUpdater.cpp
Source/WebCore/platform/graphics/chromium/SkPictureCanvasLayerTextureUpdater.h
Source/WebCore/platform/graphics/chromium/TiledLayerChromium.cpp
Source/WebCore/platform/graphics/skia/OpaqueRegionSkia.cpp
Source/WebCore/platform/graphics/skia/OpaqueRegionSkia.h
Source/WebCore/platform/graphics/skia/PlatformContextSkia.cpp
Source/WebCore/platform/graphics/skia/PlatformContextSkia.h
Source/WebKit/chromium/ChangeLog
Source/WebKit/chromium/tests/CCTiledLayerTestCommon.cpp
Source/WebKit/chromium/tests/CCTiledLayerTestCommon.h
Source/WebKit/chromium/tests/LayerTextureUpdaterTest.cpp
Source/WebKit/chromium/tests/PlatformContextSkiaTest.cpp