Skip to content

Commit

Permalink
Revert "Partial Fix to Android Omnibox scrolling revealing other cont…
Browse files Browse the repository at this point in the history
…ent"

This reverts commit 935a93c.

Reason for revert: Test revert to bisect regression

Original change's description:
> Partial Fix to Android Omnibox scrolling revealing other content
> 
> ChromeFullscreenManager::updateViewportSize calculates the changes in control
> offsets, and determines when to toggle the resizing of the renderer's view.
> 
> Currently all viewport updates are blocked while a gesture or scrolling is
> occurring.
> 
> This change updates the method to also perform the update if we've changed the
> resize state. Allowing the renderer to resize to account for the larger region
> when scrolling the controls away.
> 
> While this prevents showing older content, it only does so for normal speed
> scrolls. A quick flick can lead to such a rapid change in viewport, that we
> still have some frames of old content.
> 
> Bug: 916144
> Change-Id: Ibbf8d6daa89691945e011022f9509fea4783cfe2
> Reviewed-on: https://chromium-review.googlesource.com/c/1387945
> Reviewed-by: agrieve <agrieve@chromium.org>
> Reviewed-by: Matthew Jones <mdjones@chromium.org>
> Commit-Queue: Jonathan Ross <jonross@chromium.org>
> Cr-Commit-Position: refs/heads/master@{#623741}

TBR=jonross@chromium.org,agrieve@chromium.org,mdjones@chromium.org

# Not skipping CQ checks because original CL landed > 1 day ago.

Bug: 916144
Change-Id: I9c7df1d8e7d298db3bda532806a85cedbb22890f
Reviewed-on: https://chromium-review.googlesource.com/c/1491139
Reviewed-by: Eric Karl <ericrk@chromium.org>
Reviewed-by: Jonathan Ross <jonross@chromium.org>
Commit-Queue: Jonathan Ross <jonross@chromium.org>
Cr-Commit-Position: refs/heads/master@{#636017}
  • Loading branch information
Eric Karl authored and Commit Bot committed Feb 27, 2019
1 parent fb6a298 commit 0ab0a8b
Showing 1 changed file with 6 additions and 28 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -464,39 +464,17 @@ public void removeListener(FullscreenListener listener) {
* Updates viewport size to have it render the content correctly.
*/
public void updateViewportSize() {
if (mInGesture || mContentViewScrolling) return;

// Update content viewport size only when the browser controls are not animating.
int topContentOffset = (int) mRendererTopContentOffset;
int topControlOffset = Math.max(mRendererTopControlOffset, -getTopControlsHeight());
int bottomControlOffset = (int) mRendererBottomControlOffset;

// Controls resize the view only when they are being displayed at their
// maximum. Otherwise when the viewport is small, we can show unrelated
// graphical textures while scrolling the controls away.
// For top controls this is when the offset matches the height.
// For bottom controls this is the inverse, an offset of 0 means fully
// displayed. When there are no bottom controls, their height is 0.
boolean controlsResizeView = topControlOffset == 0 && bottomControlOffset == 0;

// Do not update the size during a gesture or scroll. Unless there has
// been a change in how a view resizes for controls, due to the viewport
// growing in size. When growing the viewport, it must be done
// immediately, otheriwse we render old textures in the expanded region.
// When shrinking the viewport, we can wait for the user input to finish
// before adjusting.
if (mControlsResizeView == controlsResizeView) {
if (mInGesture || mContentViewScrolling) return;
if ((topContentOffset != 0 && topContentOffset != getTopControlsHeight())
&& bottomControlOffset != 0
&& bottomControlOffset != getBottomControlsHeight()) {
return;
}
} else if ((mInGesture || mContentViewScrolling)
&& topContentOffset == getTopControlsHeight()) {
// When shrinking the viewport, we can wait for the user input to finish
// before adjusting.
if ((topContentOffset != 0 && topContentOffset != getTopControlsHeight())
&& bottomControlOffset != 0 && bottomControlOffset != getBottomControlsHeight()) {
return;
}

boolean controlsResizeView =
topContentOffset > 0 || bottomControlOffset < getBottomControlsHeight();
mControlsResizeView = controlsResizeView;
for (FullscreenListener listener : mListeners) listener.onUpdateViewportSize();
}
Expand Down

0 comments on commit 0ab0a8b

Please sign in to comment.