Commit 7001ef2f authored by danakj's avatar danakj Committed by Commit Bot

Scale fullscreen pepper layer from DIP to physical with use-zoom-for-dsf

Previously the input was physical pixels, so it scaled to DIP when not
using zoom-for-dsf. Now the input is DIP, so we must scale the other
way.

R=piman@chromium.org

Bug: 937602
Change-Id: If51e092ffe6e4e7e72da24315f6cc70b2330022a
Reviewed-on: https://chromium-review.googlesource.com/c/chromium/src/+/1504224Reviewed-by: default avatarAntoine Labour <piman@chromium.org>
Reviewed-by: default avatarccameron <ccameron@chromium.org>
Commit-Queue: danakj <danakj@chromium.org>
Cr-Commit-Position: refs/heads/master@{#637891}
parent c31cf962
......@@ -392,12 +392,12 @@ void RenderWidgetFullscreenPepper::UpdateLayerBounds() {
// viewport.
gfx::Size layer_size = gfx::Rect(ViewRect()).size();
// When IsUseZoomForDSFEnabled() is true, layout and compositor layer sizes
// given by blink are all in physical pixels. When IsUseZoomForDSFEnabled() is
// false, layout and compositor layer sizes given by blink are all in DIP, and
// the compositor scales them internally by the device scale factor.
if (!compositor_deps()->IsUseZoomForDSFEnabled()) {
layer_size = gfx::ConvertSizeToDIP(
GetOriginalScreenInfo().device_scale_factor, layer_size);
// given by blink are all in physical pixels, and the compositor does not do
// any scaling. But the ViewRect() is always in DIP so we must scale the layer
// here as the compositor won't.
if (compositor_deps()->IsUseZoomForDSFEnabled()) {
layer_size = gfx::ScaleToCeiledSize(
layer_size, GetOriginalScreenInfo().device_scale_factor);
}
layer_->SetBounds(layer_size);
}
......
Markdown is supported
0%
or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment