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

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

Issue 10993094: Make adding and subtracting gfx:: point types simpler. (Closed) Base URL: svn://svn.chromium.org/chrome/trunk/src
Patch Set: rebase 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 | « no previous file | ui/gfx/point.h » ('j') | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
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 b9e6eabfdc60142a56ad6aa009353158fa01ffbf..182d828f489f22dc8552aa509057209d885b2538 100644
--- a/content/browser/renderer_host/backing_store_mac.mm
+++ b/content/browser/renderer_host/backing_store_mac.mm
@@ -6,6 +6,8 @@
#include "content/browser/renderer_host/backing_store_mac.h"
+#include <cmath>
+
#include "base/logging.h"
#include "base/mac/mac_util.h"
#include "base/mac/scoped_cftyperef.h"
@@ -23,7 +25,10 @@ namespace {
// Returns a Rect obtained by flooring the values of the given RectF.
gfx::Rect ToFlooredRect(const gfx::RectF& rect) {
- return gfx::Rect(rect.origin().ToPoint(), rect.size().ToSize());
+ return gfx::Rect(static_cast<int>(std::floor(rect.x())),
+ static_cast<int>(std::floor(rect.y())),
+ static_cast<int>(std::floor(rect.width())),
+ static_cast<int>(std::floor(rect.height())));
}
} // namespace
« no previous file with comments | « no previous file | ui/gfx/point.h » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698