Issue metadata
Sign in to add a comment
|
Invalid display metrics (dpi) after desktop/tablet mode switch and rotation.
Reported by
olivier....@myscript.com,
Nov 16
|
||||||||||||||||||||||
Issue description
UserAgent: Mozilla/5.0 (Macintosh; Intel Mac OS X 10_12_6) AppleWebKit/537.36 (KHTML, like Gecko) Chrome/69.0.3497.100 Safari/537.36
Platform: 11021.56.0 (Official Build) stable-channel caroline
Steps to reproduce the problem:
1. In desktop mode launch an Android app relying on DPI (provided by DisplayMetrics)
2. switch to tablet mode
3. rotate screen
What is the expected behavior?
The DPI are stable among tablet/desktop mode and rotation.
xdpi=234.46153
ydpi=234.9133
What went wrong?
The DPI value is not stable and broken.
xdpi=156.3077
ydpi=352.36993
Did this work before? Yes ChromeOS 69
Chrome version: 70.0.3538.76 Channel: stable
OS Version: 11021.56.0
Flash Version:
You can visualize the problem with this simple Android View:
```
@Override
protected void onDraw(Canvas canvas) {
DisplayMetrics dm = getResources().getDisplayMetrics();
float widthInches = dm.widthPixels / dm.xdpi;
float heightInches = dm.heightPixels / dm.ydpi;
float widthCentimeters = widthInches * 2.54f;
float heightCentimeters = heightInches * 2.54f;
float widthOneCentimeterInPixels = dm.widthPixels / widthCentimeters;
float heightOneCentimeterInPixels = dm.heightPixels / heightCentimeters;
Paint paint = new Paint();
paint.setColor(Color.BLACK);
canvas.drawColor(Color.WHITE);
canvas.drawLine(100f, 100f, 100f + widthOneCentimeterInPixels, 100f, paint);
canvas.drawLine(100f, 100f, 100f, 100f + heightOneCentimeterInPixels, paint);
}
```
,
Nov 29
,
Nov 29
,
Nov 29
,
Dec 3
This is a dupe of the buganizer issue which I have created this morning.
,
Dec 3
mukai@, I think this is related to your work that fixes the native pixel size. Can you point me where could be an issue? Then I can work with Ricardo to fix it.
,
Dec 3
It is 70682973 of the buganizer issue.
,
Dec 6
ricardoq@ landed the fix (crrev.com/c/1364078)
,
Jan 14
Hello, first of all, thanks for the fix! Do you have any idea in which version of Chrome OS this fix will land? Thanks.
,
Jan 14
olivier: m72 was branched on dec 03, and this fix landed on dec 05. so this fix should be in m73. |
|||||||||||||||||||||||
►
Sign in to add a comment |
|||||||||||||||||||||||
Comment 1 by dtapu...@chromium.org
, Nov 16