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

Unified Diff: content/renderer/browser_plugin/browser_plugin_backing_store.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: 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
« no previous file with comments | « content/plugin/webplugin_proxy.cc ('k') | content/renderer/disambiguation_popup_helper.cc » ('j') | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: content/renderer/browser_plugin/browser_plugin_backing_store.cc
diff --git a/content/renderer/browser_plugin/browser_plugin_backing_store.cc b/content/renderer/browser_plugin/browser_plugin_backing_store.cc
index e29d5b319d18a3e8e70472140026f0adf01e161f..131b0d097be594d5efe5be3569e34c1690249e99 100644
--- a/content/renderer/browser_plugin/browser_plugin_backing_store.cc
+++ b/content/renderer/browser_plugin/browser_plugin_backing_store.cc
@@ -37,8 +37,9 @@ void BrowserPluginBackingStore::PaintToBackingStore(
if (bitmap_rect.IsEmpty())
return;
- gfx::Rect pixel_bitmap_rect =
- gfx::ToEnclosingRect(bitmap_rect.Scale(scale_factor_));
+ gfx::RectF scaled_bitmap_rect = bitmap_rect;
+ scaled_bitmap_rect.Scale(scale_factor_);
+ gfx::Rect pixel_bitmap_rect = gfx::ToEnclosingRect(scaled_bitmap_rect);
const int width = pixel_bitmap_rect.width();
const int height = pixel_bitmap_rect.height();
@@ -57,8 +58,9 @@ void BrowserPluginBackingStore::PaintToBackingStore(
sk_bitmap.setConfig(SkBitmap::kARGB_8888_Config, width, height);
sk_bitmap.setPixels(dib->memory());
for (size_t i = 0; i < copy_rects.size(); i++) {
- const gfx::Rect& pixel_copy_rect =
- gfx::ToEnclosingRect(copy_rects[i].Scale(scale_factor_));
+ gfx::RectF scaled_copy_rect = copy_rects[i];
+ scaled_copy_rect.Scale(scale_factor_);
+ const gfx::Rect& pixel_copy_rect = gfx::ToEnclosingRect(scaled_copy_rect);
int x = pixel_copy_rect.x() - pixel_bitmap_rect.x();
int y = pixel_copy_rect.y() - pixel_bitmap_rect.y();
SkIRect srcrect = SkIRect::MakeXYWH(x, y,
@@ -79,7 +81,9 @@ void BrowserPluginBackingStore::ScrollBackingStore(
int dy,
const gfx::Rect& clip_rect,
const gfx::Size& view_size) {
- gfx::Rect pixel_rect = gfx::ToEnclosingRect(clip_rect.Scale(scale_factor_));
+ gfx::RectF scaled_clip_rect = clip_rect;
+ scaled_clip_rect.Scale(scale_factor_);
+ gfx::Rect pixel_rect = gfx::ToEnclosingRect(scaled_clip_rect);
int pixel_dx = dx * scale_factor_;
int pixel_dy = dy * scale_factor_;
« no previous file with comments | « content/plugin/webplugin_proxy.cc ('k') | content/renderer/disambiguation_popup_helper.cc » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698