Flutter Engine
The Flutter Engine
ios_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_DARWIN_IOS_IOS_SURFACE_METAL_IMPELLER_H_
6#define FLUTTER_SHELL_PLATFORM_DARWIN_IOS_IOS_SURFACE_METAL_IMPELLER_H_
7
8#include "flutter/fml/macros.h"
9#include "flutter/shell/gpu/gpu_surface_metal_delegate.h"
10#include "flutter/shell/platform/darwin/ios/ios_surface.h"
11
12@class CAMetalLayer;
13
14namespace impeller {
15class Context;
16} // namespace impeller
17
18namespace flutter {
19
20class SK_API_AVAILABLE_CA_METAL_LAYER IOSSurfaceMetalImpeller final
21 : public IOSSurface,
23 public:
25 const std::shared_ptr<IOSContext>& context);
26
27 // |IOSSurface|
29
30 private:
32 const std::shared_ptr<impeller::Context> impeller_context_;
33 bool is_valid_ = false;
34
35 // |IOSSurface|
36 bool IsValid() const override;
37
38 // |IOSSurface|
39 void UpdateStorageSizeIfNecessary() override;
40
41 // |IOSSurface|
42 std::unique_ptr<Surface> CreateGPUSurface(GrDirectContext* gr_context) override;
43
44 // |GPUSurfaceMetalDelegate|
45 GPUCAMetalLayerHandle GetCAMetalLayer(const SkISize& frame_info) const override
46 __attribute__((cf_audited_transfer));
47
48 // |GPUSurfaceMetalDelegate|
49 bool PresentDrawable(GrMTLHandle drawable) const override __attribute__((cf_audited_transfer));
50
51 // |GPUSurfaceMetalDelegate|
52 GPUMTLTextureInfo GetMTLTexture(const SkISize& frame_info) const override
53 __attribute__((cf_audited_transfer));
54
55 // |GPUSurfaceMetalDelegate|
56 bool PresentTexture(GPUMTLTextureInfo texture) const override
57 __attribute__((cf_audited_transfer));
58
59 // |GPUSurfaceMetalDelegate|
60 bool AllowsDrawingWhenGpuDisabled() const override;
61
63};
64
65} // namespace flutter
66
67#endif // FLUTTER_SHELL_PLATFORM_DARWIN_IOS_IOS_SURFACE_METAL_IMPELLER_H_
const void * GrMTLHandle
Definition: GrMtlTypes.h:20
Interface implemented by all platform surfaces that can present a metal backing store to the "screen"...
#define FML_DISALLOW_COPY_AND_ASSIGN(TypeName)
Definition: macros.h:27
FlTexture * texture
struct flutter::ImageMetaData __attribute__((packed))
Definition: SkSize.h:16