Rotating the viewport 90 degrees (portrait)

201 views
Skip to first unread message

Rodger Benham

unread,
Aug 16, 2022, 3:52:33 PM8/16/22
to Chromium-discuss
I'm looking to implement a feature to rotate the viewport 90 degrees to render websites correctly in portrait on the desktop client, in a similar way to how the Android web view supports rotation. Perhaps that involves getting the desktop application to honor the viewport meta tags as well. I do not want to inject JavaScript/CSS changes to perform the rotation as this has proven to be unreliable.

The embedded device I am using is not running a window manager and outputs directly to the frame buffer, so I am not able to defer to having the OS perform the rotation.

Is anyone able to recommend a part of the code-base where I should look at to force a 90 degree rotation, and 270 degree if that is desired? Is this question more appropriate for Chromium-dev?

Thanks in advance,
Rodger

Dave Tapuska

unread,
Aug 16, 2022, 4:07:18 PM8/16/22
to rodger...@gmail.com, Chromium-discuss
You'll want to influence orientation angle here: https://source.chromium.org/chromium/chromium/src/+/main:ui/display/screen_info.h;l=66;drc=4384006e47da9bc967977902d514cc52a590e9c2;bpv=1;bpt=1

It's not clear what native platform you are on top of (linux, android, mac, windows) so how that setting gets into the ScreenInfo depends. For example https://source.chromium.org/chromium/chromium/src/+/main:ui/display/display_util.cc;l=15;drc=4384006e47da9bc967977902d514cc52a590e9c2;bpv=1;bpt=1 is used on some platforms to get it from Display. And then each platform populates the Display struct.


dave

--
--
Chromium Discussion mailing list: chromium...@chromium.org
View archives, change email options, or unsubscribe:
http://groups.google.com/a/chromium.org/group/chromium-discuss

Reply all
Reply to author
Forward
0 new messages