[chromium] Port Canvas2DLayerBridge over to WebExternalTextureLayer
authorcommit-queue@webkit.org <commit-queue@webkit.org@268f45cc-cd09-0410-ab3c-d52691b4dbfc>
Wed, 13 Jun 2012 00:10:03 +0000 (00:10 +0000)
committercommit-queue@webkit.org <commit-queue@webkit.org@268f45cc-cd09-0410-ab3c-d52691b4dbfc>
Wed, 13 Jun 2012 00:10:03 +0000 (00:10 +0000)
commit044555d02f22dee039fbae35cafd8f02004d174e
tree43693a4a8269d4a3a498db4f2d6f9ab890e3813a
parent1f82cc78464c25cf1b36d5ed57f46799426fc5e4
[chromium] Port Canvas2DLayerBridge over to WebExternalTextureLayer
https://bugs.webkit.org/show_bug.cgi?id=88597

Patch by James Robinson <jamesr@chromium.org> on 2012-06-12
Reviewed by Adrienne Walker.

Source/Platform:

This adds two new APIs to WebExternalTextureLayer that are used by the accelerated 2d canvas path:
- willModifyTexture() is called to indicate that a system outside the compositor's control is about to modify
the texture backing the WebExternalTextureLayer. This indicates to the compositor that it needs to avoid
producing more frames using this texture until it can do a full commit - either by double buffering or
appropriate flow control.

- setRateLimitContext() is called to enable rate limiting for this texture. The rate limiting logic blocks if
too many invalidate() or invalidateRect() calls are made on the texture outside of the context of a
WebLayerTreeViewClient::updateAnimations() call to prevent a non-vsynced producer from getting too far ahead of
the compositor.

* chromium/public/WebExternalTextureLayer.h:
(WebKit::WebExternalTextureLayer::WebExternalTextureLayer):
(WebExternalTextureLayer):

Source/WebCore:

This converts Canvas2DLayerBridge to using public WebLayer API types instead of LayerChromium types.

* platform/graphics/chromium/Canvas2DLayerBridge.cpp:
(WebCore::AcceleratedDeviceContext::AcceleratedDeviceContext):
(WebCore::AcceleratedDeviceContext::prepareForDraw):
(AcceleratedDeviceContext):
(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:
(WebCore):
(Canvas2DLayerBridge):

Source/WebKit/chromium:

Implementations for new WebExternalTextureLayer APIs, updates test.

* src/WebExternalTextureLayer.cpp:
(WebKit::WebExternalTextureLayer::willModifyTexture):
(WebKit):
(WebKit::WebExternalTextureLayer::setRateLimitContext):
* tests/Canvas2DLayerBridgeTest.cpp:
(Canvas2DLayerBridgeTest::fullLifecycleTest):

git-svn-id: https://svn.webkit.org/repository/webkit/trunk@120142 268f45cc-cd09-0410-ab3c-d52691b4dbfc
Source/Platform/ChangeLog
Source/Platform/chromium/public/WebExternalTextureLayer.h
Source/WebCore/ChangeLog
Source/WebCore/platform/graphics/chromium/Canvas2DLayerBridge.cpp
Source/WebCore/platform/graphics/chromium/Canvas2DLayerBridge.h
Source/WebKit/chromium/ChangeLog
Source/WebKit/chromium/src/WebExternalTextureLayer.cpp
Source/WebKit/chromium/tests/Canvas2DLayerBridgeTest.cpp