diff options
author | danakj@chromium.org <danakj@chromium.org@0039d316-1c4b-4281-b951-d872f2087c98> | 2013-03-20 21:47:34 +0000 |
---|---|---|
committer | danakj@chromium.org <danakj@chromium.org@0039d316-1c4b-4281-b951-d872f2087c98> | 2013-03-20 21:47:34 +0000 |
commit | f5433baa5badcd0c88b5dd43b2d5d68dc396a968 (patch) | |
tree | 8b2312bd2e65dbd2a723476749e4f13163aa6822 /cc/test/layer_test_common.cc | |
parent | af3b6bde2acc051fcda00549cb2d4aa0b53bc609 (diff) | |
download | chromium_src-f5433baa5badcd0c88b5dd43b2d5d68dc396a968.zip chromium_src-f5433baa5badcd0c88b5dd43b2d5d68dc396a968.tar.gz chromium_src-f5433baa5badcd0c88b5dd43b2d5d68dc396a968.tar.bz2 |
cc: Chromify LayerTestCommon
Style-only change for cc/test/layer_test_common.h|cc.
R=jamesr
Review URL: https://chromiumcodereview.appspot.com/12963007
git-svn-id: svn://svn.chromium.org/chrome/trunk/src@189420 0039d316-1c4b-4281-b951-d872f2087c98
Diffstat (limited to 'cc/test/layer_test_common.cc')
-rw-r--r-- | cc/test/layer_test_common.cc | 56 |
1 files changed, 28 insertions, 28 deletions
diff --git a/cc/test/layer_test_common.cc b/cc/test/layer_test_common.cc index 997e08e..fcd09d4 100644 --- a/cc/test/layer_test_common.cc +++ b/cc/test/layer_test_common.cc @@ -15,45 +15,45 @@ #include "ui/gfx/size_conversions.h" namespace cc { -namespace LayerTestCommon { -// Align with expected and actual output -const char* quadString = " Quad: "; +// Align with expected and actual output. +const char* LayerTestCommon::quad_string = " Quad: "; -bool canRectFBeSafelyRoundedToRect(const gfx::RectF& r) -{ - // Ensure that range of float values is not beyond integer range. - if (!r.IsExpressibleAsRect()) - return false; +static bool CanRectFBeSafelyRoundedToRect(gfx::RectF r) { + // Ensure that range of float values is not beyond integer range. + if (!r.IsExpressibleAsRect()) + return false; - // Ensure that the values are actually integers. - if (gfx::ToFlooredPoint(r.origin()) == r.origin() && gfx::ToFlooredSize(r.size()) == r.size()) - return true; + // Ensure that the values are actually integers. + if (gfx::ToFlooredPoint(r.origin()) == r.origin() && + gfx::ToFlooredSize(r.size()) == r.size()) + return true; - return false; + return false; } -void verifyQuadsExactlyCoverRect(const cc::QuadList& quads, - const gfx::Rect& rect) { - cc::Region remaining = rect; +void LayerTestCommon::VerifyQuadsExactlyCoverRect(const cc::QuadList& quads, + gfx::Rect rect) { + cc::Region remaining = rect; - for (size_t i = 0; i < quads.size(); ++i) { - cc::DrawQuad* quad = quads[i]; - gfx::RectF quadRectF = cc::MathUtil::MapClippedRect(quad->quadTransform(), gfx::RectF(quad->rect)); + for (size_t i = 0; i < quads.size(); ++i) { + cc::DrawQuad* quad = quads[i]; + gfx::RectF quad_rectf = + cc::MathUtil::MapClippedRect(quad->quadTransform(), + gfx::RectF(quad->rect)); - // Before testing for exact coverage in the integer world, assert that rounding - // will not round the rect incorrectly. - ASSERT_TRUE(canRectFBeSafelyRoundedToRect(quadRectF)); + // Before testing for exact coverage in the integer world, assert that + // rounding will not round the rect incorrectly. + ASSERT_TRUE(CanRectFBeSafelyRoundedToRect(quad_rectf)); - gfx::Rect quadRect = gfx::ToEnclosingRect(quadRectF); + gfx::Rect quad_rect = gfx::ToEnclosingRect(quad_rectf); - EXPECT_TRUE(rect.Contains(quadRect)) << quadString << i; - EXPECT_TRUE(remaining.Contains(quadRect)) << quadString << i; - remaining.Subtract(quadRect); - } + EXPECT_TRUE(rect.Contains(quad_rect)) << quad_string << i; + EXPECT_TRUE(remaining.Contains(quad_rect)) << quad_string << i; + remaining.Subtract(quad_rect); + } - EXPECT_TRUE(remaining.IsEmpty()); + EXPECT_TRUE(remaining.IsEmpty()); } -} // namespace LayerTestCommon } // namespace cc |