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

Unified Diff: ui/gfx/mac/coordinate_conversion.mm

Issue 789763002: MacViews: Implement capture using NSEvent local+global monitors (Closed) Base URL: https://chromium.googlesource.com/chromium/src.git@20140812-MacViews-LAYERS2-PRESQUASH
Patch Set: NULL -> nullptr Created 6 years 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/mac/coordinate_conversion.h ('k') | ui/gfx/mac/coordinate_conversion_unittest.mm » ('j') | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: ui/gfx/mac/coordinate_conversion.mm
diff --git a/ui/gfx/mac/coordinate_conversion.mm b/ui/gfx/mac/coordinate_conversion.mm
index b2c41a455d6c96c4aa18e2928937c1c93f3cdb45..ed47d06845fd8e71372be4560d146b1870eed897 100644
--- a/ui/gfx/mac/coordinate_conversion.mm
+++ b/ui/gfx/mac/coordinate_conversion.mm
@@ -7,6 +7,7 @@
#import <Cocoa/Cocoa.h>
#include "ui/gfx/geometry/rect.h"
+#include "ui/gfx/geometry/point.h"
namespace gfx {
@@ -34,4 +35,12 @@ gfx::Rect ScreenRectFromNSRect(const NSRect& rect) {
rect.size.height);
}
+NSPoint ScreenPointToNSPoint(const gfx::Point& point) {
+ return NSMakePoint(point.x(), PrimaryDisplayHeight() - point.y());
+}
+
+gfx::Point ScreenPointFromNSPoint(const NSPoint& point) {
+ return gfx::Point(point.x, PrimaryDisplayHeight() - point.y);
+}
+
} // namespace gfx
« no previous file with comments | « ui/gfx/mac/coordinate_conversion.h ('k') | ui/gfx/mac/coordinate_conversion_unittest.mm » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698