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

Unified Diff: ui/display/display.cc

Issue 2777343002: exo: Rotate cursor snapshot for rotated displays (Closed)
Patch Set: Add comment Created 3 years, 7 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/display/display.h ('k') | no next file » | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: ui/display/display.cc
diff --git a/ui/display/display.cc b/ui/display/display.cc
index 25573f8f9b90e3408ab9234162a0a9b0c92aae70..3255fbf3555cf8061bfe79402e274d5d084a0b6d 100644
--- a/ui/display/display.cc
+++ b/ui/display/display.cc
@@ -115,18 +115,7 @@ Display::Display(const Display& other) = default;
Display::~Display() {}
int Display::RotationAsDegree() const {
- switch (rotation_) {
- case ROTATE_0:
- return 0;
- case ROTATE_90:
- return 90;
- case ROTATE_180:
- return 180;
- case ROTATE_270:
- return 270;
- }
- NOTREACHED();
- return 0;
+ return RotateToDegree(rotation_);
}
void Display::SetRotationAsDegree(int rotation) {
@@ -231,4 +220,20 @@ bool Display::HasInternalDisplay() {
return internal_display_id_ != kInvalidDisplayId;
}
+// static
+int Display::RotateToDegree(Rotation rotation) {
+ switch (rotation) {
+ case ROTATE_0:
+ return 0;
+ case ROTATE_90:
+ return 90;
+ case ROTATE_180:
+ return 180;
+ case ROTATE_270:
+ return 270;
+ }
+ NOTREACHED();
+ return 0;
+}
+
} // namespace display
« no previous file with comments | « ui/display/display.h ('k') | no next file » | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698