From 473ba55e6cfad5f674fd2f8eb8715c7b01884026 Mon Sep 17 00:00:00 2001 From: John McCutchan Date: Tue, 15 Aug 2023 15:30:09 -0700 Subject: [PATCH] Fix clang_tidy lints --- .../android/surface_texture_external_texture.cc | 4 ++-- .../android/surface_texture_external_texture.h | 2 +- .../android/surface_texture_external_texture_gl.cc | 12 ++++++------ .../android/surface_texture_external_texture_gl.h | 4 ++-- 4 files changed, 11 insertions(+), 11 deletions(-) diff --git a/shell/platform/android/surface_texture_external_texture.cc b/shell/platform/android/surface_texture_external_texture.cc index aff59abdc1468..4f39f2b7b5924 100644 --- a/shell/platform/android/surface_texture_external_texture.cc +++ b/shell/platform/android/surface_texture_external_texture.cc @@ -24,9 +24,9 @@ namespace flutter { SurfaceTextureExternalTexture::SurfaceTextureExternalTexture( int64_t id, const fml::jni::ScopedJavaGlobalRef& surface_texture, - std::shared_ptr jni_facade) + const std::shared_ptr& jni_facade) : Texture(id), - jni_facade_(std::move(jni_facade)), + jni_facade_(jni_facade), surface_texture_(surface_texture), transform_(SkMatrix::I()) {} diff --git a/shell/platform/android/surface_texture_external_texture.h b/shell/platform/android/surface_texture_external_texture.h index fe6bff3d93519..e12328ad18559 100644 --- a/shell/platform/android/surface_texture_external_texture.h +++ b/shell/platform/android/surface_texture_external_texture.h @@ -18,7 +18,7 @@ class SurfaceTextureExternalTexture : public flutter::Texture { SurfaceTextureExternalTexture( int64_t id, const fml::jni::ScopedJavaGlobalRef& surface_texture, - std::shared_ptr jni_facade); + const std::shared_ptr& jni_facade); ~SurfaceTextureExternalTexture() override; diff --git a/shell/platform/android/surface_texture_external_texture_gl.cc b/shell/platform/android/surface_texture_external_texture_gl.cc index 8099e0edd70a6..b1cadee7f3081 100644 --- a/shell/platform/android/surface_texture_external_texture_gl.cc +++ b/shell/platform/android/surface_texture_external_texture_gl.cc @@ -24,11 +24,13 @@ namespace flutter { SurfaceTextureExternalTextureGL::SurfaceTextureExternalTextureGL( int64_t id, const fml::jni::ScopedJavaGlobalRef& surface_texture, - std::shared_ptr jni_facade) + const std::shared_ptr& jni_facade) : SurfaceTextureExternalTexture(id, surface_texture, jni_facade) {} SurfaceTextureExternalTextureGL::~SurfaceTextureExternalTextureGL() { - Detach(); + if (texture_name_ != 0) { + glDeleteTextures(1, &texture_name_); + } } void SurfaceTextureExternalTextureGL::ProcessFrame(PaintContext& context, @@ -66,14 +68,12 @@ SurfaceTextureExternalTextureImpellerGL:: const std::shared_ptr& context, int64_t id, const fml::jni::ScopedJavaGlobalRef& surface_texture, - std::shared_ptr jni_facade) + const std::shared_ptr& jni_facade) : SurfaceTextureExternalTexture(id, surface_texture, jni_facade), impeller_context_(context) {} SurfaceTextureExternalTextureImpellerGL:: - ~SurfaceTextureExternalTextureImpellerGL() { - Detach(); -} + ~SurfaceTextureExternalTextureImpellerGL() {} void SurfaceTextureExternalTextureImpellerGL::ProcessFrame( PaintContext& context, diff --git a/shell/platform/android/surface_texture_external_texture_gl.h b/shell/platform/android/surface_texture_external_texture_gl.h index 3bfa3b8489ade..d76c9cf077e0a 100644 --- a/shell/platform/android/surface_texture_external_texture_gl.h +++ b/shell/platform/android/surface_texture_external_texture_gl.h @@ -23,7 +23,7 @@ class SurfaceTextureExternalTextureGL : public SurfaceTextureExternalTexture { SurfaceTextureExternalTextureGL( int64_t id, const fml::jni::ScopedJavaGlobalRef& surface_texture, - std::shared_ptr jni_facade); + const std::shared_ptr& jni_facade); ~SurfaceTextureExternalTextureGL() override; @@ -44,7 +44,7 @@ class SurfaceTextureExternalTextureImpellerGL const std::shared_ptr& context, int64_t id, const fml::jni::ScopedJavaGlobalRef& surface_texture, - std::shared_ptr jni_facade); + const std::shared_ptr& jni_facade); ~SurfaceTextureExternalTextureImpellerGL() override;