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

Unified Diff: cc/layers/nine_patch_layer_impl_unittest.cc

Issue 448303002: Use custom ListContainer to allocate DrawQuads (Closed) Base URL: https://chromium.googlesource.com/chromium/src.git@perftest
Patch Set: change header files to try fix compile error Created 6 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 side-by-side diff with in-line comments
Download patch
« no previous file with comments | « cc/layers/delegated_renderer_layer_impl_unittest.cc ('k') | cc/layers/picture_image_layer_impl_unittest.cc » ('j') | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: cc/layers/nine_patch_layer_impl_unittest.cc
diff --git a/cc/layers/nine_patch_layer_impl_unittest.cc b/cc/layers/nine_patch_layer_impl_unittest.cc
index 60aad9ea53be92a6c3660faebff8cc31ad929d18..bc7abcf6df5611d4cc0bd3f49e99690b3c194dfd 100644
--- a/cc/layers/nine_patch_layer_impl_unittest.cc
+++ b/cc/layers/nine_patch_layer_impl_unittest.cc
@@ -70,13 +70,15 @@ void NinePatchLayerLayoutTest(const gfx::Size& bitmap_size,
EXPECT_EQ(expected_quad_size, quads.size());
Region remaining(visible_content_rect);
- for (size_t i = 0; i < quads.size(); ++i) {
- DrawQuad* quad = quads[i];
- gfx::Rect quad_rect = quad->rect;
+ size_t i = 0;
+ for (QuadList::ConstIterator iter = quads.begin(); iter != quads.end();
+ ++iter) {
+ gfx::Rect quad_rect = iter->rect;
EXPECT_TRUE(visible_content_rect.Contains(quad_rect)) << i;
EXPECT_TRUE(remaining.Contains(quad_rect)) << i;
remaining.Subtract(Region(quad_rect));
+ ++i;
}
// Check if the left-over quad is the same size as the mapped aperture quad in
@@ -90,9 +92,9 @@ void NinePatchLayerLayoutTest(const gfx::Size& bitmap_size,
// Verify UV rects
gfx::Rect bitmap_rect(bitmap_size);
Region tex_remaining(bitmap_rect);
- for (size_t i = 0; i < quads.size(); ++i) {
- DrawQuad* quad = quads[i];
- const TextureDrawQuad* tex_quad = TextureDrawQuad::MaterialCast(quad);
+ for (QuadList::ConstIterator iter = quads.begin(); iter != quads.end();
+ ++iter) {
+ const TextureDrawQuad* tex_quad = TextureDrawQuad::MaterialCast(&*iter);
gfx::RectF tex_rect =
gfx::BoundingRect(tex_quad->uv_top_left, tex_quad->uv_bottom_right);
tex_rect.Scale(bitmap_size.width(), bitmap_size.height());
« no previous file with comments | « cc/layers/delegated_renderer_layer_impl_unittest.cc ('k') | cc/layers/picture_image_layer_impl_unittest.cc » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698