| 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/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 1456 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 1467 class MockOutputSurface : public OutputSurface { | 1467 class MockOutputSurface : public OutputSurface { |
| 1468 public: | 1468 public: |
| 1469 explicit MockOutputSurface(scoped_refptr<ContextProvider> provider) | 1469 explicit MockOutputSurface(scoped_refptr<ContextProvider> provider) |
| 1470 : OutputSurface(std::move(provider)) {} | 1470 : OutputSurface(std::move(provider)) {} |
| 1471 virtual ~MockOutputSurface() {} | 1471 virtual ~MockOutputSurface() {} |
| 1472 | 1472 |
| 1473 void BindToClient(OutputSurfaceClient*) override {} | 1473 void BindToClient(OutputSurfaceClient*) override {} |
| 1474 | 1474 |
| 1475 MOCK_METHOD0(EnsureBackbuffer, void()); | 1475 MOCK_METHOD0(EnsureBackbuffer, void()); |
| 1476 MOCK_METHOD0(DiscardBackbuffer, void()); | 1476 MOCK_METHOD0(DiscardBackbuffer, void()); |
| 1477 MOCK_METHOD4(Reshape, | 1477 MOCK_METHOD5(Reshape, |
| 1478 void(const gfx::Size& size, | 1478 void(const gfx::Size& size, |
| 1479 float scale_factor, | 1479 float scale_factor, |
| 1480 const gfx::ColorSpace& color_space, | 1480 const gfx::ColorSpace& color_space, |
| 1481 bool has_alpha)); | 1481 bool has_alpha, |
| 1482 bool use_stencil)); |
| 1482 MOCK_METHOD0(BindFramebuffer, void()); | 1483 MOCK_METHOD0(BindFramebuffer, void()); |
| 1483 MOCK_METHOD0(GetFramebufferCopyTextureFormat, GLenum()); | 1484 MOCK_METHOD0(GetFramebufferCopyTextureFormat, GLenum()); |
| 1484 MOCK_METHOD1(SwapBuffers_, void(OutputSurfaceFrame& frame)); // NOLINT | 1485 MOCK_METHOD1(SwapBuffers_, void(OutputSurfaceFrame& frame)); // NOLINT |
| 1485 void SwapBuffers(OutputSurfaceFrame frame) override { SwapBuffers_(frame); } | 1486 void SwapBuffers(OutputSurfaceFrame frame) override { SwapBuffers_(frame); } |
| 1486 MOCK_CONST_METHOD0(GetOverlayCandidateValidator, | 1487 MOCK_CONST_METHOD0(GetOverlayCandidateValidator, |
| 1487 OverlayCandidateValidator*()); | 1488 OverlayCandidateValidator*()); |
| 1488 MOCK_CONST_METHOD0(IsDisplayedAsOverlayPlane, bool()); | 1489 MOCK_CONST_METHOD0(IsDisplayedAsOverlayPlane, bool()); |
| 1489 MOCK_CONST_METHOD0(GetOverlayTextureId, unsigned()); | 1490 MOCK_CONST_METHOD0(GetOverlayTextureId, unsigned()); |
| 1490 MOCK_CONST_METHOD0(SurfaceIsSuspendForRecycle, bool()); | 1491 MOCK_CONST_METHOD0(SurfaceIsSuspendForRecycle, bool()); |
| 1491 MOCK_CONST_METHOD0(HasExternalStencilTest, bool()); | 1492 MOCK_CONST_METHOD0(HasExternalStencilTest, bool()); |
| (...skipping 35 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 1527 int render_pass_id = 1; | 1528 int render_pass_id = 1; |
| 1528 RenderPass* render_pass = AddRenderPass( | 1529 RenderPass* render_pass = AddRenderPass( |
| 1529 &render_passes_in_draw_order_, render_pass_id, gfx::Rect(viewport_size), | 1530 &render_passes_in_draw_order_, render_pass_id, gfx::Rect(viewport_size), |
| 1530 gfx::Transform(), FilterOperations()); | 1531 gfx::Transform(), FilterOperations()); |
| 1531 AddQuad(render_pass, gfx::Rect(viewport_size), SK_ColorGREEN); | 1532 AddQuad(render_pass, gfx::Rect(viewport_size), SK_ColorGREEN); |
| 1532 render_pass->has_transparent_background = transparent; | 1533 render_pass->has_transparent_background = transparent; |
| 1533 | 1534 |
| 1534 EXPECT_CALL(*output_surface_, EnsureBackbuffer()).WillRepeatedly(Return()); | 1535 EXPECT_CALL(*output_surface_, EnsureBackbuffer()).WillRepeatedly(Return()); |
| 1535 | 1536 |
| 1536 EXPECT_CALL(*output_surface_, | 1537 EXPECT_CALL(*output_surface_, |
| 1537 Reshape(viewport_size, device_scale_factor, _, transparent)) | 1538 Reshape(viewport_size, device_scale_factor, _, transparent, _)) |
| 1538 .Times(1); | 1539 .Times(1); |
| 1539 | 1540 |
| 1540 EXPECT_CALL(*output_surface_, BindFramebuffer()).Times(1); | 1541 EXPECT_CALL(*output_surface_, BindFramebuffer()).Times(1); |
| 1541 | 1542 |
| 1542 EXPECT_CALL(*context_, drawElements(_, _, _, _)).Times(1); | 1543 EXPECT_CALL(*context_, drawElements(_, _, _, _)).Times(1); |
| 1543 | 1544 |
| 1544 renderer_->DecideRenderPassAllocationsForFrame( | 1545 renderer_->DecideRenderPassAllocationsForFrame( |
| 1545 render_passes_in_draw_order_); | 1546 render_passes_in_draw_order_); |
| 1546 renderer_->DrawFrame(&render_passes_in_draw_order_, device_scale_factor, | 1547 renderer_->DrawFrame(&render_passes_in_draw_order_, device_scale_factor, |
| 1547 gfx::ColorSpace(), viewport_size); | 1548 gfx::ColorSpace(), viewport_size); |
| (...skipping 423 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 1971 renderer_->SetVisible(true); | 1972 renderer_->SetVisible(true); |
| 1972 Mock::VerifyAndClearExpectations(context_support_ptr_); | 1973 Mock::VerifyAndClearExpectations(context_support_ptr_); |
| 1973 | 1974 |
| 1974 EXPECT_CALL(*context_support_ptr_, SetAggressivelyFreeResources(true)); | 1975 EXPECT_CALL(*context_support_ptr_, SetAggressivelyFreeResources(true)); |
| 1975 renderer_->SetVisible(false); | 1976 renderer_->SetVisible(false); |
| 1976 Mock::VerifyAndClearExpectations(context_support_ptr_); | 1977 Mock::VerifyAndClearExpectations(context_support_ptr_); |
| 1977 } | 1978 } |
| 1978 | 1979 |
| 1979 } // namespace | 1980 } // namespace |
| 1980 } // namespace cc | 1981 } // namespace cc |
| OLD | NEW |