Skip to content

Commit

Permalink
Browse files Browse the repository at this point in the history
[chromium] Replace completelyContains with Region::contains()
https://bugs.webkit.org/show_bug.cgi?id=80617

Patch by Dana Jansens <danakj@chromium.org> on 2012-03-08
Reviewed by James Robinson.

* tests/CCLayerTestCommon.cpp:
(CCLayerTestCommon):
(CCLayerTestCommon::verifyQuadsExactlyCoverRect):
* tests/CCLayerTestCommon.h:
(CCLayerTestCommon):

Canonical link: https://commits.webkit.org/97838@main
git-svn-id: https://svn.webkit.org/repository/webkit/trunk@110242 268f45cc-cd09-0410-ab3c-d52691b4dbfc
  • Loading branch information
danakj authored and webkit-commit-queue committed Mar 9, 2012
1 parent 127a8af commit 5f37fdd
Show file tree
Hide file tree
Showing 3 changed files with 14 additions and 11 deletions.
13 changes: 13 additions & 0 deletions Source/WebKit/chromium/ChangeLog
@@ -1,3 +1,16 @@
2012-03-08 Dana Jansens <danakj@chromium.org>

[chromium] Replace completelyContains with Region::contains()
https://bugs.webkit.org/show_bug.cgi?id=80617

Reviewed by James Robinson.

* tests/CCLayerTestCommon.cpp:
(CCLayerTestCommon):
(CCLayerTestCommon::verifyQuadsExactlyCoverRect):
* tests/CCLayerTestCommon.h:
(CCLayerTestCommon):

2012-03-08 James Robinson <jamesr@chromium.org>

Use an explicit attribute to signal that a context prefers to use a discrete GPU
Expand Down
11 changes: 1 addition & 10 deletions Source/WebKit/chromium/tests/CCLayerTestCommon.cpp
Expand Up @@ -36,15 +36,6 @@ namespace CCLayerTestCommon {
// Align with expected and actual output
const char* quadString = " Quad: ";

bool completelyContains(const Region& container, const IntRect& rect)
{
Region tester(rect);
Vector<IntRect> rects = container.rects();
for (size_t i = 0; i < rects.size(); ++i)
tester.subtract(rects[i]);
return tester.isEmpty();
}

void verifyQuadsExactlyCoverRect(const CCQuadList& quads, const IntRect& rect)
{
Region remaining(rect);
Expand All @@ -53,7 +44,7 @@ void verifyQuadsExactlyCoverRect(const CCQuadList& quads, const IntRect& rect)
CCDrawQuad* quad = quads[i].get();

EXPECT_TRUE(rect.contains(quad->quadRect())) << quadString << i;
EXPECT_TRUE(completelyContains(remaining, quad->quadRect())) << quadString << i;
EXPECT_TRUE(remaining.contains(quad->quadRect())) << quadString << i;
remaining.subtract(Region(quad->quadRect()));
}

Expand Down
1 change: 0 additions & 1 deletion Source/WebKit/chromium/tests/CCLayerTestCommon.h
Expand Up @@ -33,7 +33,6 @@ namespace CCLayerTestCommon {

extern const char* quadString;

bool completelyContains(const WebCore::Region&, const WebCore::IntRect&);
void verifyQuadsExactlyCoverRect(const WebCore::CCQuadList&, const WebCore::IntRect&);

} // namespace CCLayerTestCommon
Expand Down

0 comments on commit 5f37fdd

Please sign in to comment.