RenderWidgetHostViewAndroid::SynchronousCopyContents() does not respect origin of source rect |
|||||
Issue descriptionThe implementation of the method takes a Rect argument that may not necessarily specify (0,0) as its origin. However, the rest of the method treats it as such, ignoring its origin.
,
Mar 7 2017
Sorry I don't work on Chrome anymore.
,
Mar 7 2017
Assigning to RWHVAndroid owner for further triage/assignment.
,
Mar 8 2017
The following revision refers to this bug: https://chromium.googlesource.com/chromium/src.git/+/caa6a6165d28c3bb499fc0aec9bf391c6bda1578 commit caa6a6165d28c3bb499fc0aec9bf391c6bda1578 Author: miu <miu@chromium.org> Date: Wed Mar 08 23:36:06 2017 Fix Android tab navigation "stretch" regression. Fixes a regression in the tab-switching UI caused by https://codereview.chromium.org/2702093002. The root cause was my misunderstanding of the difference between RenderWidgtHostViewAndroid's |current_frame_size_| and the "view size" value returned by ContentViewCoreImpl. Note: While this change fixes the regression, there still seems to be a small (~2 pixel) width-stretching problem (barely noticeable). However, I confirmed that behavior is the same on current Clank stable; so, this isn't related to the bug at-hand. Something to look into later... This change revisits all code paths leading to CopyFromSurface() on Android, and fixes a few other pre-existing issues: 1. RWHVAndroid::GetScaledContentBitmap(), was substituting |current_surface_size_| instead of ContentViewCore::GetViewSize() when the source rect argument is empty. This is actually the same bug that I fixed above to resolve the regression. ;-) 2. RWHVAndroid::SynchronousCopyContents() does not copy the correct source region if the rect's origin is not at the point (0,0). 3. The plumbing from CustomTabObserver (Java code) into the eventual RWHVA::CopyFromSurface() was simplified. BUG=698157, 698974 TEST=Manually tested on Nexus 6, per bug repro steps. Review-Url: https://codereview.chromium.org/2734043003 Cr-Commit-Position: refs/heads/master@{#455595} [modify] https://crrev.com/caa6a6165d28c3bb499fc0aec9bf391c6bda1578/chrome/android/java/src/org/chromium/chrome/browser/ChromeActivity.java [modify] https://crrev.com/caa6a6165d28c3bb499fc0aec9bf391c6bda1578/chrome/android/java/src/org/chromium/chrome/browser/customtabs/CustomTabObserver.java [modify] https://crrev.com/caa6a6165d28c3bb499fc0aec9bf391c6bda1578/content/browser/renderer_host/render_widget_host_view_android.cc [modify] https://crrev.com/caa6a6165d28c3bb499fc0aec9bf391c6bda1578/content/browser/renderer_host/render_widget_host_view_android.h [modify] https://crrev.com/caa6a6165d28c3bb499fc0aec9bf391c6bda1578/content/browser/web_contents/web_contents_android.cc [modify] https://crrev.com/caa6a6165d28c3bb499fc0aec9bf391c6bda1578/content/browser/web_contents/web_contents_android.h [modify] https://crrev.com/caa6a6165d28c3bb499fc0aec9bf391c6bda1578/content/public/android/java/src/org/chromium/content/browser/webcontents/WebContentsImpl.java [modify] https://crrev.com/caa6a6165d28c3bb499fc0aec9bf391c6bda1578/content/public/android/java/src/org/chromium/content_public/browser/WebContents.java
,
Mar 10 2017
The following revision refers to this bug: https://chromium.googlesource.com/chromium/src.git/+/ad1ad1825e9b3190cbc399ab868f25eb3f50997f commit ad1ad1825e9b3190cbc399ab868f25eb3f50997f Author: Yuri Wiitala <miu@chromium.org> Date: Fri Mar 10 23:45:08 2017 Fix Android tab navigation "stretch" regression. Fixes a regression in the tab-switching UI caused by https://codereview.chromium.org/2702093002. The root cause was my misunderstanding of the difference between RenderWidgtHostViewAndroid's |current_frame_size_| and the "view size" value returned by ContentViewCoreImpl. Note: While this change fixes the regression, there still seems to be a small (~2 pixel) width-stretching problem (barely noticeable). However, I confirmed that behavior is the same on current Clank stable; so, this isn't related to the bug at-hand. Something to look into later... This change revisits all code paths leading to CopyFromSurface() on Android, and fixes a few other pre-existing issues: 1. RWHVAndroid::GetScaledContentBitmap(), was substituting |current_surface_size_| instead of ContentViewCore::GetViewSize() when the source rect argument is empty. This is actually the same bug that I fixed above to resolve the regression. ;-) 2. RWHVAndroid::SynchronousCopyContents() does not copy the correct source region if the rect's origin is not at the point (0,0). 3. The plumbing from CustomTabObserver (Java code) into the eventual RWHVA::CopyFromSurface() was simplified. BUG=698157, 698974 TEST=Manually tested on Nexus 6, per bug repro steps. Review-Url: https://codereview.chromium.org/2734043003 Cr-Commit-Position: refs/heads/master@{#455595} (cherry picked from commit caa6a6165d28c3bb499fc0aec9bf391c6bda1578) Review-Url: https://codereview.chromium.org/2741993004 . Cr-Commit-Position: refs/branch-heads/3029@{#127} Cr-Branched-From: 939b32ee5ba05c396eef3fd992822fcca9a2e262-refs/heads/master@{#454471} [modify] https://crrev.com/ad1ad1825e9b3190cbc399ab868f25eb3f50997f/chrome/android/java/src/org/chromium/chrome/browser/ChromeActivity.java [modify] https://crrev.com/ad1ad1825e9b3190cbc399ab868f25eb3f50997f/chrome/android/java/src/org/chromium/chrome/browser/customtabs/CustomTabObserver.java [modify] https://crrev.com/ad1ad1825e9b3190cbc399ab868f25eb3f50997f/content/browser/renderer_host/render_widget_host_view_android.cc [modify] https://crrev.com/ad1ad1825e9b3190cbc399ab868f25eb3f50997f/content/browser/renderer_host/render_widget_host_view_android.h [modify] https://crrev.com/ad1ad1825e9b3190cbc399ab868f25eb3f50997f/content/browser/web_contents/web_contents_android.cc [modify] https://crrev.com/ad1ad1825e9b3190cbc399ab868f25eb3f50997f/content/browser/web_contents/web_contents_android.h [modify] https://crrev.com/ad1ad1825e9b3190cbc399ab868f25eb3f50997f/content/public/android/java/src/org/chromium/content/browser/webcontents/WebContentsImpl.java [modify] https://crrev.com/ad1ad1825e9b3190cbc399ab868f25eb3f50997f/content/public/android/java/src/org/chromium/content_public/browser/WebContents.java
,
Aug 18 2017
The limitation is documented in a comment, and that's probably enough for now. If/when a use case arises for the positioned subrect readback, whoever works on that feature can add the capability. |
|||||
►
Sign in to add a comment |
|||||
Comment 1 by eustas@chromium.org
, Mar 7 2017Owner: mnaga...@chromium.org