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

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: Created 6 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 | « 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 7670a94ed4d4cd3f3e1da7540485fee25745c399..fbd42edbd84476774c600eaa60ccb66f0f8f109c 100644
--- a/content/browser/renderer_host/render_widget_host_view_aura.cc
+++ b/content/browser/renderer_host/render_widget_host_view_aura.cc
@@ -300,7 +300,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
sky 2014/06/16 20:18:42 Are you saying the webkit rotation is relative to
mlamouri (slow - plz ping) 2014/06/16 20:23:27 The value is Blink is the rotation of the renderin
sky 2014/06/16 20:53:02 I got it. Can you clarify here that webscreeninfo
mlamouri (slow - plz ping) 2014/06/16 21:07:29 By the way, WebScreenInfo behaves like that becaus
+ // 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, the opposite of the rotation as described by 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