Chromium Code Reviews
chromiumcodereview-hr@appspot.gserviceaccount.com (chromiumcodereview-hr) | Please choose your nickname with Settings | Help | Chromium Project | Gerrit Changes | Sign out
(275)

Side by Side Diff: cc/layers/nine_patch_layer_impl_unittest.cc

Issue 1314943008: cc: Remove implicit conversions from Rect to RectF in src/cc/. (Closed) Base URL: https://chromium.googlesource.com/chromium/src.git@master
Patch Set: rectfconvert-cc: rebase-and-sandwich-strategy Created 5 years, 3 months ago
Use n/p to move between diff chunks; N/P to move between comments. Draft comments are only viewable by you.
Jump to:
View unified diff | Download patch
« no previous file with comments | « cc/layers/layer_impl.cc ('k') | cc/layers/picture_layer_impl.cc » ('j') | no next file with comments »
Toggle Intra-line Diffs ('i') | Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
OLDNEW
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
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
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
OLDNEW
« no previous file with comments | « cc/layers/layer_impl.cc ('k') | cc/layers/picture_layer_impl.cc » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698