Port !7057 "custom device pixel ratio" into master
This commit ports the changes of !7057 (merged) into master. In practice it is just a copy of the applicable code.
This commit ports the changes of !7057 (merged) into master. In practice it is just a copy of the applicable code.