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

Side by Side Diff: cc/nine_patch_layer_impl_unittest.cc

Issue 11411050: cc: Make the DrawQuad subclasses into struct-like classes. (Closed) Base URL: svn://svn.chromium.org/chrome/trunk/src
Patch Set: Rebase Created 8 years, 1 month 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 | Annotate | Revision Log
« no previous file with comments | « cc/nine_patch_layer_impl.cc ('k') | cc/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 "cc/nine_patch_layer_impl.h" 5 #include "cc/nine_patch_layer_impl.h"
6 6
7 #include "cc/append_quads_data.h" 7 #include "cc/append_quads_data.h"
8 #include "cc/single_thread_proxy.h" 8 #include "cc/single_thread_proxy.h"
9 #include "cc/test/geometry_test_utils.h" 9 #include "cc/test/geometry_test_utils.h"
10 #include "cc/test/layer_test_common.h" 10 #include "cc/test/layer_test_common.h"
(...skipping 57 matching lines...) Expand 10 before | Expand all | Expand 10 after
68 } 68 }
69 EXPECT_RECT_EQ(remaining.bounds(), scaledApertureNonUniform); 69 EXPECT_RECT_EQ(remaining.bounds(), scaledApertureNonUniform);
70 Region scaledApertureRegion(scaledApertureNonUniform); 70 Region scaledApertureRegion(scaledApertureNonUniform);
71 EXPECT_EQ(remaining, scaledApertureRegion); 71 EXPECT_EQ(remaining, scaledApertureRegion);
72 72
73 // Verify UV rects 73 // Verify UV rects
74 gfx::Rect bitmapRect(gfx::Point(), bitmapSize); 74 gfx::Rect bitmapRect(gfx::Point(), bitmapSize);
75 Region texRemaining(bitmapRect); 75 Region texRemaining(bitmapRect);
76 for (size_t i = 0; i < quads.size(); ++i) { 76 for (size_t i = 0; i < quads.size(); ++i) {
77 DrawQuad* quad = quads[i]; 77 DrawQuad* quad = quads[i];
78 const TextureDrawQuad* texQuad = TextureDrawQuad::materialCast(quad); 78 const TextureDrawQuad* texQuad = TextureDrawQuad::MaterialCast(quad);
79 gfx::RectF texRect = texQuad->uvRect(); 79 gfx::RectF texRect = texQuad->uv_rect;
80 texRect.Scale(bitmapSize.width(), bitmapSize.height()); 80 texRect.Scale(bitmapSize.width(), bitmapSize.height());
81 texRemaining.Subtract(Region(ToRoundedIntRect(texRect))); 81 texRemaining.Subtract(Region(ToRoundedIntRect(texRect)));
82 } 82 }
83 EXPECT_RECT_EQ(texRemaining.bounds(), apertureRect); 83 EXPECT_RECT_EQ(texRemaining.bounds(), apertureRect);
84 Region apertureRegion(apertureRect); 84 Region apertureRegion(apertureRect);
85 EXPECT_EQ(texRemaining, apertureRegion); 85 EXPECT_EQ(texRemaining, apertureRegion);
86 } 86 }
87 87
88 } // namespace 88 } // namespace
89 } // namespace cc 89 } // namespace cc
OLDNEW
« no previous file with comments | « cc/nine_patch_layer_impl.cc ('k') | cc/picture_layer_impl.cc » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698