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

[ios] Set contentsScale before we commit CATransaction #8218

Merged
merged 5 commits into from
Mar 19, 2019

Conversation

iskakaushik
Copy link
Contributor

@iskakaushik iskakaushik commented 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

@iskakaushik iskakaushik changed the title [WIP] fix the issue with contentsScale on FlutterOverlayView [ios] Set contentsScale before we commit CATransaction Mar 19, 2019
@@ -23,6 +23,7 @@
- (instancetype)initWithCoder:(NSCoder*)aDecoder NS_UNAVAILABLE;

- (instancetype)init NS_DESIGNATED_INITIALIZER;
- (instancetype)initForGLWithContentsScale:(CGFloat)contentsScale;
Copy link
Member

Choose a reason for hiding this comment

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

Just say initWithContentsScale and check the layer class in the implementation before setting the content and rasterization scales.

return self;
}

- (void)layoutSubviews {
Copy link
Contributor Author

Choose a reason for hiding this comment

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

@chinmaygarde do I still need to override this method?

Copy link
Contributor Author

Choose a reason for hiding this comment

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

i guess not

@@ -286,6 +287,7 @@
std::unique_ptr<Surface> surface = ios_surface->CreateSecondaryGPUSurface(gr_context);
overlays_[overlay_id] = std::make_unique<FlutterPlatformViewLayer>(
fml::scoped_nsobject<UIView>(overlay_view), std::move(ios_surface), std::move(surface));
overlays_gr_context_ = gr_context;
Copy link
Contributor

Choose a reason for hiding this comment

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

mention this in the PR description

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

@iskakaushik iskakaushik merged commit a1dcb2e into flutter:master Mar 19, 2019
@iskakaushik iskakaushik deleted the issue-29573 branch March 19, 2019 23:36
engine-flutter-autoroll added a commit to engine-flutter-autoroll/flutter that referenced this pull request Mar 20, 2019
engine-flutter-autoroll added a commit to flutter/flutter that referenced this pull request Mar 20, 2019
flutter/engine@96ad0c8...a1dcb2e

git log 96ad0c8..a1dcb2e --no-merges --oneline
a1dcb2e [ios] Set contentsScale before we commit CATransaction (flutter/engine#8218)
fa1931f Send macOS keyboard data to the engine (flutter/engine#8219)
45f69ac Plumb a reference of PlatformViewsController and AccessibilityBridge to each other (flutter/engine#8208)
7cbbdb4 libtxt: more accurate tracking of run positioning and width for justified text (flutter/engine#8214)
1728103 Add a build dependencies script for Linux desktop (flutter/engine#8160)
d764b69 Add docs for helpful commands to fix format (flutter/engine#8171)

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.
engine-flutter-autoroll added a commit to engine-flutter-autoroll/flutter that referenced this pull request Mar 20, 2019
engine-flutter-autoroll added a commit to engine-flutter-autoroll/flutter that referenced this pull request Mar 20, 2019
engine-flutter-autoroll added a commit to flutter/flutter that referenced this pull request Mar 20, 2019
flutter/engine@96ad0c8...6a8a45f

git log 96ad0c8..6a8a45f --no-merges --oneline
6a8a45f Have the AccessibilityBridge attach/detach itself to the (flutter/engine#8229)
45b19e4 Roll src/third_party/skia ba91f65f2070..7e2c0614a2fd (13 commits) (flutter/engine#8228)
1dbd204 Moved io.flutter.embedding.engine.android package to io.flutter.embedding.android (flutter/engine#8221)
bb35436 Roll src/third_party/dart 70e3e67dd7..5e9df35a57 (45 commits)
3b19a4d Removed dart_plugin_tag from DEPS
d9b6629 Roll src/third_party/skia 4273a150f84d..ba91f65f2070 (6 commits) (flutter/engine#8225)
e88573a Roll src/third_party/skia d7d93001ead2..4273a150f84d (1 commits) (flutter/engine#8224)
be9067c Roll src/third_party/skia 37a9294d2eb9..d7d93001ead2 (2 commits) (flutter/engine#8223)
ee4abba Roll src/third_party/skia 2894d13a0d9b..37a9294d2eb9 (1 commits) (flutter/engine#8222)
3496156 Roll src/third_party/skia dd0544078d05..2894d13a0d9b (33 commits) (flutter/engine#8220)
a1dcb2e [ios] Set contentsScale before we commit CATransaction (flutter/engine#8218)
fa1931f Send macOS keyboard data to the engine (flutter/engine#8219)
45f69ac Plumb a reference of PlatformViewsController and AccessibilityBridge to each other (flutter/engine#8208)
7cbbdb4 libtxt: more accurate tracking of run positioning and width for justified text (flutter/engine#8214)
1728103 Add a build dependencies script for Linux desktop (flutter/engine#8160)
d764b69 Add docs for helpful commands to fix format (flutter/engine#8171)

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.
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.

4 participants