Index: content/browser/renderer_host/backing_store_aura.cc |
diff --git a/content/browser/renderer_host/backing_store_aura.cc b/content/browser/renderer_host/backing_store_aura.cc |
index 5d1149a5f50466fb15d7466e55e929c5873d34ff..82d78d716aa63bd6990460c539eda9a1c4025fb0 100644 |
--- a/content/browser/renderer_host/backing_store_aura.cc |
+++ b/content/browser/renderer_host/backing_store_aura.cc |
@@ -91,9 +91,8 @@ void BackingStoreAura::PaintToBackingStore( |
if (bitmap_rect.IsEmpty()) |
return; |
- gfx::RectF scaled_bitmap_rect = bitmap_rect; |
- scaled_bitmap_rect.Scale(scale_factor); |
- gfx::Rect pixel_bitmap_rect = gfx::ToEnclosedRect(scaled_bitmap_rect); |
+ gfx::Rect pixel_bitmap_rect = gfx::ToEnclosedRect( |
+ gfx::ScaleRect(bitmap_rect, scale_factor)); |
const int width = pixel_bitmap_rect.width(); |
const int height = pixel_bitmap_rect.height(); |
@@ -113,19 +112,16 @@ void BackingStoreAura::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++) { |
- 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); |
+ const gfx::Rect pixel_copy_rect = gfx::ToEnclosingRect( |
+ gfx::ScaleRect(copy_rects[i], scale_factor)); |
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, |
pixel_copy_rect.width(), |
pixel_copy_rect.height()); |
- gfx::RectF scaled_copy_dst_rect = copy_rects[i]; |
- scaled_copy_dst_rect.Scale(device_scale_factor_); |
- const gfx::Rect pixel_copy_dst_rect = |
- gfx::ToEnclosingRect(scaled_copy_dst_rect); |
+ const gfx::Rect pixel_copy_dst_rect = gfx::ToEnclosingRect( |
+ gfx::ScaleRect(copy_rects[i], device_scale_factor_)); |
SkRect dstrect = SkRect::MakeXYWH( |
SkIntToScalar(pixel_copy_dst_rect.x()), |
SkIntToScalar(pixel_copy_dst_rect.y()), |
@@ -138,9 +134,8 @@ void BackingStoreAura::PaintToBackingStore( |
void BackingStoreAura::ScrollBackingStore(int dx, int dy, |
const gfx::Rect& clip_rect, |
const gfx::Size& view_size) { |
- gfx::RectF scaled_clip_rect = clip_rect; |
- scaled_clip_rect.Scale(device_scale_factor_); |
- gfx::Rect pixel_rect = gfx::ToEnclosingRect(scaled_clip_rect); |
+ gfx::Rect pixel_rect = gfx::ToEnclosingRect( |
+ gfx::ScaleRect(clip_rect, device_scale_factor_)); |
int pixel_dx = dx * device_scale_factor_; |
int pixel_dy = dy * device_scale_factor_; |