Skip to content

Commit

Permalink
Revert "Reuse texture cache in ios_external_texture_gl. (flutter#9806)…
Browse files Browse the repository at this point in the history
…" (flutter#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 94b3174.
  • Loading branch information
cbracken authored Aug 27, 2019
1 parent 94b3174 commit bf77966
Show file tree
Hide file tree
Showing 2 changed files with 2 additions and 12 deletions.
1 change: 0 additions & 1 deletion shell/platform/darwin/ios/ios_external_texture_gl.h
Original file line number Diff line number Diff line change
Expand Up @@ -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_;
Expand Down
13 changes: 2 additions & 11 deletions shell/platform/darwin/ios/ios_external_texture_gl.mm
Original file line number Diff line number Diff line change
Expand Up @@ -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;
Expand Down Expand Up @@ -100,8 +93,6 @@
cache_ref_.Reset(nullptr);
}

void IOSExternalTextureGL::MarkNewFrameAvailable() {
new_frame_ready_ = true;
}
void IOSExternalTextureGL::MarkNewFrameAvailable() {}

} // namespace flutter

0 comments on commit bf77966

Please sign in to comment.