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

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: git try -b win_rel,mac_rel,linux_rel,linux_aura 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/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 7e76b932a653ab4aa5bc9b2e33695f46453a5182..6bec9d5c43a2ca45e5ac3935b1ab33474ff58a9f 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);

Powered by Google App Engine
This is Rietveld 408576698