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

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

Issue 551013002: Use Custome ListContainer to Allocate SharedQuadState (Closed) Base URL: https://chromium.googlesource.com/chromium/src.git@DQAllo
Patch Set: rebase Created 6 years, 2 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 | « no previous file | cc/layers/picture_layer_impl_unittest.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 52 matching lines...) Expand 10 before | Expand all | Expand 10 after
63 layer->SetImageBounds(bitmap_size); 63 layer->SetImageBounds(bitmap_size);
64 layer->SetLayout(aperture_rect, border, fill_center); 64 layer->SetLayout(aperture_rect, border, fill_center);
65 AppendQuadsData data; 65 AppendQuadsData data;
66 layer->AppendQuads(render_pass.get(), occlusion_tracker, &data); 66 layer->AppendQuads(render_pass.get(), occlusion_tracker, &data);
67 67
68 // Verify quad rects 68 // Verify quad rects
69 const QuadList& quads = render_pass->quad_list; 69 const QuadList& quads = render_pass->quad_list;
70 EXPECT_EQ(expected_quad_size, quads.size()); 70 EXPECT_EQ(expected_quad_size, quads.size());
71 71
72 Region remaining(visible_content_rect); 72 Region remaining(visible_content_rect);
73 size_t i = 0;
74 for (QuadList::ConstIterator iter = quads.begin(); iter != quads.end(); 73 for (QuadList::ConstIterator iter = quads.begin(); iter != quads.end();
75 ++iter) { 74 ++iter) {
76 gfx::Rect quad_rect = iter->rect; 75 gfx::Rect quad_rect = iter->rect;
77 76
78 EXPECT_TRUE(visible_content_rect.Contains(quad_rect)) << i; 77 EXPECT_TRUE(visible_content_rect.Contains(quad_rect)) << iter.index();
79 EXPECT_TRUE(remaining.Contains(quad_rect)) << i; 78 EXPECT_TRUE(remaining.Contains(quad_rect)) << iter.index();
80 remaining.Subtract(Region(quad_rect)); 79 remaining.Subtract(Region(quad_rect));
81 ++i;
82 } 80 }
83 81
84 // Check if the left-over quad is the same size as the mapped aperture quad in 82 // Check if the left-over quad is the same size as the mapped aperture quad in
85 // layer space. 83 // layer space.
86 if (!fill_center) { 84 if (!fill_center) {
87 EXPECT_RECT_EQ(expected_remaining, gfx::ToEnclosedRect(remaining.bounds())); 85 EXPECT_RECT_EQ(expected_remaining, gfx::ToEnclosedRect(remaining.bounds()));
88 } else { 86 } else {
89 EXPECT_TRUE(remaining.bounds().IsEmpty()); 87 EXPECT_TRUE(remaining.bounds().IsEmpty());
90 } 88 }
91 89
(...skipping 179 matching lines...) Expand 10 before | Expand all | Expand 10 after
271 impl.quad_list(), occluded, &partially_occluded_count); 269 impl.quad_list(), occluded, &partially_occluded_count);
272 // The layer outputs nine quads, three of which are partially occluded, and 270 // The layer outputs nine quads, three of which are partially occluded, and
273 // three fully occluded. 271 // three fully occluded.
274 EXPECT_EQ(6u, impl.quad_list().size()); 272 EXPECT_EQ(6u, impl.quad_list().size());
275 EXPECT_EQ(3u, partially_occluded_count); 273 EXPECT_EQ(3u, partially_occluded_count);
276 } 274 }
277 } 275 }
278 276
279 } // namespace 277 } // namespace
280 } // namespace cc 278 } // namespace cc
OLDNEW
« no previous file with comments | « no previous file | cc/layers/picture_layer_impl_unittest.cc » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698