From bf7796611dc1a1c5f16b5a27ae27b1061c4d49a8 Mon Sep 17 00:00:00 2001 From: Chris Bracken Date: Tue, 27 Aug 2019 09:39:48 -0700 Subject: [PATCH] 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 94b31749436e23bef0596f48bdf63e682670486c. --- shell/platform/darwin/ios/ios_external_texture_gl.h | 1 - .../platform/darwin/ios/ios_external_texture_gl.mm | 13 ++----------- 2 files changed, 2 insertions(+), 12 deletions(-) diff --git a/shell/platform/darwin/ios/ios_external_texture_gl.h b/shell/platform/darwin/ios/ios_external_texture_gl.h index e74caad2d9c66..923f7410632e8 100644 --- a/shell/platform/darwin/ios/ios_external_texture_gl.h +++ b/shell/platform/darwin/ios/ios_external_texture_gl.h @@ -31,7 +31,6 @@ class IOSExternalTextureGL : public flutter::Texture { void EnsureTextureCacheExists(); - bool new_frame_ready_ = false; NSObject* external_texture_; fml::CFRef cache_ref_; fml::CFRef texture_ref_; diff --git a/shell/platform/darwin/ios/ios_external_texture_gl.mm b/shell/platform/darwin/ios/ios_external_texture_gl.mm index a5e729195ce34..e7e15d5719196 100644 --- a/shell/platform/darwin/ios/ios_external_texture_gl.mm +++ b/shell/platform/darwin/ios/ios_external_texture_gl.mm @@ -53,24 +53,17 @@ } } -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 @@ cache_ref_.Reset(nullptr); } -void IOSExternalTextureGL::MarkNewFrameAvailable() { - new_frame_ready_ = true; -} +void IOSExternalTextureGL::MarkNewFrameAvailable() {} } // namespace flutter