| 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 48 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 59 memcpy(&other, arg, sizeof(other)); | 59 memcpy(&other, arg, sizeof(other)); |
| 60 return other == sync_token; | 60 return other == sync_token; |
| 61 } | 61 } |
| 62 | 62 |
| 63 class GLRendererTest : public testing::Test { | 63 class GLRendererTest : public testing::Test { |
| 64 protected: | 64 protected: |
| 65 RenderPass* root_render_pass() { | 65 RenderPass* root_render_pass() { |
| 66 return render_passes_in_draw_order_.back().get(); | 66 return render_passes_in_draw_order_.back().get(); |
| 67 } | 67 } |
| 68 void DrawFrame(GLRenderer* renderer, const gfx::Size& viewport_size) { | 68 void DrawFrame(GLRenderer* renderer, const gfx::Size& viewport_size) { |
| 69 renderer->DrawFrame(&render_passes_in_draw_order_, 1.f, gfx::ColorSpace(), | 69 renderer->DrawFrame(&render_passes_in_draw_order_, 1.f, viewport_size); |
| 70 viewport_size); | |
| 71 } | 70 } |
| 72 | 71 |
| 73 RenderPassList render_passes_in_draw_order_; | 72 RenderPassList render_passes_in_draw_order_; |
| 74 }; | 73 }; |
| 75 | 74 |
| 76 #define EXPECT_PROGRAM_VALID(program_binding) \ | 75 #define EXPECT_PROGRAM_VALID(program_binding) \ |
| 77 do { \ | 76 do { \ |
| 78 EXPECT_TRUE((program_binding)->program()); \ | 77 EXPECT_TRUE((program_binding)->program()); \ |
| 79 EXPECT_TRUE((program_binding)->initialized()); \ | 78 EXPECT_TRUE((program_binding)->initialized()); \ |
| 80 } while (false) | 79 } while (false) |
| (...skipping 1472 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 1553 Reshape(viewport_size, device_scale_factor, _, transparent, _)) | 1552 Reshape(viewport_size, device_scale_factor, _, transparent, _)) |
| 1554 .Times(1); | 1553 .Times(1); |
| 1555 | 1554 |
| 1556 EXPECT_CALL(*output_surface_, BindFramebuffer()).Times(1); | 1555 EXPECT_CALL(*output_surface_, BindFramebuffer()).Times(1); |
| 1557 | 1556 |
| 1558 EXPECT_CALL(*context_, drawElements(_, _, _, _)).Times(1); | 1557 EXPECT_CALL(*context_, drawElements(_, _, _, _)).Times(1); |
| 1559 | 1558 |
| 1560 renderer_->DecideRenderPassAllocationsForFrame( | 1559 renderer_->DecideRenderPassAllocationsForFrame( |
| 1561 render_passes_in_draw_order_); | 1560 render_passes_in_draw_order_); |
| 1562 renderer_->DrawFrame(&render_passes_in_draw_order_, device_scale_factor, | 1561 renderer_->DrawFrame(&render_passes_in_draw_order_, device_scale_factor, |
| 1563 gfx::ColorSpace(), viewport_size); | 1562 viewport_size); |
| 1564 } | 1563 } |
| 1565 | 1564 |
| 1566 RendererSettings settings_; | 1565 RendererSettings settings_; |
| 1567 FakeOutputSurfaceClient output_surface_client_; | 1566 FakeOutputSurfaceClient output_surface_client_; |
| 1568 OutputSurfaceMockContext* context_ = nullptr; | 1567 OutputSurfaceMockContext* context_ = nullptr; |
| 1569 std::unique_ptr<StrictMock<MockOutputSurface>> output_surface_; | 1568 std::unique_ptr<StrictMock<MockOutputSurface>> output_surface_; |
| 1570 std::unique_ptr<SharedBitmapManager> shared_bitmap_manager_; | 1569 std::unique_ptr<SharedBitmapManager> shared_bitmap_manager_; |
| 1571 std::unique_ptr<ResourceProvider> resource_provider_; | 1570 std::unique_ptr<ResourceProvider> resource_provider_; |
| 1572 std::unique_ptr<FakeRendererGL> renderer_; | 1571 std::unique_ptr<FakeRendererGL> renderer_; |
| 1573 }; | 1572 }; |
| (...skipping 413 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 1987 renderer_->SetVisible(true); | 1986 renderer_->SetVisible(true); |
| 1988 Mock::VerifyAndClearExpectations(context_support_ptr_); | 1987 Mock::VerifyAndClearExpectations(context_support_ptr_); |
| 1989 | 1988 |
| 1990 EXPECT_CALL(*context_support_ptr_, SetAggressivelyFreeResources(true)); | 1989 EXPECT_CALL(*context_support_ptr_, SetAggressivelyFreeResources(true)); |
| 1991 renderer_->SetVisible(false); | 1990 renderer_->SetVisible(false); |
| 1992 Mock::VerifyAndClearExpectations(context_support_ptr_); | 1991 Mock::VerifyAndClearExpectations(context_support_ptr_); |
| 1993 } | 1992 } |
| 1994 | 1993 |
| 1995 } // namespace | 1994 } // namespace |
| 1996 } // namespace cc | 1995 } // namespace cc |
| OLD | NEW |