Changeset 120858 in webkit
- Timestamp:
- Jun 20, 2012 1:48:07 PM (12 years ago)
- Location:
- trunk/Source
- Files:
-
- 8 edited
Legend:
- Unmodified
- Added
- Removed
-
trunk/Source/WebCore/ChangeLog
r120855 r120858 1 2012-06-19 James Robinson <jamesr@chromium.org> 2 3 [chromium] Separate LayerRenderer initialization from updateLayers 4 https://bugs.webkit.org/show_bug.cgi?id=89525 5 6 Reviewed by Adrienne Walker. 7 8 This adds an explicit call to initialize the layer renderer of a given CCLayerTreeHost instead of having it be 9 implicit in updateLayers(). This way the proxies can control the initialization sequence more closely and do 10 useful work between the two calls. 11 12 Refactor, no change in behavior. Covered by existing tests. 13 14 * platform/graphics/chromium/cc/CCLayerTreeHost.cpp: 15 (WebCore::CCLayerTreeHost::compositeAndReadback): 16 (WebCore::CCLayerTreeHost::initializeLayerRendererIfNeeded): 17 (WebCore): 18 (WebCore::CCLayerTreeHost::updateLayers): 19 * platform/graphics/chromium/cc/CCLayerTreeHost.h: 20 (CCLayerTreeHost): 21 * platform/graphics/chromium/cc/CCSingleThreadProxy.cpp: 22 (WebCore::CCSingleThreadProxy::commitAndComposite): 23 * platform/graphics/chromium/cc/CCThreadProxy.cpp: 24 (WebCore::CCThreadProxy::compositeAndReadback): 25 (WebCore::CCThreadProxy::beginFrame): 26 1 27 2012-06-20 Yong Li <yoli@rim.com> 2 28 -
trunk/Source/WebCore/platform/graphics/chromium/cc/CCLayerTreeHost.cpp
r120820 r120858 301 301 bool CCLayerTreeHost::compositeAndReadback(void *pixels, const IntRect& rect) 302 302 { 303 if (!m_layerRendererInitialized) {304 initializeLayerRenderer();305 if (!m_layerRendererInitialized)306 return false;307 }308 if (m_contextLost) {309 if (recreateContext() != RecreateSucceeded)310 return false;311 }312 303 m_triggerIdlePaints = false; 313 304 bool ret = m_proxy->compositeAndReadback(pixels, rect); … … 468 459 } 469 460 470 bool CCLayerTreeHost:: updateLayers(CCTextureUpdater& updater)461 bool CCLayerTreeHost::initializeLayerRendererIfNeeded() 471 462 { 472 463 if (!m_layerRendererInitialized) { … … 480 471 return false; 481 472 } 482 473 return true; 474 } 475 476 477 void CCLayerTreeHost::updateLayers(CCTextureUpdater& updater) 478 { 479 ASSERT(m_layerRendererInitialized); 483 480 // The visible state and memory allocation are set independently and in 484 481 // arbitrary order, so do not change the memory allocation used for the … … 493 490 494 491 if (!rootLayer()) 495 return true;492 return; 496 493 497 494 if (viewportSize().isEmpty()) 498 return true;495 return; 499 496 500 497 updateLayers(rootLayer(), updater); 501 return true;502 498 } 503 499 -
trunk/Source/WebCore/platform/graphics/chromium/cc/CCLayerTreeHost.h
r120820 r120858 171 171 virtual void acquireLayerTextures(); 172 172 // Returns false if we should abort this frame due to initialization failure. 173 bool updateLayers(CCTextureUpdater&); 173 bool initializeLayerRendererIfNeeded(); 174 void updateLayers(CCTextureUpdater&); 174 175 175 176 CCLayerTreeHostClient* client() { return m_client; } -
trunk/Source/WebCore/platform/graphics/chromium/cc/CCSingleThreadProxy.cpp
r120820 r120858 346 346 ASSERT(CCProxy::isMainThread()); 347 347 348 if (!m_layerTreeHost->initializeLayerRendererIfNeeded()) 349 return false; 350 348 351 CCTextureUpdater updater; 349 350 if (!m_layerTreeHost->updateLayers(updater)) 351 return false; 352 m_layerTreeHost->updateLayers(updater); 352 353 353 354 m_layerTreeHost->willCommit(); -
trunk/Source/WebCore/platform/graphics/chromium/cc/CCThreadProxy.cpp
r120820 r120858 105 105 ASSERT(m_layerTreeHost); 106 106 107 if (!m_layer RendererInitialized) {107 if (!m_layerTreeHost->initializeLayerRendererIfNeeded()) { 108 108 TRACE_EVENT("compositeAndReadback_EarlyOut_LR_Uninitialized", this, 0); 109 109 return false; … … 511 511 m_forcedCommitRequested = false; 512 512 513 if (!m_layerTreeHost->updateLayers(*request->updater)) 514 return; 513 if (!m_layerTreeHost->initializeLayerRendererIfNeeded()) 514 return; 515 516 m_layerTreeHost->updateLayers(*request->updater); 515 517 516 518 // Once single buffered layers are committed, they cannot be modified until -
trunk/Source/WebKit/chromium/ChangeLog
r120847 r120858 1 2012-06-19 James Robinson <jamesr@chromium.org> 2 3 [chromium] Separate LayerRenderer initialization from updateLayers 4 https://bugs.webkit.org/show_bug.cgi?id=89525 5 6 Reviewed by Adrienne Walker. 7 8 Update tests to call initializeLayerRendererIfNeeded() before calling updateLayers() to reflect what the proxies 9 do. 10 11 * tests/CCLayerTreeHostTest.cpp: 12 (WTF::CCLayerTreeHostTestLayerOcclusion::beginTest): 13 (WTF::CCLayerTreeHostTestLayerOcclusionWithFilters::beginTest): 14 (WTF::CCLayerTreeHostTestManySurfaces::beginTest): 15 * tests/TiledLayerChromiumTest.cpp: 16 1 17 2012-06-20 Christopher Cameron <ccameron@chromium.org> 2 18 -
trunk/Source/WebKit/chromium/tests/CCLayerTreeHostTest.cpp
r120820 r120858 1733 1733 m_layerTreeHost->setRootLayer(rootLayer); 1734 1734 m_layerTreeHost->setViewportSize(rootLayer->bounds()); 1735 ASSERT_TRUE(m_layerTreeHost->initializeLayerRendererIfNeeded()); 1735 1736 CCTextureUpdater updater; 1736 1737 m_layerTreeHost->updateLayers(updater); … … 1940 1941 m_layerTreeHost->setRootLayer(rootLayer); 1941 1942 m_layerTreeHost->setViewportSize(rootLayer->bounds()); 1943 ASSERT_TRUE(m_layerTreeHost->initializeLayerRendererIfNeeded()); 1942 1944 CCTextureUpdater updater; 1943 1945 m_layerTreeHost->updateLayers(updater); … … 2028 2030 m_layerTreeHost->setRootLayer(layers[0].get()); 2029 2031 m_layerTreeHost->setViewportSize(layers[0]->bounds()); 2032 ASSERT_TRUE(m_layerTreeHost->initializeLayerRendererIfNeeded()); 2030 2033 CCTextureUpdater updater; 2031 2034 m_layerTreeHost->updateLayers(updater); -
trunk/Source/WebKit/chromium/tests/TiledLayerChromiumTest.cpp
r120820 r120858 800 800 FakeCCLayerTreeHostClient fakeCCLayerTreeHostClient; 801 801 OwnPtr<CCLayerTreeHost> ccLayerTreeHost = CCLayerTreeHost::create(&fakeCCLayerTreeHostClient, CCLayerTreeSettings()); 802 ASSERT_TRUE(ccLayerTreeHost->initializeLayerRendererIfNeeded()); 802 803 803 804 // Create two 300 x 300 tiled layers. … … 883 884 FakeCCLayerTreeHostClient fakeCCLayerTreeHostClient; 884 885 OwnPtr<CCLayerTreeHost> ccLayerTreeHost = CCLayerTreeHost::create(&fakeCCLayerTreeHostClient, settings); 886 ASSERT_TRUE(ccLayerTreeHost->initializeLayerRendererIfNeeded()); 885 887 886 888 // Create one 500 x 300 tiled layer.
Note: See TracChangeset
for help on using the changeset viewer.