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

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

Issue 11081007: Remove implicit flooring Scale() method from Point and Size. (Closed) Base URL: svn://svn.chromium.org/chrome/trunk/src
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: 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 182d828f489f22dc8552aa509057209d885b2538..3328e82ef94725ef65d16d65bc2f3aa6b6735676 100644
--- a/content/browser/renderer_host/backing_store_mac.mm
+++ b/content/browser/renderer_host/backing_store_mac.mm
@@ -18,6 +18,7 @@
#include "third_party/skia/include/core/SkBitmap.h"
#include "third_party/skia/include/core/SkCanvas.h"
#include "ui/gfx/rect.h"
+#include "ui/gfx/size_conversions.h"
#include "ui/gfx/scoped_cg_context_save_gstate_mac.h"
#include "ui/surface/transport_dib.h"
@@ -80,7 +81,7 @@ void BackingStoreMac::ScaleFactorChanged(float device_scale_factor) {
}
size_t BackingStoreMac::MemorySize() {
- return size().Scale(device_scale_factor_).GetArea() * 4;
+ return gfx::ToFlooredSize(size().Scale(device_scale_factor_)).GetArea() * 4;
}
void BackingStoreMac::PaintToBackingStore(
@@ -98,7 +99,8 @@ void BackingStoreMac::PaintToBackingStore(
if (!dib)
return;
- gfx::Size pixel_size = size().Scale(device_scale_factor_);
+ gfx::Size pixel_size = gfx::ToFlooredSize(
+ size().Scale(device_scale_factor_));
gfx::Rect pixel_bitmap_rect =
ToFlooredRect(bitmap_rect.Scale(scale_factor));
@@ -268,7 +270,7 @@ CGLayerRef BackingStoreMac::CreateCGLayer() {
}
CGContextRef BackingStoreMac::CreateCGBitmapContext() {
- gfx::Size pixel_size = size().Scale(device_scale_factor_);
+ gfx::Size pixel_size = gfx::ToFlooredSize(size().Scale(device_scale_factor_));
// A CGBitmapContext serves as a stand-in for the layer before the view is
// in a containing window.
CGContextRef context = CGBitmapContextCreate(NULL,
« no previous file with comments | « content/browser/renderer_host/backing_store_aura.cc ('k') | content/browser/renderer_host/compositing_iosurface_mac.mm » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698