From 8f946425c75ea4456622ac2b85ed07ffc7fc52b1 Mon Sep 17 00:00:00 2001 From: Ben Wagner Date: Wed, 11 Sep 2024 22:03:48 -0400 Subject: [PATCH] Ensure Vulkan when including Skia Vulkan headers 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. --- shell/platform/embedder/embedder.cc | 2 +- .../embedder/tests/embedder_test_backingstore_producer.cc | 6 +++--- 2 files changed, 4 insertions(+), 4 deletions(-) diff --git a/shell/platform/embedder/embedder.cc b/shell/platform/embedder/embedder.cc index a7543dcafc2ad..7c510828acb3f 100644 --- a/shell/platform/embedder/embedder.cc +++ b/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/shell/platform/embedder/tests/embedder_test_backingstore_producer.cc b/shell/platform/embedder/tests/embedder_test_backingstore_producer.cc index 0c55f7f8d8716..86ed5246cc5e0 100644 --- a/shell/platform/embedder/tests/embedder_test_backingstore_producer.cc +++ b/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