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

Unified Diff: content/renderer/paint_aggregator_unittest.cc

Issue 11270042: Add non-member non-mutating methods for common gfx::Rect operations. (Closed) Base URL: svn://svn.chromium.org/chrome/trunk/src
Patch Set: Created 8 years, 2 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
Index: content/renderer/paint_aggregator_unittest.cc
diff --git a/content/renderer/paint_aggregator_unittest.cc b/content/renderer/paint_aggregator_unittest.cc
index 72618229b1bf37e3b5254feb3390bd7faae65c63..2b6533e519111525d71f6bf2a2a4c9e36c2b3534 100644
--- a/content/renderer/paint_aggregator_unittest.cc
+++ b/content/renderer/paint_aggregator_unittest.cc
@@ -37,8 +37,7 @@ TEST(PaintAggregator, DoubleDisjointInvalidation) {
greg.InvalidateRect(r1);
greg.InvalidateRect(r2);
- gfx::Rect expected_bounds = r1;
- expected_bounds.Union(r2);
+ gfx::Rect expected_bounds = gfx::Union(r1, r2);
EXPECT_TRUE(greg.HasPendingUpdate());
PaintAggregator::PendingUpdate update;
@@ -62,8 +61,7 @@ TEST(PaintAggregator, DisjointInvalidationsCombined) {
greg.InvalidateRect(r1);
greg.InvalidateRect(r2);
- gfx::Rect expected_bounds = r1;
- expected_bounds.Union(r2);
+ gfx::Rect expected_bounds = gfx::Union(r1, r2);
EXPECT_TRUE(greg.HasPendingUpdate());
PaintAggregator::PendingUpdate update;
@@ -279,8 +277,7 @@ TEST(PaintAggregator, OverlappingPaintBeforeScroll) {
gfx::Rect scroll_rect(0, 0, 10, 10);
greg.ScrollRect(2, 0, scroll_rect);
- gfx::Rect expected_paint_rect = scroll_rect;
- expected_paint_rect.Union(paint_rect);
+ gfx::Rect expected_paint_rect = gfx::Union(scroll_rect, paint_rect);
EXPECT_TRUE(greg.HasPendingUpdate());
PaintAggregator::PendingUpdate update;
@@ -301,8 +298,7 @@ TEST(PaintAggregator, OverlappingPaintAfterScroll) {
gfx::Rect paint_rect(4, 4, 10, 2);
greg.InvalidateRect(paint_rect);
- gfx::Rect expected_paint_rect = scroll_rect;
- expected_paint_rect.Union(paint_rect);
+ gfx::Rect expected_paint_rect = gfx::Union(scroll_rect, paint_rect);
EXPECT_TRUE(greg.HasPendingUpdate());
PaintAggregator::PendingUpdate update;

Powered by Google App Engine
This is Rietveld 408576698