Flutter Engine
ios_external_texture_metal.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 
5 #import "flutter/shell/platform/darwin/ios/ios_external_texture_metal.h"
6 
7 namespace flutter {
8 
10  fml::scoped_nsobject<FlutterDarwinExternalTextureMetal> darwin_external_texture_metal)
11  : Texture([darwin_external_texture_metal textureID]),
12  darwin_external_texture_metal_(darwin_external_texture_metal) {}
13 
15 
16 void IOSExternalTextureMetal::Paint(SkCanvas& canvas,
17  const SkRect& bounds,
18  bool freeze,
19  GrDirectContext* context,
20  const SkSamplingOptions& sampling) {
21  [darwin_external_texture_metal_ paint:canvas
22  bounds:bounds
23  freeze:freeze
24  grContext:context
25  sampling:sampling];
26 }
27 
28 void IOSExternalTextureMetal::OnGrContextCreated() {
29  [darwin_external_texture_metal_ onGrContextCreated];
30 }
31 
32 void IOSExternalTextureMetal::OnGrContextDestroyed() {
33  [darwin_external_texture_metal_ onGrContextDestroyed];
34 }
35 
36 void IOSExternalTextureMetal::MarkNewFrameAvailable() {
37  [darwin_external_texture_metal_ markNewFrameAvailable];
38 }
39 
40 void IOSExternalTextureMetal::OnTextureUnregistered() {
41  [darwin_external_texture_metal_ onTextureUnregistered];
42 }
43 
44 } // namespace flutter
IOSExternalTextureMetal(fml::scoped_nsobject< FlutterDarwinExternalTextureMetal > darwin_external_texture_metal)