From b6035062ff4a178ea78457b828ea3433f93e20b0 Mon Sep 17 00:00:00 2001 From: Chris Yang Date: Thu, 20 Aug 2020 17:46:01 -0700 Subject: [PATCH] Enable ios platform view by default (#20671) --- shell/platform/darwin/ios/ios_surface.h | 2 -- shell/platform/darwin/ios/ios_surface.mm | 17 ----------------- shell/platform/darwin/ios/ios_surface_gl.mm | 2 +- shell/platform/darwin/ios/ios_surface_metal.mm | 2 +- .../platform/darwin/ios/ios_surface_software.mm | 2 +- .../ios/Scenarios/Scenarios/Info.plist | 2 -- 6 files changed, 3 insertions(+), 24 deletions(-) diff --git a/shell/platform/darwin/ios/ios_surface.h b/shell/platform/darwin/ios/ios_surface.h index d5dfca552..a01f9f15c 100644 --- a/shell/platform/darwin/ios/ios_surface.h +++ b/shell/platform/darwin/ios/ios_surface.h @@ -34,8 +34,6 @@ class IOSSurface : public ExternalViewEmbedder { std::shared_ptr GetContext() const; - ExternalViewEmbedder* GetExternalViewEmbedderIfEnabled(); - virtual bool IsValid() const = 0; virtual void UpdateStorageSizeIfNecessary() = 0; diff --git a/shell/platform/darwin/ios/ios_surface.mm b/shell/platform/darwin/ios/ios_surface.mm index 30327582a..65fccb052 100644 --- a/shell/platform/darwin/ios/ios_surface.mm +++ b/shell/platform/darwin/ios/ios_surface.mm @@ -13,15 +13,6 @@ namespace flutter { -// The name of the Info.plist flag to enable the embedded iOS views preview. -constexpr const char* kEmbeddedViewsPreview = "io.flutter.embedded_views_preview"; - -bool IsIosEmbeddedViewsPreviewEnabled() { - static bool preview_enabled = - [[[NSBundle mainBundle] objectForInfoDictionaryKey:@(kEmbeddedViewsPreview)] boolValue]; - return preview_enabled; -} - std::unique_ptr IOSSurface::Create( std::shared_ptr context, fml::scoped_nsobject layer, @@ -75,14 +66,6 @@ SkCanvas* IOSSurface::GetRootCanvas() { return nullptr; } -ExternalViewEmbedder* IOSSurface::GetExternalViewEmbedderIfEnabled() { - if (IsIosEmbeddedViewsPreviewEnabled()) { - return this; - } else { - return nullptr; - } -} - // |ExternalViewEmbedder| void IOSSurface::CancelFrame() { TRACE_EVENT0("flutter", "IOSSurface::CancelFrame"); diff --git a/shell/platform/darwin/ios/ios_surface_gl.mm b/shell/platform/darwin/ios/ios_surface_gl.mm index 9da8d9ea5..05d2d3135 100644 --- a/shell/platform/darwin/ios/ios_surface_gl.mm +++ b/shell/platform/darwin/ios/ios_surface_gl.mm @@ -84,7 +84,7 @@ bool IOSSurfaceGL::GLContextPresent() { // |GPUSurfaceGLDelegate| ExternalViewEmbedder* IOSSurfaceGL::GetExternalViewEmbedder() { - return GetExternalViewEmbedderIfEnabled(); + return this; } } // namespace flutter diff --git a/shell/platform/darwin/ios/ios_surface_metal.mm b/shell/platform/darwin/ios/ios_surface_metal.mm index 60afa6fd6..df0d2739c 100644 --- a/shell/platform/darwin/ios/ios_surface_metal.mm +++ b/shell/platform/darwin/ios/ios_surface_metal.mm @@ -55,7 +55,7 @@ std::unique_ptr IOSSurfaceMetal::CreateGPUSurface(GrDirectContext* /* u // |GPUSurfaceDelegate| ExternalViewEmbedder* IOSSurfaceMetal::GetExternalViewEmbedder() { - return GetExternalViewEmbedderIfEnabled(); + return this; } } // namespace flutter diff --git a/shell/platform/darwin/ios/ios_surface_software.mm b/shell/platform/darwin/ios/ios_surface_software.mm index a68e0509f..03e85aec6 100644 --- a/shell/platform/darwin/ios/ios_surface_software.mm +++ b/shell/platform/darwin/ios/ios_surface_software.mm @@ -124,7 +124,7 @@ bool IOSSurfaceSoftware::PresentBackingStore(sk_sp backing_store) { // |GPUSurfaceSoftwareDelegate| ExternalViewEmbedder* IOSSurfaceSoftware::GetExternalViewEmbedder() { - return GetExternalViewEmbedderIfEnabled(); + return this; } } // namespace flutter diff --git a/testing/scenario_app/ios/Scenarios/Scenarios/Info.plist b/testing/scenario_app/ios/Scenarios/Scenarios/Info.plist index 032a9620f..bc23fd544 100644 --- a/testing/scenario_app/ios/Scenarios/Scenarios/Info.plist +++ b/testing/scenario_app/ios/Scenarios/Scenarios/Info.plist @@ -41,7 +41,5 @@ UIInterfaceOrientationLandscapeLeft UIInterfaceOrientationLandscapeRight - io.flutter.embedded_views_preview - -- GitLab