Flutter Engine
The Flutter Engine
FlutterDarwinExternalTextureMetal.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_GRAPHICS_FLUTTERDARWINEXTERNALTEXTUREMETAL_H_
6#define FLUTTER_SHELL_PLATFORM_DARWIN_GRAPHICS_FLUTTERDARWINEXTERNALTEXTUREMETAL_H_
7
8#import <Foundation/Foundation.h>
9#import <Metal/Metal.h>
10
11#include "flutter/common/graphics/texture.h"
12#import "flutter/shell/platform/darwin/common/framework/Headers/FlutterTexture.h"
15
17
18+ (sk_sp<SkImage>)wrapYUVATexture:(nonnull id<MTLTexture>)yTex
19 UVTex:(nonnull id<MTLTexture>)uvTex
20 YUVColorSpace:(SkYUVColorSpace)colorSpace
21 grContext:(nonnull GrDirectContext*)grContext
22 width:(size_t)width
23 height:(size_t)height;
24
25+ (sk_sp<SkImage>)wrapRGBATexture:(nonnull id<MTLTexture>)rgbaTex
26 grContext:(nonnull GrDirectContext*)grContext
27 width:(size_t)width
28 height:(size_t)height;
29
30@end
31
33
34- (nullable instancetype)initWithTextureCache:(nonnull CVMetalTextureCacheRef)textureCache
35 textureID:(int64_t)textureID
36 texture:(nonnull NSObject<FlutterTexture>*)texture
37 enableImpeller:(BOOL)enableImpeller;
38
39- (void)paintContext:(flutter::Texture::PaintContext&)context
40 bounds:(const SkRect&)bounds
41 freeze:(BOOL)freeze
42 sampling:(const flutter::DlImageSampling)sampling;
43
44- (void)onGrContextCreated;
45
47
49
51
52@property(nonatomic, readonly) int64_t textureID;
53
54@end
55
56#endif // FLUTTER_SHELL_PLATFORM_DARWIN_GRAPHICS_FLUTTERDARWINEXTERNALTEXTUREMETAL_H_
SkYUVColorSpace
Definition: SkImageInfo.h:68
int BOOL
Definition: windows_types.h:37