From 2289895234fc9e0168c142f59f82fd28f1f620bd Mon Sep 17 00:00:00 2001 From: bungeman Date: Thu, 12 Sep 2024 08:55:07 -0400 Subject: [PATCH] Ensure Vulkan when including Skia Vulkan headers (flutter/engine#55126) Skia is changing how it handles its internal copy of Vulkan headers to prevent them from accidentally leaking to users and potentially overriding the user's Vulkan headers. Users of Skia are responsible for providing the Vulkan headers when including Skia's public Vk headers. This change only includes Skia's public Vk headers when Flutter is providing the Vulkan headers. --- engine/src/flutter/shell/platform/embedder/embedder.cc | 2 +- .../embedder/tests/embedder_test_backingstore_producer.cc | 6 +++--- 2 files changed, 4 insertions(+), 4 deletions(-) diff --git a/engine/src/flutter/shell/platform/embedder/embedder.cc b/engine/src/flutter/shell/platform/embedder/embedder.cc index a7543dcafc..7c510828ac 100644 --- a/engine/src/flutter/shell/platform/embedder/embedder.cc +++ b/engine/src/flutter/shell/platform/embedder/embedder.cc @@ -23,7 +23,6 @@ #include "third_party/skia/include/gpu/GpuTypes.h" #include "third_party/skia/include/gpu/ganesh/GrBackendSurface.h" #include "third_party/skia/include/gpu/ganesh/SkSurfaceGanesh.h" -#include "third_party/skia/include/gpu/ganesh/vk/GrVkTypes.h" #if !defined(FLUTTER_NO_EXPORT) #if FML_OS_WIN @@ -101,6 +100,7 @@ extern const intptr_t kPlatformStrongDillSize; #ifdef SHELL_ENABLE_VULKAN #include "third_party/skia/include/gpu/ganesh/vk/GrVkBackendSurface.h" +#include "third_party/skia/include/gpu/ganesh/vk/GrVkTypes.h" #endif // SHELL_ENABLE_VULKAN const int32_t kFlutterSemanticsNodeIdBatchEnd = -1; diff --git a/engine/src/flutter/shell/platform/embedder/tests/embedder_test_backingstore_producer.cc b/engine/src/flutter/shell/platform/embedder/tests/embedder_test_backingstore_producer.cc index 0c55f7f8d8..86ed5246cc 100644 --- a/engine/src/flutter/shell/platform/embedder/tests/embedder_test_backingstore_producer.cc +++ b/engine/src/flutter/shell/platform/embedder/tests/embedder_test_backingstore_producer.cc @@ -14,9 +14,6 @@ #include "third_party/skia/include/gpu/GpuTypes.h" #include "third_party/skia/include/gpu/ganesh/GrBackendSurface.h" #include "third_party/skia/include/gpu/ganesh/SkSurfaceGanesh.h" -#include "third_party/skia/include/gpu/ganesh/gl/GrGLBackendSurface.h" -#include "third_party/skia/include/gpu/ganesh/gl/GrGLTypes.h" -#include "third_party/skia/include/gpu/ganesh/vk/GrVkTypes.h" #include #include @@ -24,6 +21,7 @@ #ifdef SHELL_ENABLE_VULKAN #include "third_party/skia/include/gpu/ganesh/vk/GrVkBackendSurface.h" +#include "third_party/skia/include/gpu/ganesh/vk/GrVkTypes.h" #endif // SHELL_ENABLE_VULKAN #ifdef SHELL_ENABLE_METAL @@ -33,6 +31,8 @@ #ifdef SHELL_ENABLE_GL #include "flutter/testing/test_gl_surface.h" +#include "third_party/skia/include/gpu/ganesh/gl/GrGLBackendSurface.h" +#include "third_party/skia/include/gpu/ganesh/gl/GrGLTypes.h" #endif // SHELL_ENABLE_GL // TODO(zanderso): https://github.com/flutter/flutter/issues/127701