Changeset 95309 in webkit
- Timestamp:
- Sep 16, 2011 11:43:37 AM (13 years ago)
- Location:
- trunk/Source
- Files:
-
- 8 edited
Legend:
- Unmodified
- Added
- Removed
-
trunk/Source/WebCore/ChangeLog
r95307 r95309 1 2011-09-16 Iain Merrick <husky@google.com> 2 3 [chromium] Fix CCLayerTreeHostTest 4 https://bugs.webkit.org/show_bug.cgi?id=67418 5 6 This is a minimal set of changes to get CCLayerTreeHostTest 7 compiling, running and passing with USE_THREADED_COMPOSITING 8 enabled. 9 10 Reviewed by James Robinson. 11 12 * platform/graphics/chromium/ContentLayerChromium.cpp: 13 (WebCore::ContentLayerChromium::createTextureUpdater): 14 * platform/graphics/chromium/LayerRendererChromium.cpp: 15 (WebCore::LayerRendererChromium::LayerRendererChromium): 16 * platform/graphics/chromium/cc/CCLayerTreeHost.cpp: 17 (WebCore::CCLayerTreeHost::createLayerTreeHostImpl): 18 * platform/graphics/chromium/cc/CCLayerTreeHost.h: 19 * platform/graphics/chromium/cc/CCLayerTreeHostImpl.h: 20 * platform/graphics/chromium/cc/CCThreadProxy.cpp: 21 (WebCore::CCThreadProxy::context): 22 (WebCore::CCThreadProxy::beginFrameAndCommitOnCCThread): 23 (WebCore::CCThreadProxy::setNeedsCommitAndRedrawOnCCThread): 24 (WebCore::CCThreadProxy::setNeedsRedrawOnCCThread): 25 1 26 2011-09-16 Sheriff Bot <webkit.review.bot@gmail.com> 2 27 -
trunk/Source/WebCore/platform/graphics/chromium/ContentLayerChromium.cpp
r95148 r95309 121 121 void ContentLayerChromium::createTextureUpdater(const CCLayerTreeHost* host) 122 122 { 123 #if !USE(THREADED_COMPOSITING) 123 124 #if USE(SKIA) 124 125 // Note that host->skiaContext() will crash if called while in threaded … … 130 131 } 131 132 #endif // SKIA 133 #endif // !THREADED_COMPOSITING 132 134 133 135 m_textureUpdater = LayerTextureUpdaterBitmap::create(ContentLayerPainter::create(m_delegate), host->layerRendererCapabilities().usingMapSub); -
trunk/Source/WebCore/platform/graphics/chromium/LayerRendererChromium.cpp
r95135 r95309 149 149 , m_offscreenFramebufferId(0) 150 150 , m_zoomAnimatorScale(1) 151 , m_contentsTextureMemoryUseBytes(0) 151 152 , m_context(context) 152 153 , m_defaultRenderSurface(0) -
trunk/Source/WebCore/platform/graphics/chromium/cc/CCLayerTreeHost.h
r95152 r95309 100 100 PassOwnPtr<CCThread> createCompositorThread(); 101 101 PassRefPtr<GraphicsContext3D> createLayerTreeHostContext3D(); 102 PassOwnPtr<CCLayerTreeHostImpl> createLayerTreeHostImpl();102 virtual PassOwnPtr<CCLayerTreeHostImpl> createLayerTreeHostImpl(); 103 103 void didRecreateGraphicsContext(bool success); 104 104 #if !USE(THREADED_COMPOSITING) … … 155 155 protected: 156 156 CCLayerTreeHost(CCLayerTreeHostClient*, PassRefPtr<LayerChromium> rootLayer, const CCSettings&); 157 bool initialize(); 157 158 158 159 private: … … 164 165 void updateCompositorResources(LayerChromium*, GraphicsContext3D*); 165 166 void clearPendingUpdate(); 166 167 bool initialize();168 167 169 168 bool m_animating; -
trunk/Source/WebCore/platform/graphics/chromium/cc/CCLayerTreeHostImpl.h
r95135 r95309 47 47 virtual ~CCLayerTreeHostImpl(); 48 48 49 // Virtual for testing 49 50 virtual void beginCommit(); 50 51 virtual void commitComplete(); 52 virtual void drawLayers(); 51 53 52 54 GraphicsContext3D* context(); 53 54 void drawLayers();55 55 56 56 void finishAllRendering(); -
trunk/Source/WebCore/platform/graphics/chromium/cc/CCThreadProxy.cpp
r95100 r95309 85 85 GraphicsContext3D* CCThreadProxy::context() 86 86 { 87 ASSERT_NOT_REACHED();88 87 return 0; 89 88 } … … 187 186 TRACE_EVENT("CCThreadProxy::beginFrameAndCommitOnCCThread", this, 0); 188 187 ASSERT(isImplThread()); 189 ASSERT_NOT_REACHED();190 // FIXME: call beginFrameAndCommit on main thread188 // TEMP HACK so we can exercise this code in unit tests. 189 CCMainThread::postTask(createMainThreadTask(this, &CCThreadProxy::beginFrameAndCommit, 0.0)); 191 190 } 192 191 … … 248 247 ASSERT(isImplThread()); 249 248 ASSERT(m_layerTreeHostImpl); 250 ASSERT_NOT_REACHED(); 249 // TEMP HACK so we can exercise this code in unit tests. 250 CCMainThread::postTask(createMainThreadTask(this, &CCThreadProxy::beginFrameAndCommit, 0.0)); 251 251 } 252 252 … … 254 254 { 255 255 TRACE_EVENT("CCThreadProxy::setNeedsRedrawOnCCThread", this, 0); 256 ASSERT_NOT_REACHED(); 256 // TEMP HACK so we can exercise this code in unit tests. 257 drawLayersOnCCThread(); 257 258 } 258 259 … … 285 286 } 286 287 287 } 288 } // namespace WebCore -
trunk/Source/WebKit/chromium/ChangeLog
r95289 r95309 1 2011-09-16 Iain Merrick <husky@google.com> 2 3 [chromium] Fix CCLayerTreeHostTest 4 https://bugs.webkit.org/show_bug.cgi?id=67418 5 6 Fixes needed to compile and link with USE_THREADED_COMPOSITING 7 enabled, and to pass the basic unit test. 8 9 Reviewed by James Robinson. 10 11 * src/GraphicsContext3DChromium.cpp: 12 (WebCore::GraphicsContext3DPrivate::GraphicsContext3DPrivate): 13 (WebCore::GraphicsContext3DPrivate::platformLayer): 14 * src/GraphicsContext3DPrivate.h: 15 * tests/CCLayerTreeHostTest.cpp: 16 (TestHooks::beginCommitOnCCThread): 17 (TestHooks::commitCompleteOnCCThread): 18 (TestHooks::drawLayersOnCCThread): 19 (MockLayerTreeHostImpl::MockLayerTreeHostImpl): 20 (MockLayerTreeHostImpl::beginCommit): 21 (MockLayerTreeHostImpl::commitComplete): 22 (MockLayerTreeHostImpl::drawLayers): 23 (MockLayerTreeHost::MockLayerTreeHost): 24 (MockLayerTreeHost::createLayerTreeHostImpl): 25 (CompositorMockWebGraphicsContext3D::makeContextCurrent): 26 (CompositorMockWebGraphicsContext3D::createProgram): 27 (CompositorMockWebGraphicsContext3D::createShader): 28 (CompositorMockWebGraphicsContext3D::getShaderiv): 29 (CompositorMockWebGraphicsContext3D::getProgramiv): 30 (MockLayerTreeHostClient::MockLayerTreeHostClient): 31 (MockLayerTreeHostClient::animateAndLayout): 32 (MockLayerTreeHostClient::createCompositorThread): 33 (MockLayerTreeHostClient::createLayerTreeHostContext3D): 34 (MockLayerTreeHostClient::createRootLayerPainter): 35 (MockLayerTreeHostClient::didRecreateGraphicsContext): 36 (CCLayerTreeHostTest::postSetNeedsCommitToMainThread): 37 (CCLayerTreeHostTest::postSetNeedsRedrawToMainThread): 38 (CCLayerTreeHostTest::onEndTest): 39 (CCLayerTreeHostTest::dispatchSetNeedsCommit): 40 (CCLayerTreeHostTest::dispatchSetNeedsRedraw): 41 (CCLayerTreeHostTest::runTest): 42 (CCLayerTreeHostTest::doBeginTest): 43 (CCLayerTreeHostTestShortlived2::beginTest): 44 (CCLayerTreeHostTestShortlived3::beginTest): 45 (CCLayerTreeHostTestCommitingWithContinuousRedraw::beginTest): 46 (CCLayerTreeHostTestCommitingWithContinuousRedraw::commitCompleteOnCCThread): 47 (CCLayerTreeHostTestCommitingWithContinuousRedraw::drawLayersOnCCThread): 48 (CCLayerTreeHostTestSetNeedsCommit1::beginTest): 49 (CCLayerTreeHostTestSetNeedsCommit1::drawLayersOnCCThread): 50 (CCLayerTreeHostTestSetNeedsCommit1::commitCompleteOnCCThread): 51 (CCLayerTreeHostTestSetNeedsCommit2::beginTest): 52 (CCLayerTreeHostTestSetNeedsCommit2::drawLayersOnCCThread): 53 (CCLayerTreeHostTestSetNeedsCommit2::commitCompleteOnCCThread): 54 (CCLayerTreeHostTestSetNeedsRedraw::beginTest): 55 (CCLayerTreeHostTestSetNeedsRedraw::drawLayersOnCCThread): 56 (CCLayerTreeHostTestSetNeedsRedraw::commitCompleteOnCCThread): 57 1 58 2011-09-16 Andrey Kosyakov <caseq@chromium.org> 2 59 -
trunk/Source/WebKit/chromium/tests/CCLayerTreeHostTest.cpp
r89837 r95309 29 29 #include "cc/CCLayerTreeHost.h" 30 30 31 #include "GraphicsContext3D.h" 31 #include "CCThreadImpl.h" 32 #include "GraphicsContext3DPrivate.h" 33 #include "LayerChromium.h" 34 #include "LayerPainterChromium.h" 35 #include "MockWebGraphicsContext3D.h" 36 #include "TextureManager.h" 32 37 #include "cc/CCLayerTreeHostImpl.h" 33 38 #include "cc/CCMainThreadTask.h" … … 39 44 #include <wtf/Vector.h> 40 45 41 42 46 using namespace WebCore; 47 using namespace WebKit; 43 48 using namespace WTF; 44 49 45 50 namespace { 46 51 47 class MockLayerTreeHost; 48 class MockLayerTreeHostClient; 49 class MockLayerTreeHostImpl; 52 // Used by test stubs to notify the test when something interesting happens. 53 class TestHooks { 54 public: 55 virtual void beginCommitOnCCThread(CCLayerTreeHostImpl*) { } 56 virtual void commitCompleteOnCCThread(CCLayerTreeHostImpl*) { } 57 virtual void drawLayersOnCCThread(CCLayerTreeHostImpl*) { } 58 }; 59 60 // Adapts CCLayerTreeHostImpl for test. Runs real code, then invokes test hooks. 61 class MockLayerTreeHostImpl : public CCLayerTreeHostImpl { 62 public: 63 static PassOwnPtr<MockLayerTreeHostImpl> create(TestHooks* testHooks, const CCSettings& settings) 64 { 65 return adoptPtr(new MockLayerTreeHostImpl(testHooks, settings)); 66 } 67 68 virtual void beginCommit() 69 { 70 CCLayerTreeHostImpl::beginCommit(); 71 m_testHooks->beginCommitOnCCThread(this); 72 } 73 74 virtual void commitComplete() 75 { 76 CCLayerTreeHostImpl::commitComplete(); 77 m_testHooks->commitCompleteOnCCThread(this); 78 } 79 80 virtual void drawLayers() 81 { 82 CCLayerTreeHostImpl::drawLayers(); 83 m_testHooks->drawLayersOnCCThread(this); 84 } 85 86 private: 87 MockLayerTreeHostImpl(TestHooks* testHooks, const CCSettings& settings) 88 : CCLayerTreeHostImpl(settings) 89 , m_testHooks(testHooks) 90 { 91 } 92 93 TestHooks* m_testHooks; 94 }; 95 96 // Adapts CCLayerTreeHost for test. Injects MockLayerTreeHostImpl. 97 class MockLayerTreeHost : public CCLayerTreeHost { 98 public: 99 static PassRefPtr<MockLayerTreeHost> create(TestHooks* testHooks, CCLayerTreeHostClient* client, PassRefPtr<LayerChromium> rootLayer, const CCSettings& settings) 100 { 101 return adoptRef(new MockLayerTreeHost(testHooks, client, rootLayer, settings)); 102 } 103 104 virtual PassOwnPtr<CCLayerTreeHostImpl> createLayerTreeHostImpl() 105 { 106 return MockLayerTreeHostImpl::create(m_testHooks, settings()); 107 } 108 109 private: 110 MockLayerTreeHost(TestHooks* testHooks, CCLayerTreeHostClient* client, PassRefPtr<LayerChromium> rootLayer, const CCSettings& settings) 111 : CCLayerTreeHost(client, rootLayer, settings) 112 , m_testHooks(testHooks) 113 { 114 bool success = initialize(); 115 ASSERT(success); 116 } 117 118 TestHooks* m_testHooks; 119 }; 120 121 // Test stub for WebGraphicsContext3D. Returns canned values needed for compositor initialization. 122 class CompositorMockWebGraphicsContext3D : public MockWebGraphicsContext3D { 123 public: 124 static PassOwnPtr<CompositorMockWebGraphicsContext3D> create() 125 { 126 return adoptPtr(new CompositorMockWebGraphicsContext3D()); 127 } 128 129 virtual bool makeContextCurrent() { return true; } 130 virtual WebGLId createProgram() { return 1; } 131 virtual WebGLId createShader(WGC3Denum) { return 1; } 132 virtual void getShaderiv(WebGLId, WGC3Denum, WGC3Dint* value) { *value = 1; } 133 virtual void getProgramiv(WebGLId, WGC3Denum, WGC3Dint* value) { *value = 1; } 134 135 private: 136 CompositorMockWebGraphicsContext3D() { } 137 }; 138 139 // Implementation of CCLayerTreeHost callback interface. 140 class MockLayerTreeHostClient : public CCLayerTreeHostClient { 141 public: 142 static PassOwnPtr<MockLayerTreeHostClient> create(TestHooks* testHooks) 143 { 144 return adoptPtr(new MockLayerTreeHostClient(testHooks)); 145 } 146 147 virtual void animateAndLayout(double frameBeginTime) 148 { 149 } 150 151 virtual PassOwnPtr<CCThread> createCompositorThread() 152 { 153 return CCThreadImpl::create(); 154 } 155 156 virtual PassRefPtr<GraphicsContext3D> createLayerTreeHostContext3D() 157 { 158 OwnPtr<WebGraphicsContext3D> mock = CompositorMockWebGraphicsContext3D::create(); 159 GraphicsContext3D::Attributes attrs; 160 RefPtr<GraphicsContext3D> context = GraphicsContext3DPrivate::createGraphicsContextFromWebContext(mock.release(), attrs, 0, GraphicsContext3D::RenderDirectlyToHostWindow, GraphicsContext3DPrivate::ForUseOnAnotherThread); 161 return context; 162 } 163 164 virtual PassOwnPtr<LayerPainterChromium> createRootLayerPainter() 165 { 166 return nullptr; 167 } 168 169 virtual void didRecreateGraphicsContext(bool) 170 { 171 } 172 173 private: 174 explicit MockLayerTreeHostClient(TestHooks* testHooks) : m_testHooks(testHooks) { } 175 176 TestHooks* m_testHooks; 177 }; 50 178 51 179 // The CCLayerTreeHostTest runs with the main loop running. It instantiates a single MockLayerTreeHost and associated … … 59 187 // The test continues until someone calls endTest. endTest can be called on any thread, but be aware that 60 188 // ending the test is an asynchronous process. 61 class CCLayerTreeHostTest : public testing::Test { 62 public: 189 class CCLayerTreeHostTest : public testing::Test, TestHooks { 190 public: 191 virtual void afterTest() = 0; 192 virtual void beginTest() = 0; 193 194 void endTest(); 195 196 void postSetNeedsCommitToMainThread() 197 { 198 callOnMainThread(CCLayerTreeHostTest::dispatchSetNeedsCommit, this); 199 } 200 201 void postSetNeedsRedrawToMainThread() 202 { 203 callOnMainThread(CCLayerTreeHostTest::dispatchSetNeedsRedraw, this); 204 } 205 206 protected: 63 207 CCLayerTreeHostTest() 64 208 : m_beginning(false) … … 67 211 , m_timedOut(false) { } 68 212 69 virtual void afterTest() = 0;70 71 virtual void beginTest() = 0;72 virtual void animateAndLayout(MockLayerTreeHostClient* layerTreeHost, double frameBeginTime) { }73 virtual void beginCommitOnCCThread(MockLayerTreeHostImpl* layerTreeHostImpl) { }74 virtual void beginCommitOnMainThread(MockLayerTreeHost* layerTreeHost) { }75 virtual void commitOnCCThread(MockLayerTreeHost* layerTreeHost, MockLayerTreeHostImpl* layerTreeHostImpl) { }76 virtual void commitCompleteOnCCThread(MockLayerTreeHostImpl* layerTreeHostImpl) { }77 virtual void commitCompleteOnMainThread(MockLayerTreeHost* layerTreeHost) { }78 virtual void drawLayersAndPresentOnCCThread(MockLayerTreeHostImpl* layerTreeHostImpl) { }79 virtual void updateLayers(MockLayerTreeHost* layerTreeHost) { }80 81 void endTest();82 83 protected:84 213 void doBeginTest(); 85 214 … … 89 218 } 90 219 91 void doEndTest()92 {93 }94 95 220 static void onEndTest(void* self) 96 221 { 97 222 ASSERT(isMainThread()); 223 webkit_support::QuitMessageLoop(); 98 224 CCLayerTreeHostTest* test = static_cast<CCLayerTreeHostTest*>(self); 225 ASSERT(test); 99 226 test->m_layerTreeHost.clear(); 100 test->m_client.clear(); 101 webkit_support::QuitMessageLoop(); 227 } 228 229 static void dispatchSetNeedsCommit(void* self) 230 { 231 ASSERT(isMainThread()); 232 CCLayerTreeHostTest* test = static_cast<CCLayerTreeHostTest*>(self); 233 ASSERT(test); 234 if (test->m_layerTreeHost) 235 test->m_layerTreeHost->setNeedsCommitAndRedraw(); 236 } 237 238 static void dispatchSetNeedsRedraw(void* self) 239 { 240 ASSERT(isMainThread()); 241 CCLayerTreeHostTest* test = static_cast<CCLayerTreeHostTest*>(self); 242 ASSERT(test); 243 if (test->m_layerTreeHost) 244 test->m_layerTreeHost->setNeedsRedraw(); 102 245 } 103 246 … … 110 253 bool timedOut = m_timedOut; // Save whether we're timed out in case RunAllPendingMessages has the timeout. 111 254 webkit_support::RunAllPendingMessages(); 255 ASSERT(!m_layerTreeHost.get()); 256 m_client.clear(); 112 257 if (timedOut) { 113 printf("Test timed out");114 258 FAIL() << "Test timed out"; 115 259 return; … … 127 271 } 128 272 129 Mutex m_tracesLock;130 Vector<std::string> m_traces;131 132 273 OwnPtr<MockLayerTreeHostClient> m_client; 133 RefPtr< MockLayerTreeHost> m_layerTreeHost;274 RefPtr<CCLayerTreeHost> m_layerTreeHost; 134 275 135 276 private: … … 140 281 }; 141 282 142 class MockLayerTreeHostClient : public CCLayerTreeHostClient {143 public:144 MockLayerTreeHostClient(CCLayerTreeHostTest* test) : m_test(test) { }145 146 virtual PassRefPtr<GraphicsContext3D> createLayerTreeHostContext3D()147 {148 return adoptRef<GraphicsContext3D>(0);149 }150 151 virtual void animateAndLayout(double frameBeginTime)152 {153 m_test->animateAndLayout(this, frameBeginTime);154 }155 156 virtual void updateLayers()157 {158 }159 160 private:161 CCLayerTreeHostTest* m_test;162 };163 164 class MockLayerTreeHostCommitter : public CCLayerTreeHostCommitter {165 public:166 static PassOwnPtr<MockLayerTreeHostCommitter> create(CCLayerTreeHostTest* test)167 {168 return adoptPtr(new MockLayerTreeHostCommitter(test));169 }170 171 virtual void commit(CCLayerTreeHost* host, CCLayerTreeHostImpl* hostImpl)172 {173 CCLayerTreeHostCommitter::commit(host, hostImpl);174 m_test->commitOnCCThread(reinterpret_cast<MockLayerTreeHost*>(host), reinterpret_cast<MockLayerTreeHostImpl*>(hostImpl));175 }176 177 private:178 MockLayerTreeHostCommitter(CCLayerTreeHostTest* test) : m_test(test) { }179 CCLayerTreeHostTest* m_test;180 };181 182 class MockLayerTreeHostImpl : public CCLayerTreeHostImpl {183 public:184 static PassOwnPtr<MockLayerTreeHostImpl> create(CCLayerTreeHostImplClient* client, CCLayerTreeHostTest* test)185 {186 return adoptPtr(new MockLayerTreeHostImpl(client, test));187 }188 189 virtual void beginCommit()190 {191 CCLayerTreeHostImpl::beginCommit();192 m_test->beginCommitOnCCThread(this);193 }194 195 virtual void commitComplete()196 {197 CCLayerTreeHostImpl::commitComplete();198 m_test->commitCompleteOnCCThread(this);199 }200 201 virtual void drawLayersAndPresent()202 {203 m_test->drawLayersAndPresentOnCCThread(this);204 }205 206 private:207 MockLayerTreeHostImpl(CCLayerTreeHostImplClient* client, CCLayerTreeHostTest* test)208 : CCLayerTreeHostImpl(client)209 , m_test(test)210 {211 }212 213 CCLayerTreeHostTest* m_test;214 };215 216 class MockLayerTreeHostImplProxy : public CCLayerTreeHostImplProxy {217 public:218 static PassOwnPtr<MockLayerTreeHostImplProxy> create(CCLayerTreeHost* host, CCLayerTreeHostTest* test)219 {220 return adoptPtr(new MockLayerTreeHostImplProxy(host, test));221 }222 223 PassOwnPtr<CCLayerTreeHostImpl> createLayerTreeHostImpl()224 {225 return MockLayerTreeHostImpl::create(this, m_test);226 }227 228 private:229 MockLayerTreeHostImplProxy(CCLayerTreeHost* host, CCLayerTreeHostTest* test)230 : CCLayerTreeHostImplProxy(host)231 , m_test(test) { }232 233 CCLayerTreeHostTest* m_test;234 };235 236 class MockLayerTreeHost : public CCLayerTreeHost {237 public:238 MockLayerTreeHost(CCLayerTreeHostClient* client, CCLayerTreeHostTest* test)239 : CCLayerTreeHost(client)240 , m_test(test) { }241 242 virtual PassOwnPtr<CCLayerTreeHostImplProxy> createLayerTreeHostImplProxy()243 {244 OwnPtr<CCLayerTreeHostImplProxy> proxy = MockLayerTreeHostImplProxy::create(this, m_test);245 proxy->start();246 return proxy.release();247 }248 249 virtual void updateLayers()250 {251 m_test->updateLayers(this);252 }253 254 virtual PassOwnPtr<CCLayerTreeHostCommitter> createLayerTreeHostCommitter()255 {256 return MockLayerTreeHostCommitter::create(m_test);257 }258 259 virtual void beginCommit()260 {261 CCLayerTreeHost::beginCommit();262 m_test->beginCommitOnMainThread(this);263 }264 265 virtual void commitComplete()266 {267 m_test->commitCompleteOnMainThread(this);268 CCLayerTreeHost::commitComplete();269 }270 271 private:272 CCLayerTreeHostTest* m_test;273 };274 275 283 void CCLayerTreeHostTest::doBeginTest() 276 284 { 285 ASSERT(isMainThread()); 277 286 ASSERT(!m_running); 278 287 m_running = true; 279 m_client = adoptPtr(new MockLayerTreeHostClient(this)); 280 m_layerTreeHost = adoptRef(new MockLayerTreeHost(m_client.get(), this)); 281 m_layerTreeHost->init(); 288 m_client = MockLayerTreeHostClient::create(this); 289 290 CCSettings settings; 291 settings.enableCompositorThread = true; 292 RefPtr<LayerChromium> rootLayer; 293 m_layerTreeHost = MockLayerTreeHost::create(this, m_client.get(), rootLayer, settings); 294 ASSERT(m_layerTreeHost); 295 282 296 m_beginning = true; 283 297 beginTest(); … … 328 342 virtual void beginTest() 329 343 { 330 m_layerTreeHost->setNeedsCommitAndRedraw();344 postSetNeedsCommitToMainThread(); 331 345 endTest(); 332 346 } … … 348 362 virtual void beginTest() 349 363 { 350 m_layerTreeHost->setNeedsRedraw();364 postSetNeedsRedrawToMainThread(); 351 365 endTest(); 352 366 } … … 372 386 virtual void beginTest() 373 387 { 374 m_layerTreeHost->setNeedsCommitAndRedraw();388 postSetNeedsCommitToMainThread(); 375 389 endTest(); 376 390 } 377 391 378 virtual void commitCompleteOnCCThread( MockLayerTreeHostImpl* layerTreeHostImpl)392 virtual void commitCompleteOnCCThread(CCLayerTreeHostImpl*) 379 393 { 380 394 m_numCompleteCommits++; … … 383 397 } 384 398 385 virtual void drawLayers AndPresentOnCCThread(MockLayerTreeHostImpl* layerTreeHostImpl)399 virtual void drawLayersOnCCThread(CCLayerTreeHostImpl*) 386 400 { 387 401 if (m_numDraws == 1) 388 layerTreeHostImpl->setNeedsCommitAndRedraw();402 postSetNeedsCommitToMainThread(); 389 403 m_numDraws++; 390 layerTreeHostImpl->setNeedsRedraw();404 postSetNeedsRedrawToMainThread(); 391 405 } 392 406 … … 416 430 virtual void beginTest() 417 431 { 418 m_layerTreeHost->setNeedsCommitAndRedraw();419 m_layerTreeHost->setNeedsCommitAndRedraw();420 } 421 422 virtual void drawLayers AndPresentOnCCThread(MockLayerTreeHostImpl* layerTreeHostImpl)432 postSetNeedsCommitToMainThread(); 433 postSetNeedsCommitToMainThread(); 434 } 435 436 virtual void drawLayersOnCCThread(CCLayerTreeHostImpl* impl) 423 437 { 424 438 m_numDraws++; 425 if (! layerTreeHostImpl->sourceFrameNumber())439 if (!impl->sourceFrameNumber()) 426 440 endTest(); 427 441 } 428 442 429 virtual void commit OnCCThread(MockLayerTreeHost* layerTreeHost, MockLayerTreeHostImpl* impl)443 virtual void commitCompleteOnCCThread(CCLayerTreeHostImpl*) 430 444 { 431 445 m_numCommits++; … … 459 473 virtual void beginTest() 460 474 { 461 m_layerTreeHost->setNeedsCommitAndRedraw();462 } 463 464 virtual void drawLayers AndPresentOnCCThread(MockLayerTreeHostImpl* layerTreeHostImpl)465 { 466 if (! layerTreeHostImpl->sourceFrameNumber())467 layerTreeHostImpl->setNeedsCommitAndRedraw();468 else if ( layerTreeHostImpl->sourceFrameNumber() == 1)475 postSetNeedsCommitToMainThread(); 476 } 477 478 virtual void drawLayersOnCCThread(CCLayerTreeHostImpl* impl) 479 { 480 if (!impl->sourceFrameNumber()) 481 postSetNeedsCommitToMainThread(); 482 else if (impl->sourceFrameNumber() == 1) 469 483 endTest(); 470 484 } 471 485 472 virtual void commit OnCCThread(MockLayerTreeHost* layerTreeHost, MockLayerTreeHostImpl* impl)486 virtual void commitCompleteOnCCThread(CCLayerTreeHostImpl*) 473 487 { 474 488 m_numCommits++; … … 502 516 virtual void beginTest() 503 517 { 504 } 505 506 virtual void drawLayersAndPresentOnCCThread(MockLayerTreeHostImpl* impl) 518 postSetNeedsCommitToMainThread(); 519 } 520 521 virtual void drawLayersOnCCThread(CCLayerTreeHostImpl* impl) 507 522 { 508 523 EXPECT_EQ(0, impl->sourceFrameNumber()); 509 524 if (!m_numDraws) 510 impl->setNeedsRedraw(); // redraw again to verify that the second redraw doesnt commit.525 postSetNeedsRedrawToMainThread(); // Redraw again to verify that the second redraw doesn't commit. 511 526 else 512 527 endTest(); … … 514 529 } 515 530 516 virtual void commit OnCCThread(MockLayerTreeHost* layerTreeHost, MockLayerTreeHostImpl* impl)531 virtual void commitCompleteOnCCThread(CCLayerTreeHostImpl*) 517 532 { 518 533 m_numCommits++;
Note: See TracChangeset
for help on using the changeset viewer.