- Revision
- 120858
- Author
- [email protected]
- Date
- 2012-06-20 13:48:07 -0700 (Wed, 20 Jun 2012)
Log Message
[chromium] Separate LayerRenderer initialization from updateLayers
https://bugs.webkit.org/show_bug.cgi?id=89525
Reviewed by Adrienne Walker.
Source/WebCore:
This adds an explicit call to initialize the layer renderer of a given CCLayerTreeHost instead of having it be
implicit in updateLayers(). This way the proxies can control the initialization sequence more closely and do
useful work between the two calls.
Refactor, no change in behavior. Covered by existing tests.
* platform/graphics/chromium/cc/CCLayerTreeHost.cpp:
(WebCore::CCLayerTreeHost::compositeAndReadback):
(WebCore::CCLayerTreeHost::initializeLayerRendererIfNeeded):
(WebCore):
(WebCore::CCLayerTreeHost::updateLayers):
* platform/graphics/chromium/cc/CCLayerTreeHost.h:
(CCLayerTreeHost):
* platform/graphics/chromium/cc/CCSingleThreadProxy.cpp:
(WebCore::CCSingleThreadProxy::commitAndComposite):
* platform/graphics/chromium/cc/CCThreadProxy.cpp:
(WebCore::CCThreadProxy::compositeAndReadback):
(WebCore::CCThreadProxy::beginFrame):
Source/WebKit/chromium:
Update tests to call initializeLayerRendererIfNeeded() before calling updateLayers() to reflect what the proxies
do.
* tests/CCLayerTreeHostTest.cpp:
(WTF::CCLayerTreeHostTestLayerOcclusion::beginTest):
(WTF::CCLayerTreeHostTestLayerOcclusionWithFilters::beginTest):
(WTF::CCLayerTreeHostTestManySurfaces::beginTest):
* tests/TiledLayerChromiumTest.cpp:
Modified Paths
Diff
Modified: trunk/Source/WebCore/ChangeLog (120857 => 120858)
--- trunk/Source/WebCore/ChangeLog 2012-06-20 20:33:43 UTC (rev 120857)
+++ trunk/Source/WebCore/ChangeLog 2012-06-20 20:48:07 UTC (rev 120858)
@@ -1,3 +1,29 @@
+2012-06-19 James Robinson <[email protected]>
+
+ [chromium] Separate LayerRenderer initialization from updateLayers
+ https://bugs.webkit.org/show_bug.cgi?id=89525
+
+ Reviewed by Adrienne Walker.
+
+ This adds an explicit call to initialize the layer renderer of a given CCLayerTreeHost instead of having it be
+ implicit in updateLayers(). This way the proxies can control the initialization sequence more closely and do
+ useful work between the two calls.
+
+ Refactor, no change in behavior. Covered by existing tests.
+
+ * platform/graphics/chromium/cc/CCLayerTreeHost.cpp:
+ (WebCore::CCLayerTreeHost::compositeAndReadback):
+ (WebCore::CCLayerTreeHost::initializeLayerRendererIfNeeded):
+ (WebCore):
+ (WebCore::CCLayerTreeHost::updateLayers):
+ * platform/graphics/chromium/cc/CCLayerTreeHost.h:
+ (CCLayerTreeHost):
+ * platform/graphics/chromium/cc/CCSingleThreadProxy.cpp:
+ (WebCore::CCSingleThreadProxy::commitAndComposite):
+ * platform/graphics/chromium/cc/CCThreadProxy.cpp:
+ (WebCore::CCThreadProxy::compositeAndReadback):
+ (WebCore::CCThreadProxy::beginFrame):
+
2012-06-20 Yong Li <[email protected]>
SecurityOrigin::canDisplay() should return true when m_universalAccess is true
Modified: trunk/Source/WebCore/platform/graphics/chromium/cc/CCLayerTreeHost.cpp (120857 => 120858)
--- trunk/Source/WebCore/platform/graphics/chromium/cc/CCLayerTreeHost.cpp 2012-06-20 20:33:43 UTC (rev 120857)
+++ trunk/Source/WebCore/platform/graphics/chromium/cc/CCLayerTreeHost.cpp 2012-06-20 20:48:07 UTC (rev 120858)
@@ -300,15 +300,6 @@
bool CCLayerTreeHost::compositeAndReadback(void *pixels, const IntRect& rect)
{
- if (!m_layerRendererInitialized) {
- initializeLayerRenderer();
- if (!m_layerRendererInitialized)
- return false;
- }
- if (m_contextLost) {
- if (recreateContext() != RecreateSucceeded)
- return false;
- }
m_triggerIdlePaints = false;
bool ret = m_proxy->compositeAndReadback(pixels, rect);
m_triggerIdlePaints = true;
@@ -467,7 +458,7 @@
m_client->scheduleComposite();
}
-bool CCLayerTreeHost::updateLayers(CCTextureUpdater& updater)
+bool CCLayerTreeHost::initializeLayerRendererIfNeeded()
{
if (!m_layerRendererInitialized) {
initializeLayerRenderer();
@@ -479,7 +470,13 @@
if (recreateContext() != RecreateSucceeded)
return false;
}
+ return true;
+}
+
+void CCLayerTreeHost::updateLayers(CCTextureUpdater& updater)
+{
+ ASSERT(m_layerRendererInitialized);
// The visible state and memory allocation are set independently and in
// arbitrary order, so do not change the memory allocation used for the
// current commit until both values match intentions.
@@ -492,13 +489,12 @@
}
if (!rootLayer())
- return true;
+ return;
if (viewportSize().isEmpty())
- return true;
+ return;
updateLayers(rootLayer(), updater);
- return true;
}
void CCLayerTreeHost::updateLayers(LayerChromium* rootLayer, CCTextureUpdater& updater)
Modified: trunk/Source/WebCore/platform/graphics/chromium/cc/CCLayerTreeHost.h (120857 => 120858)
--- trunk/Source/WebCore/platform/graphics/chromium/cc/CCLayerTreeHost.h 2012-06-20 20:33:43 UTC (rev 120857)
+++ trunk/Source/WebCore/platform/graphics/chromium/cc/CCLayerTreeHost.h 2012-06-20 20:48:07 UTC (rev 120858)
@@ -170,7 +170,8 @@
void deleteContentsTexturesOnImplThread(TextureAllocator*);
virtual void acquireLayerTextures();
// Returns false if we should abort this frame due to initialization failure.
- bool updateLayers(CCTextureUpdater&);
+ bool initializeLayerRendererIfNeeded();
+ void updateLayers(CCTextureUpdater&);
CCLayerTreeHostClient* client() { return m_client; }
Modified: trunk/Source/WebCore/platform/graphics/chromium/cc/CCSingleThreadProxy.cpp (120857 => 120858)
--- trunk/Source/WebCore/platform/graphics/chromium/cc/CCSingleThreadProxy.cpp 2012-06-20 20:33:43 UTC (rev 120857)
+++ trunk/Source/WebCore/platform/graphics/chromium/cc/CCSingleThreadProxy.cpp 2012-06-20 20:48:07 UTC (rev 120858)
@@ -345,11 +345,12 @@
{
ASSERT(CCProxy::isMainThread());
+ if (!m_layerTreeHost->initializeLayerRendererIfNeeded())
+ return false;
+
CCTextureUpdater updater;
+ m_layerTreeHost->updateLayers(updater);
- if (!m_layerTreeHost->updateLayers(updater))
- return false;
-
m_layerTreeHost->willCommit();
doCommit(updater);
bool result = doComposite();
Modified: trunk/Source/WebCore/platform/graphics/chromium/cc/CCThreadProxy.cpp (120857 => 120858)
--- trunk/Source/WebCore/platform/graphics/chromium/cc/CCThreadProxy.cpp 2012-06-20 20:33:43 UTC (rev 120857)
+++ trunk/Source/WebCore/platform/graphics/chromium/cc/CCThreadProxy.cpp 2012-06-20 20:48:07 UTC (rev 120858)
@@ -104,7 +104,7 @@
ASSERT(isMainThread());
ASSERT(m_layerTreeHost);
- if (!m_layerRendererInitialized) {
+ if (!m_layerTreeHost->initializeLayerRendererIfNeeded()) {
TRACE_EVENT("compositeAndReadback_EarlyOut_LR_Uninitialized", this, 0);
return false;
}
@@ -510,9 +510,11 @@
m_commitRequested = false;
m_forcedCommitRequested = false;
- if (!m_layerTreeHost->updateLayers(*request->updater))
+ if (!m_layerTreeHost->initializeLayerRendererIfNeeded())
return;
+ m_layerTreeHost->updateLayers(*request->updater);
+
// Once single buffered layers are committed, they cannot be modified until
// they are drawn by the impl thread.
m_texturesAcquired = false;
Modified: trunk/Source/WebKit/chromium/ChangeLog (120857 => 120858)
--- trunk/Source/WebKit/chromium/ChangeLog 2012-06-20 20:33:43 UTC (rev 120857)
+++ trunk/Source/WebKit/chromium/ChangeLog 2012-06-20 20:48:07 UTC (rev 120858)
@@ -1,3 +1,19 @@
+2012-06-19 James Robinson <[email protected]>
+
+ [chromium] Separate LayerRenderer initialization from updateLayers
+ https://bugs.webkit.org/show_bug.cgi?id=89525
+
+ Reviewed by Adrienne Walker.
+
+ Update tests to call initializeLayerRendererIfNeeded() before calling updateLayers() to reflect what the proxies
+ do.
+
+ * tests/CCLayerTreeHostTest.cpp:
+ (WTF::CCLayerTreeHostTestLayerOcclusion::beginTest):
+ (WTF::CCLayerTreeHostTestLayerOcclusionWithFilters::beginTest):
+ (WTF::CCLayerTreeHostTestManySurfaces::beginTest):
+ * tests/TiledLayerChromiumTest.cpp:
+
2012-06-20 Christopher Cameron <[email protected]>
[chromium] webkit-backface-visibility doesn't work with video
Modified: trunk/Source/WebKit/chromium/tests/CCLayerTreeHostTest.cpp (120857 => 120858)
--- trunk/Source/WebKit/chromium/tests/CCLayerTreeHostTest.cpp 2012-06-20 20:33:43 UTC (rev 120857)
+++ trunk/Source/WebKit/chromium/tests/CCLayerTreeHostTest.cpp 2012-06-20 20:48:07 UTC (rev 120858)
@@ -1732,6 +1732,7 @@
m_layerTreeHost->setRootLayer(rootLayer);
m_layerTreeHost->setViewportSize(rootLayer->bounds());
+ ASSERT_TRUE(m_layerTreeHost->initializeLayerRendererIfNeeded());
CCTextureUpdater updater;
m_layerTreeHost->updateLayers(updater);
m_layerTreeHost->commitComplete();
@@ -1939,6 +1940,7 @@
m_layerTreeHost->setRootLayer(rootLayer);
m_layerTreeHost->setViewportSize(rootLayer->bounds());
+ ASSERT_TRUE(m_layerTreeHost->initializeLayerRendererIfNeeded());
CCTextureUpdater updater;
m_layerTreeHost->updateLayers(updater);
m_layerTreeHost->commitComplete();
@@ -2027,6 +2029,7 @@
m_layerTreeHost->setRootLayer(layers[0].get());
m_layerTreeHost->setViewportSize(layers[0]->bounds());
+ ASSERT_TRUE(m_layerTreeHost->initializeLayerRendererIfNeeded());
CCTextureUpdater updater;
m_layerTreeHost->updateLayers(updater);
m_layerTreeHost->commitComplete();
Modified: trunk/Source/WebKit/chromium/tests/TiledLayerChromiumTest.cpp (120857 => 120858)
--- trunk/Source/WebKit/chromium/tests/TiledLayerChromiumTest.cpp 2012-06-20 20:33:43 UTC (rev 120857)
+++ trunk/Source/WebKit/chromium/tests/TiledLayerChromiumTest.cpp 2012-06-20 20:48:07 UTC (rev 120858)
@@ -799,6 +799,7 @@
WebKit::WebCompositor::initialize(0);
FakeCCLayerTreeHostClient fakeCCLayerTreeHostClient;
OwnPtr<CCLayerTreeHost> ccLayerTreeHost = CCLayerTreeHost::create(&fakeCCLayerTreeHostClient, CCLayerTreeSettings());
+ ASSERT_TRUE(ccLayerTreeHost->initializeLayerRendererIfNeeded());
// Create two 300 x 300 tiled layers.
IntSize contentBounds(300, 300);
@@ -882,6 +883,7 @@
FakeCCLayerTreeHostClient fakeCCLayerTreeHostClient;
OwnPtr<CCLayerTreeHost> ccLayerTreeHost = CCLayerTreeHost::create(&fakeCCLayerTreeHostClient, settings);
+ ASSERT_TRUE(ccLayerTreeHost->initializeLayerRendererIfNeeded());
// Create one 500 x 300 tiled layer.
IntSize contentBounds(300, 200);