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 76 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
87 // layer space. | 87 // layer space. |
88 if (!fill_center) { | 88 if (!fill_center) { |
89 EXPECT_EQ(expected_remaining, remaining.bounds()); | 89 EXPECT_EQ(expected_remaining, remaining.bounds()); |
90 } else { | 90 } else { |
91 EXPECT_TRUE(remaining.bounds().IsEmpty()); | 91 EXPECT_TRUE(remaining.bounds().IsEmpty()); |
92 } | 92 } |
93 | 93 |
94 // Verify UV rects | 94 // Verify UV rects |
95 gfx::Rect bitmap_rect(bitmap_size); | 95 gfx::Rect bitmap_rect(bitmap_size); |
96 Region tex_remaining(bitmap_rect); | 96 Region tex_remaining(bitmap_rect); |
97 for (const auto& quad : quads) { | 97 for (auto* quad : quads) { |
98 const TextureDrawQuad* tex_quad = TextureDrawQuad::MaterialCast(quad); | 98 const TextureDrawQuad* tex_quad = TextureDrawQuad::MaterialCast(quad); |
99 gfx::RectF tex_rect = | 99 gfx::RectF tex_rect = |
100 gfx::BoundingRect(tex_quad->uv_top_left, tex_quad->uv_bottom_right); | 100 gfx::BoundingRect(tex_quad->uv_top_left, tex_quad->uv_bottom_right); |
101 tex_rect.Scale(bitmap_size.width(), bitmap_size.height()); | 101 tex_rect.Scale(bitmap_size.width(), bitmap_size.height()); |
102 tex_remaining.Subtract(Region(ToRoundedIntRect(tex_rect))); | 102 tex_remaining.Subtract(Region(ToRoundedIntRect(tex_rect))); |
103 } | 103 } |
104 | 104 |
105 if (!fill_center) { | 105 if (!fill_center) { |
106 EXPECT_EQ(aperture_rect, tex_remaining.bounds()); | 106 EXPECT_EQ(aperture_rect, tex_remaining.bounds()); |
107 Region aperture_region(aperture_rect); | 107 Region aperture_region(aperture_rect); |
(...skipping 227 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
335 | 335 |
336 const QuadList &quad_list = impl.quad_list(); | 336 const QuadList &quad_list = impl.quad_list(); |
337 for (QuadList::ConstBackToFrontIterator it = quad_list.BackToFrontBegin(); | 337 for (QuadList::ConstBackToFrontIterator it = quad_list.BackToFrontBegin(); |
338 it != quad_list.BackToFrontEnd(); ++it) | 338 it != quad_list.BackToFrontEnd(); ++it) |
339 EXPECT_TRUE(it->ShouldDrawWithBlending()); | 339 EXPECT_TRUE(it->ShouldDrawWithBlending()); |
340 } | 340 } |
341 } | 341 } |
342 | 342 |
343 } // namespace | 343 } // namespace |
344 } // namespace cc | 344 } // namespace cc |
OLD | NEW |