diff --git a/ci/licenses_golden/licenses_flutter b/ci/licenses_golden/licenses_flutter index b8e32aa31564f..80451d2c1dc70 100644 --- a/ci/licenses_golden/licenses_flutter +++ b/ci/licenses_golden/licenses_flutter @@ -3007,10 +3007,12 @@ ORIGIN: ../../../flutter/shell/platform/android/external_view_embedder/surface_p ORIGIN: ../../../flutter/shell/platform/android/external_view_embedder/surface_pool.h + ../../../flutter/LICENSE ORIGIN: ../../../flutter/shell/platform/android/flutter_main.cc + ../../../flutter/LICENSE ORIGIN: ../../../flutter/shell/platform/android/flutter_main.h + ../../../flutter/LICENSE -ORIGIN: ../../../flutter/shell/platform/android/hardware_buffer_external_texture.h + ../../../flutter/LICENSE -ORIGIN: ../../../flutter/shell/platform/android/hardware_buffer_external_texture_gl.cc + ../../../flutter/LICENSE -ORIGIN: ../../../flutter/shell/platform/android/hardware_buffer_external_texture_gl.h + ../../../flutter/LICENSE -ORIGIN: ../../../flutter/shell/platform/android/hardware_buffer_external_texture_vk.h + ../../../flutter/LICENSE +ORIGIN: ../../../flutter/shell/platform/android/image_external_texture.h + ../../../flutter/LICENSE +ORIGIN: ../../../flutter/shell/platform/android/image_external_texture.cc + ../../../flutter/LICENSE +ORIGIN: ../../../flutter/shell/platform/android/image_external_texture_gl.cc + ../../../flutter/LICENSE +ORIGIN: ../../../flutter/shell/platform/android/image_external_texture_gl.h + ../../../flutter/LICENSE +ORIGIN: ../../../flutter/shell/platform/android/image_external_texture_vk.h + ../../../flutter/LICENSE +ORIGIN: ../../../flutter/shell/platform/android/image_external_texture_vk.cc + ../../../flutter/LICENSE ORIGIN: ../../../flutter/shell/platform/android/io/flutter/FlutterInjector.java + ../../../flutter/LICENSE ORIGIN: ../../../flutter/shell/platform/android/io/flutter/Log.java + ../../../flutter/LICENSE ORIGIN: ../../../flutter/shell/platform/android/io/flutter/app/FlutterActivity.java + ../../../flutter/LICENSE diff --git a/shell/platform/android/BUILD.gn b/shell/platform/android/BUILD.gn index 1f1068db7e703..dd035dc9060e5 100644 --- a/shell/platform/android/BUILD.gn +++ b/shell/platform/android/BUILD.gn @@ -96,12 +96,12 @@ source_set("flutter_shell_native_src") { "apk_asset_provider.h", "flutter_main.cc", "flutter_main.h", - "hardware_buffer_external_texture.cc", - "hardware_buffer_external_texture.h", - "hardware_buffer_external_texture_gl.cc", - "hardware_buffer_external_texture_gl.h", - "hardware_buffer_external_texture_vk.cc", - "hardware_buffer_external_texture_vk.h", + "image_external_texture.cc", + "image_external_texture.h", + "image_external_texture_gl.cc", + "image_external_texture_gl.h", + "image_external_texture_vk.cc", + "image_external_texture_vk.h", "library_loader.cc", "ndk_helpers.cc", "ndk_helpers.h", diff --git a/shell/platform/android/hardware_buffer_external_texture.cc b/shell/platform/android/image_external_texture.cc similarity index 71% rename from shell/platform/android/hardware_buffer_external_texture.cc rename to shell/platform/android/image_external_texture.cc index e26a7e51cd6dd..c8a7129e22fc1 100644 --- a/shell/platform/android/hardware_buffer_external_texture.cc +++ b/shell/platform/android/image_external_texture.cc @@ -1,5 +1,5 @@ -#include "flutter/shell/platform/android/hardware_buffer_external_texture.h" +#include "flutter/shell/platform/android/image_external_texture.h" #include #include @@ -9,7 +9,7 @@ namespace flutter { -HardwareBufferExternalTexture::HardwareBufferExternalTexture( +ImageExternalTexture::ImageExternalTexture( int64_t id, const fml::jni::ScopedJavaGlobalRef& image_texture_entry, const std::shared_ptr& jni_facade) @@ -18,10 +18,10 @@ HardwareBufferExternalTexture::HardwareBufferExternalTexture( jni_facade_(jni_facade) {} // Implementing flutter::Texture. -void HardwareBufferExternalTexture::Paint(PaintContext& context, - const SkRect& bounds, - bool freeze, - const DlImageSampling sampling) { +void ImageExternalTexture::Paint(PaintContext& context, + const SkRect& bounds, + bool freeze, + const DlImageSampling sampling) { if (state_ == AttachmentState::kDetached) { return; } @@ -42,26 +42,25 @@ void HardwareBufferExternalTexture::Paint(PaintContext& context, flutter::DlCanvas::SrcRectConstraint::kStrict // enforce edges ); } else { - FML_LOG(ERROR) - << "No DlImage available for HardwareBufferExternalTexture to paint."; + FML_LOG(ERROR) << "No DlImage available for ImageExternalTexture to paint."; } } // Implementing flutter::Texture. -void HardwareBufferExternalTexture::MarkNewFrameAvailable() { +void ImageExternalTexture::MarkNewFrameAvailable() { new_frame_ready_ = true; } // Implementing flutter::Texture. -void HardwareBufferExternalTexture::OnTextureUnregistered() {} +void ImageExternalTexture::OnTextureUnregistered() {} // Implementing flutter::ContextListener. -void HardwareBufferExternalTexture::OnGrContextCreated() { +void ImageExternalTexture::OnGrContextCreated() { state_ = AttachmentState::kUninitialized; } // Implementing flutter::ContextListener. -void HardwareBufferExternalTexture::OnGrContextDestroyed() { +void ImageExternalTexture::OnGrContextDestroyed() { if (state_ == AttachmentState::kAttached) { dl_image_.reset(); Detach(); @@ -69,7 +68,7 @@ void HardwareBufferExternalTexture::OnGrContextDestroyed() { state_ = AttachmentState::kDetached; } -JavaLocalRef HardwareBufferExternalTexture::AcquireLatestImage() { +JavaLocalRef ImageExternalTexture::AcquireLatestImage() { JNIEnv* env = fml::jni::AttachCurrentThread(); FML_CHECK(env != nullptr); @@ -79,15 +78,14 @@ JavaLocalRef HardwareBufferExternalTexture::AcquireLatestImage() { return image_java; } -void HardwareBufferExternalTexture::CloseImage( - const fml::jni::JavaRef& image) { +void ImageExternalTexture::CloseImage(const fml::jni::JavaRef& image) { if (image.obj() == nullptr) { return; } jni_facade_->ImageClose(JavaLocalRef(image)); } -void HardwareBufferExternalTexture::CloseHardwareBuffer( +void ImageExternalTexture::CloseHardwareBuffer( const fml::jni::JavaRef& hardware_buffer) { if (hardware_buffer.obj() == nullptr) { return; @@ -95,7 +93,7 @@ void HardwareBufferExternalTexture::CloseHardwareBuffer( jni_facade_->HardwareBufferClose(JavaLocalRef(hardware_buffer)); } -JavaLocalRef HardwareBufferExternalTexture::HardwareBufferFor( +JavaLocalRef ImageExternalTexture::HardwareBufferFor( const fml::jni::JavaRef& image) { if (image.obj() == nullptr) { return JavaLocalRef(); @@ -104,7 +102,7 @@ JavaLocalRef HardwareBufferExternalTexture::HardwareBufferFor( return jni_facade_->ImageGetHardwareBuffer(JavaLocalRef(image)); } -AHardwareBuffer* HardwareBufferExternalTexture::AHardwareBufferFor( +AHardwareBuffer* ImageExternalTexture::AHardwareBufferFor( const fml::jni::JavaRef& hardware_buffer) { JNIEnv* env = fml::jni::AttachCurrentThread(); FML_CHECK(env != nullptr); diff --git a/shell/platform/android/hardware_buffer_external_texture.h b/shell/platform/android/image_external_texture.h similarity index 82% rename from shell/platform/android/hardware_buffer_external_texture.h rename to shell/platform/android/image_external_texture.h index 6a0ec78977e1a..3de077706fff4 100644 --- a/shell/platform/android/hardware_buffer_external_texture.h +++ b/shell/platform/android/image_external_texture.h @@ -2,8 +2,8 @@ // Use of this source code is governed by a BSD-style license that can be // found in the LICENSE file. -#ifndef FLUTTER_SHELL_PLATFORM_ANDROID_HARDWARE_BUFFER_EXTERNAL_TEXTURE_H_ -#define FLUTTER_SHELL_PLATFORM_ANDROID_HARDWARE_BUFFER_EXTERNAL_TEXTURE_H_ +#ifndef FLUTTER_SHELL_PLATFORM_ANDROID_IMAGE_EXTERNAL_TEXTURE_H_ +#define FLUTTER_SHELL_PLATFORM_ANDROID_IMAGE_EXTERNAL_TEXTURE_H_ #include "flutter/common/graphics/texture.h" #include "flutter/fml/logging.h" @@ -17,14 +17,14 @@ namespace flutter { // External texture peered to a sequence of android.hardware.HardwareBuffers. // -class HardwareBufferExternalTexture : public flutter::Texture { +class ImageExternalTexture : public flutter::Texture { public: - explicit HardwareBufferExternalTexture( + explicit ImageExternalTexture( int64_t id, const fml::jni::ScopedJavaGlobalRef& image_texture_entry, const std::shared_ptr& jni_facade); - virtual ~HardwareBufferExternalTexture() = default; + virtual ~ImageExternalTexture() = default; // |flutter::Texture|. void Paint(PaintContext& context, @@ -65,9 +65,9 @@ class HardwareBufferExternalTexture : public flutter::Texture { sk_sp dl_image_; - FML_DISALLOW_COPY_AND_ASSIGN(HardwareBufferExternalTexture); + FML_DISALLOW_COPY_AND_ASSIGN(ImageExternalTexture); }; } // namespace flutter -#endif // FLUTTER_SHELL_PLATFORM_ANDROID_HARDWARE_BUFFER_EXTERNAL_TEXTURE_H_ +#endif // FLUTTER_SHELL_PLATFORM_ANDROID_IMAGE_EXTERNAL_TEXTURE_H_ diff --git a/shell/platform/android/hardware_buffer_external_texture_gl.cc b/shell/platform/android/image_external_texture_gl.cc similarity index 76% rename from shell/platform/android/hardware_buffer_external_texture_gl.cc rename to shell/platform/android/image_external_texture_gl.cc index 3eb0defe19d98..fd966c8a10ee6 100644 --- a/shell/platform/android/hardware_buffer_external_texture_gl.cc +++ b/shell/platform/android/image_external_texture_gl.cc @@ -2,7 +2,7 @@ // Use of this source code is governed by a BSD-style license that can be // found in the LICENSE file. -#include "flutter/shell/platform/android/hardware_buffer_external_texture_gl.h" +#include "flutter/shell/platform/android/image_external_texture_gl.h" #include #include @@ -28,13 +28,13 @@ namespace flutter { -HardwareBufferExternalTextureGL::HardwareBufferExternalTextureGL( +ImageExternalTextureGL::ImageExternalTextureGL( int64_t id, const fml::jni::ScopedJavaGlobalRef& image_texture_entry, const std::shared_ptr& jni_facade) - : HardwareBufferExternalTexture(id, image_texture_entry, jni_facade) {} + : ImageExternalTexture(id, image_texture_entry, jni_facade) {} -void HardwareBufferExternalTextureGL::Attach(PaintContext& context) { +void ImageExternalTextureGL::Attach(PaintContext& context) { if (state_ == AttachmentState::kUninitialized) { if (!android_image_.is_null()) { JavaLocalRef hardware_buffer = HardwareBufferFor(android_image_); @@ -47,11 +47,11 @@ void HardwareBufferExternalTextureGL::Attach(PaintContext& context) { } } -void HardwareBufferExternalTextureGL::Detach() { +void ImageExternalTextureGL::Detach() { egl_image_.reset(); } -bool HardwareBufferExternalTextureGL::MaybeSwapImages() { +bool ImageExternalTextureGL::MaybeSwapImages() { JavaLocalRef image = AcquireLatestImage(); if (image.is_null()) { return false; @@ -72,7 +72,7 @@ bool HardwareBufferExternalTextureGL::MaybeSwapImages() { return true; } -impeller::UniqueEGLImageKHR HardwareBufferExternalTextureGL::CreateEGLImage( +impeller::UniqueEGLImageKHR ImageExternalTextureGL::CreateEGLImage( AHardwareBuffer* hardware_buffer) { if (hardware_buffer == nullptr) { return impeller::UniqueEGLImageKHR(); @@ -98,31 +98,31 @@ impeller::UniqueEGLImageKHR HardwareBufferExternalTextureGL::CreateEGLImage( return impeller::UniqueEGLImageKHR(maybe_image); } -HardwareBufferExternalTextureGLSkia::HardwareBufferExternalTextureGLSkia( +ImageExternalTextureGLSkia::ImageExternalTextureGLSkia( const std::shared_ptr& context, int64_t id, const fml::jni::ScopedJavaGlobalRef& image_texture_entry, const std::shared_ptr& jni_facade) - : HardwareBufferExternalTextureGL(id, image_texture_entry, jni_facade) {} + : ImageExternalTextureGL(id, image_texture_entry, jni_facade) {} -void HardwareBufferExternalTextureGLSkia::Attach(PaintContext& context) { +void ImageExternalTextureGLSkia::Attach(PaintContext& context) { if (state_ == AttachmentState::kUninitialized) { // After this call state_ will be AttachmentState::kAttached and egl_image_ // will have been created if we still have an Image associated with us. - HardwareBufferExternalTextureGL::Attach(context); + ImageExternalTextureGL::Attach(context); GLuint texture_name; glGenTextures(1, &texture_name); texture_.reset(impeller::GLTexture{texture_name}); } } -void HardwareBufferExternalTextureGLSkia::Detach() { - HardwareBufferExternalTextureGL::Detach(); +void ImageExternalTextureGLSkia::Detach() { + ImageExternalTextureGL::Detach(); texture_.reset(); } -void HardwareBufferExternalTextureGLSkia::ProcessFrame(PaintContext& context, - const SkRect& bounds) { +void ImageExternalTextureGLSkia::ProcessFrame(PaintContext& context, + const SkRect& bounds) { const bool swapped = MaybeSwapImages(); if (!swapped && !egl_image_.is_valid()) { // Nothing to do. @@ -132,7 +132,7 @@ void HardwareBufferExternalTextureGLSkia::ProcessFrame(PaintContext& context, dl_image_ = CreateDlImage(context, bounds); } -void HardwareBufferExternalTextureGLSkia::BindImageToTexture( +void ImageExternalTextureGLSkia::BindImageToTexture( const impeller::UniqueEGLImageKHR& image, GLuint tex) { if (!image.is_valid() || tex == 0) { @@ -143,7 +143,7 @@ void HardwareBufferExternalTextureGLSkia::BindImageToTexture( (GLeglImageOES)image.get().image); } -sk_sp HardwareBufferExternalTextureGLSkia::CreateDlImage( +sk_sp ImageExternalTextureGLSkia::CreateDlImage( PaintContext& context, const SkRect& bounds) { GrGLTextureInfo textureInfo = {GL_TEXTURE_EXTERNAL_OES, @@ -155,26 +155,24 @@ sk_sp HardwareBufferExternalTextureGLSkia::CreateDlImage( kRGBA_8888_SkColorType, kPremul_SkAlphaType, nullptr)); } -HardwareBufferExternalTextureGLImpeller:: - HardwareBufferExternalTextureGLImpeller( - const std::shared_ptr& context, - int64_t id, - const fml::jni::ScopedJavaGlobalRef& image_textury_entry, - const std::shared_ptr& jni_facade) - : HardwareBufferExternalTextureGL(id, image_textury_entry, jni_facade), +ImageExternalTextureGLImpeller::ImageExternalTextureGLImpeller( + const std::shared_ptr& context, + int64_t id, + const fml::jni::ScopedJavaGlobalRef& image_textury_entry, + const std::shared_ptr& jni_facade) + : ImageExternalTextureGL(id, image_textury_entry, jni_facade), impeller_context_(context) {} -void HardwareBufferExternalTextureGLImpeller::Detach() {} +void ImageExternalTextureGLImpeller::Detach() {} -void HardwareBufferExternalTextureGLImpeller::Attach(PaintContext& context) { +void ImageExternalTextureGLImpeller::Attach(PaintContext& context) { if (state_ == AttachmentState::kUninitialized) { - HardwareBufferExternalTextureGL::Attach(context); + ImageExternalTextureGL::Attach(context); } } -void HardwareBufferExternalTextureGLImpeller::ProcessFrame( - PaintContext& context, - const SkRect& bounds) { +void ImageExternalTextureGLImpeller::ProcessFrame(PaintContext& context, + const SkRect& bounds) { const bool swapped = MaybeSwapImages(); if (!swapped && !egl_image_.is_valid()) { // Nothing to do. @@ -183,7 +181,7 @@ void HardwareBufferExternalTextureGLImpeller::ProcessFrame( dl_image_ = CreateDlImage(context, bounds); } -sk_sp HardwareBufferExternalTextureGLImpeller::CreateDlImage( +sk_sp ImageExternalTextureGLImpeller::CreateDlImage( PaintContext& context, const SkRect& bounds) { impeller::TextureDescriptor desc; diff --git a/shell/platform/android/hardware_buffer_external_texture_gl.h b/shell/platform/android/image_external_texture_gl.h similarity index 73% rename from shell/platform/android/hardware_buffer_external_texture_gl.h rename to shell/platform/android/image_external_texture_gl.h index 0a81fde0d1321..bdaa50ac605df 100644 --- a/shell/platform/android/hardware_buffer_external_texture_gl.h +++ b/shell/platform/android/image_external_texture_gl.h @@ -2,11 +2,11 @@ // Use of this source code is governed by a BSD-style license that can be // found in the LICENSE file. -#ifndef FLUTTER_SHELL_PLATFORM_ANDROID_HARDWARE_BUFFER_EXTERNAL_TEXTURE_GL_H_ -#define FLUTTER_SHELL_PLATFORM_ANDROID_HARDWARE_BUFFER_EXTERNAL_TEXTURE_GL_H_ +#ifndef FLUTTER_SHELL_PLATFORM_ANDROID_IMAGE_EXTERNAL_TEXTURE_GL_H_ +#define FLUTTER_SHELL_PLATFORM_ANDROID_IMAGE_EXTERNAL_TEXTURE_GL_H_ #include "flutter/fml/platform/android/scoped_java_ref.h" -#include "flutter/shell/platform/android/hardware_buffer_external_texture.h" +#include "flutter/shell/platform/android/image_external_texture.h" #include "flutter/impeller/renderer/backend/gles/context_gles.h" #include "flutter/impeller/renderer/backend/gles/gles.h" @@ -20,9 +20,9 @@ namespace flutter { -class HardwareBufferExternalTextureGL : public HardwareBufferExternalTexture { +class ImageExternalTextureGL : public ImageExternalTexture { public: - HardwareBufferExternalTextureGL( + ImageExternalTextureGL( int64_t id, const fml::jni::ScopedJavaGlobalRef& image_textury_entry, const std::shared_ptr& jni_facade); @@ -39,13 +39,12 @@ class HardwareBufferExternalTextureGL : public HardwareBufferExternalTexture { fml::jni::ScopedJavaGlobalRef android_image_; impeller::UniqueEGLImageKHR egl_image_; - FML_DISALLOW_COPY_AND_ASSIGN(HardwareBufferExternalTextureGL); + FML_DISALLOW_COPY_AND_ASSIGN(ImageExternalTextureGL); }; -class HardwareBufferExternalTextureGLSkia - : public HardwareBufferExternalTextureGL { +class ImageExternalTextureGLSkia : public ImageExternalTextureGL { public: - HardwareBufferExternalTextureGLSkia( + ImageExternalTextureGLSkia( const std::shared_ptr& context, int64_t id, const fml::jni::ScopedJavaGlobalRef& image_textury_entry, @@ -62,13 +61,12 @@ class HardwareBufferExternalTextureGLSkia impeller::UniqueGLTexture texture_; - FML_DISALLOW_COPY_AND_ASSIGN(HardwareBufferExternalTextureGLSkia); + FML_DISALLOW_COPY_AND_ASSIGN(ImageExternalTextureGLSkia); }; -class HardwareBufferExternalTextureGLImpeller - : public HardwareBufferExternalTextureGL { +class ImageExternalTextureGLImpeller : public ImageExternalTextureGL { public: - HardwareBufferExternalTextureGLImpeller( + ImageExternalTextureGLImpeller( const std::shared_ptr& context, int64_t id, const fml::jni::ScopedJavaGlobalRef& @@ -85,9 +83,9 @@ class HardwareBufferExternalTextureGLImpeller const std::shared_ptr impeller_context_; - FML_DISALLOW_COPY_AND_ASSIGN(HardwareBufferExternalTextureGLImpeller); + FML_DISALLOW_COPY_AND_ASSIGN(ImageExternalTextureGLImpeller); }; } // namespace flutter -#endif // FLUTTER_SHELL_PLATFORM_ANDROID_HARDWARE_BUFFER_EXTERNAL_TEXTURE_GL_H_ +#endif // FLUTTER_SHELL_PLATFORM_ANDROID_IMAGE_EXTERNAL_TEXTURE_GL_H_ diff --git a/shell/platform/android/hardware_buffer_external_texture_vk.cc b/shell/platform/android/image_external_texture_vk.cc similarity index 79% rename from shell/platform/android/hardware_buffer_external_texture_vk.cc rename to shell/platform/android/image_external_texture_vk.cc index d02a4f545af97..8843b1774fc81 100644 --- a/shell/platform/android/hardware_buffer_external_texture_vk.cc +++ b/shell/platform/android/image_external_texture_vk.cc @@ -1,5 +1,5 @@ -#include "flutter/shell/platform/android/hardware_buffer_external_texture_vk.h" +#include "flutter/shell/platform/android/image_external_texture_vk.h" #include "flutter/impeller/core/formats.h" #include "flutter/impeller/core/texture_descriptor.h" @@ -10,27 +10,27 @@ namespace flutter { -HardwareBufferExternalTextureVK::HardwareBufferExternalTextureVK( +ImageExternalTextureVK::ImageExternalTextureVK( const std::shared_ptr& impeller_context, int64_t id, const fml::jni::ScopedJavaGlobalRef& image_texture_entry, const std::shared_ptr& jni_facade) - : HardwareBufferExternalTexture(id, image_texture_entry, jni_facade), + : ImageExternalTexture(id, image_texture_entry, jni_facade), impeller_context_(impeller_context) {} -HardwareBufferExternalTextureVK::~HardwareBufferExternalTextureVK() {} +ImageExternalTextureVK::~ImageExternalTextureVK() {} -void HardwareBufferExternalTextureVK::Attach(PaintContext& context) { +void ImageExternalTextureVK::Attach(PaintContext& context) { if (state_ == AttachmentState::kUninitialized) { // First processed frame we are attached. state_ = AttachmentState::kAttached; } } -void HardwareBufferExternalTextureVK::Detach() {} +void ImageExternalTextureVK::Detach() {} -void HardwareBufferExternalTextureVK::ProcessFrame(PaintContext& context, - const SkRect& bounds) { +void ImageExternalTextureVK::ProcessFrame(PaintContext& context, + const SkRect& bounds) { JavaLocalRef image = AcquireLatestImage(); if (image.is_null()) { return; diff --git a/shell/platform/android/hardware_buffer_external_texture_vk.h b/shell/platform/android/image_external_texture_vk.h similarity index 68% rename from shell/platform/android/hardware_buffer_external_texture_vk.h rename to shell/platform/android/image_external_texture_vk.h index f4cd12a1ffb00..a6c531e07945e 100644 --- a/shell/platform/android/hardware_buffer_external_texture_vk.h +++ b/shell/platform/android/image_external_texture_vk.h @@ -2,10 +2,10 @@ // Use of this source code is governed by a BSD-style license that can be // found in the LICENSE file. -#ifndef FLUTTER_SHELL_PLATFORM_ANDROID_HARDWARE_BUFFER_EXTERNAL_TEXTURE_VK_H_ -#define FLUTTER_SHELL_PLATFORM_ANDROID_HARDWARE_BUFFER_EXTERNAL_TEXTURE_VK_H_ +#ifndef FLUTTER_SHELL_PLATFORM_ANDROID_IMAGE_EXTERNAL_TEXTURE_VK_H_ +#define FLUTTER_SHELL_PLATFORM_ANDROID_IMAGE_EXTERNAL_TEXTURE_VK_H_ -#include "flutter/shell/platform/android/hardware_buffer_external_texture.h" +#include "flutter/shell/platform/android/image_external_texture.h" #include "flutter/impeller/renderer/backend/vulkan/android_hardware_buffer_texture_source_vk.h" #include "flutter/impeller/renderer/backend/vulkan/context_vk.h" @@ -14,16 +14,16 @@ namespace flutter { -class HardwareBufferExternalTextureVK : public HardwareBufferExternalTexture { +class ImageExternalTextureVK : public ImageExternalTexture { public: - HardwareBufferExternalTextureVK( + ImageExternalTextureVK( const std::shared_ptr& impeller_context, int64_t id, const fml::jni::ScopedJavaGlobalRef& hardware_buffer_texture_entry, const std::shared_ptr& jni_facade); - ~HardwareBufferExternalTextureVK() override; + ~ImageExternalTextureVK() override; private: void Attach(PaintContext& context) override; @@ -37,4 +37,4 @@ class HardwareBufferExternalTextureVK : public HardwareBufferExternalTexture { } // namespace flutter -#endif // FLUTTER_SHELL_PLATFORM_ANDROID_HARDWARE_BUFFER_EXTERNAL_TEXTURE_VK_H_ +#endif // FLUTTER_SHELL_PLATFORM_ANDROID_IMAGE_EXTERNAL_TEXTURE_VK_H_ diff --git a/shell/platform/android/platform_view_android.cc b/shell/platform/android/platform_view_android.cc index 434c44db634a1..83f1f635cf639 100644 --- a/shell/platform/android/platform_view_android.cc +++ b/shell/platform/android/platform_view_android.cc @@ -17,11 +17,11 @@ #include "flutter/shell/platform/android/android_surface_gl_impeller.h" #include "flutter/shell/platform/android/android_surface_gl_skia.h" #include "flutter/shell/platform/android/android_surface_software.h" -#include "flutter/shell/platform/android/hardware_buffer_external_texture_gl.h" +#include "flutter/shell/platform/android/image_external_texture_gl.h" #include "flutter/shell/platform/android/surface_texture_external_texture_gl.h" #if IMPELLER_ENABLE_VULKAN // b/258506856 for why this is behind an if #include "flutter/shell/platform/android/android_surface_vulkan_impeller.h" -#include "flutter/shell/platform/android/hardware_buffer_external_texture_vk.h" +#include "flutter/shell/platform/android/image_external_texture_vk.h" #endif #include "flutter/shell/platform/android/context/android_context.h" #include "flutter/shell/platform/android/external_view_embedder/external_view_embedder.h" @@ -324,18 +324,18 @@ void PlatformViewAndroid::RegisterImageTexture( if (android_context_->RenderingApi() == AndroidRenderingAPI::kOpenGLES) { if (android_context_->GetImpellerContext()) { // Impeller GLES. - RegisterTexture(std::make_shared( + RegisterTexture(std::make_shared( std::static_pointer_cast( android_context_->GetImpellerContext()), texture_id, image_texture_entry, jni_facade_)); } else { // Legacy GL. - RegisterTexture(std::make_shared( + RegisterTexture(std::make_shared( std::static_pointer_cast(android_context_), texture_id, image_texture_entry, jni_facade_)); } } else if (android_context_->RenderingApi() == AndroidRenderingAPI::kVulkan) { - RegisterTexture(std::make_shared( + RegisterTexture(std::make_shared( std::static_pointer_cast( android_context_->GetImpellerContext()), texture_id, image_texture_entry, jni_facade_)); diff --git a/shell/platform/android/platform_view_android_jni_impl.cc b/shell/platform/android/platform_view_android_jni_impl.cc index 43a2f63fa378c..a8d3bd94d5b88 100644 --- a/shell/platform/android/platform_view_android_jni_impl.cc +++ b/shell/platform/android/platform_view_android_jni_impl.cc @@ -31,7 +31,7 @@ #include "flutter/shell/platform/android/android_shell_holder.h" #include "flutter/shell/platform/android/apk_asset_provider.h" #include "flutter/shell/platform/android/flutter_main.h" -#include "flutter/shell/platform/android/hardware_buffer_external_texture_gl.h" +#include "flutter/shell/platform/android/image_external_texture_gl.h" #include "flutter/shell/platform/android/jni/platform_view_android_jni.h" #include "flutter/shell/platform/android/platform_view_android.h" #include "flutter/shell/platform/android/surface_texture_external_texture_gl.h"