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

Unified Diff: ui/gfx/blit.cc

Issue 11110004: Make gfx::Rect class operations consistently mutate the class they are called on. (Closed) Base URL: http://git.chromium.org/chromium/src.git@master
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: ui/gfx/blit.cc
diff --git a/ui/gfx/blit.cc b/ui/gfx/blit.cc
index 25d0ebedd455d165079deda78fea6df25a011bf3..0c6e6b6bca82466971c593695317bc1c385d6e48 100644
--- a/ui/gfx/blit.cc
+++ b/ui/gfx/blit.cc
@@ -152,13 +152,13 @@ void ScrollCanvas(SkCanvas* canvas,
SkAutoLockPixels lock(bitmap);
// We expect all coords to be inside the canvas, so clip here.
- gfx::Rect clip = in_clip.Intersect(
- gfx::Rect(0, 0, bitmap.width(), bitmap.height()));
+ gfx::Rect clip = in_clip;
+ clip.Intersect(gfx::Rect(0, 0, bitmap.width(), bitmap.height()));
// Compute the set of pixels we'll actually end up painting.
gfx::Rect dest_rect = clip;
dest_rect.Offset(amount);
- dest_rect = dest_rect.Intersect(clip);
+ dest_rect.Intersect(clip);
if (dest_rect.size() == gfx::Size())
return; // Nothing to do.

Powered by Google App Engine
This is Rietveld 408576698