Flutter Engine
The Flutter Engine
Loading...
Searching...
No Matches
ios_surface_metal_skia.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_SKIA_H_
6#define FLUTTER_SHELL_PLATFORM_DARWIN_IOS_IOS_SURFACE_METAL_SKIA_H_
7
8#include "flutter/fml/macros.h"
9#include "flutter/shell/gpu/gpu_surface_metal_delegate.h"
10#import "flutter/shell/platform/darwin/ios/ios_surface.h"
12
13@class CAMetalLayer;
14
15namespace flutter {
16
17class SK_API_AVAILABLE_CA_METAL_LAYER IOSSurfaceMetalSkia final : public IOSSurface,
19 public:
21 std::shared_ptr<IOSContext> context);
22
23 // |IOSSurface|
25
26 private:
28 id<MTLDevice> device_;
29 id<MTLCommandQueue> command_queue_;
30 bool is_valid_ = false;
31
32 // |IOSSurface|
33 bool IsValid() const override;
34
35 // |IOSSurface|
36 void UpdateStorageSizeIfNecessary() override;
37
38 // |IOSSurface|
39 std::unique_ptr<Surface> CreateGPUSurface(GrDirectContext* gr_context) override;
40
41 // |GPUSurfaceMetalDelegate|
42 GPUCAMetalLayerHandle GetCAMetalLayer(const SkISize& frame_info) const override
43 __attribute__((cf_audited_transfer));
44
45 // |GPUSurfaceMetalDelegate|
46 bool PresentDrawable(GrMTLHandle drawable) const override __attribute__((cf_audited_transfer));
47
48 // |GPUSurfaceMetalDelegate|
49 GPUMTLTextureInfo GetMTLTexture(const SkISize& frame_info) const override
50 __attribute__((cf_audited_transfer));
51
52 // |GPUSurfaceMetalDelegate|
53 bool PresentTexture(GPUMTLTextureInfo texture) const override
54 __attribute__((cf_audited_transfer));
55
56 // |GPUSurfaceMetalDelegate|
57 bool AllowsDrawingWhenGpuDisabled() const override;
58
60};
61
62} // namespace flutter
63
64#endif // FLUTTER_SHELL_PLATFORM_DARWIN_IOS_IOS_SURFACE_METAL_SKIA_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
__attribute__((visibility("default"))) int RunBenchmarks(int argc
FlTexture * texture