Chromium Code Reviews
chromiumcodereview-hr@appspot.gserviceaccount.com (chromiumcodereview-hr) | Please choose your nickname with Settings | Help | Chromium Project | Gerrit Changes | Sign out
(49)

Side by Side Diff: cc/output/gl_renderer_unittest.cc

Issue 2612023002: cc: Implement overdraw feedback debugging feature. (Closed)
Patch Set: rebase Created 3 years, 11 months ago
Use n/p to move between diff chunks; N/P to move between comments. Draft comments are only viewable by you.
Jump to:
View unified diff | Download patch
OLDNEW
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/output/gl_renderer.h" 5 #include "cc/output/gl_renderer.h"
6 6
7 #include <stdint.h> 7 #include <stdint.h>
8 8
9 #include <set> 9 #include <set>
10 #include <vector> 10 #include <vector>
(...skipping 1458 matching lines...) Expand 10 before | Expand all | Expand 10 after
1469 class MockOutputSurface : public OutputSurface { 1469 class MockOutputSurface : public OutputSurface {
1470 public: 1470 public:
1471 explicit MockOutputSurface(scoped_refptr<ContextProvider> provider) 1471 explicit MockOutputSurface(scoped_refptr<ContextProvider> provider)
1472 : OutputSurface(std::move(provider)) {} 1472 : OutputSurface(std::move(provider)) {}
1473 virtual ~MockOutputSurface() {} 1473 virtual ~MockOutputSurface() {}
1474 1474
1475 void BindToClient(OutputSurfaceClient*) override {} 1475 void BindToClient(OutputSurfaceClient*) override {}
1476 1476
1477 MOCK_METHOD0(EnsureBackbuffer, void()); 1477 MOCK_METHOD0(EnsureBackbuffer, void());
1478 MOCK_METHOD0(DiscardBackbuffer, void()); 1478 MOCK_METHOD0(DiscardBackbuffer, void());
1479 MOCK_METHOD4(Reshape, 1479 MOCK_METHOD5(Reshape,
1480 void(const gfx::Size& size, 1480 void(const gfx::Size& size,
1481 float scale_factor, 1481 float scale_factor,
1482 const gfx::ColorSpace& color_space, 1482 const gfx::ColorSpace& color_space,
1483 bool has_alpha)); 1483 bool has_alpha,
1484 bool use_stencil));
1484 MOCK_METHOD0(BindFramebuffer, void()); 1485 MOCK_METHOD0(BindFramebuffer, void());
1485 MOCK_METHOD0(GetFramebufferCopyTextureFormat, GLenum()); 1486 MOCK_METHOD0(GetFramebufferCopyTextureFormat, GLenum());
1486 MOCK_METHOD1(SwapBuffers_, void(OutputSurfaceFrame& frame)); // NOLINT 1487 MOCK_METHOD1(SwapBuffers_, void(OutputSurfaceFrame& frame)); // NOLINT
1487 void SwapBuffers(OutputSurfaceFrame frame) override { SwapBuffers_(frame); } 1488 void SwapBuffers(OutputSurfaceFrame frame) override { SwapBuffers_(frame); }
1488 MOCK_CONST_METHOD0(GetOverlayCandidateValidator, 1489 MOCK_CONST_METHOD0(GetOverlayCandidateValidator,
1489 OverlayCandidateValidator*()); 1490 OverlayCandidateValidator*());
1490 MOCK_CONST_METHOD0(IsDisplayedAsOverlayPlane, bool()); 1491 MOCK_CONST_METHOD0(IsDisplayedAsOverlayPlane, bool());
1491 MOCK_CONST_METHOD0(GetOverlayTextureId, unsigned()); 1492 MOCK_CONST_METHOD0(GetOverlayTextureId, unsigned());
1492 MOCK_CONST_METHOD0(SurfaceIsSuspendForRecycle, bool()); 1493 MOCK_CONST_METHOD0(SurfaceIsSuspendForRecycle, bool());
1493 MOCK_CONST_METHOD0(HasExternalStencilTest, bool()); 1494 MOCK_CONST_METHOD0(HasExternalStencilTest, bool());
(...skipping 35 matching lines...) Expand 10 before | Expand all | Expand 10 after
1529 int render_pass_id = 1; 1530 int render_pass_id = 1;
1530 RenderPass* render_pass = AddRenderPass( 1531 RenderPass* render_pass = AddRenderPass(
1531 &render_passes_in_draw_order_, render_pass_id, gfx::Rect(viewport_size), 1532 &render_passes_in_draw_order_, render_pass_id, gfx::Rect(viewport_size),
1532 gfx::Transform(), FilterOperations()); 1533 gfx::Transform(), FilterOperations());
1533 AddQuad(render_pass, gfx::Rect(viewport_size), SK_ColorGREEN); 1534 AddQuad(render_pass, gfx::Rect(viewport_size), SK_ColorGREEN);
1534 render_pass->has_transparent_background = transparent; 1535 render_pass->has_transparent_background = transparent;
1535 1536
1536 EXPECT_CALL(*output_surface_, EnsureBackbuffer()).WillRepeatedly(Return()); 1537 EXPECT_CALL(*output_surface_, EnsureBackbuffer()).WillRepeatedly(Return());
1537 1538
1538 EXPECT_CALL(*output_surface_, 1539 EXPECT_CALL(*output_surface_,
1539 Reshape(viewport_size, device_scale_factor, _, transparent)) 1540 Reshape(viewport_size, device_scale_factor, _, transparent, _))
1540 .Times(1); 1541 .Times(1);
1541 1542
1542 EXPECT_CALL(*output_surface_, BindFramebuffer()).Times(1); 1543 EXPECT_CALL(*output_surface_, BindFramebuffer()).Times(1);
1543 1544
1544 EXPECT_CALL(*context_, drawElements(_, _, _, _)).Times(1); 1545 EXPECT_CALL(*context_, drawElements(_, _, _, _)).Times(1);
1545 1546
1546 renderer_->DecideRenderPassAllocationsForFrame( 1547 renderer_->DecideRenderPassAllocationsForFrame(
1547 render_passes_in_draw_order_); 1548 render_passes_in_draw_order_);
1548 renderer_->DrawFrame(&render_passes_in_draw_order_, device_scale_factor, 1549 renderer_->DrawFrame(&render_passes_in_draw_order_, device_scale_factor,
1549 gfx::ColorSpace(), viewport_size); 1550 gfx::ColorSpace(), viewport_size);
(...skipping 423 matching lines...) Expand 10 before | Expand all | Expand 10 after
1973 renderer_->SetVisible(true); 1974 renderer_->SetVisible(true);
1974 Mock::VerifyAndClearExpectations(context_support_ptr_); 1975 Mock::VerifyAndClearExpectations(context_support_ptr_);
1975 1976
1976 EXPECT_CALL(*context_support_ptr_, SetAggressivelyFreeResources(true)); 1977 EXPECT_CALL(*context_support_ptr_, SetAggressivelyFreeResources(true));
1977 renderer_->SetVisible(false); 1978 renderer_->SetVisible(false);
1978 Mock::VerifyAndClearExpectations(context_support_ptr_); 1979 Mock::VerifyAndClearExpectations(context_support_ptr_);
1979 } 1980 }
1980 1981
1981 } // namespace 1982 } // namespace
1982 } // namespace cc 1983 } // namespace cc
OLDNEW

Powered by Google App Engine
This is Rietveld 408576698