Skip to content

Commit

Permalink
Scale fullscreen pepper layer from DIP to physical with use-zoom-for-dsf
Browse files Browse the repository at this point in the history
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.

[email protected]

Bug: 937602
Change-Id: If51e092ffe6e4e7e72da24315f6cc70b2330022a
Reviewed-on: https://chromium-review.googlesource.com/c/chromium/src/+/1504224
Reviewed-by: Antoine Labour <[email protected]>
Reviewed-by: ccameron <[email protected]>
Commit-Queue: danakj <[email protected]>
Cr-Commit-Position: refs/heads/master@{#637891}
  • Loading branch information
danakj authored and Commit Bot committed Mar 5, 2019
1 parent c31cf96 commit 7001ef2
Showing 1 changed file with 6 additions and 6 deletions.
12 changes: 6 additions & 6 deletions content/renderer/render_widget_fullscreen_pepper.cc
Original file line number Diff line number Diff line change
Expand Up @@ -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);
}
Expand Down

0 comments on commit 7001ef2

Please sign in to comment.