Chromium Code Reviews| OLD | NEW |
|---|---|
| 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 "cc/math_util.h" | |
| 10 #include "testing/gtest/include/gtest/gtest.h" | 11 #include "testing/gtest/include/gtest/gtest.h" |
| 11 | 12 |
| 12 namespace LayerTestCommon { | 13 namespace LayerTestCommon { |
| 13 | 14 |
| 14 // Align with expected and actual output | 15 // Align with expected and actual output |
| 15 const char* quadString = " Quad: "; | 16 const char* quadString = " Quad: "; |
| 16 | 17 |
| 17 void verifyQuadsExactlyCoverRect(const cc::QuadList& quads, | 18 void verifyQuadsExactlyCoverRect(const cc::QuadList& quads, |
| 18 const cc::IntRect& rect) { | 19 const cc::IntRect& rect) { |
| 19 cc::Region remaining(rect); | 20 cc::Region remaining(rect); |
| 20 | 21 |
| 21 for (size_t i = 0; i < quads.size(); ++i) { | 22 for (size_t i = 0; i < quads.size(); ++i) { |
| 22 cc::DrawQuad* quad = quads[i]; | 23 cc::DrawQuad* quad = quads[i]; |
| 23 cc::IntRect quadRect = cc::IntRect(quad->quadRect()); | 24 bool clipped = false; |
| 25 cc::IntRect quadRect = cc::MathUtil::mapClippedRect(quad->sharedQuadStat e()->quadTransform, cc::IntRect(quad->quadRect())); | |
|
enne (OOO)
2012/10/26 20:33:20
This is wrong. The rect is in the content space o
| |
| 24 | 26 |
| 25 EXPECT_TRUE(rect.contains(quadRect)) << quadString << i; | 27 EXPECT_TRUE(rect.contains(quadRect)) << quadString << i; |
| 26 EXPECT_TRUE(remaining.contains(quadRect)) << quadString << i; | 28 EXPECT_TRUE(remaining.contains(quadRect)) << quadString << i; |
| 27 remaining.subtract(cc::Region(quadRect)); | 29 remaining.subtract(cc::Region(quadRect)); |
| 28 } | 30 } |
| 29 | 31 |
| 30 EXPECT_TRUE(remaining.isEmpty()); | 32 EXPECT_TRUE(remaining.isEmpty()); |
| 31 } | 33 } |
| 32 | 34 |
| 33 } // namespace LayerTestCommon | 35 } // namespace LayerTestCommon |
| OLD | NEW |