Flutter Engine
android_surface_vulkan.h
Go to the documentation of this file.
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_SHELL_PLATFORM_ANDROID_ANDROID_SURFACE_VULKAN_H_
6 #define FLUTTER_SHELL_PLATFORM_ANDROID_ANDROID_SURFACE_VULKAN_H_
7 
8 #include <jni.h>
9 
10 #include <memory>
11 
12 #include "flutter/fml/macros.h"
13 #include "flutter/shell/gpu/gpu_surface_vulkan_delegate.h"
14 #include "flutter/shell/platform/android/external_view_embedder/external_view_embedder.h"
15 #include "flutter/shell/platform/android/jni/platform_view_android_jni.h"
16 #include "flutter/shell/platform/android/surface/android_surface.h"
17 #include "flutter/vulkan/vulkan_window.h"
18 
19 namespace flutter {
20 
23  public:
25  std::shared_ptr<AndroidContext> android_context,
26  std::shared_ptr<PlatformViewAndroidJNI> jni_facade,
27  std::shared_ptr<AndroidExternalViewEmbedder> external_view_embedder);
28 
29  ~AndroidSurfaceVulkan() override;
30 
31  // |AndroidSurface|
32  bool IsValid() const override;
33 
34  // |AndroidSurface|
35  std::unique_ptr<Surface> CreateGPUSurface(
36  GrDirectContext* gr_context) override;
37 
38  // |AndroidSurface|
39  void TeardownOnScreenContext() override;
40 
41  // |AndroidSurface|
42  bool OnScreenSurfaceResize(const SkISize& size) override;
43 
44  // |AndroidSurface|
45  bool ResourceContextMakeCurrent() override;
46 
47  // |AndroidSurface|
48  bool ResourceContextClearCurrent() override;
49 
50  // |AndroidSurface|
52 
53  // |GPUSurfaceVulkanDelegate|
55 
56  // |GPUSurfaceVulkanDelegate|
58 
59  private:
60  const std::shared_ptr<AndroidExternalViewEmbedder> external_view_embedder_;
62  fml::RefPtr<AndroidNativeWindow> native_window_;
63 
64  FML_DISALLOW_COPY_AND_ASSIGN(AndroidSurfaceVulkan);
65 };
66 
67 } // namespace flutter
68 
69 #endif // FLUTTER_SHELL_PLATFORM_ANDROID_ANDROID_SURFACE_VULKAN_H_
bool SetNativeWindow(fml::RefPtr< AndroidNativeWindow > window) override
ExternalViewEmbedder * GetExternalViewEmbedder() override
Gets the view embedder that controls how the Flutter layer hierarchy split into multiple chunks shoul...
fml::RefPtr< vulkan::VulkanProcTable > vk() override
constexpr std::size_t size(T(&array)[N])
Definition: size.h:13
AndroidSurfaceVulkan(std::shared_ptr< AndroidContext > android_context, std::shared_ptr< PlatformViewAndroidJNI > jni_facade, std::shared_ptr< AndroidExternalViewEmbedder > external_view_embedder)
bool OnScreenSurfaceResize(const SkISize &size) override
std::unique_ptr< Surface > CreateGPUSurface(GrDirectContext *gr_context) override