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 package io.flutter.view; 6 7 import android.graphics.SurfaceTexture; 8 9 /** 10 * Registry of backend textures used with a single {@link FlutterView} instance. 11 * Entries may be embedded into the Flutter view using the 12 * <a href="https://docs.flutter.io/flutter/widgets/Texture-class.html">Texture</a> 13 * widget. 14 */ 15 public interface TextureRegistry { 16 /** 17 * Creates and registers a SurfaceTexture managed by the Flutter engine. 18 * 19 * @return A SurfaceTextureEntry. 20 */ createSurfaceTexture()21 SurfaceTextureEntry createSurfaceTexture(); 22 23 /** 24 * A registry entry for a managed SurfaceTexture. 25 */ 26 interface SurfaceTextureEntry { 27 /** 28 * @return The managed SurfaceTexture. 29 */ surfaceTexture()30 SurfaceTexture surfaceTexture(); 31 32 /** 33 * @return The identity of this SurfaceTexture. 34 */ id()35 long id(); 36 37 /** 38 * Deregisters and releases this SurfaceTexture. 39 */ release()40 void release(); 41 } 42 } 43