OLD | NEW |
1 // Copyright 2012 The Chromium Authors. All rights reserved. | 1 // Copyright 2012 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/nine_patch_layer_impl.h" | 8 #include "cc/layers/nine_patch_layer_impl.h" |
9 #include "cc/quads/texture_draw_quad.h" | 9 #include "cc/quads/texture_draw_quad.h" |
10 #include "cc/resources/ui_resource_bitmap.h" | 10 #include "cc/resources/ui_resource_bitmap.h" |
(...skipping 17 matching lines...) Expand all Loading... |
28 return gfx::Rect(gfx::ToRoundedInt(rect_f.x()), | 28 return gfx::Rect(gfx::ToRoundedInt(rect_f.x()), |
29 gfx::ToRoundedInt(rect_f.y()), | 29 gfx::ToRoundedInt(rect_f.y()), |
30 gfx::ToRoundedInt(rect_f.width()), | 30 gfx::ToRoundedInt(rect_f.width()), |
31 gfx::ToRoundedInt(rect_f.height())); | 31 gfx::ToRoundedInt(rect_f.height())); |
32 } | 32 } |
33 | 33 |
34 void NinePatchLayerLayoutTest(const gfx::Size& bitmap_size, | 34 void NinePatchLayerLayoutTest(const gfx::Size& bitmap_size, |
35 const gfx::Rect& aperture_rect, | 35 const gfx::Rect& aperture_rect, |
36 const gfx::Size& layer_size, | 36 const gfx::Size& layer_size, |
37 const gfx::Rect& border, | 37 const gfx::Rect& border, |
| 38 const gfx::Rect& occlusion, |
38 bool fill_center, | 39 bool fill_center, |
39 size_t expected_quad_size) { | 40 size_t expected_quad_size) { |
40 scoped_ptr<RenderPass> render_pass = RenderPass::Create(); | 41 scoped_ptr<RenderPass> render_pass = RenderPass::Create(); |
41 gfx::Rect visible_layer_rect(layer_size); | 42 gfx::Rect visible_layer_rect(layer_size); |
42 gfx::Rect expected_remaining(border.x(), | 43 gfx::Rect expected_layer_remaining; |
43 border.y(), | 44 gfx::Rect expected_tex_remaining; |
44 layer_size.width() - border.width(), | 45 |
45 layer_size.height() - border.height()); | 46 if (!occlusion.IsEmpty()) { |
| 47 expected_layer_remaining = occlusion; |
| 48 expected_tex_remaining.SetRect( |
| 49 occlusion.x(), occlusion.y(), |
| 50 (bitmap_size.width() - occlusion.x()) - |
| 51 (layer_size.width() - occlusion.right()), |
| 52 (bitmap_size.height() - occlusion.y()) - |
| 53 (layer_size.height() - occlusion.bottom())); |
| 54 } else { |
| 55 expected_layer_remaining.SetRect(border.x(), border.y(), |
| 56 layer_size.width() - border.width(), |
| 57 layer_size.height() - border.height()); |
| 58 expected_tex_remaining = aperture_rect; |
| 59 } |
46 | 60 |
47 FakeImplTaskRunnerProvider task_runner_provider; | 61 FakeImplTaskRunnerProvider task_runner_provider; |
48 TestSharedBitmapManager shared_bitmap_manager; | 62 TestSharedBitmapManager shared_bitmap_manager; |
49 TestTaskGraphRunner task_graph_runner; | 63 TestTaskGraphRunner task_graph_runner; |
50 scoped_ptr<OutputSurface> output_surface = FakeOutputSurface::Create3d(); | 64 scoped_ptr<OutputSurface> output_surface = FakeOutputSurface::Create3d(); |
51 FakeUIResourceLayerTreeHostImpl host_impl( | 65 FakeUIResourceLayerTreeHostImpl host_impl( |
52 &task_runner_provider, &shared_bitmap_manager, &task_graph_runner); | 66 &task_runner_provider, &shared_bitmap_manager, &task_graph_runner); |
53 host_impl.SetVisible(true); | 67 host_impl.SetVisible(true); |
54 host_impl.InitializeRenderer(output_surface.get()); | 68 host_impl.InitializeRenderer(output_surface.get()); |
55 | 69 |
56 scoped_ptr<NinePatchLayerImpl> layer = | 70 scoped_ptr<NinePatchLayerImpl> layer = |
57 NinePatchLayerImpl::Create(host_impl.active_tree(), 1); | 71 NinePatchLayerImpl::Create(host_impl.active_tree(), 1); |
58 layer->draw_properties().visible_layer_rect = visible_layer_rect; | 72 layer->draw_properties().visible_layer_rect = visible_layer_rect; |
59 layer->SetBounds(layer_size); | 73 layer->SetBounds(layer_size); |
60 layer->SetForceRenderSurface(true); | 74 layer->SetForceRenderSurface(true); |
61 layer->draw_properties().render_target = layer.get(); | 75 layer->draw_properties().render_target = layer.get(); |
62 | 76 |
63 UIResourceId uid = 1; | 77 UIResourceId uid = 1; |
64 bool is_opaque = false; | 78 bool is_opaque = false; |
65 UIResourceBitmap bitmap(bitmap_size, is_opaque); | 79 UIResourceBitmap bitmap(bitmap_size, is_opaque); |
66 | 80 |
67 host_impl.CreateUIResource(uid, bitmap); | 81 host_impl.CreateUIResource(uid, bitmap); |
68 layer->SetUIResourceId(uid); | 82 layer->SetUIResourceId(uid); |
69 layer->SetImageBounds(bitmap_size); | 83 layer->SetImageBounds(bitmap_size); |
70 layer->SetLayout(aperture_rect, border, fill_center, false); | 84 layer->SetLayout(aperture_rect, border, fill_center, false, occlusion); |
71 AppendQuadsData data; | 85 AppendQuadsData data; |
72 layer->AppendQuads(render_pass.get(), &data); | 86 layer->AppendQuads(render_pass.get(), &data); |
73 | 87 |
74 // Verify quad rects | 88 // Verify quad rects |
75 const QuadList& quads = render_pass->quad_list; | 89 const QuadList& quads = render_pass->quad_list; |
76 EXPECT_EQ(expected_quad_size, quads.size()); | 90 EXPECT_EQ(expected_quad_size, quads.size()); |
77 | 91 |
78 Region remaining(visible_layer_rect); | 92 Region layer_remaining(visible_layer_rect); |
79 for (auto iter = quads.cbegin(); iter != quads.cend(); ++iter) { | 93 for (auto iter = quads.cbegin(); iter != quads.cend(); ++iter) { |
80 gfx::Rect quad_rect = iter->rect; | 94 gfx::Rect quad_rect = iter->rect; |
81 | 95 |
82 EXPECT_TRUE(visible_layer_rect.Contains(quad_rect)) << iter.index(); | 96 EXPECT_TRUE(visible_layer_rect.Contains(quad_rect)) << iter.index(); |
83 EXPECT_TRUE(remaining.Contains(quad_rect)) << iter.index(); | 97 EXPECT_TRUE(layer_remaining.Contains(quad_rect)) << iter.index(); |
84 remaining.Subtract(Region(quad_rect)); | 98 layer_remaining.Subtract(Region(quad_rect)); |
85 } | 99 } |
86 | 100 |
87 // Check if the left-over quad is the same size as the mapped aperture quad in | 101 // Check if the left-over quad is the same size as the mapped aperture quad in |
88 // layer space. | 102 // layer space. |
89 if (!fill_center) { | 103 if (!fill_center) { |
90 EXPECT_EQ(expected_remaining, remaining.bounds()); | 104 EXPECT_EQ(expected_layer_remaining, layer_remaining.bounds()); |
91 } else { | 105 } else { |
92 EXPECT_TRUE(remaining.bounds().IsEmpty()); | 106 EXPECT_TRUE(layer_remaining.bounds().IsEmpty()); |
93 } | 107 } |
94 | 108 |
95 // Verify UV rects | 109 // Verify UV rects |
96 gfx::Rect bitmap_rect(bitmap_size); | 110 gfx::Rect bitmap_rect(bitmap_size); |
97 Region tex_remaining(bitmap_rect); | 111 Region tex_remaining(bitmap_rect); |
98 for (const auto& quad : quads) { | 112 for (const auto& quad : quads) { |
99 const TextureDrawQuad* tex_quad = TextureDrawQuad::MaterialCast(quad); | 113 const TextureDrawQuad* tex_quad = TextureDrawQuad::MaterialCast(quad); |
100 gfx::RectF tex_rect = | 114 gfx::RectF tex_rect = |
101 gfx::BoundingRect(tex_quad->uv_top_left, tex_quad->uv_bottom_right); | 115 gfx::BoundingRect(tex_quad->uv_top_left, tex_quad->uv_bottom_right); |
102 tex_rect.Scale(bitmap_size.width(), bitmap_size.height()); | 116 tex_rect.Scale(bitmap_size.width(), bitmap_size.height()); |
103 tex_remaining.Subtract(Region(ToRoundedIntRect(tex_rect))); | 117 tex_remaining.Subtract(Region(ToRoundedIntRect(tex_rect))); |
104 } | 118 } |
105 | 119 |
106 if (!fill_center) { | 120 if (!fill_center) { |
107 EXPECT_EQ(aperture_rect, tex_remaining.bounds()); | 121 EXPECT_EQ(expected_tex_remaining, tex_remaining.bounds()); |
108 Region aperture_region(aperture_rect); | 122 Region aperture_region(expected_tex_remaining); |
109 EXPECT_EQ(aperture_region, tex_remaining); | 123 EXPECT_EQ(aperture_region, tex_remaining); |
110 } else { | 124 } else { |
111 EXPECT_TRUE(remaining.bounds().IsEmpty()); | 125 EXPECT_TRUE(layer_remaining.bounds().IsEmpty()); |
112 } | 126 } |
113 } | 127 } |
114 | 128 |
115 TEST(NinePatchLayerImplTest, VerifyDrawQuads) { | 129 TEST(NinePatchLayerImplTest, VerifyDrawQuads) { |
116 // Input is a 100x100 bitmap with a 40x50 aperture at x=20, y=30. | 130 // Input is a 100x100 bitmap with a 40x50 aperture at x=20, y=30. |
117 // The bounds of the layer are set to 400x400. | 131 // The bounds of the layer are set to 400x400. |
118 gfx::Size bitmap_size(100, 100); | 132 gfx::Size bitmap_size(100, 100); |
119 gfx::Size layer_size(400, 500); | 133 gfx::Size layer_size(400, 500); |
120 gfx::Rect aperture_rect(20, 30, 40, 50); | 134 gfx::Rect aperture_rect(20, 30, 40, 50); |
121 gfx::Rect border(40, 40, 80, 80); | 135 gfx::Rect border(40, 40, 80, 80); |
122 bool fill_center = false; | 136 bool fill_center = false; |
123 size_t expected_quad_size = 8; | 137 size_t expected_quad_size = 8; |
124 NinePatchLayerLayoutTest(bitmap_size, | 138 NinePatchLayerLayoutTest(bitmap_size, aperture_rect, layer_size, border, |
125 aperture_rect, | 139 gfx::Rect(), fill_center, expected_quad_size); |
126 layer_size, | |
127 border, | |
128 fill_center, | |
129 expected_quad_size); | |
130 | 140 |
131 // The bounds of the layer are set to less than the bitmap size. | 141 // The bounds of the layer are set to less than the bitmap size. |
132 bitmap_size = gfx::Size(100, 100); | 142 bitmap_size = gfx::Size(100, 100); |
133 layer_size = gfx::Size(40, 50); | 143 layer_size = gfx::Size(40, 50); |
134 aperture_rect = gfx::Rect(20, 30, 40, 50); | 144 aperture_rect = gfx::Rect(20, 30, 40, 50); |
135 border = gfx::Rect(10, 10, 25, 15); | 145 border = gfx::Rect(10, 10, 25, 15); |
136 fill_center = true; | 146 fill_center = true; |
137 expected_quad_size = 9; | 147 expected_quad_size = 9; |
138 NinePatchLayerLayoutTest(bitmap_size, | 148 NinePatchLayerLayoutTest(bitmap_size, aperture_rect, layer_size, border, |
139 aperture_rect, | 149 gfx::Rect(), fill_center, expected_quad_size); |
140 layer_size, | |
141 border, | |
142 fill_center, | |
143 expected_quad_size); | |
144 | 150 |
145 // Layer and image sizes are equal. | 151 // Layer and image sizes are equal. |
146 bitmap_size = gfx::Size(100, 100); | 152 bitmap_size = gfx::Size(100, 100); |
147 layer_size = gfx::Size(100, 100); | 153 layer_size = gfx::Size(100, 100); |
148 aperture_rect = gfx::Rect(20, 30, 40, 50); | 154 aperture_rect = gfx::Rect(20, 30, 40, 50); |
149 border = gfx::Rect(20, 30, 40, 50); | 155 border = gfx::Rect(20, 30, 40, 50); |
150 fill_center = true; | 156 fill_center = true; |
151 expected_quad_size = 9; | 157 expected_quad_size = 9; |
152 NinePatchLayerLayoutTest(bitmap_size, | 158 NinePatchLayerLayoutTest(bitmap_size, aperture_rect, layer_size, border, |
153 aperture_rect, | 159 gfx::Rect(), fill_center, expected_quad_size); |
154 layer_size, | 160 } |
155 border, | 161 |
156 fill_center, | 162 TEST(NinePatchLayerImplTest, VerifyDrawQuadsWithOcclusion) { |
157 expected_quad_size); | 163 // Input is a 100x100 bitmap with a 40x50 aperture at x=20, y=30. |
| 164 // The bounds of the layer are set to 400x400. |
| 165 gfx::Size bitmap_size(100, 100); |
| 166 gfx::Rect aperture_rect(30, 30, 40, 40); |
| 167 gfx::Size layer_size(400, 400); |
| 168 gfx::Rect occlusion(20, 20, 360, 360); |
| 169 bool fill_center = false; |
| 170 size_t expected_quad_size = 12; |
| 171 NinePatchLayerLayoutTest(bitmap_size, aperture_rect, layer_size, gfx::Rect(), |
| 172 occlusion, fill_center, expected_quad_size); |
158 } | 173 } |
159 | 174 |
160 TEST(NinePatchLayerImplTest, VerifyDrawQuadsWithEmptyPatches) { | 175 TEST(NinePatchLayerImplTest, VerifyDrawQuadsWithEmptyPatches) { |
161 // The top component of the 9-patch is empty, so there should be no quads for | 176 // The top component of the 9-patch is empty, so there should be no quads for |
162 // the top three components. | 177 // the top three components. |
163 gfx::Size bitmap_size(100, 100); | 178 gfx::Size bitmap_size(100, 100); |
164 gfx::Size layer_size(100, 100); | 179 gfx::Size layer_size(100, 100); |
165 gfx::Rect aperture_rect(10, 0, 80, 90); | 180 gfx::Rect aperture_rect(10, 0, 80, 90); |
166 gfx::Rect border(10, 0, 20, 10); | 181 gfx::Rect border(10, 0, 20, 10); |
167 bool fill_center = false; | 182 bool fill_center = false; |
168 size_t expected_quad_size = 5; | 183 size_t expected_quad_size = 5; |
169 NinePatchLayerLayoutTest(bitmap_size, | 184 NinePatchLayerLayoutTest(bitmap_size, aperture_rect, layer_size, border, |
170 aperture_rect, | 185 gfx::Rect(), fill_center, expected_quad_size); |
171 layer_size, | |
172 border, | |
173 fill_center, | |
174 expected_quad_size); | |
175 | 186 |
176 // The top and left components of the 9-patch are empty, so there should be no | 187 // The top and left components of the 9-patch are empty, so there should be no |
177 // quads for the left and top components. | 188 // quads for the left and top components. |
178 bitmap_size = gfx::Size(100, 100); | 189 bitmap_size = gfx::Size(100, 100); |
179 layer_size = gfx::Size(100, 100); | 190 layer_size = gfx::Size(100, 100); |
180 aperture_rect = gfx::Rect(0, 0, 90, 90); | 191 aperture_rect = gfx::Rect(0, 0, 90, 90); |
181 border = gfx::Rect(0, 0, 10, 10); | 192 border = gfx::Rect(0, 0, 10, 10); |
182 fill_center = false; | 193 fill_center = false; |
183 expected_quad_size = 3; | 194 expected_quad_size = 3; |
184 NinePatchLayerLayoutTest(bitmap_size, | 195 NinePatchLayerLayoutTest(bitmap_size, aperture_rect, layer_size, border, |
185 aperture_rect, | 196 gfx::Rect(), fill_center, expected_quad_size); |
186 layer_size, | |
187 border, | |
188 fill_center, | |
189 expected_quad_size); | |
190 | 197 |
191 // The aperture is the size of the bitmap and the center doesn't draw. | 198 // The aperture is the size of the bitmap and the center doesn't draw. |
192 bitmap_size = gfx::Size(100, 100); | 199 bitmap_size = gfx::Size(100, 100); |
193 layer_size = gfx::Size(100, 100); | 200 layer_size = gfx::Size(100, 100); |
194 aperture_rect = gfx::Rect(0, 0, 100, 100); | 201 aperture_rect = gfx::Rect(0, 0, 100, 100); |
195 border = gfx::Rect(0, 0, 0, 0); | 202 border = gfx::Rect(0, 0, 0, 0); |
196 fill_center = false; | 203 fill_center = false; |
197 expected_quad_size = 0; | 204 expected_quad_size = 0; |
198 NinePatchLayerLayoutTest(bitmap_size, | 205 NinePatchLayerLayoutTest(bitmap_size, aperture_rect, layer_size, border, |
199 aperture_rect, | 206 gfx::Rect(), fill_center, expected_quad_size); |
200 layer_size, | |
201 border, | |
202 fill_center, | |
203 expected_quad_size); | |
204 | 207 |
205 // The aperture is the size of the bitmap and the center does draw. | 208 // The aperture is the size of the bitmap and the center does draw. |
206 bitmap_size = gfx::Size(100, 100); | 209 bitmap_size = gfx::Size(100, 100); |
207 layer_size = gfx::Size(100, 100); | 210 layer_size = gfx::Size(100, 100); |
208 aperture_rect = gfx::Rect(0, 0, 100, 100); | 211 aperture_rect = gfx::Rect(0, 0, 100, 100); |
209 border = gfx::Rect(0, 0, 0, 0); | 212 border = gfx::Rect(0, 0, 0, 0); |
210 fill_center = true; | 213 fill_center = true; |
211 expected_quad_size = 1; | 214 expected_quad_size = 1; |
212 NinePatchLayerLayoutTest(bitmap_size, | 215 NinePatchLayerLayoutTest(bitmap_size, aperture_rect, layer_size, border, |
213 aperture_rect, | 216 gfx::Rect(), fill_center, expected_quad_size); |
214 layer_size, | |
215 border, | |
216 fill_center, | |
217 expected_quad_size); | |
218 } | 217 } |
219 | 218 |
220 TEST(NinePatchLayerImplTest, Occlusion) { | 219 TEST(NinePatchLayerImplTest, Occlusion) { |
221 gfx::Size layer_size(1000, 1000); | 220 gfx::Size layer_size(1000, 1000); |
222 gfx::Size viewport_size(1000, 1000); | 221 gfx::Size viewport_size(1000, 1000); |
223 | 222 |
224 LayerTestCommon::LayerImplTest impl; | 223 LayerTestCommon::LayerImplTest impl; |
225 | 224 |
226 SkBitmap sk_bitmap; | 225 SkBitmap sk_bitmap; |
227 sk_bitmap.allocN32Pixels(10, 10); | 226 sk_bitmap.allocN32Pixels(10, 10); |
228 sk_bitmap.setImmutable(); | 227 sk_bitmap.setImmutable(); |
229 UIResourceId uid = 5; | 228 UIResourceId uid = 5; |
230 UIResourceBitmap bitmap(sk_bitmap); | 229 UIResourceBitmap bitmap(sk_bitmap); |
231 impl.host_impl()->CreateUIResource(uid, bitmap); | 230 impl.host_impl()->CreateUIResource(uid, bitmap); |
232 | 231 |
233 NinePatchLayerImpl* nine_patch_layer_impl = | 232 NinePatchLayerImpl* nine_patch_layer_impl = |
234 impl.AddChildToRoot<NinePatchLayerImpl>(); | 233 impl.AddChildToRoot<NinePatchLayerImpl>(); |
235 nine_patch_layer_impl->SetBounds(layer_size); | 234 nine_patch_layer_impl->SetBounds(layer_size); |
236 nine_patch_layer_impl->SetDrawsContent(true); | 235 nine_patch_layer_impl->SetDrawsContent(true); |
237 nine_patch_layer_impl->SetUIResourceId(uid); | 236 nine_patch_layer_impl->SetUIResourceId(uid); |
238 nine_patch_layer_impl->SetImageBounds(gfx::Size(10, 10)); | 237 nine_patch_layer_impl->SetImageBounds(gfx::Size(10, 10)); |
239 | 238 |
240 gfx::Rect aperture = gfx::Rect(3, 3, 4, 4); | 239 gfx::Rect aperture = gfx::Rect(3, 3, 4, 4); |
241 gfx::Rect border = gfx::Rect(300, 300, 400, 400); | 240 gfx::Rect border = gfx::Rect(300, 300, 400, 400); |
242 nine_patch_layer_impl->SetLayout(aperture, border, true, false); | 241 nine_patch_layer_impl->SetLayout(aperture, border, true, false, gfx::Rect()); |
243 | 242 |
244 impl.CalcDrawProps(viewport_size); | 243 impl.CalcDrawProps(viewport_size); |
245 | 244 |
246 { | 245 { |
247 SCOPED_TRACE("No occlusion"); | 246 SCOPED_TRACE("No occlusion"); |
248 gfx::Rect occluded; | 247 gfx::Rect occluded; |
249 impl.AppendQuadsWithOcclusion(nine_patch_layer_impl, occluded); | 248 impl.AppendQuadsWithOcclusion(nine_patch_layer_impl, occluded); |
250 | 249 |
251 LayerTestCommon::VerifyQuadsExactlyCoverRect(impl.quad_list(), | 250 LayerTestCommon::VerifyQuadsExactlyCoverRect(impl.quad_list(), |
252 gfx::Rect(layer_size)); | 251 gfx::Rect(layer_size)); |
(...skipping 57 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
310 impl.CalcDrawProps(viewport_size); | 309 impl.CalcDrawProps(viewport_size); |
311 | 310 |
312 { | 311 { |
313 SCOPED_TRACE("Use opaque image"); | 312 SCOPED_TRACE("Use opaque image"); |
314 | 313 |
315 nine_patch_layer_impl->SetUIResourceId(uid_opaque); | 314 nine_patch_layer_impl->SetUIResourceId(uid_opaque); |
316 nine_patch_layer_impl->SetImageBounds(gfx::Size(10, 10)); | 315 nine_patch_layer_impl->SetImageBounds(gfx::Size(10, 10)); |
317 | 316 |
318 gfx::Rect aperture = gfx::Rect(3, 3, 4, 4); | 317 gfx::Rect aperture = gfx::Rect(3, 3, 4, 4); |
319 gfx::Rect border = gfx::Rect(300, 300, 400, 400); | 318 gfx::Rect border = gfx::Rect(300, 300, 400, 400); |
320 nine_patch_layer_impl->SetLayout(aperture, border, true, false); | 319 nine_patch_layer_impl->SetLayout(aperture, border, true, false, |
| 320 gfx::Rect()); |
321 | 321 |
322 impl.AppendQuadsWithOcclusion(nine_patch_layer_impl, gfx::Rect()); | 322 impl.AppendQuadsWithOcclusion(nine_patch_layer_impl, gfx::Rect()); |
323 | 323 |
324 const QuadList &quad_list = impl.quad_list(); | 324 const QuadList &quad_list = impl.quad_list(); |
325 for (QuadList::ConstBackToFrontIterator it = quad_list.BackToFrontBegin(); | 325 for (QuadList::ConstBackToFrontIterator it = quad_list.BackToFrontBegin(); |
326 it != quad_list.BackToFrontEnd(); ++it) | 326 it != quad_list.BackToFrontEnd(); ++it) |
327 EXPECT_FALSE(it->ShouldDrawWithBlending()); | 327 EXPECT_FALSE(it->ShouldDrawWithBlending()); |
328 } | 328 } |
329 | 329 |
330 { | 330 { |
331 SCOPED_TRACE("Use tranparent image"); | 331 SCOPED_TRACE("Use tranparent image"); |
332 | 332 |
333 nine_patch_layer_impl->SetUIResourceId(uid_alpha); | 333 nine_patch_layer_impl->SetUIResourceId(uid_alpha); |
334 | 334 |
335 impl.AppendQuadsWithOcclusion(nine_patch_layer_impl, gfx::Rect()); | 335 impl.AppendQuadsWithOcclusion(nine_patch_layer_impl, gfx::Rect()); |
336 | 336 |
337 const QuadList &quad_list = impl.quad_list(); | 337 const QuadList &quad_list = impl.quad_list(); |
338 for (QuadList::ConstBackToFrontIterator it = quad_list.BackToFrontBegin(); | 338 for (QuadList::ConstBackToFrontIterator it = quad_list.BackToFrontBegin(); |
339 it != quad_list.BackToFrontEnd(); ++it) | 339 it != quad_list.BackToFrontEnd(); ++it) |
340 EXPECT_TRUE(it->ShouldDrawWithBlending()); | 340 EXPECT_TRUE(it->ShouldDrawWithBlending()); |
341 } | 341 } |
342 } | 342 } |
343 | 343 |
344 } // namespace | 344 } // namespace |
345 } // namespace cc | 345 } // namespace cc |
OLD | NEW |