Flutter Engine
 
Loading...
Searching...
No Matches
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
15#include "third_party/skia/include/core/SkImage.h"
16
18
19+ (sk_sp<SkImage>)wrapYUVATexture:(nonnull id<MTLTexture>)yTex
20 UVTex:(nonnull id<MTLTexture>)uvTex
21 YUVColorSpace:(SkYUVColorSpace)colorSpace
22 grContext:(nonnull GrDirectContext*)grContext
23 width:(size_t)width
24 height:(size_t)height;
25
26+ (sk_sp<SkImage>)wrapRGBATexture:(nonnull id<MTLTexture>)rgbaTex
27 grContext:(nonnull GrDirectContext*)grContext
28 width:(size_t)width
29 height:(size_t)height;
30
31@end
32
34
35+ (sk_sp<flutter::DlImage>)wrapYUVATexture:(nonnull id<MTLTexture>)yTex
36 UVTex:(nonnull id<MTLTexture>)uvTex
37 YUVColorSpace:(impeller::YUVColorSpace)colorSpace
38 aiksContext:(nonnull impeller::AiksContext*)aiksContext;
39
40+ (sk_sp<flutter::DlImage>)wrapRGBATexture:(nonnull id<MTLTexture>)rgbaTex
41 aiksContext:(nonnull impeller::AiksContext*)aiks_context;
42
43@end
44
46
47- (nullable instancetype)initWithTextureCache:(nonnull CVMetalTextureCacheRef)textureCache
48 textureID:(int64_t)textureID
49 texture:(nonnull NSObject<FlutterTexture>*)texture
50 enableImpeller:(BOOL)enableImpeller;
51
52- (void)paintContext:(flutter::Texture::PaintContext&)context
53 bounds:(const SkRect&)bounds
54 freeze:(BOOL)freeze
55 sampling:(const flutter::DlImageSampling)sampling;
56
57- (void)onGrContextCreated;
58
60
62
64
65@property(nonatomic, readonly) int64_t textureID;
66
67@end
68
69#endif // FLUTTER_SHELL_PLATFORM_DARWIN_GRAPHICS_FLUTTERDARWINEXTERNALTEXTUREMETAL_H_
int BOOL