Flutter Engine Uber Docs
Docs for the entire Flutter Engine repo.
 
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
17#include "impeller/base/flags.h"
18
19namespace impeller {
20class Context;
21}
22
23namespace flutter {
24
27 public:
29 std::function<bool(GPUMTLTextureInfo texture)> present; // required
30 std::function<GPUMTLTextureInfo(const DlISize& frame_size)>
31 get_texture; // required
32 };
33
36 GPUMTLCommandQueueHandle command_queue,
37 MetalDispatchTable dispatch_table,
38 std::shared_ptr<EmbedderExternalViewEmbedder> external_view_embedder,
39 impeller::Flags impeller_flags);
40
42
43 private:
44 bool valid_ = false;
45 MetalDispatchTable metal_dispatch_table_;
46 std::shared_ptr<EmbedderExternalViewEmbedder> external_view_embedder_;
47 std::shared_ptr<impeller::Context> context_;
48 std::shared_ptr<impeller::AiksContext> aiks_context_;
49
50 // |EmbedderSurface|
51 bool IsValid() const override;
52
53 // |EmbedderSurface|
54 std::unique_ptr<Surface> CreateGPUSurface() override;
55
56 // |GPUSurfaceMetalDelegate|
57 GPUCAMetalLayerHandle GetCAMetalLayer(
58 const DlISize& frame_size) const override;
59
60 // |GPUSurfaceMetalDelegate|
61 bool PresentDrawable(GrMTLHandle drawable) const override;
62
63 // |GPUSurfaceMetalDelegate|
64 GPUMTLTextureInfo GetMTLTexture(const DlISize& frame_size) const override;
65
66 // |GPUSurfaceMetalDelegate|
67 bool PresentTexture(GPUMTLTextureInfo texture) const override;
68
69 // |EmbedderSurface|
70 std::shared_ptr<impeller::Context> CreateImpellerContext() const override;
71
73};
74
75} // namespace flutter
76
77#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