blob: 988902b93f6a6324f9c384ed013bc3ea2278f9aa (
plain)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
|
// Copyright 2012 The Chromium Authors. All rights reserved.
// Use of this source code is governed by a BSD-style license that can be
// found in the LICENSE file.
#include "config.h"
#include "CCLayerTestCommon.h"
#include "CCDrawQuad.h"
#include <gtest/gtest.h>
namespace CCLayerTestCommon {
// Align with expected and actual output
const char* quadString = " Quad: ";
void verifyQuadsExactlyCoverRect(const cc::CCQuadList& quads,
const cc::IntRect& rect) {
cc::Region remaining(rect);
for (size_t i = 0; i < quads.size(); ++i) {
cc::CCDrawQuad* quad = quads[i];
cc::IntRect quadRect = quad->quadRect();
EXPECT_TRUE(rect.contains(quadRect)) << quadString << i;
EXPECT_TRUE(remaining.contains(quadRect)) << quadString << i;
remaining.subtract(cc::Region(quadRect));
}
EXPECT_TRUE(remaining.isEmpty());
}
} // namespace CCLayerTestCommon
|