1 // Copyright 2013 The Flutter Authors. All rights reserved. 2 // Use of this source code is governed by a BSD-style license that can be 3 // found in the LICENSE file. 4 5 #ifndef FLUTTER_VULKAN_VULKAN_NATIVE_SURFACE_ANDROID_H_ 6 #define FLUTTER_VULKAN_VULKAN_NATIVE_SURFACE_ANDROID_H_ 7 8 #include "flutter/fml/macros.h" 9 #include "flutter/vulkan/vulkan_native_surface.h" 10 11 struct ANativeWindow; 12 typedef struct ANativeWindow ANativeWindow; 13 14 namespace vulkan { 15 16 class VulkanNativeSurfaceAndroid : public VulkanNativeSurface { 17 public: 18 /// Create a native surface from the valid ANativeWindow reference. Ownership 19 /// of the ANativeWindow is assumed by this instance. 20 VulkanNativeSurfaceAndroid(ANativeWindow* native_window); 21 22 ~VulkanNativeSurfaceAndroid(); 23 24 const char* GetExtensionName() const override; 25 26 uint32_t GetSkiaExtensionName() const override; 27 28 VkSurfaceKHR CreateSurfaceHandle( 29 VulkanProcTable& vk, 30 const VulkanHandle<VkInstance>& instance) const override; 31 32 bool IsValid() const override; 33 34 SkISize GetSize() const override; 35 36 private: 37 ANativeWindow* native_window_; 38 39 FML_DISALLOW_COPY_AND_ASSIGN(VulkanNativeSurfaceAndroid); 40 }; 41 42 } // namespace vulkan 43 44 #endif // FLUTTER_VULKAN_VULKAN_NATIVE_SURFACE_ANDROID_H_ 45