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

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

Issue 11264056: cc: Use gfx:: Geometry types for positions, bounds, and related things. (Closed) Base URL: svn://svn.chromium.org/chrome/trunk/src
Patch Set: some missed intstuff 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
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 "config.h" 5 #include "config.h"
6 6
7 #include "cc/test/layer_test_common.h" 7 #include "cc/test/layer_test_common.h"
8 8
9 #include "cc/draw_quad.h" 9 #include "cc/draw_quad.h"
10 #include "testing/gtest/include/gtest/gtest.h" 10 #include "testing/gtest/include/gtest/gtest.h"
11 11
12 namespace LayerTestCommon { 12 namespace LayerTestCommon {
13 13
14 // Align with expected and actual output 14 // Align with expected and actual output
15 const char* quadString = " Quad: "; 15 const char* quadString = " Quad: ";
16 16
17 void verifyQuadsExactlyCoverRect(const cc::QuadList& quads, 17 void verifyQuadsExactlyCoverRect(const cc::QuadList& quads,
18 const cc::IntRect& rect) { 18 const gfx::Rect& rect) {
19 cc::Region remaining(rect); 19 cc::Region remaining = cc::IntRect(rect);
20 20
21 for (size_t i = 0; i < quads.size(); ++i) { 21 for (size_t i = 0; i < quads.size(); ++i) {
22 cc::DrawQuad* quad = quads[i]; 22 cc::DrawQuad* quad = quads[i];
23 cc::IntRect quadRect = cc::IntRect(quad->quadRect()); 23 gfx::Rect quadRect = quad->quadRect();
24 24
25 EXPECT_TRUE(rect.contains(quadRect)) << quadString << i; 25 EXPECT_TRUE(rect.Contains(quadRect)) << quadString << i;
26 EXPECT_TRUE(remaining.contains(quadRect)) << quadString << i; 26 EXPECT_TRUE(remaining.contains(cc::IntRect(quadRect))) << quadString << i;
27 remaining.subtract(cc::Region(quadRect)); 27 remaining.subtract(cc::IntRect(quadRect));
28 } 28 }
29 29
30 EXPECT_TRUE(remaining.isEmpty()); 30 EXPECT_TRUE(remaining.isEmpty());
31 } 31 }
32 32
33 } // namespace LayerTestCommon 33 } // namespace LayerTestCommon
OLDNEW

Powered by Google App Engine
This is Rietveld 408576698