Chromium Code Reviews
chromiumcodereview-hr@appspot.gserviceaccount.com (chromiumcodereview-hr) | Please choose your nickname with Settings | Help | Chromium Project | Gerrit Changes | Sign out
(345)

Side by Side Diff: cc/surfaces/surfaces_pixeltest.cc

Issue 2708153005: Rename SurfaceIdAllocator to LocalSurfaceIdAllocator (Closed)
Patch Set: Delete useless include Created 3 years, 10 months ago
Use n/p to move between diff chunks; N/P to move between comments. Draft comments are only viewable by you.
Jump to:
View unified diff | Download patch
« no previous file with comments | « cc/surfaces/surface_unittest.cc ('k') | cc/test/test_compositor_frame_sink.h » ('j') | no next file with comments »
Toggle Intra-line Diffs ('i') | Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
OLDNEW
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
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)
OLDNEW
« no previous file with comments | « cc/surfaces/surface_unittest.cc ('k') | cc/test/test_compositor_frame_sink.h » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698