| OLD | NEW |
| 1 // Copyright 2014 The Chromium Authors. All rights reserved. | 1 // Copyright 2014 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/compositor_frame.h" | 5 #include "cc/output/compositor_frame.h" |
| 6 #include "cc/quads/render_pass.h" | 6 #include "cc/quads/render_pass.h" |
| 7 #include "cc/quads/solid_color_draw_quad.h" | 7 #include "cc/quads/solid_color_draw_quad.h" |
| 8 #include "cc/quads/surface_draw_quad.h" | 8 #include "cc/quads/surface_draw_quad.h" |
| 9 #include "cc/surfaces/local_surface_id_allocator.h" |
| 9 #include "cc/surfaces/surface.h" | 10 #include "cc/surfaces/surface.h" |
| 10 #include "cc/surfaces/surface_aggregator.h" | 11 #include "cc/surfaces/surface_aggregator.h" |
| 11 #include "cc/surfaces/surface_factory.h" | 12 #include "cc/surfaces/surface_factory.h" |
| 12 #include "cc/surfaces/surface_factory_client.h" | 13 #include "cc/surfaces/surface_factory_client.h" |
| 13 #include "cc/surfaces/surface_id_allocator.h" | |
| 14 #include "cc/surfaces/surface_manager.h" | 14 #include "cc/surfaces/surface_manager.h" |
| 15 #include "cc/test/pixel_comparator.h" | 15 #include "cc/test/pixel_comparator.h" |
| 16 #include "cc/test/pixel_test.h" | 16 #include "cc/test/pixel_test.h" |
| 17 #include "testing/gtest/include/gtest/gtest.h" | 17 #include "testing/gtest/include/gtest/gtest.h" |
| 18 | 18 |
| 19 #if !defined(OS_ANDROID) | 19 #if !defined(OS_ANDROID) |
| 20 | 20 |
| 21 namespace cc { | 21 namespace cc { |
| 22 namespace { | 22 namespace { |
| 23 | 23 |
| 24 static constexpr FrameSinkId kArbitraryRootFrameSinkId(1, 1); | 24 static constexpr FrameSinkId kArbitraryRootFrameSinkId(1, 1); |
| 25 static constexpr FrameSinkId kArbitraryChildFrameSinkId(2, 2); | 25 static constexpr FrameSinkId kArbitraryChildFrameSinkId(2, 2); |
| 26 static constexpr FrameSinkId kArbitraryLeftFrameSinkId(3, 3); | 26 static constexpr FrameSinkId kArbitraryLeftFrameSinkId(3, 3); |
| 27 static constexpr FrameSinkId kArbitraryRightFrameSinkId(4, 4); | 27 static constexpr FrameSinkId kArbitraryRightFrameSinkId(4, 4); |
| 28 | 28 |
| 29 class EmptySurfaceFactoryClient : public SurfaceFactoryClient { | 29 class EmptySurfaceFactoryClient : public SurfaceFactoryClient { |
| 30 public: | 30 public: |
| 31 void ReturnResources(const ReturnedResourceArray& resources) override {} | 31 void ReturnResources(const ReturnedResourceArray& resources) override {} |
| 32 void SetBeginFrameSource(BeginFrameSource* begin_frame_source) override {} | 32 void SetBeginFrameSource(BeginFrameSource* begin_frame_source) override {} |
| 33 }; | 33 }; |
| 34 | 34 |
| 35 class SurfacesPixelTest : public RendererPixelTest<GLRenderer> { | 35 class SurfacesPixelTest : public RendererPixelTest<GLRenderer> { |
| 36 public: | 36 public: |
| 37 SurfacesPixelTest() | 37 SurfacesPixelTest() |
| 38 : factory_(kArbitraryRootFrameSinkId, &manager_, &client_) {} | 38 : factory_(kArbitraryRootFrameSinkId, &manager_, &client_) {} |
| 39 ~SurfacesPixelTest() override { factory_.EvictSurface(); } | 39 ~SurfacesPixelTest() override { factory_.EvictSurface(); } |
| 40 | 40 |
| 41 protected: | 41 protected: |
| 42 SurfaceManager manager_; | 42 SurfaceManager manager_; |
| 43 SurfaceIdAllocator allocator_; | 43 LocalSurfaceIdAllocator allocator_; |
| 44 EmptySurfaceFactoryClient client_; | 44 EmptySurfaceFactoryClient client_; |
| 45 SurfaceFactory factory_; | 45 SurfaceFactory factory_; |
| 46 }; | 46 }; |
| 47 | 47 |
| 48 SharedQuadState* CreateAndAppendTestSharedQuadState( | 48 SharedQuadState* CreateAndAppendTestSharedQuadState( |
| 49 RenderPass* render_pass, | 49 RenderPass* render_pass, |
| 50 const gfx::Transform& transform, | 50 const gfx::Transform& transform, |
| 51 const gfx::Size& size) { | 51 const gfx::Size& size) { |
| 52 const gfx::Size layer_bounds = size; | 52 const gfx::Size layer_bounds = size; |
| 53 const gfx::Rect visible_layer_rect = gfx::Rect(size); | 53 const gfx::Rect visible_layer_rect = gfx::Rect(size); |
| (...skipping 262 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 316 pixel_comparator)); | 316 pixel_comparator)); |
| 317 | 317 |
| 318 left_factory.EvictSurface(); | 318 left_factory.EvictSurface(); |
| 319 right_factory.EvictSurface(); | 319 right_factory.EvictSurface(); |
| 320 } | 320 } |
| 321 | 321 |
| 322 } // namespace | 322 } // namespace |
| 323 } // namespace cc | 323 } // namespace cc |
| 324 | 324 |
| 325 #endif // !defined(OS_ANDROID) | 325 #endif // !defined(OS_ANDROID) |
| OLD | NEW |