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 "base/containers/hash_tables.h" | 5 #include "base/containers/hash_tables.h" |
6 #include "cc/layers/append_quads_data.h" | 6 #include "cc/layers/append_quads_data.h" |
7 #include "cc/layers/nine_patch_layer_impl.h" | 7 #include "cc/layers/nine_patch_layer_impl.h" |
8 #include "cc/quads/texture_draw_quad.h" | 8 #include "cc/quads/texture_draw_quad.h" |
9 #include "cc/resources/ui_resource_bitmap.h" | 9 #include "cc/resources/ui_resource_bitmap.h" |
10 #include "cc/resources/ui_resource_client.h" | 10 #include "cc/resources/ui_resource_client.h" |
(...skipping 66 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
77 gfx::Rect quad_rect = iter->rect; | 77 gfx::Rect quad_rect = iter->rect; |
78 | 78 |
79 EXPECT_TRUE(visible_layer_rect.Contains(quad_rect)) << iter.index(); | 79 EXPECT_TRUE(visible_layer_rect.Contains(quad_rect)) << iter.index(); |
80 EXPECT_TRUE(remaining.Contains(quad_rect)) << iter.index(); | 80 EXPECT_TRUE(remaining.Contains(quad_rect)) << iter.index(); |
81 remaining.Subtract(Region(quad_rect)); | 81 remaining.Subtract(Region(quad_rect)); |
82 } | 82 } |
83 | 83 |
84 // Check if the left-over quad is the same size as the mapped aperture quad in | 84 // Check if the left-over quad is the same size as the mapped aperture quad in |
85 // layer space. | 85 // layer space. |
86 if (!fill_center) { | 86 if (!fill_center) { |
87 EXPECT_EQ(expected_remaining, gfx::ToEnclosedRect(remaining.bounds())); | 87 EXPECT_EQ(expected_remaining, remaining.bounds()); |
88 } else { | 88 } else { |
89 EXPECT_TRUE(remaining.bounds().IsEmpty()); | 89 EXPECT_TRUE(remaining.bounds().IsEmpty()); |
90 } | 90 } |
91 | 91 |
92 // Verify UV rects | 92 // Verify UV rects |
93 gfx::Rect bitmap_rect(bitmap_size); | 93 gfx::Rect bitmap_rect(bitmap_size); |
94 Region tex_remaining(bitmap_rect); | 94 Region tex_remaining(bitmap_rect); |
95 for (const auto& quad : quads) { | 95 for (const auto& quad : quads) { |
96 const TextureDrawQuad* tex_quad = TextureDrawQuad::MaterialCast(quad); | 96 const TextureDrawQuad* tex_quad = TextureDrawQuad::MaterialCast(quad); |
97 gfx::RectF tex_rect = | 97 gfx::RectF tex_rect = |
(...skipping 235 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
333 | 333 |
334 const QuadList &quad_list = impl.quad_list(); | 334 const QuadList &quad_list = impl.quad_list(); |
335 for (QuadList::ConstBackToFrontIterator it = quad_list.BackToFrontBegin(); | 335 for (QuadList::ConstBackToFrontIterator it = quad_list.BackToFrontBegin(); |
336 it != quad_list.BackToFrontEnd(); ++it) | 336 it != quad_list.BackToFrontEnd(); ++it) |
337 EXPECT_TRUE(it->ShouldDrawWithBlending()); | 337 EXPECT_TRUE(it->ShouldDrawWithBlending()); |
338 } | 338 } |
339 } | 339 } |
340 | 340 |
341 } // namespace | 341 } // namespace |
342 } // namespace cc | 342 } // namespace cc |
OLD | NEW |