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 "cc/trees/layer_tree_host.h" | 5 #include "cc/trees/layer_tree_host.h" |
6 | 6 |
7 #include <algorithm> | 7 #include <algorithm> |
8 | 8 |
9 #include "base/bind.h" | 9 #include "base/bind.h" |
10 #include "base/location.h" | 10 #include "base/location.h" |
(...skipping 62 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
73 | 73 |
74 // These tests deal with delegated renderer layers. | 74 // These tests deal with delegated renderer layers. |
75 class LayerTreeHostDelegatedTest : public LayerTreeTest { | 75 class LayerTreeHostDelegatedTest : public LayerTreeTest { |
76 protected: | 76 protected: |
77 scoped_ptr<DelegatedFrameData> CreateFrameData( | 77 scoped_ptr<DelegatedFrameData> CreateFrameData( |
78 const gfx::Rect& root_output_rect, | 78 const gfx::Rect& root_output_rect, |
79 const gfx::Rect& root_damage_rect) { | 79 const gfx::Rect& root_damage_rect) { |
80 scoped_ptr<DelegatedFrameData> frame(new DelegatedFrameData); | 80 scoped_ptr<DelegatedFrameData> frame(new DelegatedFrameData); |
81 | 81 |
82 scoped_ptr<RenderPass> root_pass(RenderPass::Create()); | 82 scoped_ptr<RenderPass> root_pass(RenderPass::Create()); |
83 root_pass->SetNew(RenderPass::Id(1, 1), | 83 root_pass->SetNew(RenderPassId(1, 1), |
84 root_output_rect, | 84 root_output_rect, |
85 root_damage_rect, | 85 root_damage_rect, |
86 gfx::Transform()); | 86 gfx::Transform()); |
87 frame->render_pass_list.push_back(root_pass.Pass()); | 87 frame->render_pass_list.push_back(root_pass.Pass()); |
88 return frame.Pass(); | 88 return frame.Pass(); |
89 } | 89 } |
90 | 90 |
91 scoped_ptr<DelegatedFrameData> CreateInvalidFrameData( | 91 scoped_ptr<DelegatedFrameData> CreateInvalidFrameData( |
92 const gfx::Rect& root_output_rect, | 92 const gfx::Rect& root_output_rect, |
93 const gfx::Rect& root_damage_rect) { | 93 const gfx::Rect& root_damage_rect) { |
94 scoped_ptr<DelegatedFrameData> frame(new DelegatedFrameData); | 94 scoped_ptr<DelegatedFrameData> frame(new DelegatedFrameData); |
95 | 95 |
96 scoped_ptr<RenderPass> root_pass(RenderPass::Create()); | 96 scoped_ptr<RenderPass> root_pass(RenderPass::Create()); |
97 root_pass->SetNew(RenderPass::Id(1, 1), | 97 root_pass->SetNew(RenderPassId(1, 1), |
98 root_output_rect, | 98 root_output_rect, |
99 root_damage_rect, | 99 root_damage_rect, |
100 gfx::Transform()); | 100 gfx::Transform()); |
101 | 101 |
102 SharedQuadState* shared_quad_state = | 102 SharedQuadState* shared_quad_state = |
103 root_pass->CreateAndAppendSharedQuadState(); | 103 root_pass->CreateAndAppendSharedQuadState(); |
104 | 104 |
105 gfx::Rect rect = root_output_rect; | 105 gfx::Rect rect = root_output_rect; |
106 gfx::Rect opaque_rect = root_output_rect; | 106 gfx::Rect opaque_rect = root_output_rect; |
107 gfx::Rect visible_rect = root_output_rect; | 107 gfx::Rect visible_rect = root_output_rect; |
(...skipping 51 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
159 resource_id, | 159 resource_id, |
160 false, | 160 false, |
161 gfx::PointF(0.f, 0.f), | 161 gfx::PointF(0.f, 0.f), |
162 gfx::PointF(1.f, 1.f), | 162 gfx::PointF(1.f, 1.f), |
163 SK_ColorTRANSPARENT, | 163 SK_ColorTRANSPARENT, |
164 vertex_opacity, | 164 vertex_opacity, |
165 false); | 165 false); |
166 } | 166 } |
167 | 167 |
168 void AddRenderPass(DelegatedFrameData* frame, | 168 void AddRenderPass(DelegatedFrameData* frame, |
169 RenderPass::Id id, | 169 RenderPassId id, |
170 const gfx::Rect& output_rect, | 170 const gfx::Rect& output_rect, |
171 const gfx::Rect& damage_rect, | 171 const gfx::Rect& damage_rect, |
172 const FilterOperations& filters, | 172 const FilterOperations& filters, |
173 const FilterOperations& background_filters) { | 173 const FilterOperations& background_filters) { |
174 for (size_t i = 0; i < frame->render_pass_list.size(); ++i) | 174 for (size_t i = 0; i < frame->render_pass_list.size(); ++i) |
175 DCHECK(id != frame->render_pass_list[i]->id); | 175 DCHECK(id != frame->render_pass_list[i]->id); |
176 | 176 |
177 scoped_ptr<RenderPass> pass(RenderPass::Create()); | 177 scoped_ptr<RenderPass> pass(RenderPass::Create()); |
178 pass->SetNew(id, | 178 pass->SetNew(id, |
179 output_rect, | 179 output_rect, |
(...skipping 2012 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
2192 } | 2192 } |
2193 | 2193 |
2194 scoped_refptr<DelegatedRendererLayer> delegated_thief_; | 2194 scoped_refptr<DelegatedRendererLayer> delegated_thief_; |
2195 }; | 2195 }; |
2196 | 2196 |
2197 SINGLE_AND_MULTI_THREAD_TEST_F( | 2197 SINGLE_AND_MULTI_THREAD_TEST_F( |
2198 LayerTreeHostDelegatedTestRemoveAndChangeResources); | 2198 LayerTreeHostDelegatedTestRemoveAndChangeResources); |
2199 | 2199 |
2200 } // namespace | 2200 } // namespace |
2201 } // namespace cc | 2201 } // namespace cc |
OLD | NEW |