OLD | NEW |
1 // Copyright 2013 The Chromium Authors. All rights reserved. | 1 // Copyright 2013 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 <stddef.h> | 5 #include <stddef.h> |
6 | 6 |
7 #include "cc/layers/append_quads_data.h" | 7 #include "cc/layers/append_quads_data.h" |
8 #include "cc/layers/ui_resource_layer_impl.h" | 8 #include "cc/layers/ui_resource_layer_impl.h" |
9 #include "cc/quads/draw_quad.h" | 9 #include "cc/quads/draw_quad.h" |
10 #include "cc/resources/ui_resource_bitmap.h" | 10 #include "cc/resources/ui_resource_bitmap.h" |
(...skipping 52 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
63 TestSharedBitmapManager shared_bitmap_manager; | 63 TestSharedBitmapManager shared_bitmap_manager; |
64 TestTaskGraphRunner task_graph_runner; | 64 TestTaskGraphRunner task_graph_runner; |
65 scoped_ptr<OutputSurface> output_surface = FakeOutputSurface::Create3d(); | 65 scoped_ptr<OutputSurface> output_surface = FakeOutputSurface::Create3d(); |
66 FakeUIResourceLayerTreeHostImpl host_impl( | 66 FakeUIResourceLayerTreeHostImpl host_impl( |
67 &task_runner_provider, &shared_bitmap_manager, &task_graph_runner); | 67 &task_runner_provider, &shared_bitmap_manager, &task_graph_runner); |
68 host_impl.SetVisible(true); | 68 host_impl.SetVisible(true); |
69 host_impl.InitializeRenderer(output_surface.get()); | 69 host_impl.InitializeRenderer(output_surface.get()); |
70 | 70 |
71 // Make sure we're appending quads when there are valid values. | 71 // Make sure we're appending quads when there are valid values. |
72 gfx::Size bitmap_size(100, 100); | 72 gfx::Size bitmap_size(100, 100); |
73 gfx::Size layer_size(100, 100);; | 73 gfx::Size layer_size(100, 100); |
74 size_t expected_quad_size = 1; | 74 size_t expected_quad_size = 1; |
75 bool opaque = true; | 75 bool opaque = true; |
76 UIResourceId uid = 1; | 76 UIResourceId uid = 1; |
77 scoped_ptr<UIResourceLayerImpl> layer = GenerateUIResourceLayer(&host_impl, | 77 scoped_ptr<UIResourceLayerImpl> layer = GenerateUIResourceLayer(&host_impl, |
78 bitmap_size, | 78 bitmap_size, |
79 layer_size, | 79 layer_size, |
80 opaque, | 80 opaque, |
81 uid); | 81 uid); |
82 QuadSizeTest(std::move(layer), expected_quad_size); | 82 QuadSizeTest(std::move(layer), expected_quad_size); |
83 | 83 |
(...skipping 26 matching lines...) Expand all Loading... |
110 FakeImplTaskRunnerProvider task_runner_provider; | 110 FakeImplTaskRunnerProvider task_runner_provider; |
111 TestSharedBitmapManager shared_bitmap_manager; | 111 TestSharedBitmapManager shared_bitmap_manager; |
112 TestTaskGraphRunner task_graph_runner; | 112 TestTaskGraphRunner task_graph_runner; |
113 scoped_ptr<OutputSurface> output_surface = FakeOutputSurface::Create3d(); | 113 scoped_ptr<OutputSurface> output_surface = FakeOutputSurface::Create3d(); |
114 FakeUIResourceLayerTreeHostImpl host_impl( | 114 FakeUIResourceLayerTreeHostImpl host_impl( |
115 &task_runner_provider, &shared_bitmap_manager, &task_graph_runner); | 115 &task_runner_provider, &shared_bitmap_manager, &task_graph_runner); |
116 host_impl.SetVisible(true); | 116 host_impl.SetVisible(true); |
117 host_impl.InitializeRenderer(output_surface.get()); | 117 host_impl.InitializeRenderer(output_surface.get()); |
118 | 118 |
119 gfx::Size bitmap_size(100, 100); | 119 gfx::Size bitmap_size(100, 100); |
120 gfx::Size layer_size(100, 100);; | 120 gfx::Size layer_size(100, 100); |
121 bool opaque = false; | 121 bool opaque = false; |
122 UIResourceId uid = 1; | 122 UIResourceId uid = 1; |
123 scoped_ptr<UIResourceLayerImpl> layer = GenerateUIResourceLayer(&host_impl, | 123 scoped_ptr<UIResourceLayerImpl> layer = GenerateUIResourceLayer(&host_impl, |
124 bitmap_size, | 124 bitmap_size, |
125 layer_size, | 125 layer_size, |
126 opaque, | 126 opaque, |
127 uid); | 127 uid); |
128 gfx::Rect expected_opaque_bounds; | 128 gfx::Rect expected_opaque_bounds; |
129 OpaqueBoundsTest(std::move(layer), expected_opaque_bounds); | 129 OpaqueBoundsTest(std::move(layer), expected_opaque_bounds); |
130 | 130 |
(...skipping 83 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
214 LayerTestCommon::VerifyQuadsAreOccluded( | 214 LayerTestCommon::VerifyQuadsAreOccluded( |
215 impl.quad_list(), occluded, &partially_occluded_count); | 215 impl.quad_list(), occluded, &partially_occluded_count); |
216 // The layer outputs one quad, which is partially occluded. | 216 // The layer outputs one quad, which is partially occluded. |
217 EXPECT_EQ(1u, impl.quad_list().size()); | 217 EXPECT_EQ(1u, impl.quad_list().size()); |
218 EXPECT_EQ(1u, partially_occluded_count); | 218 EXPECT_EQ(1u, partially_occluded_count); |
219 } | 219 } |
220 } | 220 } |
221 | 221 |
222 } // namespace | 222 } // namespace |
223 } // namespace cc | 223 } // namespace cc |
OLD | NEW |