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

Unified Diff: content/browser/renderer_host/render_widget_host_view_aura.cc

Issue 293033004: Make Display's rotation and WebScreenInfo rotation work together on Aura. (Closed) Base URL: https://chromium.googlesource.com/chromium/src.git@randr_orientation
Patch Set: review comments Created 6 years, 6 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 | no next file » | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: content/browser/renderer_host/render_widget_host_view_aura.cc
diff --git a/content/browser/renderer_host/render_widget_host_view_aura.cc b/content/browser/renderer_host/render_widget_host_view_aura.cc
index ad3e95fd1bf5617693fd450862633c47393ddf10..26e425bccaaec777f383371a9c807a740c03bca1 100644
--- a/content/browser/renderer_host/render_widget_host_view_aura.cc
+++ b/content/browser/renderer_host/render_widget_host_view_aura.cc
@@ -306,7 +306,16 @@ void GetScreenInfoForWindow(WebScreenInfo* results, aura::Window* window) {
results->depth = 24;
results->depthPerComponent = 8;
results->deviceScaleFactor = display.device_scale_factor();
+
+ // The Display rotation and the WebScreenInfo orientation are not the same
+ // angle. The former is the physical display rotation while the later is the
+ // rotation required by the content to be shown properly on the screen, in
+ // other words, relative to the physical display.
results->orientationAngle = display.RotationAsDegree();
+ if (results->orientationAngle == 90)
+ results->orientationAngle = 270;
+ else if (results->orientationAngle == 270)
+ results->orientationAngle = 90;
}
bool PointerEventActivates(const ui::Event& event) {
« no previous file with comments | « no previous file | no next file » | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698