Skip to content
This repository was archived by the owner on Feb 25, 2025. It is now read-only.

Keep overlays_gr_context_ in sync with the overlay surface#8175

Merged
iskakaushik merged 1 commit intoflutter:masterfrom
iskakaushik:issue/28920
Mar 15, 2019
Merged

Keep overlays_gr_context_ in sync with the overlay surface#8175
iskakaushik merged 1 commit intoflutter:masterfrom
iskakaushik:issue/28920

Conversation

@iskakaushik
Copy link
Contributor

@iskakaushik iskakaushik commented Mar 15, 2019

When we come back from the background, and have no platform view in the layer tree, composition_order_ will be empty. This would result in EnsureGLOverlayInitialized getting called, but overlays_gr_context_ is falsely updated to the current gr_context, which puts us in a state where we will not update overlays_gr_context_ the next time we call EnsureGLOverlayInitialized with non empty composition_order_.

This manifests as flutter/flutter#28920

There can be cases where SubmitFrame gets called
before overlays are a part of the frame, in these
cases, we should not update the GRContext ahead of time.

This commit makes it so we will update it only when
the frame really shows the overlay.

This addresses: flutter/flutter#28920
@iskakaushik iskakaushik requested a review from amirh March 15, 2019 02:05
Copy link
Contributor

@amirh amirh left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

LGTM

Nice fix!

Per offline discussion let's update the PR description before landing.

@iskakaushik iskakaushik changed the title Update overlays_gr_context_ correctly Keep overlays_gr_context_ in sync with the overlay surface Mar 15, 2019
@iskakaushik iskakaushik merged commit cad97fe into flutter:master Mar 15, 2019
@iskakaushik iskakaushik deleted the issue/28920 branch March 15, 2019 15:35
engine-flutter-autoroll added a commit to engine-flutter-autoroll/flutter that referenced this pull request Mar 15, 2019
engine-flutter-autoroll added a commit to flutter/flutter that referenced this pull request Mar 15, 2019
flutter/engine@b36068c...cad97fe

git log b36068c..cad97fe --no-merges --oneline
cad97fe Update overlays_gr_context_ correctly (flutter/engine#8175)
c0690e6 Roll src/third_party/skia aefecad7c0d2..69600007e278 (2 commits) (flutter/engine#8177)

The AutoRoll server is located here: https://autoroll.skia.org/r/flutter-engine-flutter-autoroll

Documentation for the AutoRoller is here:
https://skia.googlesource.com/buildbot/+/master/autoroll/README.md

If the roll is causing failures, please contact the current sheriff ([email protected]), and stop
the roller if necessary.
iskakaushik added a commit that referenced this pull request Mar 19, 2019
Layout occurs after [CATransaction commit]. layoutSubviews was where we set the contentsScale on the CALayer. This meant that for one frame, we would see content on the overlay view which was did not have the correct content scale.

This change makes it so that we initialize the FlutterOverlayView with the correct contentsScale.

This also updates the overlay_gr_context_ when we first create the overlay_view. This is an artifact of #8175.

This manifests as jank as seen in: flutter/flutter#29573
RBogie pushed a commit to RBogie/flutter-engine that referenced this pull request Apr 8, 2019
There can be cases where SubmitFrame gets called
before overlays are a part of the frame, in these
cases, we should not update the GRContext ahead of time.

This commit makes it so we will update it only when
the frame really shows the overlay.

This addresses: flutter/flutter#28920
RBogie pushed a commit to RBogie/flutter-engine that referenced this pull request Apr 8, 2019
Layout occurs after [CATransaction commit]. layoutSubviews was where we set the contentsScale on the CALayer. This meant that for one frame, we would see content on the overlay view which was did not have the correct content scale.

This change makes it so that we initialize the FlutterOverlayView with the correct contentsScale.

This also updates the overlay_gr_context_ when we first create the overlay_view. This is an artifact of flutter#8175.

This manifests as jank as seen in: flutter/flutter#29573
RBogie added a commit to RBogie/flutter-engine that referenced this pull request Apr 8, 2019
RBogie added a commit to RBogie/flutter-engine that referenced this pull request Apr 8, 2019
Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.

Labels

Projects

None yet

Development

Successfully merging this pull request may close these issues.

3 participants