diff --git a/ci/licenses_golden/licenses_flutter b/ci/licenses_golden/licenses_flutter index 638ae3138506c..8d469700299c5 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/platform_view.h b/shell/common/platform_view.h index 7b0fffd4c6743..07ba3a1bb6d93 100644 --- a/shell/common/platform_view.h +++ b/shell/common/platform_view.h @@ -563,6 +563,8 @@ class PlatformView { ComputePlatformResolvedLocales( const std::vector& supported_locale_data); + virtual std::shared_ptr CreateExternalViewEmbedder(); + protected: PlatformView::Delegate& delegate_; const TaskRunners task_runners_; @@ -575,8 +577,6 @@ class PlatformView { // GPU task runner. virtual std::unique_ptr CreateRenderingSurface(); - virtual std::shared_ptr CreateExternalViewEmbedder(); - private: FML_DISALLOW_COPY_AND_ASSIGN(PlatformView); }; diff --git a/shell/common/rasterizer.cc b/shell/common/rasterizer.cc index 4ec8d5b99026a..1d326a7727166 100644 --- a/shell/common/rasterizer.cc +++ b/shell/common/rasterizer.cc @@ -76,8 +76,8 @@ void Rasterizer::Setup(std::unique_ptr surface) { user_override_resource_cache_bytes_); } compositor_context_->OnGrContextCreated(); - if (surface_->GetExternalViewEmbedder() && - surface_->GetExternalViewEmbedder()->SupportsDynamicThreadMerging() && + if (external_view_embedder_ && + external_view_embedder_->SupportsDynamicThreadMerging() && !raster_thread_merger_) { const auto platform_id = delegate_.GetTaskRunners().GetPlatformTaskRunner()->GetTaskQueueId(); @@ -191,9 +191,9 @@ void Rasterizer::Draw(fml::RefPtr> pipeline, } // EndFrame should perform cleanups for the external_view_embedder. - if (surface_ != nullptr && surface_->GetExternalViewEmbedder() != nullptr) { - surface_->GetExternalViewEmbedder()->EndFrame(should_resubmit_frame, - raster_thread_merger_); + if (surface_ && external_view_embedder_) { + external_view_embedder_->EndFrame(should_resubmit_frame, + raster_thread_merger_); } // Consume as many pipeline items as possible. But yield the event loop @@ -423,14 +423,12 @@ RasterStatus Rasterizer::DrawToSurface(flutter::LayerTree& layer_tree) { // for instrumentation. compositor_context_->ui_time().SetLapTime(layer_tree.build_time()); - auto* external_view_embedder = surface_->GetExternalViewEmbedder(); - SkCanvas* embedder_root_canvas = nullptr; - if (external_view_embedder != nullptr) { - external_view_embedder->BeginFrame( + if (external_view_embedder_) { + external_view_embedder_->BeginFrame( layer_tree.frame_size(), surface_->GetContext(), layer_tree.device_pixel_ratio(), raster_thread_merger_); - embedder_root_canvas = external_view_embedder->GetRootCanvas(); + embedder_root_canvas = external_view_embedder_->GetRootCanvas(); } // On Android, the external view embedder deletes surfaces in `BeginFrame`. @@ -453,13 +451,13 @@ RasterStatus Rasterizer::DrawToSurface(flutter::LayerTree& layer_tree) { embedder_root_canvas ? embedder_root_canvas : frame->SkiaCanvas(); auto compositor_frame = compositor_context_->AcquireFrame( - surface_->GetContext(), // skia GrContext - root_surface_canvas, // root surface canvas - external_view_embedder, // external view embedder - root_surface_transformation, // root surface transformation - true, // instrumentation enabled - frame->supports_readback(), // surface supports pixel reads - raster_thread_merger_ // thread merger + surface_->GetContext(), // skia GrContext + root_surface_canvas, // root surface canvas + external_view_embedder_.get(), // external view embedder + root_surface_transformation, // root surface transformation + true, // instrumentation enabled + frame->supports_readback(), // surface supports pixel reads + raster_thread_merger_ // thread merger ); if (compositor_frame) { @@ -468,11 +466,11 @@ RasterStatus Rasterizer::DrawToSurface(flutter::LayerTree& layer_tree) { raster_status == RasterStatus::kSkipAndRetry) { return raster_status; } - if (external_view_embedder != nullptr && + if (external_view_embedder_ && (!raster_thread_merger_ || raster_thread_merger_->IsMerged())) { FML_DCHECK(!frame->IsSubmitted()); - external_view_embedder->SubmitFrame(surface_->GetContext(), - std::move(frame)); + external_view_embedder_->SubmitFrame(surface_->GetContext(), + std::move(frame)); } else { frame->Submit(); } @@ -653,6 +651,11 @@ void Rasterizer::SetNextFrameCallback(const fml::closure& callback) { next_frame_callback_ = callback; } +void Rasterizer::SetExternalViewEmbedder( + const std::shared_ptr& view_embedder) { + external_view_embedder_ = view_embedder; +} + void Rasterizer::FireNextFrameCallbackIfPresent() { if (!next_frame_callback_) { return; diff --git a/shell/common/rasterizer.h b/shell/common/rasterizer.h index b658f18e0674c..0637ad37ca955 100644 --- a/shell/common/rasterizer.h +++ b/shell/common/rasterizer.h @@ -8,6 +8,7 @@ #include #include +#include "flow/embedded_views.h" #include "flutter/common/settings.h" #include "flutter/common/task_runners.h" #include "flutter/flow/compositor_context.h" @@ -349,6 +350,16 @@ class Rasterizer final : public SnapshotDelegate { /// void SetNextFrameCallback(const fml::closure& callback); + //---------------------------------------------------------------------------- + /// @brief Set the External View Embedder. This is done on shell + /// initialization. This is non-null on platforms that support + /// embedding externally composited views. + /// + /// @param[in] view_embedder The external view embedder object. + /// + void SetExternalViewEmbedder( + const std::shared_ptr& view_embedder); + //---------------------------------------------------------------------------- /// @brief Returns a pointer to the compositor context used by this /// rasterizer. This pointer will never be `nullptr`. @@ -437,6 +448,7 @@ class Rasterizer final : public SnapshotDelegate { std::optional max_cache_bytes_; fml::RefPtr raster_thread_merger_; fml::TaskRunnerAffineWeakPtrFactory weak_factory_; + std::shared_ptr external_view_embedder_; // |SnapshotDelegate| sk_sp MakeRasterSnapshot(sk_sp picture, diff --git a/shell/common/rasterizer_unittests.cc b/shell/common/rasterizer_unittests.cc index 2ccc9ca706bbb..38611b0343723 100644 --- a/shell/common/rasterizer_unittests.cc +++ b/shell/common/rasterizer_unittests.cc @@ -113,9 +113,9 @@ TEST(RasterizerTest, auto rasterizer = std::make_unique(delegate); auto surface = std::make_unique(); - MockExternalViewEmbedder external_view_embedder; - EXPECT_CALL(*surface, GetExternalViewEmbedder()) - .WillRepeatedly(Return(&external_view_embedder)); + std::shared_ptr external_view_embedder = + std::make_shared(); + rasterizer->SetExternalViewEmbedder(external_view_embedder); auto surface_frame = std::make_unique( /*surface=*/nullptr, /*supports_readback=*/true, @@ -123,15 +123,15 @@ TEST(RasterizerTest, EXPECT_CALL(*surface, AcquireFrame(SkISize())) .WillOnce(Return(ByMove(std::move(surface_frame)))); - EXPECT_CALL(external_view_embedder, + EXPECT_CALL(*external_view_embedder, BeginFrame(/*frame_size=*/SkISize(), /*context=*/nullptr, /*device_pixel_ratio=*/2.0, /*raster_thread_merger=*/ fml::RefPtr(nullptr))) .Times(1); - EXPECT_CALL(external_view_embedder, SubmitFrame).Times(1); + EXPECT_CALL(*external_view_embedder, SubmitFrame).Times(1); EXPECT_CALL( - external_view_embedder, + *external_view_embedder, EndFrame(/*should_resubmit_frame=*/false, /*raster_thread_merger=*/fml::RefPtr( nullptr))) @@ -170,10 +170,10 @@ TEST( EXPECT_CALL(delegate, OnFrameRasterized(_)); auto rasterizer = std::make_unique(delegate); auto surface = std::make_unique(); - MockExternalViewEmbedder external_view_embedder; - EXPECT_CALL(*surface, GetExternalViewEmbedder()) - .WillRepeatedly(Return(&external_view_embedder)); - EXPECT_CALL(external_view_embedder, SupportsDynamicThreadMerging) + std::shared_ptr external_view_embedder = + std::make_shared(); + rasterizer->SetExternalViewEmbedder(external_view_embedder); + EXPECT_CALL(*external_view_embedder, SupportsDynamicThreadMerging) .WillRepeatedly(Return(true)); auto surface_frame = std::make_unique( /*surface=*/nullptr, /*supports_readback=*/true, @@ -181,14 +181,14 @@ TEST( EXPECT_CALL(*surface, AcquireFrame(SkISize())) .WillOnce(Return(ByMove(std::move(surface_frame)))); - EXPECT_CALL(external_view_embedder, + EXPECT_CALL(*external_view_embedder, BeginFrame(/*frame_size=*/SkISize(), /*context=*/nullptr, /*device_pixel_ratio=*/2.0, /*raster_thread_merger=*/_)) .Times(1); - EXPECT_CALL(external_view_embedder, SubmitFrame).Times(0); - EXPECT_CALL(external_view_embedder, EndFrame(/*should_resubmit_frame=*/false, - /*raster_thread_merger=*/_)) + EXPECT_CALL(*external_view_embedder, SubmitFrame).Times(0); + EXPECT_CALL(*external_view_embedder, EndFrame(/*should_resubmit_frame=*/false, + /*raster_thread_merger=*/_)) .Times(1); rasterizer->Setup(std::move(surface)); @@ -229,26 +229,26 @@ TEST( auto rasterizer = std::make_unique(delegate); auto surface = std::make_unique(); - MockExternalViewEmbedder external_view_embedder; - EXPECT_CALL(*surface, GetExternalViewEmbedder()) - .WillRepeatedly(Return(&external_view_embedder)); + std::shared_ptr external_view_embedder = + std::make_shared(); + rasterizer->SetExternalViewEmbedder(external_view_embedder); auto surface_frame = std::make_unique( /*surface=*/nullptr, /*supports_readback=*/true, /*submit_callback=*/[](const SurfaceFrame&, SkCanvas*) { return true; }); EXPECT_CALL(*surface, AcquireFrame(SkISize())) .WillOnce(Return(ByMove(std::move(surface_frame)))); - EXPECT_CALL(external_view_embedder, SupportsDynamicThreadMerging) + EXPECT_CALL(*external_view_embedder, SupportsDynamicThreadMerging) .WillRepeatedly(Return(true)); - EXPECT_CALL(external_view_embedder, + EXPECT_CALL(*external_view_embedder, BeginFrame(/*frame_size=*/SkISize(), /*context=*/nullptr, /*device_pixel_ratio=*/2.0, /*raster_thread_merger=*/_)) .Times(1); - EXPECT_CALL(external_view_embedder, SubmitFrame).Times(1); - EXPECT_CALL(external_view_embedder, EndFrame(/*should_resubmit_frame=*/false, - /*raster_thread_merger=*/_)) + EXPECT_CALL(*external_view_embedder, SubmitFrame).Times(1); + EXPECT_CALL(*external_view_embedder, EndFrame(/*should_resubmit_frame=*/false, + /*raster_thread_merger=*/_)) .Times(1); rasterizer->Setup(std::move(surface)); @@ -261,4 +261,40 @@ TEST( auto no_discard = [](LayerTree&) { return false; }; rasterizer->Draw(pipeline, no_discard); } + +TEST(RasterizerTest, externalViewEmbedderDoesntEndFrameWhenNoSurfaceIsSet) { + std::string test_name = + ::testing::UnitTest::GetInstance()->current_test_info()->name(); + ThreadHost thread_host("io.flutter.test." + test_name + ".", + ThreadHost::Type::Platform | ThreadHost::Type::GPU | + ThreadHost::Type::IO | ThreadHost::Type::UI); + TaskRunners task_runners("test", thread_host.platform_thread->GetTaskRunner(), + thread_host.raster_thread->GetTaskRunner(), + thread_host.ui_thread->GetTaskRunner(), + thread_host.io_thread->GetTaskRunner()); + MockDelegate delegate; + EXPECT_CALL(delegate, GetTaskRunners()) + .WillRepeatedly(ReturnRef(task_runners)); + auto rasterizer = std::make_unique(delegate); + + std::shared_ptr external_view_embedder = + std::make_shared(); + rasterizer->SetExternalViewEmbedder(external_view_embedder); + + EXPECT_CALL( + *external_view_embedder, + EndFrame(/*should_resubmit_frame=*/false, + /*raster_thread_merger=*/fml::RefPtr( + nullptr))) + .Times(0); + + fml::AutoResetWaitableEvent latch; + thread_host.raster_thread->GetTaskRunner()->PostTask([&] { + auto pipeline = fml::AdoptRef(new Pipeline(/*depth=*/10)); + auto no_discard = [](LayerTree&) { return false; }; + rasterizer->Draw(pipeline, no_discard); + latch.Signal(); + }); + latch.Wait(); +} } // namespace flutter diff --git a/shell/common/shell.cc b/shell/common/shell.cc index b9dabf587b5d1..a8a8b884e4c0f 100644 --- a/shell/common/shell.cc +++ b/shell/common/shell.cc @@ -547,6 +547,10 @@ bool Shell::Setup(std::unique_ptr platform_view, rasterizer_ = std::move(rasterizer); io_manager_ = std::move(io_manager); + // Set the external view embedder for the rasterizer. + auto view_embedder = platform_view_->CreateExternalViewEmbedder(); + rasterizer_->SetExternalViewEmbedder(view_embedder); + // The weak ptr must be generated in the platform thread which owns the unique // ptr. weak_engine_ = engine_->GetWeakPtr(); 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); };