未验证 提交 bf779661 编写于 作者: C Chris Bracken 提交者: GitHub

Revert "Reuse texture cache in ios_external_texture_gl. (#9806)" (#11522)

Broke iOS builds:

    ../../flutter/shell/platform/darwin/ios/ios_external_texture_gl.mm:56:28: error: out-of-line definition of 'NeedUpdateTexture' does not match any declaration in 'flutter::IOSExternalTextureGL'
    bool IOSExternalTextureGL::NeedUpdateTexture(bool freeze) {
                           ^~~~~~~~~~~~~~~~~

This reverts commit 94b31749.
上级 94b31749
......@@ -31,7 +31,6 @@ class IOSExternalTextureGL : public flutter::Texture {
void EnsureTextureCacheExists();
bool new_frame_ready_ = false;
NSObject<FlutterTexture>* external_texture_;
fml::CFRef<CVOpenGLESTextureCacheRef> cache_ref_;
fml::CFRef<CVOpenGLESTextureRef> texture_ref_;
......
......@@ -53,24 +53,17 @@ void IOSExternalTextureGL::CreateTextureFromPixelBuffer() {
}
}
bool IOSExternalTextureGL::NeedUpdateTexture(bool freeze) {
// Update texture if `texture_ref_` is reset to `nullptr` when GrContext
// is destroied or new frame is ready.
return (!freeze && new_frame_ready_) || !texture_ref_;
}
void IOSExternalTextureGL::Paint(SkCanvas& canvas,
const SkRect& bounds,
bool freeze,
GrContext* context) {
EnsureTextureCacheExists();
if (NeedUpdateTexture(freeze)) {
if (!freeze) {
auto pixelBuffer = [external_texture_ copyPixelBuffer];
if (pixelBuffer) {
buffer_ref_.Reset(pixelBuffer);
}
CreateTextureFromPixelBuffer();
new_frame_ready_ = false;
}
if (!texture_ref_) {
return;
......@@ -100,8 +93,6 @@ void IOSExternalTextureGL::OnGrContextDestroyed() {
cache_ref_.Reset(nullptr);
}
void IOSExternalTextureGL::MarkNewFrameAvailable() {
new_frame_ready_ = true;
}
void IOSExternalTextureGL::MarkNewFrameAvailable() {}
} // namespace flutter
Markdown is supported
0% .
You are about to add 0 people to the discussion. Proceed with caution.
先完成此消息的编辑!
想要评论请 注册