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

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

Issue 2612023002: cc: Implement overdraw feedback debugging feature. (Closed)
Patch Set: make sure overdraw_feedback_ is initialized and reset properly 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
« no previous file with comments | « cc/output/gl_renderer.cc ('k') | cc/output/output_surface.h » ('j') | no next file with comments »
Toggle Intra-line Diffs ('i') | Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
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 1466 matching lines...) Expand 10 before | Expand all | Expand 10 after
1477 class MockOutputSurface : public OutputSurface { 1477 class MockOutputSurface : public OutputSurface {
1478 public: 1478 public:
1479 explicit MockOutputSurface(scoped_refptr<ContextProvider> provider) 1479 explicit MockOutputSurface(scoped_refptr<ContextProvider> provider)
1480 : OutputSurface(std::move(provider)) {} 1480 : OutputSurface(std::move(provider)) {}
1481 virtual ~MockOutputSurface() {} 1481 virtual ~MockOutputSurface() {}
1482 1482
1483 void BindToClient(OutputSurfaceClient*) override {} 1483 void BindToClient(OutputSurfaceClient*) override {}
1484 1484
1485 MOCK_METHOD0(EnsureBackbuffer, void()); 1485 MOCK_METHOD0(EnsureBackbuffer, void());
1486 MOCK_METHOD0(DiscardBackbuffer, void()); 1486 MOCK_METHOD0(DiscardBackbuffer, void());
1487 MOCK_METHOD4(Reshape, 1487 MOCK_METHOD5(Reshape,
1488 void(const gfx::Size& size, 1488 void(const gfx::Size& size,
1489 float scale_factor, 1489 float scale_factor,
1490 const gfx::ColorSpace& color_space, 1490 const gfx::ColorSpace& color_space,
1491 bool has_alpha)); 1491 bool has_alpha,
1492 bool use_stencil));
1492 MOCK_METHOD0(BindFramebuffer, void()); 1493 MOCK_METHOD0(BindFramebuffer, void());
1493 MOCK_METHOD0(GetFramebufferCopyTextureFormat, GLenum()); 1494 MOCK_METHOD0(GetFramebufferCopyTextureFormat, GLenum());
1494 MOCK_METHOD1(SwapBuffers_, void(OutputSurfaceFrame& frame)); // NOLINT 1495 MOCK_METHOD1(SwapBuffers_, void(OutputSurfaceFrame& frame)); // NOLINT
1495 void SwapBuffers(OutputSurfaceFrame frame) override { SwapBuffers_(frame); } 1496 void SwapBuffers(OutputSurfaceFrame frame) override { SwapBuffers_(frame); }
1496 MOCK_CONST_METHOD0(GetOverlayCandidateValidator, 1497 MOCK_CONST_METHOD0(GetOverlayCandidateValidator,
1497 OverlayCandidateValidator*()); 1498 OverlayCandidateValidator*());
1498 MOCK_CONST_METHOD0(IsDisplayedAsOverlayPlane, bool()); 1499 MOCK_CONST_METHOD0(IsDisplayedAsOverlayPlane, bool());
1499 MOCK_CONST_METHOD0(GetOverlayTextureId, unsigned()); 1500 MOCK_CONST_METHOD0(GetOverlayTextureId, unsigned());
1500 MOCK_CONST_METHOD0(SurfaceIsSuspendForRecycle, bool()); 1501 MOCK_CONST_METHOD0(SurfaceIsSuspendForRecycle, bool());
1501 MOCK_CONST_METHOD0(HasExternalStencilTest, bool()); 1502 MOCK_CONST_METHOD0(HasExternalStencilTest, bool());
(...skipping 35 matching lines...) Expand 10 before | Expand all | Expand 10 after
1537 int render_pass_id = 1; 1538 int render_pass_id = 1;
1538 RenderPass* render_pass = AddRenderPass( 1539 RenderPass* render_pass = AddRenderPass(
1539 &render_passes_in_draw_order_, render_pass_id, gfx::Rect(viewport_size), 1540 &render_passes_in_draw_order_, render_pass_id, gfx::Rect(viewport_size),
1540 gfx::Transform(), FilterOperations()); 1541 gfx::Transform(), FilterOperations());
1541 AddQuad(render_pass, gfx::Rect(viewport_size), SK_ColorGREEN); 1542 AddQuad(render_pass, gfx::Rect(viewport_size), SK_ColorGREEN);
1542 render_pass->has_transparent_background = transparent; 1543 render_pass->has_transparent_background = transparent;
1543 1544
1544 EXPECT_CALL(*output_surface_, EnsureBackbuffer()).WillRepeatedly(Return()); 1545 EXPECT_CALL(*output_surface_, EnsureBackbuffer()).WillRepeatedly(Return());
1545 1546
1546 EXPECT_CALL(*output_surface_, 1547 EXPECT_CALL(*output_surface_,
1547 Reshape(viewport_size, device_scale_factor, _, transparent)) 1548 Reshape(viewport_size, device_scale_factor, _, transparent, _))
1548 .Times(1); 1549 .Times(1);
1549 1550
1550 EXPECT_CALL(*output_surface_, BindFramebuffer()).Times(1); 1551 EXPECT_CALL(*output_surface_, BindFramebuffer()).Times(1);
1551 1552
1552 EXPECT_CALL(*context_, drawElements(_, _, _, _)).Times(1); 1553 EXPECT_CALL(*context_, drawElements(_, _, _, _)).Times(1);
1553 1554
1554 renderer_->DecideRenderPassAllocationsForFrame( 1555 renderer_->DecideRenderPassAllocationsForFrame(
1555 render_passes_in_draw_order_); 1556 render_passes_in_draw_order_);
1556 renderer_->DrawFrame(&render_passes_in_draw_order_, device_scale_factor, 1557 renderer_->DrawFrame(&render_passes_in_draw_order_, device_scale_factor,
1557 gfx::ColorSpace(), viewport_size); 1558 gfx::ColorSpace(), viewport_size);
(...skipping 423 matching lines...) Expand 10 before | Expand all | Expand 10 after
1981 renderer_->SetVisible(true); 1982 renderer_->SetVisible(true);
1982 Mock::VerifyAndClearExpectations(context_support_ptr_); 1983 Mock::VerifyAndClearExpectations(context_support_ptr_);
1983 1984
1984 EXPECT_CALL(*context_support_ptr_, SetAggressivelyFreeResources(true)); 1985 EXPECT_CALL(*context_support_ptr_, SetAggressivelyFreeResources(true));
1985 renderer_->SetVisible(false); 1986 renderer_->SetVisible(false);
1986 Mock::VerifyAndClearExpectations(context_support_ptr_); 1987 Mock::VerifyAndClearExpectations(context_support_ptr_);
1987 } 1988 }
1988 1989
1989 } // namespace 1990 } // namespace
1990 } // namespace cc 1991 } // namespace cc
OLDNEW
« no previous file with comments | « cc/output/gl_renderer.cc ('k') | cc/output/output_surface.h » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698