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

Unified Diff: content/browser/renderer_host/backing_store_mac.mm

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: cc/ fixes 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/browser/renderer_host/backing_store_mac.mm
diff --git a/content/browser/renderer_host/backing_store_mac.mm b/content/browser/renderer_host/backing_store_mac.mm
index 0cb5a3b6c2f7d2976b0b3e36812cf17a374466c3..d8513e4aadfc6486214182e7bef6303f59e681d6 100644
--- a/content/browser/renderer_host/backing_store_mac.mm
+++ b/content/browser/renderer_host/backing_store_mac.mm
@@ -101,8 +101,9 @@ void BackingStoreMac::PaintToBackingStore(
gfx::Size pixel_size = gfx::ToFlooredSize(
size().Scale(device_scale_factor_));
- gfx::Rect pixel_bitmap_rect =
- ToFlooredRect(bitmap_rect.Scale(scale_factor));
+ gfx::RectF scaled_bitmap_rect = bitmap_rect;
+ scaled_bitmap_rect.Scale(scale_factor);
+ gfx::Rect pixel_bitmap_rect = ToFlooredRect(scaled_bitmap_rect);
size_t bitmap_byte_count =
pixel_bitmap_rect.width() * pixel_bitmap_rect.height() * 4;
@@ -121,8 +122,9 @@ void BackingStoreMac::PaintToBackingStore(
for (size_t i = 0; i < copy_rects.size(); i++) {
const gfx::Rect& copy_rect = copy_rects[i];
- gfx::Rect pixel_copy_rect =
- ToFlooredRect(copy_rect.Scale(scale_factor));
+ gfx::RectF scaled_copy_rect = copy_rect;
+ scaled_copy_rect.Scale(scale_factor);
+ gfx::Rect pixel_copy_rect = ToFlooredRect(scaled_copy_rect);
// Only the subpixels given by copy_rect have pixels to copy.
base::mac::ScopedCFTypeRef<CGImageRef> image(
« no previous file with comments | « content/browser/renderer_host/backing_store_aura.cc ('k') | content/browser/renderer_host/backing_store_win.cc » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698