Flutter Engine
The Flutter Engine
shell
platform
android
io
flutter
embedding
engine
renderer
RenderSurface.java
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
package
io.flutter.embedding.engine.renderer;
6
7
import
android
.view.Surface;
8
import
androidx.annotation.NonNull;
9
import
androidx.annotation.Nullable;
10
11
/**
12
* Owns a {@code Surface} that {@code FlutterRenderer} would like to paint.
13
*
14
* <p>{@code RenderSurface} is responsible for providing a {@code Surface} to a given {@code
15
* FlutterRenderer} when requested, and then notify that {@code FlutterRenderer} when the {@code
16
* Surface} changes, or is destroyed.
17
*
18
* <p>The behavior of providing a {@code Surface} is delegated to this interface because the timing
19
* of a {@code Surface}'s availability is determined by Android. Therefore, an accessor method would
20
* not fulfill the requirements. Therefore, a {@code RenderSurface} is given a {@code
21
* FlutterRenderer}, which the {@code RenderSurface} is expected to notify as a {@code Surface}
22
* becomes available, changes, or is destroyed.
23
*/
24
public
interface
RenderSurface
{
25
/**
26
* Returns the {@code FlutterRenderer} that is attached to this {@code RenderSurface}, or null if
27
* no {@code FlutterRenderer} is currently attached.
28
*/
29
@Nullable
30
FlutterRenderer
getAttachedRenderer
();
31
32
/**
33
* Instructs this {@code RenderSurface} to give its {@code Surface} to the given {@code
34
* FlutterRenderer} so that Flutter can paint pixels on it.
35
*
36
* <p>After this call, {@code RenderSurface} is expected to invoke the following methods on {@link
37
* FlutterRenderer} at the appropriate times:
38
*
39
* <ol>
40
* <li>{@link FlutterRenderer#startRenderingToSurface(Surface, boolean)}
41
* <li>{@link FlutterRenderer#surfaceChanged(int, int)}}
42
* <li>{@link FlutterRenderer#stopRenderingToSurface()}
43
* </ol>
44
*/
45
void
attachToRenderer
(@NonNull
FlutterRenderer
renderer
);
46
47
/**
48
* Instructs this {@code RenderSurface} to stop forwarding {@code Surface} notifications to the
49
* {@code FlutterRenderer} that was previously connected with {@link
50
* #attachToRenderer(FlutterRenderer)}.
51
*
52
* <p>This {@code RenderSurface} should also clean up any references related to the previously
53
* connected {@code FlutterRenderer}.
54
*/
55
void
detachFromRenderer
();
56
57
/**
58
* Instructs this {@code RenderSurface} to stop forwarding {@code Surface} notifications to the
59
* {@code FlutterRenderer} that was previously connected with {@link
60
* #attachToRenderer(FlutterRenderer)}.
61
*/
62
void
pause
();
63
64
/**
65
* Instructs this {@code RenderSurface} to resume forwarding {@code Surface} notifications to the
66
* {@code FlutterRenderer} that was previously connected with {@link
67
* #attachToRenderer(FlutterRenderer)}.
68
*/
69
void
resume
();
70
}
io.flutter.embedding.engine.renderer.FlutterRenderer
Definition:
FlutterRenderer.java:55
io.flutter.embedding.engine.renderer.RenderSurface
Definition:
RenderSurface.java:24
io.flutter.embedding.engine.renderer.RenderSurface.detachFromRenderer
void detachFromRenderer()
io.flutter.embedding.engine.renderer.RenderSurface.resume
void resume()
io.flutter.embedding.engine.renderer.RenderSurface.attachToRenderer
void attachToRenderer(@NonNull FlutterRenderer renderer)
io.flutter.embedding.engine.renderer.RenderSurface.getAttachedRenderer
FlutterRenderer getAttachedRenderer()
io.flutter.embedding.engine.renderer.RenderSurface.pause
void pause()
android
Definition:
BitmapRegionDecoder.cpp:14
parse_lottieweb_trace.renderer
renderer
Definition:
parse_lottieweb_trace.py:13
Generated on Sun Jun 23 2024 21:55:09 for Flutter Engine by
1.9.4