| 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 | 10 |
| (...skipping 1121 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 1132 | 1132 |
| 1133 private: | 1133 private: |
| 1134 int discarded_; | 1134 int discarded_; |
| 1135 }; | 1135 }; |
| 1136 | 1136 |
| 1137 class NonReshapableOutputSurface : public FakeOutputSurface { | 1137 class NonReshapableOutputSurface : public FakeOutputSurface { |
| 1138 public: | 1138 public: |
| 1139 explicit NonReshapableOutputSurface( | 1139 explicit NonReshapableOutputSurface( |
| 1140 std::unique_ptr<TestWebGraphicsContext3D> context3d) | 1140 std::unique_ptr<TestWebGraphicsContext3D> context3d) |
| 1141 : FakeOutputSurface(TestContextProvider::Create(std::move(context3d)), | 1141 : FakeOutputSurface(TestContextProvider::Create(std::move(context3d)), |
| 1142 nullptr, |
| 1142 false) { | 1143 false) { |
| 1143 surface_size_ = gfx::Size(500, 500); | 1144 surface_size_ = gfx::Size(500, 500); |
| 1144 } | 1145 } |
| 1145 void Reshape(const gfx::Size& size, | 1146 void Reshape(const gfx::Size& size, |
| 1146 float scale_factor, | 1147 float scale_factor, |
| 1147 bool has_alpha) override {} | 1148 bool has_alpha) override {} |
| 1148 void set_fixed_size(const gfx::Size& size) { surface_size_ = size; } | 1149 void set_fixed_size(const gfx::Size& size) { surface_size_ = size; } |
| 1149 }; | 1150 }; |
| 1150 | 1151 |
| 1151 TEST_F(GLRendererTest, NoDiscardOnPartialUpdates) { | 1152 TEST_F(GLRendererTest, NoDiscardOnPartialUpdates) { |
| (...skipping 602 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 1754 MOCK_METHOD2(bindFramebuffer, void(GLenum target, GLuint framebuffer)); | 1755 MOCK_METHOD2(bindFramebuffer, void(GLenum target, GLuint framebuffer)); |
| 1755 MOCK_METHOD3(reshapeWithScaleFactor, | 1756 MOCK_METHOD3(reshapeWithScaleFactor, |
| 1756 void(int width, int height, float scale_factor)); | 1757 void(int width, int height, float scale_factor)); |
| 1757 MOCK_METHOD4(drawElements, | 1758 MOCK_METHOD4(drawElements, |
| 1758 void(GLenum mode, GLsizei count, GLenum type, GLintptr offset)); | 1759 void(GLenum mode, GLsizei count, GLenum type, GLintptr offset)); |
| 1759 }; | 1760 }; |
| 1760 | 1761 |
| 1761 class MockOutputSurface : public OutputSurface { | 1762 class MockOutputSurface : public OutputSurface { |
| 1762 public: | 1763 public: |
| 1763 MockOutputSurface() | 1764 MockOutputSurface() |
| 1764 : OutputSurface(TestContextProvider::Create( | 1765 : OutputSurface( |
| 1765 std::unique_ptr<TestWebGraphicsContext3D>( | 1766 TestContextProvider::Create( |
| 1766 new StrictMock<OutputSurfaceMockContext>))) { | 1767 base::MakeUnique<StrictMock<OutputSurfaceMockContext>>()), |
| 1768 nullptr, |
| 1769 nullptr) { |
| 1767 surface_size_ = gfx::Size(100, 100); | 1770 surface_size_ = gfx::Size(100, 100); |
| 1768 } | 1771 } |
| 1769 virtual ~MockOutputSurface() {} | 1772 virtual ~MockOutputSurface() {} |
| 1770 | 1773 |
| 1771 MOCK_METHOD0(EnsureBackbuffer, void()); | 1774 MOCK_METHOD0(EnsureBackbuffer, void()); |
| 1772 MOCK_METHOD0(DiscardBackbuffer, void()); | 1775 MOCK_METHOD0(DiscardBackbuffer, void()); |
| 1773 MOCK_METHOD3(Reshape, | 1776 MOCK_METHOD3(Reshape, |
| 1774 void(const gfx::Size& size, float scale_factor, bool has_alpha)); | 1777 void(const gfx::Size& size, float scale_factor, bool has_alpha)); |
| 1775 MOCK_METHOD0(BindFramebuffer, void()); | 1778 MOCK_METHOD0(BindFramebuffer, void()); |
| 1776 MOCK_METHOD1(SwapBuffers, void(CompositorFrame* frame)); | 1779 MOCK_METHOD1(SwapBuffers, void(CompositorFrame* frame)); |
| (...skipping 371 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 2148 EXPECT_CALL(overlay_scheduler, | 2151 EXPECT_CALL(overlay_scheduler, |
| 2149 Schedule(1, gfx::OVERLAY_TRANSFORM_NONE, _, viewport_rect, | 2152 Schedule(1, gfx::OVERLAY_TRANSFORM_NONE, _, viewport_rect, |
| 2150 BoundingRect(uv_top_left, uv_bottom_right))).Times(1); | 2153 BoundingRect(uv_top_left, uv_bottom_right))).Times(1); |
| 2151 | 2154 |
| 2152 renderer.DrawFrame(&render_passes_in_draw_order_, 1.f, viewport_rect, | 2155 renderer.DrawFrame(&render_passes_in_draw_order_, 1.f, viewport_rect, |
| 2153 viewport_rect, false); | 2156 viewport_rect, false); |
| 2154 } | 2157 } |
| 2155 | 2158 |
| 2156 } // namespace | 2159 } // namespace |
| 2157 } // namespace cc | 2160 } // namespace cc |
| OLD | NEW |