This repository was archived by the owner on Feb 25, 2025. It is now read-only.
Guarding EAGLContext used by Flutter#13314
Merged
cyanglaz merged 41 commits intoflutter:masterfrom Nov 8, 2019
Merged
Conversation
added 10 commits
August 27, 2019 15:30
cyanglaz
commented
Oct 30, 2019
Contributor
Author
cyanglaz
left a comment
There was a problem hiding this comment.
Updated with @chinmaygarde's suggestions.
| #ifndef FLUTTER_SHELL_COMMON_GL_CONTEXT_SWITCH_MANAGER_H_ | ||
| #define FLUTTER_SHELL_COMMON_GL_CONTEXT_SWITCH_MANAGER_H_ | ||
|
|
||
| #include <map> |
| // Should be subclassed for platforms that uses GL and requires context | ||
| // switching. Always use `MakeCurrent` and `ResourceMakeCurrent` in the | ||
| // `GLContextSwitchManager` to set gl contexts. | ||
| class GLContextSwitchManager { |
Contributor
Author
There was a problem hiding this comment.
done with the doxygen
| public: | ||
| class IOSGLContextSwitch final : public GLContextSwitch { | ||
| public: | ||
| IOSGLContextSwitch(IOSGLContextSwitchManager& manager, |
|
Excited about this update guys! |
chinmaygarde
approved these changes
Nov 7, 2019
engine-flutter-autoroll
added a commit
to engine-flutter-autoroll/flutter
that referenced
this pull request
Nov 8, 2019
…vent plugins from polluting Flutter's EAGLContext (flutter/engine#13314)
cyanglaz
pushed a commit
that referenced
this pull request
Nov 8, 2019
engine-flutter-autoroll
added a commit
to engine-flutter-autoroll/flutter
that referenced
this pull request
Nov 8, 2019
…vent plugins from polluting Flutter's EAGLContext (flutter/engine#13314)
engine-flutter-autoroll
added a commit
to engine-flutter-autoroll/flutter
that referenced
this pull request
Nov 8, 2019
…vent plugins from polluting Flutter's EAGLContext (flutter/engine#13314)
cyanglaz
pushed a commit
that referenced
this pull request
Nov 8, 2019
cyanglaz
pushed a commit
that referenced
this pull request
Nov 8, 2019
engine-flutter-autoroll
added a commit
to engine-flutter-autoroll/flutter
that referenced
this pull request
Nov 9, 2019
…vent plugins from polluting Flutter's EAGLContext (flutter/engine#13314)
engine-flutter-autoroll
added a commit
to flutter/flutter
that referenced
this pull request
Nov 9, 2019
[email protected]:flutter/engine.git/compare/5f5713e33971...af04338 git log 5f5713e..af04338 --no-merges --oneline 2019-11-08 [email protected] Manual roll of Dart e68ca9b652acdb642668a6acb5f630d5be6c03da...fa4379946109467c8a48f20f19d83d7c72968a3e (flutter/engine#13756) 2019-11-08 [email protected] Revert "Reland "Guarding EAGLContext used by Flutter #13314" (#13755)" (flutter/engine#13757) 2019-11-08 [email protected] [web] Support gif/webp animations, Speed up image drawing in BitmapCanvas. (flutter/engine#13748) 2019-11-08 [email protected] Reland "Guarding EAGLContext used by Flutter #13314" (flutter/engine#13755) 2019-11-08 [email protected] Move TextRange from the framework to dart:ui. (flutter/engine#13747) 2019-11-08 [email protected] Roll src/third_party/skia 8c1e265f6f81..c88d1774ed50 (7 commits) (flutter/engine#13754) 2019-11-08 [email protected] Revert "Always use `IOSGLContextSwitch` to access EAGLContexts to prevent plugins from polluting Flutter's EAGLContext (#13314)" (flutter/engine#13753) 2019-11-08 [email protected] Always use `IOSGLContextSwitch` to access EAGLContexts to prevent plugins from polluting Flutter's EAGLContext (flutter/engine#13314) If this roll has caused a breakage, revert this CL and stop the roller using the controls here: https://autoroll.skia.org/r/flutter-engine-flutter-autoroll Please CC [email protected] on the revert to ensure that a human is aware of the problem. To report a problem with the AutoRoller itself, please file a bug: https://bugs.chromium.org/p/skia/issues/entry?template=Autoroller+Bug Documentation for the AutoRoller is here: https://skia.googlesource.com/buildbot/+/master/autoroll/README.md
cyanglaz
pushed a commit
that referenced
this pull request
Nov 9, 2019
cyanglaz
pushed a commit
that referenced
this pull request
Nov 11, 2019
cyanglaz
pushed a commit
that referenced
this pull request
Nov 12, 2019
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to subscribe to this conversation on GitHub.
Already have an account?
Sign in.
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
issue related flutter/flutter#41620
Code
GLContextSwitchAn interface should be subclassed to switch flutter's gl context to current context on construction and switch back the previous context to current on destruction.
IOSGLContextSwitchThe iOS implementation of
GLContextSwitch.GLContextSwitchManagerManages the
GLContextSwitch, exposes 2 APIs that should be overridden by the platform:MakeCurrent,MakeResourceCurrentIOSGLContextSwitchManagerThe iOS implementation of
GLContextSwitchManager. It creates a NSMutableArray as a stack to manage the EAGLContexts.On
MakeCurrentandMakeResourceCurrent, it pushes the current EAGLContext to the stack, then creates aIOSGLContextSwitchand set the current context to the respective flutter context.When
IOSGLContextSwitchgoes out of the scope, the previous context is restored from the stack and set to current.GLContextSwitchPureResultIn certain cases, when we call MakeCurrent method in
ios_context_glorios_render_target_gl, if certain condition wasn't met, we don't set the context and returns afalsedirectly. I added this class to accommodate this situation without further refactoring to prevent too much of refactoring during this work.Both android and embedder use
GLContextSwitchPureResultto avoid changes to the current behavior while complying to the new interface.Test
Add a scenario app integration test that makes sure the
[EAGLContext currentContext]by a Platform View is not the context used by Flutter.