Pool mixin
A mixin that provides a simple pooling mechanism for commonly-used objects such as GPoint, GMatrix, and GRect. This can help reduce the frequency of garbage collection and improve performance in some cases.
Properties
- hashCode → int
-
The hash code for this object.
no setterinherited
- runtimeType → Type
-
A representation of the runtime type of the object.
no setterinherited
Methods
-
noSuchMethod(
Invocation invocation) → dynamic -
Invoked when a nonexistent method or property is accessed.
inherited
-
toString(
) → String -
A string representation of this object.
inherited
Operators
-
operator ==(
Object other) → bool -
The equality operator.
inherited
Static Methods
-
getMatrix(
[double a = 1, double b = 0, double c = 0, double d = 1, double tx = 0, double ty = 0]) → GMatrix - Get a GMatrix instance from the pool. If the pool is empty, a new GMatrix object is created and returned.
-
getPoint(
[double x = 0, double y = 0]) → GPoint - Get a GPoint instance from the pool. If the pool is empty, a new GPoint object is created and returned.
-
getRect(
[double x = 0, double y = 0, double w = 0, double h = 0]) → GRect - Get a GRect instance from the pool.
-
putMatrix(
GMatrix matrix) → void - Store a GMatrix in the pool. Remember to not keep any references to the object after moving it to the pool.
-
putPoint(
GPoint point) → void - Store a GPoint in the pool. It is important not to keep any references to the object after returning it to the pool.
-
putRect(
GRect rect) → void - Store a GRect in the pool. Remember to not keep any references to the object after moving it to the pool.