| OLD | NEW |
| (Empty) |
| 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 | |
| 3 // found in the LICENSE file. | |
| 4 | |
| 5 #include "config.h" | |
| 6 | |
| 7 #include "CCLayerTestCommon.h" | |
| 8 #include "CCDrawQuad.h" | |
| 9 #include "testing/gtest/include/gtest/gtest.h" | |
| 10 | |
| 11 namespace CCLayerTestCommon { | |
| 12 | |
| 13 // Align with expected and actual output | |
| 14 const char* quadString = " Quad: "; | |
| 15 | |
| 16 void verifyQuadsExactlyCoverRect(const cc::CCQuadList& quads, | |
| 17 const cc::IntRect& rect) { | |
| 18 cc::Region remaining(rect); | |
| 19 | |
| 20 for (size_t i = 0; i < quads.size(); ++i) { | |
| 21 cc::CCDrawQuad* quad = quads[i]; | |
| 22 cc::IntRect quadRect = quad->quadRect(); | |
| 23 | |
| 24 EXPECT_TRUE(rect.contains(quadRect)) << quadString << i; | |
| 25 EXPECT_TRUE(remaining.contains(quadRect)) << quadString << i; | |
| 26 remaining.subtract(cc::Region(quadRect)); | |
| 27 } | |
| 28 | |
| 29 EXPECT_TRUE(remaining.isEmpty()); | |
| 30 } | |
| 31 | |
| 32 } // namespace CCLayerTestCommon | |
| OLD | NEW |