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 <set> | 7 #include <set> |
8 | 8 |
9 #include "cc/base/math_util.h" | 9 #include "cc/base/math_util.h" |
10 #include "cc/output/compositor_frame_metadata.h" | 10 #include "cc/output/compositor_frame_metadata.h" |
(...skipping 1733 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
1744 ResourceProvider::Create(&output_surface_, NULL, 0, false, 1).Pass(); | 1744 ResourceProvider::Create(&output_surface_, NULL, 0, false, 1).Pass(); |
1745 | 1745 |
1746 renderer_.reset(new FakeRendererGL(&renderer_client_, | 1746 renderer_.reset(new FakeRendererGL(&renderer_client_, |
1747 &settings_, | 1747 &settings_, |
1748 &output_surface_, | 1748 &output_surface_, |
1749 resource_provider_.get())); | 1749 resource_provider_.get())); |
1750 } | 1750 } |
1751 | 1751 |
1752 void SwapBuffers() { renderer_->SwapBuffers(CompositorFrameMetadata()); } | 1752 void SwapBuffers() { renderer_->SwapBuffers(CompositorFrameMetadata()); } |
1753 | 1753 |
1754 void DrawFrame(float device_scale_factor, gfx::Rect device_viewport_rect) { | 1754 void DrawFrame(float device_scale_factor, |
| 1755 const gfx::Rect& device_viewport_rect) { |
1755 RenderPass::Id render_pass_id(1, 0); | 1756 RenderPass::Id render_pass_id(1, 0); |
1756 TestRenderPass* render_pass = AddRenderPass(&render_passes_in_draw_order_, | 1757 TestRenderPass* render_pass = AddRenderPass(&render_passes_in_draw_order_, |
1757 render_pass_id, | 1758 render_pass_id, |
1758 device_viewport_rect, | 1759 device_viewport_rect, |
1759 gfx::Transform()); | 1760 gfx::Transform()); |
1760 AddQuad(render_pass, device_viewport_rect, SK_ColorGREEN); | 1761 AddQuad(render_pass, device_viewport_rect, SK_ColorGREEN); |
1761 | 1762 |
1762 EXPECT_CALL(output_surface_, EnsureBackbuffer()).WillRepeatedly(Return()); | 1763 EXPECT_CALL(output_surface_, EnsureBackbuffer()).WillRepeatedly(Return()); |
1763 | 1764 |
1764 EXPECT_CALL(output_surface_, | 1765 EXPECT_CALL(output_surface_, |
(...skipping 130 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
1895 base::MessageLoop::current()->Run(); | 1896 base::MessageLoop::current()->Run(); |
1896 | 1897 |
1897 // The sync point should have happened. | 1898 // The sync point should have happened. |
1898 EXPECT_EQ(1, sync_point_callback_count); | 1899 EXPECT_EQ(1, sync_point_callback_count); |
1899 EXPECT_EQ(1, other_callback_count); | 1900 EXPECT_EQ(1, other_callback_count); |
1900 } | 1901 } |
1901 #endif // OS_ANDROID | 1902 #endif // OS_ANDROID |
1902 | 1903 |
1903 } // namespace | 1904 } // namespace |
1904 } // namespace cc | 1905 } // namespace cc |
OLD | NEW |