diff --git a/ci/licenses_golden/licenses_flutter b/ci/licenses_golden/licenses_flutter index f3a32953a8b5b..9bc86b609f7ce 100755 --- a/ci/licenses_golden/licenses_flutter +++ b/ci/licenses_golden/licenses_flutter @@ -667,7 +667,6 @@ FILE: ../../../flutter/shell/common/vsync_waiter_fallback.cc FILE: ../../../flutter/shell/common/vsync_waiter_fallback.h FILE: ../../../flutter/shell/common/vsync_waiters_test.cc FILE: ../../../flutter/shell/common/vsync_waiters_test.h -FILE: ../../../flutter/shell/gpu/gpu_surface_delegate.h FILE: ../../../flutter/shell/gpu/gpu_surface_gl.cc FILE: ../../../flutter/shell/gpu/gpu_surface_gl.h FILE: ../../../flutter/shell/gpu/gpu_surface_gl_delegate.cc diff --git a/flow/surface.cc b/flow/surface.cc index 7dbdfb06753cf..7dbe56c1e8e78 100644 --- a/flow/surface.cc +++ b/flow/surface.cc @@ -10,10 +10,6 @@ Surface::Surface() = default; Surface::~Surface() = default; -flutter::ExternalViewEmbedder* Surface::GetExternalViewEmbedder() { - return nullptr; -} - std::unique_ptr Surface::MakeRenderContextCurrent() { return std::make_unique(true); } diff --git a/flow/surface.h b/flow/surface.h index fa29e41d03320..21b248c074d4c 100644 --- a/flow/surface.h +++ b/flow/surface.h @@ -29,8 +29,6 @@ class Surface { virtual GrDirectContext* GetContext() = 0; - virtual flutter::ExternalViewEmbedder* GetExternalViewEmbedder(); - virtual std::unique_ptr MakeRenderContextCurrent(); virtual bool ClearRenderContext(); diff --git a/shell/common/shell_test_platform_view_gl.cc b/shell/common/shell_test_platform_view_gl.cc index 287686b08c805..6c1214abb9e1a 100644 --- a/shell/common/shell_test_platform_view_gl.cc +++ b/shell/common/shell_test_platform_view_gl.cc @@ -79,10 +79,5 @@ ShellTestPlatformViewGL::GetGLProcResolver() const { }; } -// |GPUSurfaceGLDelegate| -ExternalViewEmbedder* ShellTestPlatformViewGL::GetExternalViewEmbedder() { - return shell_test_external_view_embedder_.get(); -} - } // namespace testing } // namespace flutter diff --git a/shell/common/shell_test_platform_view_gl.h b/shell/common/shell_test_platform_view_gl.h index 5779147e289af..bb6d74486583b 100644 --- a/shell/common/shell_test_platform_view_gl.h +++ b/shell/common/shell_test_platform_view_gl.h @@ -64,9 +64,6 @@ class ShellTestPlatformViewGL : public ShellTestPlatformView, // |GPUSurfaceGLDelegate| GLProcResolver GetGLProcResolver() const override; - // |GPUSurfaceGLDelegate| - ExternalViewEmbedder* GetExternalViewEmbedder() override; - FML_DISALLOW_COPY_AND_ASSIGN(ShellTestPlatformViewGL); }; diff --git a/shell/common/shell_test_platform_view_vulkan.cc b/shell/common/shell_test_platform_view_vulkan.cc index 4415d5e9bf2a0..9a296b6663c0a 100644 --- a/shell/common/shell_test_platform_view_vulkan.cc +++ b/shell/common/shell_test_platform_view_vulkan.cc @@ -198,10 +198,5 @@ SkMatrix ShellTestPlatformViewVulkan::OffScreenSurface::GetRootTransformation() return matrix; } -flutter::ExternalViewEmbedder* -ShellTestPlatformViewVulkan::OffScreenSurface::GetExternalViewEmbedder() { - return shell_test_external_view_embedder_.get(); -} - } // namespace testing } // namespace flutter diff --git a/shell/common/shell_test_platform_view_vulkan.h b/shell/common/shell_test_platform_view_vulkan.h index 745647e77ca38..5a3ea47b9dec6 100644 --- a/shell/common/shell_test_platform_view_vulkan.h +++ b/shell/common/shell_test_platform_view_vulkan.h @@ -47,8 +47,6 @@ class ShellTestPlatformViewVulkan : public ShellTestPlatformView { // |Surface| GrDirectContext* GetContext() override; - flutter::ExternalViewEmbedder* GetExternalViewEmbedder() override; - private: bool valid_; fml::RefPtr vk_; diff --git a/shell/gpu/BUILD.gn b/shell/gpu/BUILD.gn index a431dfe9ee3c6..606de7ed52ae6 100644 --- a/shell/gpu/BUILD.gn +++ b/shell/gpu/BUILD.gn @@ -16,7 +16,6 @@ gpu_common_deps = [ source_set("gpu_surface_software") { sources = [ - "gpu_surface_delegate.h", "gpu_surface_software.cc", "gpu_surface_software.h", "gpu_surface_software_delegate.cc", @@ -28,7 +27,6 @@ source_set("gpu_surface_software") { source_set("gpu_surface_gl") { sources = [ - "gpu_surface_delegate.h", "gpu_surface_gl.cc", "gpu_surface_gl.h", "gpu_surface_gl_delegate.cc", @@ -40,7 +38,6 @@ source_set("gpu_surface_gl") { source_set("gpu_surface_vulkan") { sources = [ - "gpu_surface_delegate.h", "gpu_surface_vulkan.cc", "gpu_surface_vulkan.h", "gpu_surface_vulkan_delegate.cc", @@ -52,7 +49,6 @@ source_set("gpu_surface_vulkan") { source_set("gpu_surface_metal") { sources = [ - "gpu_surface_delegate.h", "gpu_surface_metal.h", "gpu_surface_metal.mm", ] diff --git a/shell/gpu/gpu_surface_delegate.h b/shell/gpu/gpu_surface_delegate.h deleted file mode 100644 index 4eb5c46885814..0000000000000 --- a/shell/gpu/gpu_surface_delegate.h +++ /dev/null @@ -1,28 +0,0 @@ -#ifndef FLUTTER_SHELL_GPU_GPU_SURFACE_DELEGATE_H_ -#define FLUTTER_SHELL_GPU_GPU_SURFACE_DELEGATE_H_ - -#include "flutter/flow/embedded_views.h" - -namespace flutter { - -class GPUSurfaceDelegate { - public: - virtual ~GPUSurfaceDelegate() {} - - //---------------------------------------------------------------------------- - /// @brief Gets the view embedder that controls how the Flutter layer - /// hierarchy split into multiple chunks should be composited back - /// on-screen. This field is optional and the Flutter rasterizer - /// will render into a single on-screen surface if this call - /// returns a null external view embedder. This happens on the GPU - /// thread. - /// - /// @return The external view embedder, or, null if Flutter is rendering - /// into a single on-screen surface. - /// - virtual ExternalViewEmbedder* GetExternalViewEmbedder() = 0; -}; - -} // namespace flutter - -#endif // FLUTTER_SHELL_GPU_GPU_SURFACE_DELEGATE_H_ diff --git a/shell/gpu/gpu_surface_gl.cc b/shell/gpu/gpu_surface_gl.cc index 36a5e2eb47a06..388a22e352dd5 100644 --- a/shell/gpu/gpu_surface_gl.cc +++ b/shell/gpu/gpu_surface_gl.cc @@ -333,11 +333,6 @@ GrDirectContext* GPUSurfaceGL::GetContext() { return context_.get(); } -// |Surface| -flutter::ExternalViewEmbedder* GPUSurfaceGL::GetExternalViewEmbedder() { - return delegate_->GetExternalViewEmbedder(); -} - // |Surface| std::unique_ptr GPUSurfaceGL::MakeRenderContextCurrent() { return delegate_->GLContextMakeCurrent(); diff --git a/shell/gpu/gpu_surface_gl.h b/shell/gpu/gpu_surface_gl.h index 481e194d907e9..e7fa001123e52 100644 --- a/shell/gpu/gpu_surface_gl.h +++ b/shell/gpu/gpu_surface_gl.h @@ -42,9 +42,6 @@ class GPUSurfaceGL : public Surface { // |Surface| GrDirectContext* GetContext() override; - // |Surface| - flutter::ExternalViewEmbedder* GetExternalViewEmbedder() override; - // |Surface| std::unique_ptr MakeRenderContextCurrent() override; diff --git a/shell/gpu/gpu_surface_gl_delegate.cc b/shell/gpu/gpu_surface_gl_delegate.cc index 1b31268c30f07..66f9df261f0ab 100644 --- a/shell/gpu/gpu_surface_gl_delegate.cc +++ b/shell/gpu/gpu_surface_gl_delegate.cc @@ -99,8 +99,4 @@ GPUSurfaceGLDelegate::GetDefaultPlatformGLInterface() { return CreateGLInterface(nullptr); } -ExternalViewEmbedder* GPUSurfaceGLDelegate::GetExternalViewEmbedder() { - return nullptr; -} - } // namespace flutter diff --git a/shell/gpu/gpu_surface_gl_delegate.h b/shell/gpu/gpu_surface_gl_delegate.h index 2208123bf2ec5..fff96945e00a8 100644 --- a/shell/gpu/gpu_surface_gl_delegate.h +++ b/shell/gpu/gpu_surface_gl_delegate.h @@ -8,7 +8,6 @@ #include "flutter/common/graphics/gl_context_switch.h" #include "flutter/flow/embedded_views.h" #include "flutter/fml/macros.h" -#include "flutter/shell/gpu/gpu_surface_delegate.h" #include "third_party/skia/include/core/SkMatrix.h" #include "third_party/skia/include/gpu/gl/GrGLInterface.h" @@ -21,12 +20,9 @@ struct GLFrameInfo { uint32_t height; }; -class GPUSurfaceGLDelegate : public GPUSurfaceDelegate { +class GPUSurfaceGLDelegate { public: - ~GPUSurfaceGLDelegate() override; - - // |GPUSurfaceDelegate| - ExternalViewEmbedder* GetExternalViewEmbedder() override; + ~GPUSurfaceGLDelegate(); // Called to make the main GL context current on the current thread. virtual std::unique_ptr GLContextMakeCurrent() = 0; diff --git a/shell/gpu/gpu_surface_metal.h b/shell/gpu/gpu_surface_metal.h index 5a91307af4da7..b56e4bafd6ae8 100644 --- a/shell/gpu/gpu_surface_metal.h +++ b/shell/gpu/gpu_surface_metal.h @@ -10,7 +10,6 @@ #include "flutter/flow/surface.h" #include "flutter/fml/macros.h" #include "flutter/fml/platform/darwin/scoped_nsobject.h" -#include "flutter/shell/gpu/gpu_surface_delegate.h" #include "third_party/skia/include/gpu/GrDirectContext.h" #include "third_party/skia/include/gpu/mtl/GrMtlTypes.h" @@ -20,16 +19,14 @@ namespace flutter { class SK_API_AVAILABLE_CA_METAL_LAYER GPUSurfaceMetal : public Surface { public: - GPUSurfaceMetal(GPUSurfaceDelegate* delegate, - fml::scoped_nsobject layer, + GPUSurfaceMetal(fml::scoped_nsobject layer, sk_sp context, fml::scoped_nsprotocol> command_queue); // |Surface| - ~GPUSurfaceMetal() override; + ~GPUSurfaceMetal(); private: - GPUSurfaceDelegate* delegate_; fml::scoped_nsobject layer_; sk_sp context_; fml::scoped_nsprotocol> command_queue_; @@ -47,9 +44,6 @@ class SK_API_AVAILABLE_CA_METAL_LAYER GPUSurfaceMetal : public Surface { // |Surface| GrDirectContext* GetContext() override; - // |Surface| - flutter::ExternalViewEmbedder* GetExternalViewEmbedder() override; - // |Surface| std::unique_ptr MakeRenderContextCurrent() override; diff --git a/shell/gpu/gpu_surface_metal.mm b/shell/gpu/gpu_surface_metal.mm index 2fc8a2a02dfaf..195631984ea10 100644 --- a/shell/gpu/gpu_surface_metal.mm +++ b/shell/gpu/gpu_surface_metal.mm @@ -15,12 +15,10 @@ namespace flutter { -GPUSurfaceMetal::GPUSurfaceMetal(GPUSurfaceDelegate* delegate, - fml::scoped_nsobject layer, +GPUSurfaceMetal::GPUSurfaceMetal(fml::scoped_nsobject layer, sk_sp context, fml::scoped_nsprotocol> command_queue) - : delegate_(delegate), - layer_(std::move(layer)), + : layer_(std::move(layer)), context_(std::move(context)), command_queue_(std::move(command_queue)) { layer_.get().pixelFormat = MTLPixelFormatBGRA8Unorm; @@ -121,11 +119,6 @@ return context_.get(); } -// |Surface| -flutter::ExternalViewEmbedder* GPUSurfaceMetal::GetExternalViewEmbedder() { - return delegate_->GetExternalViewEmbedder(); -} - // |Surface| std::unique_ptr GPUSurfaceMetal::MakeRenderContextCurrent() { // This backend has no such concept. diff --git a/shell/gpu/gpu_surface_software.cc b/shell/gpu/gpu_surface_software.cc index ea9f6ae556bf5..4d079e282d019 100644 --- a/shell/gpu/gpu_surface_software.cc +++ b/shell/gpu/gpu_surface_software.cc @@ -87,9 +87,4 @@ GrDirectContext* GPUSurfaceSoftware::GetContext() { return nullptr; } -// |Surface| -flutter::ExternalViewEmbedder* GPUSurfaceSoftware::GetExternalViewEmbedder() { - return delegate_->GetExternalViewEmbedder(); -} - } // namespace flutter diff --git a/shell/gpu/gpu_surface_software.h b/shell/gpu/gpu_surface_software.h index 8784493584850..23d5cdedf8fed 100644 --- a/shell/gpu/gpu_surface_software.h +++ b/shell/gpu/gpu_surface_software.h @@ -31,9 +31,6 @@ class GPUSurfaceSoftware : public Surface { // |Surface| GrDirectContext* GetContext() override; - // |Surface| - flutter::ExternalViewEmbedder* GetExternalViewEmbedder() override; - private: GPUSurfaceSoftwareDelegate* delegate_; // TODO(38466): Refactor GPU surface APIs take into account the fact that an diff --git a/shell/gpu/gpu_surface_software_delegate.cc b/shell/gpu/gpu_surface_software_delegate.cc index d4141a3c72b41..9bc6d8b98fea7 100644 --- a/shell/gpu/gpu_surface_software_delegate.cc +++ b/shell/gpu/gpu_surface_software_delegate.cc @@ -8,8 +8,4 @@ namespace flutter { GPUSurfaceSoftwareDelegate::~GPUSurfaceSoftwareDelegate() = default; -ExternalViewEmbedder* GPUSurfaceSoftwareDelegate::GetExternalViewEmbedder() { - return nullptr; -} - } // namespace flutter diff --git a/shell/gpu/gpu_surface_software_delegate.h b/shell/gpu/gpu_surface_software_delegate.h index 920e4f8a8313f..81cf30a6b0aff 100644 --- a/shell/gpu/gpu_surface_software_delegate.h +++ b/shell/gpu/gpu_surface_software_delegate.h @@ -7,7 +7,6 @@ #include "flutter/flow/embedded_views.h" #include "flutter/fml/macros.h" -#include "flutter/shell/gpu/gpu_surface_delegate.h" #include "third_party/skia/include/core/SkSurface.h" namespace flutter { @@ -25,12 +24,9 @@ namespace flutter { /// @see |IOSurfaceSoftware|, |AndroidSurfaceSoftware|, /// |EmbedderSurfaceSoftware|. /// -class GPUSurfaceSoftwareDelegate : public GPUSurfaceDelegate { +class GPUSurfaceSoftwareDelegate { public: - ~GPUSurfaceSoftwareDelegate() override; - - // |GPUSurfaceDelegate| - ExternalViewEmbedder* GetExternalViewEmbedder() override; + ~GPUSurfaceSoftwareDelegate(); //---------------------------------------------------------------------------- /// @brief Called when the GPU surface needs a new buffer to render a new diff --git a/shell/gpu/gpu_surface_vulkan.cc b/shell/gpu/gpu_surface_vulkan.cc index fe45ad5ecfab5..e334196a83e4a 100644 --- a/shell/gpu/gpu_surface_vulkan.cc +++ b/shell/gpu/gpu_surface_vulkan.cc @@ -13,7 +13,6 @@ GPUSurfaceVulkan::GPUSurfaceVulkan( std::unique_ptr native_surface, bool render_to_surface) : window_(delegate->vk(), std::move(native_surface), render_to_surface), - delegate_(delegate), render_to_surface_(render_to_surface), weak_factory_(this) {} @@ -67,8 +66,4 @@ GrDirectContext* GPUSurfaceVulkan::GetContext() { return window_.GetSkiaGrContext(); } -flutter::ExternalViewEmbedder* GPUSurfaceVulkan::GetExternalViewEmbedder() { - return delegate_->GetExternalViewEmbedder(); -} - } // namespace flutter diff --git a/shell/gpu/gpu_surface_vulkan.h b/shell/gpu/gpu_surface_vulkan.h index c52346ed301d0..1c9c2470fe2e5 100644 --- a/shell/gpu/gpu_surface_vulkan.h +++ b/shell/gpu/gpu_surface_vulkan.h @@ -36,12 +36,8 @@ class GPUSurfaceVulkan : public Surface { // |Surface| GrDirectContext* GetContext() override; - // |Surface| - flutter::ExternalViewEmbedder* GetExternalViewEmbedder() override; - private: vulkan::VulkanWindow window_; - GPUSurfaceVulkanDelegate* delegate_; const bool render_to_surface_; fml::WeakPtrFactory weak_factory_; diff --git a/shell/gpu/gpu_surface_vulkan_delegate.cc b/shell/gpu/gpu_surface_vulkan_delegate.cc index 8b336faec2ff5..3e64ad702279c 100644 --- a/shell/gpu/gpu_surface_vulkan_delegate.cc +++ b/shell/gpu/gpu_surface_vulkan_delegate.cc @@ -8,8 +8,4 @@ namespace flutter { GPUSurfaceVulkanDelegate::~GPUSurfaceVulkanDelegate() = default; -ExternalViewEmbedder* GPUSurfaceVulkanDelegate::GetExternalViewEmbedder() { - return nullptr; -} - } // namespace flutter diff --git a/shell/gpu/gpu_surface_vulkan_delegate.h b/shell/gpu/gpu_surface_vulkan_delegate.h index 991720f26f1d9..9b1a495959562 100644 --- a/shell/gpu/gpu_surface_vulkan_delegate.h +++ b/shell/gpu/gpu_surface_vulkan_delegate.h @@ -6,17 +6,13 @@ #define FLUTTER_SHELL_GPU_GPU_SURFACE_VULKAN_DELEGATE_H_ #include "flutter/fml/memory/ref_ptr.h" -#include "flutter/shell/gpu/gpu_surface_delegate.h" #include "flutter/vulkan/vulkan_proc_table.h" namespace flutter { -class GPUSurfaceVulkanDelegate : public GPUSurfaceDelegate { +class GPUSurfaceVulkanDelegate { public: - ~GPUSurfaceVulkanDelegate() override; - - // |GPUSurfaceDelegate| - ExternalViewEmbedder* GetExternalViewEmbedder() override; + ~GPUSurfaceVulkanDelegate(); // Obtain a reference to the Vulkan implementation's proc table. virtual fml::RefPtr vk() = 0; diff --git a/shell/platform/android/android_surface_gl.cc b/shell/platform/android/android_surface_gl.cc index d7a630c345099..36720dc501f8a 100644 --- a/shell/platform/android/android_surface_gl.cc +++ b/shell/platform/android/android_surface_gl.cc @@ -132,11 +132,6 @@ intptr_t AndroidSurfaceGL::GLContextFBO(GLFrameInfo frame_info) const { return 0; } -// |GPUSurfaceGLDelegate| -ExternalViewEmbedder* AndroidSurfaceGL::GetExternalViewEmbedder() { - return external_view_embedder_.get(); -} - // |GPUSurfaceGLDelegate| sk_sp AndroidSurfaceGL::GetGLInterface() const { // This is a workaround for a bug in the Android emulator EGL/GLES diff --git a/shell/platform/android/android_surface_gl.h b/shell/platform/android/android_surface_gl.h index ca9aead26b4c5..86c35a8f8f67f 100644 --- a/shell/platform/android/android_surface_gl.h +++ b/shell/platform/android/android_surface_gl.h @@ -63,9 +63,6 @@ class AndroidSurfaceGL final : public GPUSurfaceGLDelegate, // |GPUSurfaceGLDelegate| intptr_t GLContextFBO(GLFrameInfo frame_info) const override; - // |GPUSurfaceGLDelegate| - ExternalViewEmbedder* GetExternalViewEmbedder() override; - // |GPUSurfaceGLDelegate| sk_sp GetGLInterface() const override; diff --git a/shell/platform/android/android_surface_software.cc b/shell/platform/android/android_surface_software.cc index ab116f79048fa..7731c11e47369 100644 --- a/shell/platform/android/android_surface_software.cc +++ b/shell/platform/android/android_surface_software.cc @@ -141,11 +141,6 @@ bool AndroidSurfaceSoftware::PresentBackingStore( return true; } -// |GPUSurfaceSoftwareDelegate| -ExternalViewEmbedder* AndroidSurfaceSoftware::GetExternalViewEmbedder() { - return external_view_embedder_.get(); -} - void AndroidSurfaceSoftware::TeardownOnScreenContext() {} bool AndroidSurfaceSoftware::OnScreenSurfaceResize(const SkISize& size) { diff --git a/shell/platform/android/android_surface_software.h b/shell/platform/android/android_surface_software.h index fc54ce2091778..51c4c421dd0ee 100644 --- a/shell/platform/android/android_surface_software.h +++ b/shell/platform/android/android_surface_software.h @@ -53,9 +53,6 @@ class AndroidSurfaceSoftware final : public AndroidSurface, // |GPUSurfaceSoftwareDelegate| bool PresentBackingStore(sk_sp backing_store) override; - // |GPUSurfaceSoftwareDelegate| - ExternalViewEmbedder* GetExternalViewEmbedder() override; - private: const std::shared_ptr external_view_embedder_; diff --git a/shell/platform/android/android_surface_vulkan.cc b/shell/platform/android/android_surface_vulkan.cc index f31faf3716493..dfb710b90fcb9 100644 --- a/shell/platform/android/android_surface_vulkan.cc +++ b/shell/platform/android/android_surface_vulkan.cc @@ -77,10 +77,6 @@ bool AndroidSurfaceVulkan::SetNativeWindow( return native_window_ && native_window_->IsValid(); } -ExternalViewEmbedder* AndroidSurfaceVulkan::GetExternalViewEmbedder() { - return external_view_embedder_.get(); -} - fml::RefPtr AndroidSurfaceVulkan::vk() { return proc_table_; } diff --git a/shell/platform/android/android_surface_vulkan.h b/shell/platform/android/android_surface_vulkan.h index b91248b96c76a..58632d858b88b 100644 --- a/shell/platform/android/android_surface_vulkan.h +++ b/shell/platform/android/android_surface_vulkan.h @@ -50,9 +50,6 @@ class AndroidSurfaceVulkan : public AndroidSurface, // |AndroidSurface| bool SetNativeWindow(fml::RefPtr window) override; - // |GPUSurfaceVulkanDelegate| - ExternalViewEmbedder* GetExternalViewEmbedder() override; - // |GPUSurfaceVulkanDelegate| fml::RefPtr vk() override; diff --git a/shell/platform/android/external_view_embedder/external_view_embedder_unittests.cc b/shell/platform/android/external_view_embedder/external_view_embedder_unittests.cc index b161a7031d51b..54921d2659eae 100644 --- a/shell/platform/android/external_view_embedder/external_view_embedder_unittests.cc +++ b/shell/platform/android/external_view_embedder/external_view_embedder_unittests.cc @@ -52,11 +52,6 @@ class SurfaceMock : public Surface { MOCK_METHOD(GrDirectContext*, GetContext, (), (override)); - MOCK_METHOD(flutter::ExternalViewEmbedder*, - GetExternalViewEmbedder, - (), - (override)); - MOCK_METHOD(std::unique_ptr, MakeRenderContextCurrent, (), diff --git a/shell/platform/android/surface/android_surface_mock.cc b/shell/platform/android/surface/android_surface_mock.cc index 8e76b5ed740bb..fc9ca103211b3 100644 --- a/shell/platform/android/surface/android_surface_mock.cc +++ b/shell/platform/android/surface/android_surface_mock.cc @@ -22,8 +22,4 @@ intptr_t AndroidSurfaceMock::GLContextFBO(GLFrameInfo frame_info) const { return 0; } -ExternalViewEmbedder* AndroidSurfaceMock::GetExternalViewEmbedder() { - return nullptr; -} - } // namespace flutter diff --git a/shell/platform/android/surface/android_surface_mock.h b/shell/platform/android/surface/android_surface_mock.h index 359d228335ae9..b0e5be87747aa 100644 --- a/shell/platform/android/surface/android_surface_mock.h +++ b/shell/platform/android/surface/android_surface_mock.h @@ -49,9 +49,6 @@ class AndroidSurfaceMock final : public GPUSurfaceGLDelegate, // |GPUSurfaceGLDelegate| intptr_t GLContextFBO(GLFrameInfo frame_info) const override; - - // |GPUSurfaceGLDelegate| - ExternalViewEmbedder* GetExternalViewEmbedder() override; }; } // namespace flutter diff --git a/shell/platform/darwin/ios/ios_surface_gl.h b/shell/platform/darwin/ios/ios_surface_gl.h index b5514c945106c..5345364ce8265 100644 --- a/shell/platform/darwin/ios/ios_surface_gl.h +++ b/shell/platform/darwin/ios/ios_surface_gl.h @@ -48,9 +48,6 @@ class IOSSurfaceGL final : public IOSSurface, public GPUSurfaceGLDelegate { // |GPUSurfaceGLDelegate| bool SurfaceSupportsReadback() const override; - // |GPUSurfaceGLDelegate| - ExternalViewEmbedder* GetExternalViewEmbedder() override; - private: std::unique_ptr render_target_; diff --git a/shell/platform/darwin/ios/ios_surface_gl.mm b/shell/platform/darwin/ios/ios_surface_gl.mm index 36f8238868444..e15dccb0280a9 100644 --- a/shell/platform/darwin/ios/ios_surface_gl.mm +++ b/shell/platform/darwin/ios/ios_surface_gl.mm @@ -82,9 +82,4 @@ return IsValid() && render_target_->PresentRenderBuffer(); } -// |GPUSurfaceGLDelegate| -ExternalViewEmbedder* IOSSurfaceGL::GetExternalViewEmbedder() { - return GetSurfaceExternalViewEmbedder().get(); -} - } // namespace flutter diff --git a/shell/platform/darwin/ios/ios_surface_metal.h b/shell/platform/darwin/ios/ios_surface_metal.h index a0f7f075cf120..5fe0dbb8a2846 100644 --- a/shell/platform/darwin/ios/ios_surface_metal.h +++ b/shell/platform/darwin/ios/ios_surface_metal.h @@ -6,7 +6,6 @@ #define FLUTTER_SHELL_PLATFORM_DARWIN_IOS_IOS_SURFACE_METAL_H_ #include "flutter/fml/macros.h" -#include "flutter/shell/gpu/gpu_surface_delegate.h" #import "flutter/shell/platform/darwin/ios/ios_surface.h" #include "third_party/skia/include/gpu/mtl/GrMtlTypes.h" @@ -14,15 +13,14 @@ namespace flutter { -class SK_API_AVAILABLE_CA_METAL_LAYER IOSSurfaceMetal final : public IOSSurface, - public GPUSurfaceDelegate { +class SK_API_AVAILABLE_CA_METAL_LAYER IOSSurfaceMetal final : public IOSSurface { public: IOSSurfaceMetal(fml::scoped_nsobject layer, std::shared_ptr context, const std::shared_ptr& external_view_embedder); // |IOSSurface| - ~IOSSurfaceMetal() override; + ~IOSSurfaceMetal(); private: fml::scoped_nsobject layer_; @@ -37,9 +35,6 @@ class SK_API_AVAILABLE_CA_METAL_LAYER IOSSurfaceMetal final : public IOSSurface, // |IOSSurface| std::unique_ptr CreateGPUSurface(GrDirectContext* gr_context) override; - // |GPUSurfaceDelegate| - ExternalViewEmbedder* GetExternalViewEmbedder() override; - FML_DISALLOW_COPY_AND_ASSIGN(IOSSurfaceMetal); }; diff --git a/shell/platform/darwin/ios/ios_surface_metal.mm b/shell/platform/darwin/ios/ios_surface_metal.mm index 00271e610fc85..8dbeaea46321b 100644 --- a/shell/platform/darwin/ios/ios_surface_metal.mm +++ b/shell/platform/darwin/ios/ios_surface_metal.mm @@ -47,16 +47,10 @@ std::unique_ptr IOSSurfaceMetal::CreateGPUSurface(GrDirectContext* /* unused */) { auto metal_context = CastToMetalContext(GetContext()); - return std::make_unique(this, // Metal surface delegate - layer_, // layer + return std::make_unique(layer_, // layer metal_context->GetMainContext(), // context metal_context->GetMainCommandQueue() // command queue ); } -// |GPUSurfaceDelegate| -ExternalViewEmbedder* IOSSurfaceMetal::GetExternalViewEmbedder() { - return GetSurfaceExternalViewEmbedder().get(); -} - } // namespace flutter diff --git a/shell/platform/darwin/ios/ios_surface_software.h b/shell/platform/darwin/ios/ios_surface_software.h index 915071af8b954..3f86de981a209 100644 --- a/shell/platform/darwin/ios/ios_surface_software.h +++ b/shell/platform/darwin/ios/ios_surface_software.h @@ -39,9 +39,6 @@ class IOSSurfaceSoftware final : public IOSSurface, public GPUSurfaceSoftwareDel // |GPUSurfaceSoftwareDelegate| bool PresentBackingStore(sk_sp backing_store) override; - // |GPUSurfaceSoftwareDelegate| - ExternalViewEmbedder* GetExternalViewEmbedder() override; - private: fml::scoped_nsobject layer_; sk_sp sk_surface_; diff --git a/shell/platform/darwin/ios/ios_surface_software.mm b/shell/platform/darwin/ios/ios_surface_software.mm index 8899bc675b881..a945bbb175104 100644 --- a/shell/platform/darwin/ios/ios_surface_software.mm +++ b/shell/platform/darwin/ios/ios_surface_software.mm @@ -123,9 +123,4 @@ return true; } -// |GPUSurfaceSoftwareDelegate| -ExternalViewEmbedder* IOSSurfaceSoftware::GetExternalViewEmbedder() { - return GetSurfaceExternalViewEmbedder().get(); -} - } // namespace flutter diff --git a/shell/platform/embedder/embedder_surface_gl.cc b/shell/platform/embedder/embedder_surface_gl.cc index 05ff3e95ed3cb..53b0e9c3e3b85 100644 --- a/shell/platform/embedder/embedder_surface_gl.cc +++ b/shell/platform/embedder/embedder_surface_gl.cc @@ -70,11 +70,6 @@ SkMatrix EmbedderSurfaceGL::GLContextSurfaceTransformation() const { return callback(); } -// |GPUSurfaceGLDelegate| -ExternalViewEmbedder* EmbedderSurfaceGL::GetExternalViewEmbedder() { - return external_view_embedder_.get(); -} - // |GPUSurfaceGLDelegate| EmbedderSurfaceGL::GLProcResolver EmbedderSurfaceGL::GetGLProcResolver() const { return gl_dispatch_table_.gl_proc_resolver; diff --git a/shell/platform/embedder/embedder_surface_gl.h b/shell/platform/embedder/embedder_surface_gl.h index 43ad1e4778bf6..6f07bcce9ef51 100644 --- a/shell/platform/embedder/embedder_surface_gl.h +++ b/shell/platform/embedder/embedder_surface_gl.h @@ -67,9 +67,6 @@ class EmbedderSurfaceGL final : public EmbedderSurface, // |GPUSurfaceGLDelegate| SkMatrix GLContextSurfaceTransformation() const override; - // |GPUSurfaceGLDelegate| - ExternalViewEmbedder* GetExternalViewEmbedder() override; - // |GPUSurfaceGLDelegate| GLProcResolver GetGLProcResolver() const override; diff --git a/shell/platform/embedder/embedder_surface_software.cc b/shell/platform/embedder/embedder_surface_software.cc index 914087ec1081b..e427936b6ba3b 100644 --- a/shell/platform/embedder/embedder_surface_software.cc +++ b/shell/platform/embedder/embedder_surface_software.cc @@ -106,9 +106,4 @@ bool EmbedderSurfaceSoftware::PresentBackingStore( ); } -// |GPUSurfaceSoftwareDelegate| -ExternalViewEmbedder* EmbedderSurfaceSoftware::GetExternalViewEmbedder() { - return external_view_embedder_.get(); -} - } // namespace flutter diff --git a/shell/platform/embedder/embedder_surface_software.h b/shell/platform/embedder/embedder_surface_software.h index a08122809f92b..21c60cfae208e 100644 --- a/shell/platform/embedder/embedder_surface_software.h +++ b/shell/platform/embedder/embedder_surface_software.h @@ -47,9 +47,6 @@ class EmbedderSurfaceSoftware final : public EmbedderSurface, // |GPUSurfaceSoftwareDelegate| bool PresentBackingStore(sk_sp backing_store) override; - // |GPUSurfaceSoftwareDelegate| - ExternalViewEmbedder* GetExternalViewEmbedder() override; - FML_DISALLOW_COPY_AND_ASSIGN(EmbedderSurfaceSoftware); }; diff --git a/shell/platform/fuchsia/flutter/platform_view.h b/shell/platform/fuchsia/flutter/platform_view.h index 28765d2fd146a..d847d29540cb1 100644 --- a/shell/platform/fuchsia/flutter/platform_view.h +++ b/shell/platform/fuchsia/flutter/platform_view.h @@ -80,6 +80,10 @@ class PlatformView final : public flutter::PlatformView, // |PlatformView| flutter::PointerDataDispatcherMaker GetDispatcherMaker() override; + // |flutter::PlatformView| + std::shared_ptr CreateExternalViewEmbedder() + override; + private: void RegisterPlatformMessageHandlers(); @@ -121,10 +125,6 @@ class PlatformView final : public flutter::PlatformView, // |flutter::PlatformView| std::unique_ptr CreateRenderingSurface() override; - // |flutter::PlatformView| - std::shared_ptr CreateExternalViewEmbedder() - override; - // |flutter::PlatformView| void HandlePlatformMessage( fml::RefPtr message) override; diff --git a/shell/platform/fuchsia/flutter/platform_view_unittest.cc b/shell/platform/fuchsia/flutter/platform_view_unittest.cc index 38f771ce257b9..eb3a16b32f097 100644 --- a/shell/platform/fuchsia/flutter/platform_view_unittest.cc +++ b/shell/platform/fuchsia/flutter/platform_view_unittest.cc @@ -215,7 +215,8 @@ TEST_F(PlatformViewTests, CreateSurfaceTest) { RunLoopUntilIdle(); EXPECT_EQ(gr_context.get(), delegate.surface()->GetContext()); - EXPECT_EQ(view_embedder.get(), delegate.surface()->GetExternalViewEmbedder()); + EXPECT_EQ(view_embedder.get(), + platform_view.CreateExternalViewEmbedder().get()); } // This test makes sure that the PlatformView correctly registers Scenic diff --git a/shell/platform/fuchsia/flutter/surface.cc b/shell/platform/fuchsia/flutter/surface.cc index 27753721bcc1c..aadfffe73c413 100644 --- a/shell/platform/fuchsia/flutter/surface.cc +++ b/shell/platform/fuchsia/flutter/surface.cc @@ -51,9 +51,4 @@ SkMatrix Surface::GetRootTransformation() const { return matrix; } -// |flutter::GetViewEmbedder| -flutter::ExternalViewEmbedder* Surface::GetExternalViewEmbedder() { - return view_embedder_.get(); -} - } // namespace flutter_runner diff --git a/shell/platform/fuchsia/flutter/surface.h b/shell/platform/fuchsia/flutter/surface.h index bc95d88cc10d4..5d9098fbc6e07 100644 --- a/shell/platform/fuchsia/flutter/surface.h +++ b/shell/platform/fuchsia/flutter/surface.h @@ -39,9 +39,6 @@ class Surface final : public flutter::Surface { // |flutter::Surface| SkMatrix GetRootTransformation() const override; - // |flutter::Surface| - flutter::ExternalViewEmbedder* GetExternalViewEmbedder() override; - FML_DISALLOW_COPY_AND_ASSIGN(Surface); };