Chromium Code Reviews
chromiumcodereview-hr@appspot.gserviceaccount.com (chromiumcodereview-hr) | Please choose your nickname with Settings | Help | Chromium Project | Gerrit Changes | Sign out
(32)

Issue 2734043003: Fix Android tab navigation "stretch" regression. (Closed)

Created:
3 years, 9 months ago by miu
Modified:
3 years, 9 months ago
CC:
chromium-reviews, darin-cc_chromium.org, jam, Jinsuk Kim, nona+watch_chromium.org, shuchen+watch_chromium.org, James Su, yusukes+watch_chromium.org
Target Ref:
refs/pending/heads/master
Project:
chromium
Visibility:
Public.

Description

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} Committed: https://chromium.googlesource.com/chromium/src/+/caa6a6165d28c3bb499fc0aec9bf391c6bda1578

Patch Set 1 #

Total comments: 6

Patch Set 2 : Addressed aelias's comments: Simplified some Java→JNI→C++ plumbing. #

Total comments: 8

Patch Set 3 : Added some code comments, per review comments. #

Patch Set 4 : REBASE #

Messages

Total messages: 28 (15 generated)
miu
aelias: OWNERS RS please. yusufo: PTAL.
3 years, 9 months ago (2017-03-07 04:09:36 UTC) #5
Yusuf
miu@, although I occasionally need to modify the content/browser/renderer_host/ code for prerender and such (hence ...
3 years, 9 months ago (2017-03-07 18:55:28 UTC) #6
miu
On 2017/03/07 18:55:28, Yusuf wrote: > miu@, although I occasionally need to modify the content/browser/renderer_host/ ...
3 years, 9 months ago (2017-03-07 20:28:33 UTC) #7
aelias_OOO_until_Jul13
https://codereview.chromium.org/2734043003/diff/60001/content/browser/renderer_host/render_widget_host_view_android.cc File content/browser/renderer_host/render_widget_host_view_android.cc (right): https://codereview.chromium.org/2734043003/diff/60001/content/browser/renderer_host/render_widget_host_view_android.cc#newcode542 content/browser/renderer_host/render_widget_host_view_android.cc:542: gfx::Rect src_subrect_in_pixel, It looks like this is always called ...
3 years, 9 months ago (2017-03-07 21:08:01 UTC) #8
miu
https://codereview.chromium.org/2734043003/diff/60001/content/browser/renderer_host/render_widget_host_view_android.cc File content/browser/renderer_host/render_widget_host_view_android.cc (right): https://codereview.chromium.org/2734043003/diff/60001/content/browser/renderer_host/render_widget_host_view_android.cc#newcode542 content/browser/renderer_host/render_widget_host_view_android.cc:542: gfx::Rect src_subrect_in_pixel, On 2017/03/07 21:08:01, aelias wrote: > It ...
3 years, 9 months ago (2017-03-08 01:42:04 UTC) #11
miu
tedchoc: Need OWNERS approval for: chrome/android/.../ChromeActivity.java content/browser/web_contents/web_contents_android.*
3 years, 9 months ago (2017-03-08 01:43:10 UTC) #13
aelias_OOO_until_Jul13
renderer_host/ lgtm https://codereview.chromium.org/2734043003/diff/80001/chrome/android/java/src/org/chromium/chrome/browser/customtabs/CustomTabObserver.java File chrome/android/java/src/org/chromium/chrome/browser/customtabs/CustomTabObserver.java (right): https://codereview.chromium.org/2734043003/diff/80001/chrome/android/java/src/org/chromium/chrome/browser/customtabs/CustomTabObserver.java#newcode67 chrome/android/java/src/org/chromium/chrome/browser/customtabs/CustomTabObserver.java:67: Math.min(desiredWidth / bounds.width(), desiredHeight / bounds.height()); Yusuf ...
3 years, 9 months ago (2017-03-08 02:22:03 UTC) #16
Ted C
lgtm https://codereview.chromium.org/2734043003/diff/80001/chrome/android/java/src/org/chromium/chrome/browser/ChromeActivity.java File chrome/android/java/src/org/chromium/chrome/browser/ChromeActivity.java (left): https://codereview.chromium.org/2734043003/diff/80001/chrome/android/java/src/org/chromium/chrome/browser/ChromeActivity.java#oldcode1267 chrome/android/java/src/org/chromium/chrome/browser/ChromeActivity.java:1267: webContents.getContentBitmapAsync(Bitmap.Config.ARGB_8888, 1.f, EMPTY_RECT, callback); Can you remove EMPTY_RECT ...
3 years, 9 months ago (2017-03-08 18:59:27 UTC) #19
Yusuf
https://codereview.chromium.org/2734043003/diff/80001/chrome/android/java/src/org/chromium/chrome/browser/customtabs/CustomTabObserver.java File chrome/android/java/src/org/chromium/chrome/browser/customtabs/CustomTabObserver.java (right): https://codereview.chromium.org/2734043003/diff/80001/chrome/android/java/src/org/chromium/chrome/browser/customtabs/CustomTabObserver.java#newcode67 chrome/android/java/src/org/chromium/chrome/browser/customtabs/CustomTabObserver.java:67: Math.min(desiredWidth / bounds.width(), desiredHeight / bounds.height()); On 2017/03/08 02:22:03, ...
3 years, 9 months ago (2017-03-08 19:08:21 UTC) #20
miu
yusufo: PTAL at my response regarding the "desired width/height" code in CustomTabObserver.java. LGTY? https://codereview.chromium.org/2734043003/diff/80001/chrome/android/java/src/org/chromium/chrome/browser/ChromeActivity.java File ...
3 years, 9 months ago (2017-03-08 21:01:39 UTC) #21
Yusuf
https://codereview.chromium.org/2734043003/diff/80001/chrome/android/java/src/org/chromium/chrome/browser/customtabs/CustomTabObserver.java File chrome/android/java/src/org/chromium/chrome/browser/customtabs/CustomTabObserver.java (right): https://codereview.chromium.org/2734043003/diff/80001/chrome/android/java/src/org/chromium/chrome/browser/customtabs/CustomTabObserver.java#newcode67 chrome/android/java/src/org/chromium/chrome/browser/customtabs/CustomTabObserver.java:67: Math.min(desiredWidth / bounds.width(), desiredHeight / bounds.height()); On 2017/03/08 21:01:39, ...
3 years, 9 months ago (2017-03-08 21:17:25 UTC) #22
commit-bot: I haz the power
CQ is trying da patch. Follow status at https://chromium-cq-status.appspot.com/v2/patch-status/codereview.chromium.org/2734043003/120001
3 years, 9 months ago (2017-03-08 22:43:31 UTC) #25
commit-bot: I haz the power
3 years, 9 months ago (2017-03-08 23:36:54 UTC) #28
Message was sent while issue was closed.
Committed patchset #4 (id:120001) as
https://chromium.googlesource.com/chromium/src/+/caa6a6165d28c3bb499fc0aec9bf...

Powered by Google App Engine
This is Rietveld 408576698