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

Unified Diff: ui/gfx/display.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/gfx/canvas.cc ('k') | ui/gfx/image/image_skia_operations.cc » ('j') | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: ui/gfx/display.cc
diff --git a/ui/gfx/display.cc b/ui/gfx/display.cc
index 9fcf15608ff00992cdc18ec904810efb97b5f414..e647f650603ff777e9a2c46931e5e11c7d3c645a 100644
--- a/ui/gfx/display.cc
+++ b/ui/gfx/display.cc
@@ -10,6 +10,7 @@
#include "base/stringprintf.h"
#include "ui/base/ui_base_switches.h"
#include "ui/gfx/insets.h"
+#include "ui/gfx/size_conversions.h"
namespace gfx {
namespace {
@@ -87,8 +88,8 @@ void Display::SetScaleAndBounds(
#if defined(USE_AURA)
bounds_in_pixel_ = bounds_in_pixel;
#endif
- bounds_ = gfx::Rect(
- bounds_in_pixel.size().Scale(1.0f / device_scale_factor_));
+ bounds_ = gfx::Rect(gfx::ToFlooredSize(
+ bounds_in_pixel.size().Scale(1.0f / device_scale_factor_)));
UpdateWorkAreaFromInsets(insets);
}
@@ -108,7 +109,7 @@ void Display::UpdateWorkAreaFromInsets(const gfx::Insets& insets) {
}
gfx::Size Display::GetSizeInPixel() const {
- return size().Scale(device_scale_factor_);
+ return gfx::ToFlooredSize(size().Scale(device_scale_factor_));
}
std::string Display::ToString() const {
« no previous file with comments | « ui/gfx/canvas.cc ('k') | ui/gfx/image/image_skia_operations.cc » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698