| OLD | NEW |
| 1 // Copyright 2012 The Chromium Authors. All rights reserved. | 1 // Copyright 2012 The Chromium Authors. All rights reserved. |
| 2 // Use of this source code is governed by a BSD-style license that can be | 2 // Use of this source code is governed by a BSD-style license that can be |
| 3 // found in the LICENSE file. | 3 // found in the LICENSE file. |
| 4 | 4 |
| 5 #include "cc/gl_renderer.h" | 5 #include "cc/gl_renderer.h" |
| 6 | 6 |
| 7 #include "cc/draw_quad.h" | 7 #include "cc/draw_quad.h" |
| 8 #include "cc/prioritized_resource_manager.h" | 8 #include "cc/prioritized_resource_manager.h" |
| 9 #include "cc/resource_provider.h" | 9 #include "cc/resource_provider.h" |
| 10 #include "cc/test/fake_web_compositor_output_surface.h" | 10 #include "cc/test/fake_web_compositor_output_surface.h" |
| (...skipping 55 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 66 RenderPass::Id renderPassId = m_rootLayer->renderSurface()->renderPassId
(); | 66 RenderPass::Id renderPassId = m_rootLayer->renderSurface()->renderPassId
(); |
| 67 scoped_ptr<RenderPass> rootRenderPass = RenderPass::Create(); | 67 scoped_ptr<RenderPass> rootRenderPass = RenderPass::Create(); |
| 68 rootRenderPass->SetNew(renderPassId, gfx::Rect(), gfx::Rect(), gfx::Tran
sform()); | 68 rootRenderPass->SetNew(renderPassId, gfx::Rect(), gfx::Rect(), gfx::Tran
sform()); |
| 69 m_renderPassesInDrawOrder.push_back(rootRenderPass.get()); | 69 m_renderPassesInDrawOrder.push_back(rootRenderPass.get()); |
| 70 m_renderPasses.set(renderPassId, rootRenderPass.Pass()); | 70 m_renderPasses.set(renderPassId, rootRenderPass.Pass()); |
| 71 } | 71 } |
| 72 | 72 |
| 73 // RendererClient methods. | 73 // RendererClient methods. |
| 74 virtual const gfx::Size& deviceViewportSize() const OVERRIDE { static gfx::S
ize fakeSize(1, 1); return fakeSize; } | 74 virtual const gfx::Size& deviceViewportSize() const OVERRIDE { static gfx::S
ize fakeSize(1, 1); return fakeSize; } |
| 75 virtual const LayerTreeSettings& settings() const OVERRIDE { static LayerTre
eSettings fakeSettings; return fakeSettings; } | 75 virtual const LayerTreeSettings& settings() const OVERRIDE { static LayerTre
eSettings fakeSettings; return fakeSettings; } |
| 76 virtual void didLoseContext() OVERRIDE { } | 76 virtual void didLoseOutputSurface() OVERRIDE { } |
| 77 virtual void onSwapBuffersComplete() OVERRIDE { } | 77 virtual void onSwapBuffersComplete() OVERRIDE { } |
| 78 virtual void setFullRootLayerDamage() OVERRIDE { m_setFullRootLayerDamageCou
nt++; } | 78 virtual void setFullRootLayerDamage() OVERRIDE { m_setFullRootLayerDamageCou
nt++; } |
| 79 virtual void setManagedMemoryPolicy(const ManagedMemoryPolicy& policy) OVERR
IDE { m_memoryAllocationLimitBytes = policy.bytesLimitWhenVisible; } | 79 virtual void setManagedMemoryPolicy(const ManagedMemoryPolicy& policy) OVERR
IDE { m_memoryAllocationLimitBytes = policy.bytesLimitWhenVisible; } |
| 80 virtual void enforceManagedMemoryPolicy(const ManagedMemoryPolicy& policy) O
VERRIDE { if (m_lastCallWasSetVisibility) *m_lastCallWasSetVisibility = false; } | 80 virtual void enforceManagedMemoryPolicy(const ManagedMemoryPolicy& policy) O
VERRIDE { if (m_lastCallWasSetVisibility) *m_lastCallWasSetVisibility = false; } |
| 81 virtual bool hasImplThread() const OVERRIDE { return false; } | 81 virtual bool hasImplThread() const OVERRIDE { return false; } |
| 82 | 82 |
| 83 // Methods added for test. | 83 // Methods added for test. |
| 84 int setFullRootLayerDamageCount() const { return m_setFullRootLayerDamageCou
nt; } | 84 int setFullRootLayerDamageCount() const { return m_setFullRootLayerDamageCou
nt; } |
| 85 void setLastCallWasSetVisibilityPointer(bool* lastCallWasSetVisibility) { m_
lastCallWasSetVisibility = lastCallWasSetVisibility; } | 85 void setLastCallWasSetVisibilityPointer(bool* lastCallWasSetVisibility) { m_
lastCallWasSetVisibility = lastCallWasSetVisibility; } |
| 86 | 86 |
| (...skipping 45 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 132 void swapBuffers() | 132 void swapBuffers() |
| 133 { | 133 { |
| 134 m_renderer.swapBuffers(); | 134 m_renderer.swapBuffers(); |
| 135 } | 135 } |
| 136 | 136 |
| 137 FrameCountingMemoryAllocationSettingContext* context() { return static_cast<
FrameCountingMemoryAllocationSettingContext*>(m_context->context3D()); } | 137 FrameCountingMemoryAllocationSettingContext* context() { return static_cast<
FrameCountingMemoryAllocationSettingContext*>(m_context->context3D()); } |
| 138 | 138 |
| 139 WebGraphicsMemoryAllocation m_suggestHaveBackbufferYes; | 139 WebGraphicsMemoryAllocation m_suggestHaveBackbufferYes; |
| 140 WebGraphicsMemoryAllocation m_suggestHaveBackbufferNo; | 140 WebGraphicsMemoryAllocation m_suggestHaveBackbufferNo; |
| 141 | 141 |
| 142 scoped_ptr<GraphicsContext> m_context; | 142 scoped_ptr<OutputSurface> m_context; |
| 143 FakeRendererClient m_mockClient; | 143 FakeRendererClient m_mockClient; |
| 144 scoped_ptr<ResourceProvider> m_resourceProvider; | 144 scoped_ptr<ResourceProvider> m_resourceProvider; |
| 145 FakeRendererGL m_renderer; | 145 FakeRendererGL m_renderer; |
| 146 }; | 146 }; |
| 147 | 147 |
| 148 // Test GLRenderer discardFramebuffer functionality: | 148 // Test GLRenderer discardFramebuffer functionality: |
| 149 // Suggest recreating framebuffer when one already exists. | 149 // Suggest recreating framebuffer when one already exists. |
| 150 // Expected: it does nothing. | 150 // Expected: it does nothing. |
| 151 TEST_F(GLRendererTest, SuggestBackbufferYesWhenItAlreadyExistsShouldDoNothing) | 151 TEST_F(GLRendererTest, SuggestBackbufferYesWhenItAlreadyExistsShouldDoNothing) |
| 152 { | 152 { |
| (...skipping 140 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 293 virtual WGC3Dint getUniformLocation(WebGLId program, const WGC3Dchar* name)
{ ADD_FAILURE(); return 0; } | 293 virtual WGC3Dint getUniformLocation(WebGLId program, const WGC3Dchar* name)
{ ADD_FAILURE(); return 0; } |
| 294 virtual void getVertexAttribfv(WGC3Duint index, WGC3Denum pname, WGC3Dfloat*
value) { ADD_FAILURE(); } | 294 virtual void getVertexAttribfv(WGC3Duint index, WGC3Denum pname, WGC3Dfloat*
value) { ADD_FAILURE(); } |
| 295 virtual void getVertexAttribiv(WGC3Duint index, WGC3Denum pname, WGC3Dint* v
alue) { ADD_FAILURE(); } | 295 virtual void getVertexAttribiv(WGC3Duint index, WGC3Denum pname, WGC3Dint* v
alue) { ADD_FAILURE(); } |
| 296 virtual WGC3Dsizeiptr getVertexAttribOffset(WGC3Duint index, WGC3Denum pname
) { ADD_FAILURE(); return 0; } | 296 virtual WGC3Dsizeiptr getVertexAttribOffset(WGC3Duint index, WGC3Denum pname
) { ADD_FAILURE(); return 0; } |
| 297 }; | 297 }; |
| 298 | 298 |
| 299 // This test isn't using the same fixture as GLRendererTest, and you can't mix T
EST() and TEST_F() with the same name, hence LRC2. | 299 // This test isn't using the same fixture as GLRendererTest, and you can't mix T
EST() and TEST_F() with the same name, hence LRC2. |
| 300 TEST(GLRendererTest2, initializationDoesNotMakeSynchronousCalls) | 300 TEST(GLRendererTest2, initializationDoesNotMakeSynchronousCalls) |
| 301 { | 301 { |
| 302 FakeRendererClient mockClient; | 302 FakeRendererClient mockClient; |
| 303 scoped_ptr<GraphicsContext> context(FakeWebCompositorOutputSurface::create(s
coped_ptr<WebKit::WebGraphicsContext3D>(new ForbidSynchronousCallContext))); | 303 scoped_ptr<OutputSurface> context(FakeWebCompositorOutputSurface::create(sco
ped_ptr<WebKit::WebGraphicsContext3D>(new ForbidSynchronousCallContext))); |
| 304 scoped_ptr<ResourceProvider> resourceProvider(ResourceProvider::create(conte
xt.get())); | 304 scoped_ptr<ResourceProvider> resourceProvider(ResourceProvider::create(conte
xt.get())); |
| 305 FakeRendererGL renderer(&mockClient, resourceProvider.get()); | 305 FakeRendererGL renderer(&mockClient, resourceProvider.get()); |
| 306 | 306 |
| 307 EXPECT_TRUE(renderer.initialize()); | 307 EXPECT_TRUE(renderer.initialize()); |
| 308 } | 308 } |
| 309 | 309 |
| 310 class LoseContextOnFirstGetContext : public FakeWebGraphicsContext3D { | 310 class LoseContextOnFirstGetContext : public FakeWebGraphicsContext3D { |
| 311 public: | 311 public: |
| 312 LoseContextOnFirstGetContext() | 312 LoseContextOnFirstGetContext() |
| 313 : m_contextLost(false) | 313 : m_contextLost(false) |
| (...skipping 22 matching lines...) Expand all Loading... |
| 336 return m_contextLost ? 1 : 0; | 336 return m_contextLost ? 1 : 0; |
| 337 } | 337 } |
| 338 | 338 |
| 339 private: | 339 private: |
| 340 bool m_contextLost; | 340 bool m_contextLost; |
| 341 }; | 341 }; |
| 342 | 342 |
| 343 TEST(GLRendererTest2, initializationWithQuicklyLostContextDoesNotAssert) | 343 TEST(GLRendererTest2, initializationWithQuicklyLostContextDoesNotAssert) |
| 344 { | 344 { |
| 345 FakeRendererClient mockClient; | 345 FakeRendererClient mockClient; |
| 346 scoped_ptr<GraphicsContext> context(FakeWebCompositorOutputSurface::create(s
coped_ptr<WebKit::WebGraphicsContext3D>(new LoseContextOnFirstGetContext))); | 346 scoped_ptr<OutputSurface> context(FakeWebCompositorOutputSurface::create(sco
ped_ptr<WebKit::WebGraphicsContext3D>(new LoseContextOnFirstGetContext))); |
| 347 scoped_ptr<ResourceProvider> resourceProvider(ResourceProvider::create(conte
xt.get())); | 347 scoped_ptr<ResourceProvider> resourceProvider(ResourceProvider::create(conte
xt.get())); |
| 348 FakeRendererGL renderer(&mockClient, resourceProvider.get()); | 348 FakeRendererGL renderer(&mockClient, resourceProvider.get()); |
| 349 | 349 |
| 350 renderer.initialize(); | 350 renderer.initialize(); |
| 351 } | 351 } |
| 352 | 352 |
| 353 class ContextThatDoesNotSupportMemoryManagmentExtensions : public FakeWebGraphic
sContext3D { | 353 class ContextThatDoesNotSupportMemoryManagmentExtensions : public FakeWebGraphic
sContext3D { |
| 354 public: | 354 public: |
| 355 ContextThatDoesNotSupportMemoryManagmentExtensions() { } | 355 ContextThatDoesNotSupportMemoryManagmentExtensions() { } |
| 356 | 356 |
| 357 // WebGraphicsContext3D methods. | 357 // WebGraphicsContext3D methods. |
| 358 | 358 |
| 359 // This method would normally do a glSwapBuffers under the hood. | 359 // This method would normally do a glSwapBuffers under the hood. |
| 360 virtual void prepareTexture() { } | 360 virtual void prepareTexture() { } |
| 361 virtual void setMemoryAllocationChangedCallbackCHROMIUM(WebGraphicsMemoryAll
ocationChangedCallbackCHROMIUM* callback) { } | 361 virtual void setMemoryAllocationChangedCallbackCHROMIUM(WebGraphicsMemoryAll
ocationChangedCallbackCHROMIUM* callback) { } |
| 362 virtual WebString getString(WebKit::WGC3Denum name) { return WebString(); } | 362 virtual WebString getString(WebKit::WGC3Denum name) { return WebString(); } |
| 363 }; | 363 }; |
| 364 | 364 |
| 365 TEST(GLRendererTest2, initializationWithoutGpuMemoryManagerExtensionSupportShoul
dDefaultToNonZeroAllocation) | 365 TEST(GLRendererTest2, initializationWithoutGpuMemoryManagerExtensionSupportShoul
dDefaultToNonZeroAllocation) |
| 366 { | 366 { |
| 367 FakeRendererClient mockClient; | 367 FakeRendererClient mockClient; |
| 368 scoped_ptr<GraphicsContext> context(FakeWebCompositorOutputSurface::create(s
coped_ptr<WebKit::WebGraphicsContext3D>(new ContextThatDoesNotSupportMemoryManag
mentExtensions))); | 368 scoped_ptr<OutputSurface> outputSurface(FakeWebCompositorOutputSurface::crea
te(scoped_ptr<WebKit::WebGraphicsContext3D>(new ContextThatDoesNotSupportMemoryM
anagmentExtensions))); |
| 369 scoped_ptr<ResourceProvider> resourceProvider(ResourceProvider::create(conte
xt.get())); | 369 scoped_ptr<ResourceProvider> resourceProvider(ResourceProvider::create(outpu
tSurface.get())); |
| 370 FakeRendererGL renderer(&mockClient, resourceProvider.get()); | 370 FakeRendererGL renderer(&mockClient, resourceProvider.get()); |
| 371 | 371 |
| 372 renderer.initialize(); | 372 renderer.initialize(); |
| 373 | 373 |
| 374 EXPECT_GT(mockClient.memoryAllocationLimitBytes(), 0ul); | 374 EXPECT_GT(mockClient.memoryAllocationLimitBytes(), 0ul); |
| 375 } | 375 } |
| 376 | 376 |
| 377 class ClearCountingContext : public FakeWebGraphicsContext3D { | 377 class ClearCountingContext : public FakeWebGraphicsContext3D { |
| 378 public: | 378 public: |
| 379 ClearCountingContext() : m_clear(0) { } | 379 ClearCountingContext() : m_clear(0) { } |
| 380 | 380 |
| 381 virtual void clear(WGC3Dbitfield) | 381 virtual void clear(WGC3Dbitfield) |
| 382 { | 382 { |
| 383 m_clear++; | 383 m_clear++; |
| 384 } | 384 } |
| 385 | 385 |
| 386 int clearCount() const { return m_clear; } | 386 int clearCount() const { return m_clear; } |
| 387 | 387 |
| 388 private: | 388 private: |
| 389 int m_clear; | 389 int m_clear; |
| 390 }; | 390 }; |
| 391 | 391 |
| 392 TEST(GLRendererTest2, opaqueBackground) | 392 TEST(GLRendererTest2, opaqueBackground) |
| 393 { | 393 { |
| 394 FakeRendererClient mockClient; | 394 FakeRendererClient mockClient; |
| 395 scoped_ptr<GraphicsContext> outputSurface(FakeWebCompositorOutputSurface::cr
eate(scoped_ptr<WebKit::WebGraphicsContext3D>(new ClearCountingContext))); | 395 scoped_ptr<OutputSurface> outputSurface(FakeWebCompositorOutputSurface::crea
te(scoped_ptr<WebKit::WebGraphicsContext3D>(new ClearCountingContext))); |
| 396 ClearCountingContext* context = static_cast<ClearCountingContext*>(outputSur
face->context3D()); | 396 ClearCountingContext* context = static_cast<ClearCountingContext*>(outputSur
face->context3D()); |
| 397 scoped_ptr<ResourceProvider> resourceProvider(ResourceProvider::create(outpu
tSurface.get())); | 397 scoped_ptr<ResourceProvider> resourceProvider(ResourceProvider::create(outpu
tSurface.get())); |
| 398 FakeRendererGL renderer(&mockClient, resourceProvider.get()); | 398 FakeRendererGL renderer(&mockClient, resourceProvider.get()); |
| 399 | 399 |
| 400 mockClient.rootRenderPass()->has_transparent_background = false; | 400 mockClient.rootRenderPass()->has_transparent_background = false; |
| 401 | 401 |
| 402 EXPECT_TRUE(renderer.initialize()); | 402 EXPECT_TRUE(renderer.initialize()); |
| 403 | 403 |
| 404 renderer.drawFrame(mockClient.renderPassesInDrawOrder(), mockClient.renderPa
sses()); | 404 renderer.drawFrame(mockClient.renderPassesInDrawOrder(), mockClient.renderPa
sses()); |
| 405 | 405 |
| 406 // On DEBUG builds, render passes with opaque background clear to blue to | 406 // On DEBUG builds, render passes with opaque background clear to blue to |
| 407 // easily see regions that were not drawn on the screen. | 407 // easily see regions that were not drawn on the screen. |
| 408 #ifdef NDEBUG | 408 #ifdef NDEBUG |
| 409 EXPECT_EQ(0, context->clearCount()); | 409 EXPECT_EQ(0, context->clearCount()); |
| 410 #else | 410 #else |
| 411 EXPECT_EQ(1, context->clearCount()); | 411 EXPECT_EQ(1, context->clearCount()); |
| 412 #endif | 412 #endif |
| 413 } | 413 } |
| 414 | 414 |
| 415 TEST(GLRendererTest2, transparentBackground) | 415 TEST(GLRendererTest2, transparentBackground) |
| 416 { | 416 { |
| 417 FakeRendererClient mockClient; | 417 FakeRendererClient mockClient; |
| 418 scoped_ptr<GraphicsContext> outputSurface(FakeWebCompositorOutputSurface::cr
eate(scoped_ptr<WebKit::WebGraphicsContext3D>(new ClearCountingContext))); | 418 scoped_ptr<OutputSurface> outputSurface(FakeWebCompositorOutputSurface::crea
te(scoped_ptr<WebKit::WebGraphicsContext3D>(new ClearCountingContext))); |
| 419 ClearCountingContext* context = static_cast<ClearCountingContext*>(outputSur
face->context3D()); | 419 ClearCountingContext* context = static_cast<ClearCountingContext*>(outputSur
face->context3D()); |
| 420 scoped_ptr<ResourceProvider> resourceProvider(ResourceProvider::create(outpu
tSurface.get())); | 420 scoped_ptr<ResourceProvider> resourceProvider(ResourceProvider::create(outpu
tSurface.get())); |
| 421 FakeRendererGL renderer(&mockClient, resourceProvider.get()); | 421 FakeRendererGL renderer(&mockClient, resourceProvider.get()); |
| 422 | 422 |
| 423 mockClient.rootRenderPass()->has_transparent_background = true; | 423 mockClient.rootRenderPass()->has_transparent_background = true; |
| 424 | 424 |
| 425 EXPECT_TRUE(renderer.initialize()); | 425 EXPECT_TRUE(renderer.initialize()); |
| 426 | 426 |
| 427 renderer.drawFrame(mockClient.renderPassesInDrawOrder(), mockClient.renderPa
sses()); | 427 renderer.drawFrame(mockClient.renderPassesInDrawOrder(), mockClient.renderPa
sses()); |
| 428 | 428 |
| (...skipping 30 matching lines...) Expand all Loading... |
| 459 // Methods added for test. | 459 // Methods added for test. |
| 460 void setLastCallWasSetVisibilityPointer(bool* lastCallWasSetVisibility) { m_
lastCallWasSetVisibility = lastCallWasSetVisibility; } | 460 void setLastCallWasSetVisibilityPointer(bool* lastCallWasSetVisibility) { m_
lastCallWasSetVisibility = lastCallWasSetVisibility; } |
| 461 | 461 |
| 462 private: | 462 private: |
| 463 bool* m_lastCallWasSetVisibility; | 463 bool* m_lastCallWasSetVisibility; |
| 464 }; | 464 }; |
| 465 | 465 |
| 466 TEST(GLRendererTest2, visibilityChangeIsLastCall) | 466 TEST(GLRendererTest2, visibilityChangeIsLastCall) |
| 467 { | 467 { |
| 468 FakeRendererClient mockClient; | 468 FakeRendererClient mockClient; |
| 469 scoped_ptr<GraphicsContext> outputSurface(FakeWebCompositorOutputSurface::cr
eate(scoped_ptr<WebKit::WebGraphicsContext3D>(new VisibilityChangeIsLastCallTrac
kingContext))); | 469 scoped_ptr<OutputSurface> outputSurface(FakeWebCompositorOutputSurface::crea
te(scoped_ptr<WebKit::WebGraphicsContext3D>(new VisibilityChangeIsLastCallTracki
ngContext))); |
| 470 VisibilityChangeIsLastCallTrackingContext* context = static_cast<VisibilityC
hangeIsLastCallTrackingContext*>(outputSurface->context3D()); | 470 VisibilityChangeIsLastCallTrackingContext* context = static_cast<VisibilityC
hangeIsLastCallTrackingContext*>(outputSurface->context3D()); |
| 471 scoped_ptr<ResourceProvider> resourceProvider(ResourceProvider::create(outpu
tSurface.get())); | 471 scoped_ptr<ResourceProvider> resourceProvider(ResourceProvider::create(outpu
tSurface.get())); |
| 472 FakeRendererGL renderer(&mockClient, resourceProvider.get()); | 472 FakeRendererGL renderer(&mockClient, resourceProvider.get()); |
| 473 | 473 |
| 474 EXPECT_TRUE(renderer.initialize()); | 474 EXPECT_TRUE(renderer.initialize()); |
| 475 | 475 |
| 476 bool lastCallWasSetVisiblity = false; | 476 bool lastCallWasSetVisiblity = false; |
| 477 // Ensure that the call to setVisibilityCHROMIUM is the last call issue to t
he GPU | 477 // Ensure that the call to setVisibilityCHROMIUM is the last call issue to t
he GPU |
| 478 // process, after glFlush is called, and after the RendererClient's enforceM
anagedMemoryPolicy | 478 // process, after glFlush is called, and after the RendererClient's enforceM
anagedMemoryPolicy |
| 479 // is called. Plumb this tracking between both the RenderClient and the Cont
ext by giving | 479 // is called. Plumb this tracking between both the RenderClient and the Cont
ext by giving |
| (...skipping 31 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 511 | 511 |
| 512 WGC3Denum activeTexture() const { return m_activeTexture; } | 512 WGC3Denum activeTexture() const { return m_activeTexture; } |
| 513 | 513 |
| 514 private: | 514 private: |
| 515 WGC3Denum m_activeTexture; | 515 WGC3Denum m_activeTexture; |
| 516 }; | 516 }; |
| 517 | 517 |
| 518 TEST(GLRendererTest2, activeTextureState) | 518 TEST(GLRendererTest2, activeTextureState) |
| 519 { | 519 { |
| 520 FakeRendererClient fakeClient; | 520 FakeRendererClient fakeClient; |
| 521 scoped_ptr<GraphicsContext> outputSurface(FakeWebCompositorOutputSurface::cr
eate(scoped_ptr<WebKit::WebGraphicsContext3D>(new TextureStateTrackingContext)))
; | 521 scoped_ptr<OutputSurface> outputSurface(FakeWebCompositorOutputSurface::crea
te(scoped_ptr<WebKit::WebGraphicsContext3D>(new TextureStateTrackingContext))); |
| 522 TextureStateTrackingContext* context = static_cast<TextureStateTrackingConte
xt*>(outputSurface->context3D()); | 522 TextureStateTrackingContext* context = static_cast<TextureStateTrackingConte
xt*>(outputSurface->context3D()); |
| 523 scoped_ptr<ResourceProvider> resourceProvider(ResourceProvider::create(outpu
tSurface.get())); | 523 scoped_ptr<ResourceProvider> resourceProvider(ResourceProvider::create(outpu
tSurface.get())); |
| 524 FakeRendererGL renderer(&fakeClient, resourceProvider.get()); | 524 FakeRendererGL renderer(&fakeClient, resourceProvider.get()); |
| 525 | 525 |
| 526 // During initialization we are allowed to set any texture parameters. | 526 // During initialization we are allowed to set any texture parameters. |
| 527 EXPECT_CALL(*context, texParameteri(_, _, _)).Times(AnyNumber()); | 527 EXPECT_CALL(*context, texParameteri(_, _, _)).Times(AnyNumber()); |
| 528 EXPECT_TRUE(renderer.initialize()); | 528 EXPECT_TRUE(renderer.initialize()); |
| 529 | 529 |
| 530 cc::RenderPass::Id id(1, 1); | 530 cc::RenderPass::Id id(1, 1); |
| 531 scoped_ptr<TestRenderPass> pass = TestRenderPass::Create(); | 531 scoped_ptr<TestRenderPass> pass = TestRenderPass::Create(); |
| (...skipping 36 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 568 it != pass->quad_list.backToFrontEnd(); ++it) { | 568 it != pass->quad_list.backToFrontEnd(); ++it) { |
| 569 renderer.drawQuad(drawingFrame, *it); | 569 renderer.drawQuad(drawingFrame, *it); |
| 570 } | 570 } |
| 571 renderer.finishDrawingQuadList(); | 571 renderer.finishDrawingQuadList(); |
| 572 EXPECT_EQ(context->activeTexture(), GL_TEXTURE0); | 572 EXPECT_EQ(context->activeTexture(), GL_TEXTURE0); |
| 573 Mock::VerifyAndClearExpectations(context); | 573 Mock::VerifyAndClearExpectations(context); |
| 574 } | 574 } |
| 575 | 575 |
| 576 } // namespace | 576 } // namespace |
| 577 } // namespace cc | 577 } // namespace cc |
| OLD | NEW |