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

Unified Diff: content/browser/renderer_host/backing_store_aura.cc

Issue 10996037: Do not convert from RectF to Rect by flooring. (Closed) Base URL: svn://svn.chromium.org/chrome/trunk/src
Patch Set: Fixing mac build. Created 8 years, 3 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 | « no previous file | content/browser/renderer_host/backing_store_mac.mm » ('j') | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
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 73d9dad0fe9af2789d5f64e7c7b0be7e303c1ac0..bd0a84a2bf59dc8c39c5d017071f8a799c6a35eb 100644
--- a/content/browser/renderer_host/backing_store_aura.cc
+++ b/content/browser/renderer_host/backing_store_aura.cc
@@ -12,6 +12,7 @@
#include "ui/gfx/canvas.h"
#include "ui/gfx/image/image_skia.h"
#include "ui/gfx/rect.h"
+#include "ui/gfx/rect_conversions.h"
namespace content {
@@ -87,7 +88,8 @@ void BackingStoreAura::PaintToBackingStore(
if (bitmap_rect.IsEmpty())
return;
- gfx::Rect pixel_bitmap_rect = bitmap_rect.Scale(scale_factor);
+ gfx::Rect pixel_bitmap_rect =
+ gfx::ToEnclosingRect(bitmap_rect.Scale(scale_factor));
const int width = pixel_bitmap_rect.width();
const int height = pixel_bitmap_rect.height();
@@ -107,7 +109,8 @@ 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++) {
- const gfx::Rect pixel_copy_rect = copy_rects[i].Scale(scale_factor);
+ const gfx::Rect pixel_copy_rect =
+ gfx::ToEnclosingRect(copy_rects[i].Scale(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,
@@ -115,7 +118,7 @@ void BackingStoreAura::PaintToBackingStore(
pixel_copy_rect.height());
const gfx::Rect pixel_copy_dst_rect =
- copy_rects[i].Scale(device_scale_factor_);
+ gfx::ToEnclosingRect(copy_rects[i].Scale(device_scale_factor_));
SkRect dstrect = SkRect::MakeXYWH(
SkIntToScalar(pixel_copy_dst_rect.x()),
SkIntToScalar(pixel_copy_dst_rect.y()),
@@ -128,7 +131,8 @@ void BackingStoreAura::PaintToBackingStore(
void BackingStoreAura::ScrollBackingStore(int dx, int dy,
const gfx::Rect& clip_rect,
const gfx::Size& view_size) {
- gfx::Rect pixel_rect = clip_rect.Scale(device_scale_factor_);
+ gfx::Rect pixel_rect =
+ gfx::ToEnclosingRect(clip_rect.Scale(device_scale_factor_));
int pixel_dx = dx * device_scale_factor_;
int pixel_dy = dy * device_scale_factor_;
« no previous file with comments | « no previous file | content/browser/renderer_host/backing_store_mac.mm » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698