Changeset 117825 in webkit
- Timestamp:
- May 21, 2012 3:57:49 PM (12 years ago)
- Location:
- trunk/Source
- Files:
-
- 3 edited
Legend:
- Unmodified
- Added
- Removed
-
trunk/Source/WebCore/ChangeLog
r117817 r117825 1 2012-05-21 Antoine Labour <piman@chromium.org> 2 3 Don't force rendering in finishAllRendering 4 https://bugs.webkit.org/show_bug.cgi?id=86919 5 6 Reviewed by James Robinson. 7 8 After we acquire the texture layers on the main thread, we can't draw. 9 In particular if we destroyed the texture ids used previously by 10 TextureLayerChromium, drawing before a commit would cause a 11 bind-after-destroy. 12 13 Tested by CCLayerTreeHostTestFinishAllRendering. 14 15 * platform/graphics/chromium/cc/CCThreadProxy.cpp: 16 (WebCore::CCThreadProxy::CCThreadProxy): 17 (WebCore::CCThreadProxy::finishAllRenderingOnImplThread): 18 (WebCore::CCThreadProxy::scheduledActionDrawAndSwapInternal): 19 1 20 2012-05-21 Joshua Bell <jsbell@chromium.org> 2 21 -
trunk/Source/WebCore/platform/graphics/chromium/cc/CCThreadProxy.cpp
r117312 r117825 82 82 , m_beginFrameCompletionEventOnImplThread(0) 83 83 , m_readbackRequestOnImplThread(0) 84 , m_finishAllRenderingCompletionEventOnImplThread(0)85 84 , m_commitCompletionEventOnImplThread(0) 86 85 , m_textureAcquisitionCompletionEventOnImplThread(0) … … 432 431 TRACE_EVENT("CCThreadProxy::finishAllRenderingOnImplThread", this, 0); 433 432 ASSERT(isImplThread()); 434 ASSERT(!m_finishAllRenderingCompletionEventOnImplThread); 435 m_finishAllRenderingCompletionEventOnImplThread = completion; 436 437 m_schedulerOnImplThread->setNeedsForcedRedraw(); 433 m_layerTreeHostImpl->finishAllRendering(); 434 completion->signal(); 438 435 } 439 436 … … 666 663 result.didSwap = m_layerTreeHostImpl->swapBuffers(); 667 664 668 // Process any finish request669 if (m_finishAllRenderingCompletionEventOnImplThread) {670 m_layerTreeHostImpl->finishAllRendering();671 m_finishAllRenderingCompletionEventOnImplThread->signal();672 m_finishAllRenderingCompletionEventOnImplThread = 0;673 }674 675 665 // Tell the main thread that the the newly-commited frame was drawn. 676 666 if (m_nextFrameIsNewlyCommittedFrameOnImplThread) { -
trunk/Source/WebKit/chromium/tests/CCLayerTreeHostTest.cpp
r117608 r117825 50 50 #include <gtest/gtest.h> 51 51 #include <public/Platform.h> 52 #include <wtf/Locker.h> 52 53 #include <wtf/MainThread.h> 53 54 #include <wtf/PassRefPtr.h> 55 #include <wtf/ThreadingPrimitives.h> 54 56 #include <wtf/Vector.h> 55 57 … … 81 83 virtual void didRecreateContext(bool succeded) { } 82 84 virtual void didCommitAndDrawFrame() { } 85 virtual void scheduleComposite() { } 83 86 84 87 // Implementation of CCLayerAnimationDelegate … … 285 288 virtual void scheduleComposite() OVERRIDE 286 289 { 290 m_testHooks->scheduleComposite(); 287 291 } 288 292 … … 369 373 , m_endWhenBeginReturns(false) 370 374 , m_timedOut(false) 371 , m_finished(false) { } 375 , m_finished(false) 376 , m_scheduled(false) { } 372 377 373 378 void doBeginTest(); 379 380 virtual void scheduleComposite() 381 { 382 if (m_scheduled || m_finished) 383 return; 384 m_scheduled = true; 385 callOnMainThread(&CCLayerTreeHostTest::dispatchComposite, this); 386 } 374 387 375 388 static void onEndTest(void* self) … … 487 500 if (test->m_layerTreeHost) 488 501 test->m_layerTreeHost->setVisible(false); 502 } 503 504 static void dispatchComposite(void* self) 505 { 506 CCLayerTreeHostTest* test = static_cast<CCLayerTreeHostTest*>(self); 507 test->m_scheduled = false; 508 if (test->m_layerTreeHost && !test->m_finished) 509 test->m_layerTreeHost->composite(); 489 510 } 490 511 … … 577 598 bool m_timedOut; 578 599 bool m_finished; 600 bool m_scheduled; 579 601 580 602 OwnPtr<WebThread> m_webThread; … … 1216 1238 virtual void animateLayers(CCLayerTreeHostImpl* layerTreeHostImpl, double monotonicTime) 1217 1239 { 1218 const CCFloatAnimationCurve* curve = m_layerTreeHost->rootLayer()->layerAnimationController()->getActiveAnimation(0, CCActiveAnimation::Opacity)->curve()->toFloatAnimationCurve(); 1240 const CCActiveAnimation* animation = m_layerTreeHost->rootLayer()->layerAnimationController()->getActiveAnimation(0, CCActiveAnimation::Opacity); 1241 if (!animation) 1242 return; 1243 const CCFloatAnimationCurve* curve = animation->curve()->toFloatAnimationCurve(); 1219 1244 float startOpacity = curve->getValue(0); 1220 1245 float endOpacity = curve->getValue(curve->duration()); … … 2645 2670 } 2646 2671 2672 class CCLayerTreeHostTestFinishAllRendering : public CCLayerTreeHostTest { 2673 public: 2674 CCLayerTreeHostTestFinishAllRendering() 2675 : m_once(false) 2676 , m_mutex() 2677 , m_drawCount(0) 2678 { 2679 } 2680 2681 virtual void beginTest() 2682 { 2683 m_layerTreeHost->setNeedsRedraw(); 2684 } 2685 2686 virtual void didCommitAndDrawFrame() 2687 { 2688 if (m_once) 2689 return; 2690 m_once = true; 2691 m_layerTreeHost->setNeedsRedraw(); 2692 m_layerTreeHost->acquireLayerTextures(); 2693 { 2694 Locker<Mutex> lock(m_mutex); 2695 m_drawCount = 0; 2696 } 2697 m_layerTreeHost->finishAllRendering(); 2698 { 2699 Locker<Mutex> lock(m_mutex); 2700 EXPECT_EQ(0, m_drawCount); 2701 } 2702 endTest(); 2703 } 2704 2705 virtual void drawLayersOnCCThread(CCLayerTreeHostImpl* impl) 2706 { 2707 Locker<Mutex> lock(m_mutex); 2708 ++m_drawCount; 2709 } 2710 2711 virtual void afterTest() 2712 { 2713 } 2714 private: 2715 2716 bool m_once; 2717 Mutex m_mutex; 2718 int m_drawCount; 2719 }; 2720 2721 SINGLE_AND_MULTI_THREAD_TEST_F(CCLayerTreeHostTestFinishAllRendering) 2722 2647 2723 } // namespace
Note: See TracChangeset
for help on using the changeset viewer.