Chromium Code Reviews
chromiumcodereview-hr@appspot.gserviceaccount.com (chromiumcodereview-hr) | Please choose your nickname with Settings | Help | Chromium Project | Gerrit Changes | Sign out
(159)

Unified Diff: content/browser/compositor/reflector_impl_unittest.cc

Issue 1080633009: ui: Clean up damaged rects and clear them after painting. (Closed) Base URL: https://chromium.googlesource.com/chromium/src.git@master
Patch Set: damagedregion: fixtest Created 5 years, 8 months ago
Use n/p to move between diff chunks; N/P to move between comments. Draft comments are only viewable by you.
Jump to:
View side-by-side diff with in-line comments
Download patch
« no previous file with comments | « no previous file | ui/compositor/compositor.cc » ('j') | ui/compositor/compositor.cc » ('J')
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: content/browser/compositor/reflector_impl_unittest.cc
diff --git a/content/browser/compositor/reflector_impl_unittest.cc b/content/browser/compositor/reflector_impl_unittest.cc
index a8de2d2c05991714874460e92e7fc22c02d2c6d3..a1dd7512e665715670c396b2426bfc3c753e7135 100644
--- a/content/browser/compositor/reflector_impl_unittest.cc
+++ b/content/browser/compositor/reflector_impl_unittest.cc
@@ -89,8 +89,7 @@ class TestOutputSurface : public BrowserCompositorOutputSurface {
gfx::Size SurfaceSize() const override { return gfx::Size(256, 256); }
};
-const gfx::Rect kSubRect = gfx::Rect(0, 0, 64, 64);
-const SkIRect kSkSubRect = SkIRect::MakeXYWH(0, 0, 64, 64);
+const gfx::Rect kSubRect(0, 0, 64, 64);
} // namespace
@@ -159,10 +158,10 @@ TEST_F(ReflectorImplTest, CheckNormalOutputSurface) {
SetUpReflector();
UpdateTexture();
EXPECT_TRUE(mirroring_layer_->TextureFlipped());
- EXPECT_EQ(SkRegion(SkIRect::MakeXYWH(
- 0, output_surface_->SurfaceSize().height() - kSubRect.height(),
- kSubRect.width(), kSubRect.height())),
- mirroring_layer_->damaged_region());
+ gfx::Rect expected_rect =
+ kSubRect + gfx::Vector2d(0, output_surface_->SurfaceSize().height()) -
+ gfx::Vector2d(0, kSubRect.height());
+ EXPECT_EQ(expected_rect, mirroring_layer_->damaged_region());
}
TEST_F(ReflectorImplTest, CheckInvertedOutputSurface) {
@@ -170,7 +169,7 @@ TEST_F(ReflectorImplTest, CheckInvertedOutputSurface) {
SetUpReflector();
UpdateTexture();
EXPECT_FALSE(mirroring_layer_->TextureFlipped());
- EXPECT_EQ(SkRegion(kSkSubRect), mirroring_layer_->damaged_region());
+ EXPECT_EQ(kSubRect, mirroring_layer_->damaged_region());
}
#if defined(USE_OZONE)
« no previous file with comments | « no previous file | ui/compositor/compositor.cc » ('j') | ui/compositor/compositor.cc » ('J')

Powered by Google App Engine
This is Rietveld 408576698