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

Re-create texture from pixel buffer onGrContextCreate#8792

Merged
iskakaushik merged 3 commits into
flutter-team-archive:masterfrom
iskakaushik:vp-ws
Apr 30, 2019
Merged

Re-create texture from pixel buffer onGrContextCreate#8792
iskakaushik merged 3 commits into
flutter-team-archive:masterfrom
iskakaushik:vp-ws

Conversation

@iskakaushik

@iskakaushik iskakaushik commented Apr 30, 2019

Copy link
Copy Markdown
Contributor

OnGrContextDestroy we destroy the texture, this is because
we can not access it from the potentially new context that
we get on bringing the app back to foreground.

To show a valid texture on fg, we need to preserve the pixel
buffer, using which we will create the new texture.

Fixes flutter/flutter#30491

OnGrContextDestroy we destroy the texture, this is because
we can not access it from the potentially new context that
we get on bringing the app back to foreground.

To show a valid texture on fg, we need to preserve the pixel
buffer, using which we will create the new texture.

void MarkNewFrameAvailable() override;

void CreateTextureFromPixelBuffer();

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

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

This doesn't need to be public.

}
CVOpenGLESTextureRef texture;
CVReturn err = CVOpenGLESTextureCacheCreateTextureFromImage(
kCFAllocatorDefault, cache_ref_, buffer_ref_, nullptr, GL_TEXTURE_2D, GL_RGBA,

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

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

I don't understand where this cache is being recreated. I thought it was collected in IOSExternalTextureGL::OnGrContextDestroyed.

Copy link
Copy Markdown
Contributor Author

Choose a reason for hiding this comment

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

Ah, I did not recreate the texture cache. It would still get created on the next frame, but not ideal. Will fix it.

@iskakaushik iskakaushik merged commit 1219e5c into flutter-team-archive:master Apr 30, 2019
@iskakaushik iskakaushik deleted the vp-ws branch April 30, 2019 22:25
engine-flutter-autoroll added a commit to flutter/flutter that referenced this pull request May 1, 2019
flutter-team-archive/engine@f2d2179...2f11d3c

git log f2d2179..2f11d3c --no-merges --oneline
2f11d3c Roll src/third_party/skia f808c5e3afa3..e6a83e160860 (3 commits) (flutter-team-archive/engine#8795)
1219e5c Re-create texture from pixel buffer onGrContextCreate (flutter-team-archive/engine#8792)

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 (bmparr@google.com), and stop
the roller if necessary.
Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.

Labels

Development

Successfully merging this pull request may close these issues.

fix paused video player lose the last image when the engine goes into inactive in iOS

3 participants