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/layers/append_quads_data.h" | 5 #include "cc/layers/append_quads_data.h" |
6 #include "cc/layers/ui_resource_layer_impl.h" | 6 #include "cc/layers/ui_resource_layer_impl.h" |
7 #include "cc/resources/ui_resource_bitmap.h" | 7 #include "cc/resources/ui_resource_bitmap.h" |
8 #include "cc/resources/ui_resource_client.h" | 8 #include "cc/resources/ui_resource_client.h" |
9 #include "cc/test/fake_impl_proxy.h" | 9 #include "cc/test/fake_impl_proxy.h" |
10 #include "cc/test/fake_layer_tree_host_impl.h" | 10 #include "cc/test/fake_layer_tree_host_impl.h" |
(...skipping 141 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
152 | 152 |
153 SkBitmap sk_bitmap; | 153 SkBitmap sk_bitmap; |
154 sk_bitmap.allocN32Pixels(10, 10); | 154 sk_bitmap.allocN32Pixels(10, 10); |
155 sk_bitmap.setImmutable(); | 155 sk_bitmap.setImmutable(); |
156 UIResourceId uid = 5; | 156 UIResourceId uid = 5; |
157 UIResourceBitmap bitmap(sk_bitmap); | 157 UIResourceBitmap bitmap(sk_bitmap); |
158 impl.host_impl()->CreateUIResource(uid, bitmap); | 158 impl.host_impl()->CreateUIResource(uid, bitmap); |
159 | 159 |
160 UIResourceLayerImpl* ui_resource_layer_impl = | 160 UIResourceLayerImpl* ui_resource_layer_impl = |
161 impl.AddChildToRoot<UIResourceLayerImpl>(); | 161 impl.AddChildToRoot<UIResourceLayerImpl>(); |
162 ui_resource_layer_impl->SetAnchorPoint(gfx::PointF()); | |
163 ui_resource_layer_impl->SetBounds(layer_size); | 162 ui_resource_layer_impl->SetBounds(layer_size); |
164 ui_resource_layer_impl->SetContentBounds(layer_size); | 163 ui_resource_layer_impl->SetContentBounds(layer_size); |
165 ui_resource_layer_impl->SetDrawsContent(true); | 164 ui_resource_layer_impl->SetDrawsContent(true); |
166 ui_resource_layer_impl->SetUIResourceId(uid); | 165 ui_resource_layer_impl->SetUIResourceId(uid); |
167 | 166 |
168 impl.CalcDrawProps(viewport_size); | 167 impl.CalcDrawProps(viewport_size); |
169 | 168 |
170 { | 169 { |
171 SCOPED_TRACE("No occlusion"); | 170 SCOPED_TRACE("No occlusion"); |
172 gfx::Rect occluded; | 171 gfx::Rect occluded; |
(...skipping 25 matching lines...) Expand all Loading... |
198 occluded, | 197 occluded, |
199 &partially_occluded_count); | 198 &partially_occluded_count); |
200 // The layer outputs one quad, which is partially occluded. | 199 // The layer outputs one quad, which is partially occluded. |
201 EXPECT_EQ(1u, impl.quad_list().size()); | 200 EXPECT_EQ(1u, impl.quad_list().size()); |
202 EXPECT_EQ(1u, partially_occluded_count); | 201 EXPECT_EQ(1u, partially_occluded_count); |
203 } | 202 } |
204 } | 203 } |
205 | 204 |
206 } // namespace | 205 } // namespace |
207 } // namespace cc | 206 } // namespace cc |
OLD | NEW |