Flutter Engine
 
Loading...
Searching...
No Matches
FlutterTextureRegistryRelay.mm
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
6
7#import "flutter/shell/platform/darwin/common/InternalFlutterSwiftCommon/InternalFlutterSwiftCommon.h"
8
10
11@implementation FlutterTextureRegistryRelay : NSObject
12
13#pragma mark - FlutterTextureRegistry
14
15- (instancetype)initWithParent:(NSObject<FlutterTextureRegistry>*)parent {
16 if (self = [super init]) {
17 _parent = parent;
18 }
19 return self;
20}
21
22- (int64_t)registerTexture:(NSObject<FlutterTexture>*)texture {
23 if (!self.parent) {
24 [FlutterLogger logWarning:@"Using on an empty registry."];
25 return 0;
26 }
27 return [self.parent registerTexture:texture];
28}
29
30- (void)textureFrameAvailable:(int64_t)textureId {
31 if (!self.parent) {
32 [FlutterLogger logWarning:@"Using on an empty registry."];
33 }
34 return [self.parent textureFrameAvailable:textureId];
35}
36
37- (void)unregisterTexture:(int64_t)textureId {
38 if (!self.parent) {
39 [FlutterLogger logWarning:@"Using on an empty registry."];
40 }
41 return [self.parent unregisterTexture:textureId];
42}
43
44@end
NSObject< FlutterTextureRegistry > * parent