[chromium] Move deferral-related logic out of Canvas2DLayerChromium
authorjamesr@google.com <jamesr@google.com@268f45cc-cd09-0410-ab3c-d52691b4dbfc>
Thu, 7 Jun 2012 23:35:54 +0000 (23:35 +0000)
committerjamesr@google.com <jamesr@google.com@268f45cc-cd09-0410-ab3c-d52691b4dbfc>
Thu, 7 Jun 2012 23:35:54 +0000 (23:35 +0000)
commit40846ff92afd939b0cd701393110608ae16a8d4f
tree41393b9ad4ea2ebabe74769183b4adacea103ea7
parenta334f739c4a5eedbdb302cdf616e537886321938
[chromium] Move deferral-related logic out of Canvas2DLayerChromium
https://bugs.webkit.org/show_bug.cgi?id=86050

Reviewed by Stephen White.

Source/WebCore:

This removes Canvas2DLayerChromium and puts the deferral and double-buffering related logic in a new class,
Canvas2DLayerBridge, that uses TextureLayerChromium for compositing.  The bridge is responsible for managing the
front texture when double buffering is active, inserting the correct makeContextCurrent() and flush() calls on
the GraphicsContext3D and SkCanvas when appropriate, and owning the lifetime of the layer.

* WebCore.gypi:
* platform/graphics/chromium/Canvas2DLayerBridge.cpp: Added.
(WebCore):
(AcceleratedDeviceContext):
(WebCore::AcceleratedDeviceContext::AcceleratedDeviceContext):
(WebCore::AcceleratedDeviceContext::prepareForDraw):
(WebCore::Canvas2DLayerBridge::Canvas2DLayerBridge):
(WebCore::Canvas2DLayerBridge::~Canvas2DLayerBridge):
(WebCore::Canvas2DLayerBridge::skCanvas):
(WebCore::Canvas2DLayerBridge::prepareTexture):
(WebCore::Canvas2DLayerBridge::context):
(WebCore::Canvas2DLayerBridge::layer):
(WebCore::Canvas2DLayerBridge::contextAcquired):
* platform/graphics/chromium/Canvas2DLayerBridge.h: Added.
(WebCore):
(Canvas2DLayerBridge):
(WebCore::Canvas2DLayerBridge::create):
* platform/graphics/chromium/Canvas2DLayerChromium.cpp: Removed.
* platform/graphics/chromium/Canvas2DLayerChromium.h: Removed.
* platform/graphics/chromium/GraphicsLayerChromium.cpp:
* platform/graphics/chromium/ImageBufferDataSkia.h:
(WebCore):
(ImageBufferData):
* platform/graphics/chromium/TextureLayerChromium.cpp:
(WebCore::TextureLayerChromium::willModifyTexture):
    willModifyTexture() is called whenever the texture currently owned by the TextureLayerChromium will be
    modified by a system out of the compositor's control. It makes sure that the compositor does not attempt to
    draw with the potentially-modified texture until the next commit. For canvas, this is used when threading is
    enabled and a non-deferrable drawing command is invoked from JS.
(WebCore):
* platform/graphics/chromium/TextureLayerChromium.h:
(TextureLayerChromium):
* platform/graphics/chromium/cc/CCTextureUpdater.cpp:
(WebCore::CCTextureUpdater::hasMoreUpdates):
(WebCore::CCTextureUpdater::update):
(WebCore::CCTextureUpdater::clear):
* platform/graphics/chromium/cc/CCTextureUpdater.h:
(CCTextureUpdater):
* platform/graphics/skia/ImageBufferSkia.cpp:
(WebCore::createAcceleratedCanvas):
(WebCore::ImageBuffer::~ImageBuffer):
(WebCore::ImageBuffer::context):
(WebCore::ImageBuffer::platformLayer):

Source/WebKit/chromium:

* WebKit.gypi:
* tests/Canvas2DLayerBridgeTest.cpp: Renamed from tests/Canvas2DLayerChromiumTest
(Canvas2DLayerBridgeTest):
(Canvas2DLayerBridgeTest::fullLifecycleTest):

git-svn-id: http://svn.webkit.org/repository/webkit/trunk@119769 268f45cc-cd09-0410-ab3c-d52691b4dbfc
17 files changed:
Source/WebCore/ChangeLog
Source/WebCore/WebCore.gypi
Source/WebCore/platform/graphics/chromium/Canvas2DLayerBridge.cpp [new file with mode: 0644]
Source/WebCore/platform/graphics/chromium/Canvas2DLayerBridge.h [new file with mode: 0644]
Source/WebCore/platform/graphics/chromium/Canvas2DLayerChromium.cpp [deleted file]
Source/WebCore/platform/graphics/chromium/Canvas2DLayerChromium.h [deleted file]
Source/WebCore/platform/graphics/chromium/GraphicsLayerChromium.cpp
Source/WebCore/platform/graphics/chromium/ImageBufferDataSkia.h
Source/WebCore/platform/graphics/chromium/TextureLayerChromium.cpp
Source/WebCore/platform/graphics/chromium/TextureLayerChromium.h
Source/WebCore/platform/graphics/chromium/cc/CCTextureUpdater.cpp
Source/WebCore/platform/graphics/chromium/cc/CCTextureUpdater.h
Source/WebCore/platform/graphics/skia/ImageBufferSkia.cpp
Source/WebKit/chromium/ChangeLog
Source/WebKit/chromium/WebKit.gypi
Source/WebKit/chromium/tests/Canvas2DLayerBridgeTest.cpp [new file with mode: 0644]
Source/WebKit/chromium/tests/Canvas2DLayerChromiumTest.cpp [deleted file]