New issue
Advanced search Search tips
Note: Color blocks (like or ) mean that a user may not be available. Tooltip shows the reason.

Issue 785596 link

Starred by 4 users

Issue metadata

Status: Verified
Owner:
Last visit > 30 days ago
Closed: Nov 2017
Cc:
Components:
EstimatedDays: ----
NextAction: ----
OS: Android
Pri: 1
Type: Bug



Sign in to add a comment

Webview is smaller than it should be

Project Member Reported by jamwalla@chromium.org, Nov 16 2017

Issue description

On ToT, webviews take up a small part of the upper-left corner of its container. Touch input is offset, so a touch in the middle of the screen will display as a touch in the middle of the tiny webview. 

This happens in multiple apps. It's not broken in yesterday's build 64.0.3269.0.
 
demo.mp4
894 KB View Download

Comment 2 by boliu@chromium.org, Nov 16 2017

Labels: -Pri-3 Pri-1

Comment 3 by fsamuel@google.com, Nov 16 2017

Yea, looks like WebView always reports a DSF of 1.0 to Viz:

https://cs.chromium.org/chromium/src/android_webview/browser/surfaces_instance.cc?type=cs&q=surfaces_instance.cc&sq=package:chromium&l=153

How do I plumb the view's device scale factor for Webview?

Comment 4 by fsamuel@google.com, Nov 16 2017

Note to self:

https://cs.chromium.org/chromium/src/android_webview/browser/hardware_renderer.cc?type=cs&q=AddChildId+file:%5Esrc/android_webview/browser/+package:%5Echromium$&l=164

It looks like surfaces_->DrawAndSwap likely should just get the device scale factor of the child CompositorFrame which should be getting the right device scale factor from the browser ultimately through WebContentsViewAndroid...I think. I'll try to fix this tomorrow. Thanks!

Comment 5 by boliu@chromium.org, Nov 16 2017

Cc: fsam...@chromium.org boliu@chromium.org
 Issue 785708  has been merged into this issue.
fsamuel@, do you think this can be fixed by today? If not, I think we need to revert your changes.
Project Member

Comment 8 by bugdroid1@chromium.org, Nov 17 2017

The following revision refers to this bug:
  https://chromium.googlesource.com/chromium/src.git/+/64d7ccec1afeaa0c4d11d1db5b74770440398ccf

commit 64d7ccec1afeaa0c4d11d1db5b74770440398ccf
Author: Fady Samuel <fsamuel@chromium.org>
Date: Fri Nov 17 02:27:41 2017

Surface synchronization: Report correct DSF to Viz in android_webview

SurfacesInstance's CompositorFrame always reported a device scale factor
of 1. When surface scaling was moved to SurfaceAggregator, viz started
scaling surfaces relative to their parent. The renderer's CompositorFrame
correctly reported a DSF of 2. However, as the top level CF reported
a DSF of 1, SurfaceAggregator scaled the renderer down. This CL fixes
the problem by making surface the top level CompositorFrame reports
the right device scale factor.

Bug:  785596 ,  672962 
Change-Id: Ife0668ae3f7c531265119d2b37954918504444ae
Reviewed-on: https://chromium-review.googlesource.com/776078
Commit-Queue: Fady Samuel <fsamuel@chromium.org>
Reviewed-by: Bo <boliu@chromium.org>
Cr-Commit-Position: refs/heads/master@{#517253}
[modify] https://crrev.com/64d7ccec1afeaa0c4d11d1db5b74770440398ccf/android_webview/browser/hardware_renderer.cc
[modify] https://crrev.com/64d7ccec1afeaa0c4d11d1db5b74770440398ccf/android_webview/browser/surfaces_instance.cc
[modify] https://crrev.com/64d7ccec1afeaa0c4d11d1db5b74770440398ccf/android_webview/browser/surfaces_instance.h

Comment 9 by fsamuel@google.com, Nov 17 2017

Status: Started (was: Untriaged)

Comment 10 by fsamuel@google.com, Nov 17 2017

Status: Fixed (was: Started)
This should be fixed now.
Project Member

Comment 11 by bugdroid1@chromium.org, Nov 17 2017

Labels: merge-merged-3271
The following revision refers to this bug:
  https://chromium.googlesource.com/chromium/src.git/+/267a787d9029e32d37359eb67905f6e327bb97f2

commit 267a787d9029e32d37359eb67905f6e327bb97f2
Author: Fady Samuel <fsamuel@chromium.org>
Date: Fri Nov 17 19:57:58 2017

Surface synchronization: Report correct DSF to Viz in android_webview

SurfacesInstance's CompositorFrame always reported a device scale factor
of 1. When surface scaling was moved to SurfaceAggregator, viz started
scaling surfaces relative to their parent. The renderer's CompositorFrame
correctly reported a DSF of 2. However, as the top level CF reported
a DSF of 1, SurfaceAggregator scaled the renderer down. This CL fixes
the problem by making surface the top level CompositorFrame reports
the right device scale factor.

TBR=fsamuel@chromium.org

(cherry picked from commit 64d7ccec1afeaa0c4d11d1db5b74770440398ccf)

Bug:  785596 ,  672962 
Change-Id: Ife0668ae3f7c531265119d2b37954918504444ae
Reviewed-on: https://chromium-review.googlesource.com/776078
Commit-Queue: Fady Samuel <fsamuel@chromium.org>
Reviewed-by: Bo <boliu@chromium.org>
Cr-Original-Commit-Position: refs/heads/master@{#517253}
Reviewed-on: https://chromium-review.googlesource.com/777679
Reviewed-by: Fady Samuel <fsamuel@chromium.org>
Cr-Commit-Position: refs/branch-heads/3271@{#3}
Cr-Branched-From: 71f07f2c6c77c9e67158a193516e2f0c6229ce64-refs/heads/master@{#517250}
[modify] https://crrev.com/267a787d9029e32d37359eb67905f6e327bb97f2/android_webview/browser/hardware_renderer.cc
[modify] https://crrev.com/267a787d9029e32d37359eb67905f6e327bb97f2/android_webview/browser/surfaces_instance.cc
[modify] https://crrev.com/267a787d9029e32d37359eb67905f6e327bb97f2/android_webview/browser/surfaces_instance.h

Comment 12 by torne@chromium.org, Nov 20 2017

Issue 787013 has been merged into this issue.
Status: Verified (was: Fixed)
battun@ verified this on pixel XL /OPM1.171019.013 with latest webview version M64:64.0.3281.0.

Thanks!

Sign in to add a comment