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

Side by Side Diff: cc/test/layer_test_common.cc

Issue 11416088: cc: Turn SharedQuadState into a struct-like class similar to DrawQuads. (Closed) Base URL: svn://svn.chromium.org/chrome/trunk/src
Patch Set: Fix debug build 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/software_renderer_unittest.cc ('k') | cc/test/mock_quad_culler.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/test/layer_test_common.h" 5 #include "cc/test/layer_test_common.h"
6 6
7 #include "cc/draw_quad.h" 7 #include "cc/draw_quad.h"
8 #include "cc/math_util.h" 8 #include "cc/math_util.h"
9 #include "cc/region.h" 9 #include "cc/region.h"
10 #include "cc/render_pass.h" 10 #include "cc/render_pass.h"
(...skipping 20 matching lines...) Expand all
31 31
32 return false; 32 return false;
33 } 33 }
34 34
35 void verifyQuadsExactlyCoverRect(const cc::QuadList& quads, 35 void verifyQuadsExactlyCoverRect(const cc::QuadList& quads,
36 const gfx::Rect& rect) { 36 const gfx::Rect& rect) {
37 cc::Region remaining = rect; 37 cc::Region remaining = rect;
38 38
39 for (size_t i = 0; i < quads.size(); ++i) { 39 for (size_t i = 0; i < quads.size(); ++i) {
40 cc::DrawQuad* quad = quads[i]; 40 cc::DrawQuad* quad = quads[i];
41 gfx::RectF quadRectF = cc::MathUtil::mapClippedRect(quad->shared_quad_st ate->quadTransform, gfx::RectF(quad->rect)); 41 gfx::RectF quadRectF = cc::MathUtil::mapClippedRect(quad->quadTransform( ), gfx::RectF(quad->rect));
42 42
43 // Before testing for exact coverage in the integer world, assert that r ounding 43 // Before testing for exact coverage in the integer world, assert that r ounding
44 // will not round the rect incorrectly. 44 // will not round the rect incorrectly.
45 ASSERT_TRUE(canRectFBeSafelyRoundedToRect(quadRectF)); 45 ASSERT_TRUE(canRectFBeSafelyRoundedToRect(quadRectF));
46 46
47 gfx::Rect quadRect = gfx::ToEnclosingRect(quadRectF); 47 gfx::Rect quadRect = gfx::ToEnclosingRect(quadRectF);
48 48
49 EXPECT_TRUE(rect.Contains(quadRect)) << quadString << i; 49 EXPECT_TRUE(rect.Contains(quadRect)) << quadString << i;
50 EXPECT_TRUE(remaining.Contains(quadRect)) << quadString << i; 50 EXPECT_TRUE(remaining.Contains(quadRect)) << quadString << i;
51 remaining.Subtract(quadRect); 51 remaining.Subtract(quadRect);
52 } 52 }
53 53
54 EXPECT_TRUE(remaining.IsEmpty()); 54 EXPECT_TRUE(remaining.IsEmpty());
55 } 55 }
56 56
57 } // namespace LayerTestCommon 57 } // namespace LayerTestCommon
OLDNEW
« no previous file with comments | « cc/software_renderer_unittest.cc ('k') | cc/test/mock_quad_culler.cc » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698