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

Unified Diff: ui/gfx/canvas.cc

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
« no previous file with comments | « ui/compositor/layer.cc ('k') | ui/gfx/display.cc » ('j') | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: ui/gfx/canvas.cc
diff --git a/ui/gfx/canvas.cc b/ui/gfx/canvas.cc
index c4f98d68b515ba3cdbaae7ffe42631966f044584..78badf1694873acfc852b5d1b42b633e6a1371be 100644
--- a/ui/gfx/canvas.cc
+++ b/ui/gfx/canvas.cc
@@ -13,6 +13,7 @@
#include "ui/gfx/canvas.h"
#include "ui/gfx/font.h"
#include "ui/gfx/rect.h"
+#include "ui/gfx/size_conversions.h"
#include "ui/gfx/skia_util.h"
#include "ui/gfx/transform.h"
@@ -28,7 +29,8 @@ Canvas::Canvas(const gfx::Size& size,
: scale_factor_(scale_factor),
owned_canvas_(NULL),
canvas_(NULL) {
- gfx::Size pixel_size = size.Scale(ui::GetScaleFactorScale(scale_factor));
+ gfx::Size pixel_size = gfx::ToFlooredSize(size.Scale(
+ ui::GetScaleFactorScale(scale_factor)));
owned_canvas_.reset(new skia::PlatformCanvas(pixel_size.width(),
pixel_size.height(),
is_opaque));
@@ -74,7 +76,8 @@ void Canvas::RecreateBackingCanvas(const gfx::Size& size,
ui::ScaleFactor scale_factor,
bool is_opaque) {
scale_factor_ = scale_factor;
- gfx::Size pixel_size = size.Scale(ui::GetScaleFactorScale(scale_factor));
+ gfx::Size pixel_size = gfx::ToFlooredSize(
+ size.Scale(ui::GetScaleFactorScale(scale_factor)));
owned_canvas_.reset(new skia::PlatformCanvas(pixel_size.width(),
pixel_size.height(),
is_opaque));
« no previous file with comments | « ui/compositor/layer.cc ('k') | ui/gfx/display.cc » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698