mirror of
https://github.com/flutter/flutter.git
synced 2026-02-20 02:29:02 +08:00
Change Rect internal representation from Float32List to Float64List (flutter/engine#8524)
This commit is contained in:
parent
dd244ce0de
commit
0c481e37ab
@ -98,7 +98,7 @@ class SceneBuilder extends NativeFieldWrapperClass2 {
|
||||
EngineLayer pushClipRRect(RRect rrect, {Clip clipBehavior = Clip.antiAlias}) {
|
||||
assert(clipBehavior != null);
|
||||
assert(clipBehavior != Clip.none);
|
||||
return _pushClipRRect(rrect._value, clipBehavior.index);
|
||||
return _pushClipRRect(rrect._value32, clipBehavior.index);
|
||||
}
|
||||
EngineLayer _pushClipRRect(Float32List rrect, int clipBehavior) native 'SceneBuilder_pushClipRRect';
|
||||
|
||||
|
||||
@ -666,7 +666,9 @@ class Rect {
|
||||
}
|
||||
|
||||
static const int _kDataSize = 4;
|
||||
final Float32List _value = new Float32List(_kDataSize);
|
||||
final Float64List _value = new Float64List(_kDataSize);
|
||||
|
||||
Float32List get _value32 => Float32List.fromList(_value);
|
||||
|
||||
/// The offset of the left edge of this rectangle from the x axis.
|
||||
double get left => _value[0];
|
||||
@ -1157,9 +1159,11 @@ class RRect {
|
||||
}
|
||||
|
||||
static const int _kDataSize = 12;
|
||||
final Float32List _value = new Float32List(_kDataSize);
|
||||
final Float64List _value = new Float64List(_kDataSize);
|
||||
RRect _scaled; // same RRect with scaled radii per side
|
||||
|
||||
Float32List get _value32 => Float32List.fromList(_value);
|
||||
|
||||
/// The offset of the left edge of this rectangle from the x axis.
|
||||
double get left => _value[0];
|
||||
|
||||
|
||||
@ -2028,7 +2028,7 @@ class Path extends NativeFieldWrapperClass2 {
|
||||
/// argument.
|
||||
void addRRect(RRect rrect) {
|
||||
assert(_rrectIsValid(rrect));
|
||||
_addRRect(rrect._value);
|
||||
_addRRect(rrect._value32);
|
||||
}
|
||||
void _addRRect(Float32List rrect) native 'Path_addRRect';
|
||||
|
||||
@ -3259,7 +3259,7 @@ class Canvas extends NativeFieldWrapperClass2 {
|
||||
void clipRRect(RRect rrect, {bool doAntiAlias = true}) {
|
||||
assert(_rrectIsValid(rrect));
|
||||
assert(doAntiAlias != null);
|
||||
_clipRRect(rrect._value, doAntiAlias);
|
||||
_clipRRect(rrect._value32, doAntiAlias);
|
||||
}
|
||||
void _clipRRect(Float32List rrect, bool doAntiAlias) native 'Canvas_clipRRect';
|
||||
|
||||
@ -3336,7 +3336,7 @@ class Canvas extends NativeFieldWrapperClass2 {
|
||||
void drawRRect(RRect rrect, Paint paint) {
|
||||
assert(_rrectIsValid(rrect));
|
||||
assert(paint != null);
|
||||
_drawRRect(rrect._value, paint._objects, paint._data);
|
||||
_drawRRect(rrect._value32, paint._objects, paint._data);
|
||||
}
|
||||
void _drawRRect(Float32List rrect,
|
||||
List<dynamic> paintObjects,
|
||||
@ -3351,7 +3351,7 @@ class Canvas extends NativeFieldWrapperClass2 {
|
||||
assert(_rrectIsValid(outer));
|
||||
assert(_rrectIsValid(inner));
|
||||
assert(paint != null);
|
||||
_drawDRRect(outer._value, inner._value, paint._objects, paint._data);
|
||||
_drawDRRect(outer._value32, inner._value32, paint._objects, paint._data);
|
||||
}
|
||||
void _drawDRRect(Float32List outer,
|
||||
Float32List inner,
|
||||
@ -3651,7 +3651,7 @@ class Canvas extends NativeFieldWrapperClass2 {
|
||||
}
|
||||
|
||||
final Int32List colorBuffer = colors.isEmpty ? null : _encodeColorList(colors);
|
||||
final Float32List cullRectBuffer = cullRect?._value;
|
||||
final Float32List cullRectBuffer = cullRect?._value32;
|
||||
|
||||
_drawAtlas(
|
||||
paint._objects, paint._data, atlas, rstTransformBuffer, rectBuffer,
|
||||
@ -3698,7 +3698,7 @@ class Canvas extends NativeFieldWrapperClass2 {
|
||||
|
||||
_drawAtlas(
|
||||
paint._objects, paint._data, atlas, rstTransforms, rects,
|
||||
colors, blendMode.index, cullRect?._value
|
||||
colors, blendMode.index, cullRect?._value32
|
||||
);
|
||||
}
|
||||
|
||||
|
||||
Loading…
x
Reference in New Issue
Block a user