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

Unified Diff: content/browser/renderer_host/compositing_iosurface_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
« no previous file with comments | « content/browser/renderer_host/backing_store_mac.mm ('k') | content/browser/renderer_host/dip_util.cc » ('j') | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: content/browser/renderer_host/compositing_iosurface_mac.mm
diff --git a/content/browser/renderer_host/compositing_iosurface_mac.mm b/content/browser/renderer_host/compositing_iosurface_mac.mm
index 22be48709f175e4b9be7200e4d411718172fb7b7..db49a82dfee8c0fd0e544d1f45d0259a6e8af2a3 100644
--- a/content/browser/renderer_host/compositing_iosurface_mac.mm
+++ b/content/browser/renderer_host/compositing_iosurface_mac.mm
@@ -19,6 +19,7 @@
#include "ui/gl/gl_context.h"
#include "ui/gl/gl_switches.h"
#include "ui/gl/gpu_switching_manager.h"
+#include "ui/gfx/size_conversions.h"
#include "ui/surface/io_surface_support_mac.h"
#ifdef NDEBUG
@@ -327,12 +328,14 @@ void CompositingIOSurfaceMac::DrawIOSurface(NSView* view, float scale_factor) {
[glContext_ setView:view];
gfx::Size window_size(NSSizeToCGSize([view frame].size));
- gfx::Size pixel_window_size = window_size.Scale(scale_factor);
+ gfx::Size pixel_window_size = gfx::ToFlooredSize(
+ window_size.Scale(scale_factor));
glViewport(0, 0, pixel_window_size.width(), pixel_window_size.height());
// TODO: After a resolution change, the DPI-ness of the view and the
// IOSurface might not be in sync.
- io_surface_size_ = pixel_io_surface_size_.Scale(1.0 / scale_factor);
+ io_surface_size_ = gfx::ToFlooredSize(
+ pixel_io_surface_size_.Scale(1.0 / scale_factor));
quad_.set_size(io_surface_size_, pixel_io_surface_size_);
glMatrixMode(GL_PROJECTION);
« no previous file with comments | « content/browser/renderer_host/backing_store_mac.mm ('k') | content/browser/renderer_host/dip_util.cc » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698