From ad60da5e59c92463db13d45e76f78fe38c484f14 Mon Sep 17 00:00:00 2001 From: Dan Field Date: Thu, 19 May 2022 12:10:42 -0700 Subject: [PATCH] Guard impeller references in platform_view_android.cc for google build (flutter/engine#33487) --- .../shell/platform/android/platform_view_android.cc | 10 ++++++++++ 1 file changed, 10 insertions(+) diff --git a/engine/src/flutter/shell/platform/android/platform_view_android.cc b/engine/src/flutter/shell/platform/android/platform_view_android.cc index 6d6068ac71..f6f439059d 100644 --- a/engine/src/flutter/shell/platform/android/platform_view_android.cc +++ b/engine/src/flutter/shell/platform/android/platform_view_android.cc @@ -10,10 +10,14 @@ #include "flutter/fml/synchronization/waitable_event.h" #include "flutter/shell/common/shell_io_manager.h" #include "flutter/shell/gpu/gpu_surface_gl_delegate.h" +#if IMPELLER_SUPPORTS_PLATFORM #include "flutter/shell/platform/android/android_context_gl_impeller.h" +#endif #include "flutter/shell/platform/android/android_context_gl_skia.h" #include "flutter/shell/platform/android/android_external_texture_gl.h" +#if IMPELLER_SUPPORTS_PLATFORM #include "flutter/shell/platform/android/android_surface_gl_impeller.h" +#endif #include "flutter/shell/platform/android/android_surface_gl_skia.h" #include "flutter/shell/platform/android/android_surface_software.h" #include "flutter/shell/platform/android/context/android_context.h" @@ -42,13 +46,17 @@ std::unique_ptr AndroidSurfaceFactoryImpl::CreateSurface() { return std::make_unique(android_context_, jni_facade_); case AndroidRenderingAPI::kOpenGLES: +#if IMPELLER_SUPPORTS_PLATFORM if (enable_impeller_) { return std::make_unique(android_context_, jni_facade_); } else { +#endif return std::make_unique(android_context_, jni_facade_); +#if IMPELLER_SUPPORTS_PLATFORM } +#endif default: FML_DCHECK(false); return nullptr; @@ -63,9 +71,11 @@ static std::shared_ptr CreateAndroidContext( if (use_software_rendering) { return std::make_shared(AndroidRenderingAPI::kSoftware); } +#if IMPELLER_SUPPORTS_PLATFORM if (enable_impeller) { return std::make_unique(); } +#endif return std::make_unique( AndroidRenderingAPI::kOpenGLES, // fml::MakeRefCounted(), //