Flutter Engine
The Flutter Engine
Loading...
Searching...
No Matches
Classes | Public Member Functions | List of all members
io.flutter.embedding.engine.mutatorsstack.FlutterMutatorsStack Class Reference

Classes

class  FlutterMutator
 
enum  FlutterMutatorType
 

Public Member Functions

 FlutterMutatorsStack ()
 
void pushTransform (float[] values)
 
void pushClipRect (int left, int top, int right, int bottom)
 
void pushClipRRect (int left, int top, int right, int bottom, float[] radiis)
 
List< FlutterMutatorgetMutators ()
 
List< Path > getFinalClippingPaths ()
 
Matrix getFinalMatrix ()
 

Detailed Description

The mutator stack containing a list of mutators

The mutators can be applied to a io.flutter.plugin.platform.PlatformView to perform a series mutations. See FlutterMutatorsStack.FlutterMutator for informations on Mutators.

Definition at line 24 of file FlutterMutatorsStack.java.

Constructor & Destructor Documentation

◆ FlutterMutatorsStack()

io.flutter.embedding.engine.mutatorsstack.FlutterMutatorsStack.FlutterMutatorsStack ( )
inline

Initialize the mutator stack.

Definition at line 139 of file FlutterMutatorsStack.java.

139 {
140 this.mutators = new ArrayList<FlutterMutator>();
141 finalMatrix = new Matrix();
142 finalClippingPaths = new ArrayList<Path>();
143 }

Member Function Documentation

◆ getFinalClippingPaths()

List< Path > io.flutter.embedding.engine.mutatorsstack.FlutterMutatorsStack.getFinalClippingPaths ( )
inline

Get a list of all the clipping operations. All the clipping operations – whether it is clip rect, clip rrect, or clip path – are converted into Paths. The paths are also transformed with the matrix that up to their stack positions. For example: If the stack looks like (from top to bottom): TransA -> ClipA -> TransB -> ClipB, the final paths will look like [TransA*ClipA, TransA*TransB*ClipB].

Clipping this list to the parent canvas of a view results the final clipping path.

Definition at line 206 of file FlutterMutatorsStack.java.

206 {
207 return finalClippingPaths;
208 }

◆ getFinalMatrix()

Matrix io.flutter.embedding.engine.mutatorsstack.FlutterMutatorsStack.getFinalMatrix ( )
inline

Returns the final matrix. Apply this matrix to the canvas of a view results the final transformation of the view.

Definition at line 214 of file FlutterMutatorsStack.java.

214 {
215 return finalMatrix;
216 }

◆ getMutators()

List< FlutterMutator > io.flutter.embedding.engine.mutatorsstack.FlutterMutatorsStack.getMutators ( )
inline

Get a list of all the raw mutators. The 0 index of the returned list is the top of the stack.

Definition at line 193 of file FlutterMutatorsStack.java.

193 {
194 return mutators;
195 }

◆ pushClipRect()

void io.flutter.embedding.engine.mutatorsstack.FlutterMutatorsStack.pushClipRect ( int  left,
int  top,
int  right,
int  bottom 
)
inline

Push a clipRect FlutterMutatorsStack.FlutterMutator to the stack.

Definition at line 160 of file FlutterMutatorsStack.java.

160 {
161 Rect rect = new Rect(left, top, right, bottom);
162 FlutterMutator mutator = new FlutterMutator(rect);
163 mutators.add(mutator);
164 Path path = new Path();
165 path.addRect(new RectF(rect), Path.Direction.CCW);
166 path.transform(finalMatrix);
167 finalClippingPaths.add(path);
168 }
static bool left(const SkPoint &p0, const SkPoint &p1)
static bool right(const SkPoint &p0, const SkPoint &p1)
void add(sk_sp< SkIDChangeListener > listener) SK_EXCLUDES(fMutex)
sk_sp< SkBlender > blender SkRect rect
Definition SkRecords.h:350
DEF_SWITCHES_START aot vmservice shared library Name of the *so containing AOT compiled Dart assets for launching the service isolate vm snapshot The VM snapshot data that will be memory mapped as read only SnapshotAssetPath must be present isolate snapshot The isolate snapshot data that will be memory mapped as read only SnapshotAssetPath must be present cache dir path
Definition switches.h:57
CanvasPath Path
Definition dart_ui.cc:58
TRect< Scalar > Rect
Definition rect.h:746

◆ pushClipRRect()

void io.flutter.embedding.engine.mutatorsstack.FlutterMutatorsStack.pushClipRRect ( int  left,
int  top,
int  right,
int  bottom,
float[]  radiis 
)
inline

Push a clipRRect FlutterMutatorsStack.FlutterMutator to the stack.

Parameters
leftleft offset of the rrect.
toptop offset of the rrect.
rightright position of the rrect.
bottombottom position of the rrect.
radiisthe radiis of the rrect. It must be size of 8, including an x and y for each corner.

Definition at line 180 of file FlutterMutatorsStack.java.

180 {
181 Rect rect = new Rect(left, top, right, bottom);
182 FlutterMutator mutator = new FlutterMutator(rect, radiis);
183 mutators.add(mutator);
184 Path path = new Path();
185 path.addRoundRect(new RectF(rect), radiis, Path.Direction.CCW);
186 path.transform(finalMatrix);
187 finalClippingPaths.add(path);
188 }

◆ pushTransform()

void io.flutter.embedding.engine.mutatorsstack.FlutterMutatorsStack.pushTransform ( float[]  values)
inline

Push a transform FlutterMutatorsStack.FlutterMutator to the stack.

Parameters
valuesthe transform matrix to be pushed to the stack. The array matches how a android.graphics.Matrix is constructed.

Definition at line 151 of file FlutterMutatorsStack.java.

151 {
152 Matrix matrix = new Matrix();
153 matrix.setValues(values);
154 FlutterMutator mutator = new FlutterMutator(matrix);
155 mutators.add(mutator);
156 finalMatrix.preConcat(mutator.getMatrix());
157 }
unsigned useCenter Optional< SkMatrix > matrix
Definition SkRecords.h:258

The documentation for this class was generated from the following file: