Flutter Engine
 
Loading...
Searching...
No Matches
embedder_surface_metal_impeller.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_EMBEDDER_EMBEDDER_SURFACE_METAL_IMPELLER_H_
6#define FLUTTER_SHELL_PLATFORM_EMBEDDER_EMBEDDER_SURFACE_METAL_IMPELLER_H_
7
8#include <memory>
16
17namespace impeller {
18class Context;
19}
20
21namespace flutter {
22
25 public:
27 std::function<bool(GPUMTLTextureInfo texture)> present; // required
28 std::function<GPUMTLTextureInfo(const DlISize& frame_size)>
29 get_texture; // required
30 };
31
34 GPUMTLCommandQueueHandle command_queue,
35 MetalDispatchTable dispatch_table,
36 std::shared_ptr<EmbedderExternalViewEmbedder> external_view_embedder);
37
39
40 private:
41 bool valid_ = false;
42 MetalDispatchTable metal_dispatch_table_;
43 std::shared_ptr<EmbedderExternalViewEmbedder> external_view_embedder_;
44 std::shared_ptr<impeller::Context> context_;
45 std::shared_ptr<impeller::AiksContext> aiks_context_;
46
47 // |EmbedderSurface|
48 bool IsValid() const override;
49
50 // |EmbedderSurface|
51 std::unique_ptr<Surface> CreateGPUSurface() override;
52
53 // |GPUSurfaceMetalDelegate|
54 GPUCAMetalLayerHandle GetCAMetalLayer(
55 const DlISize& frame_size) const override;
56
57 // |GPUSurfaceMetalDelegate|
58 bool PresentDrawable(GrMTLHandle drawable) const override;
59
60 // |GPUSurfaceMetalDelegate|
61 GPUMTLTextureInfo GetMTLTexture(const DlISize& frame_size) const override;
62
63 // |GPUSurfaceMetalDelegate|
64 bool PresentTexture(GPUMTLTextureInfo texture) const override;
65
66 // |EmbedderSurface|
67 std::shared_ptr<impeller::Context> CreateImpellerContext() const override;
68
70};
71
72} // namespace flutter
73
74#endif // FLUTTER_SHELL_PLATFORM_EMBEDDER_EMBEDDER_SURFACE_METAL_IMPELLER_H_
Interface implemented by all platform surfaces that can present a metal backing store to the "screen"...
VkDevice device
Definition main.cc:69
#define FML_DISALLOW_COPY_AND_ASSIGN(TypeName)
Definition macros.h:27
FlTexture * texture
std::function< GPUMTLTextureInfo(const DlISize &frame_size)> get_texture