[web] Move surface path code (flutter/engine#19533)
* Move surface path code * Update licenses_flutter * dartfmt
This commit is contained in:
@@ -449,7 +449,6 @@ FILE: ../../../flutter/lib/web_ui/lib/src/engine/compositor/text.dart
|
||||
FILE: ../../../flutter/lib/web_ui/lib/src/engine/compositor/util.dart
|
||||
FILE: ../../../flutter/lib/web_ui/lib/src/engine/compositor/vertices.dart
|
||||
FILE: ../../../flutter/lib/web_ui/lib/src/engine/compositor/viewport_metrics.dart
|
||||
FILE: ../../../flutter/lib/web_ui/lib/src/engine/conic.dart
|
||||
FILE: ../../../flutter/lib/web_ui/lib/src/engine/dom_canvas.dart
|
||||
FILE: ../../../flutter/lib/web_ui/lib/src/engine/dom_renderer.dart
|
||||
FILE: ../../../flutter/lib/web_ui/lib/src/engine/engine_canvas.dart
|
||||
@@ -460,7 +459,6 @@ FILE: ../../../flutter/lib/web_ui/lib/src/engine/html_image_codec.dart
|
||||
FILE: ../../../flutter/lib/web_ui/lib/src/engine/keyboard.dart
|
||||
FILE: ../../../flutter/lib/web_ui/lib/src/engine/mouse_cursor.dart
|
||||
FILE: ../../../flutter/lib/web_ui/lib/src/engine/onscreen_logging.dart
|
||||
FILE: ../../../flutter/lib/web_ui/lib/src/engine/path_to_svg.dart
|
||||
FILE: ../../../flutter/lib/web_ui/lib/src/engine/picture.dart
|
||||
FILE: ../../../flutter/lib/web_ui/lib/src/engine/platform_views.dart
|
||||
FILE: ../../../flutter/lib/web_ui/lib/src/engine/plugins.dart
|
||||
@@ -493,8 +491,10 @@ FILE: ../../../flutter/lib/web_ui/lib/src/engine/surface/image_filter.dart
|
||||
FILE: ../../../flutter/lib/web_ui/lib/src/engine/surface/offset.dart
|
||||
FILE: ../../../flutter/lib/web_ui/lib/src/engine/surface/opacity.dart
|
||||
FILE: ../../../flutter/lib/web_ui/lib/src/engine/surface/painting.dart
|
||||
FILE: ../../../flutter/lib/web_ui/lib/src/engine/surface/path.dart
|
||||
FILE: ../../../flutter/lib/web_ui/lib/src/engine/surface/path_metrics.dart
|
||||
FILE: ../../../flutter/lib/web_ui/lib/src/engine/surface/path/conic.dart
|
||||
FILE: ../../../flutter/lib/web_ui/lib/src/engine/surface/path/path.dart
|
||||
FILE: ../../../flutter/lib/web_ui/lib/src/engine/surface/path/path_metrics.dart
|
||||
FILE: ../../../flutter/lib/web_ui/lib/src/engine/surface/path/path_to_svg.dart
|
||||
FILE: ../../../flutter/lib/web_ui/lib/src/engine/surface/picture.dart
|
||||
FILE: ../../../flutter/lib/web_ui/lib/src/engine/surface/platform_view.dart
|
||||
FILE: ../../../flutter/lib/web_ui/lib/src/engine/surface/recording_canvas.dart
|
||||
|
||||
@@ -57,7 +57,6 @@ part 'engine/compositor/text.dart';
|
||||
part 'engine/compositor/util.dart';
|
||||
part 'engine/compositor/vertices.dart';
|
||||
part 'engine/compositor/viewport_metrics.dart';
|
||||
part 'engine/conic.dart';
|
||||
part 'engine/dom_canvas.dart';
|
||||
part 'engine/dom_renderer.dart';
|
||||
part 'engine/engine_canvas.dart';
|
||||
@@ -68,7 +67,6 @@ part 'engine/html_image_codec.dart';
|
||||
part 'engine/keyboard.dart';
|
||||
part 'engine/mouse_cursor.dart';
|
||||
part 'engine/onscreen_logging.dart';
|
||||
part 'engine/path_to_svg.dart';
|
||||
part 'engine/picture.dart';
|
||||
part 'engine/platform_views.dart';
|
||||
part 'engine/plugins.dart';
|
||||
@@ -101,7 +99,10 @@ part 'engine/surface/image_filter.dart';
|
||||
part 'engine/surface/offset.dart';
|
||||
part 'engine/surface/opacity.dart';
|
||||
part 'engine/surface/painting.dart';
|
||||
part 'engine/surface/path_metrics.dart';
|
||||
part 'engine/surface/path/conic.dart';
|
||||
part 'engine/surface/path/path.dart';
|
||||
part 'engine/surface/path/path_metrics.dart';
|
||||
part 'engine/surface/path/path_to_svg.dart';
|
||||
part 'engine/surface/picture.dart';
|
||||
part 'engine/surface/platform_view.dart';
|
||||
part 'engine/surface/recording_canvas.dart';
|
||||
@@ -109,7 +110,6 @@ part 'engine/surface/render_vertices.dart';
|
||||
part 'engine/surface/scene.dart';
|
||||
part 'engine/surface/scene_builder.dart';
|
||||
part 'engine/surface/surface.dart';
|
||||
part 'engine/surface/path.dart';
|
||||
part 'engine/surface/surface_stats.dart';
|
||||
part 'engine/surface/transform.dart';
|
||||
part 'engine/test_embedding.dart';
|
||||
|
||||
@@ -2,7 +2,6 @@
|
||||
// Use of this source code is governed by a BSD-style license that can be
|
||||
// found in the LICENSE file.
|
||||
|
||||
|
||||
part of engine;
|
||||
|
||||
/// Converts conic curve to a list of quadratic curves for rendering on
|
||||
@@ -149,8 +148,8 @@ class Conic {
|
||||
}
|
||||
pair.first = Conic(p0x, p0y, (p0x + wp1.dx) * scale, (p0y + wp1.dy) * scale,
|
||||
m.dx, m.dy, newW);
|
||||
pair.second = Conic(m.dx, m.dy, (p2x + wp1.dx) * scale, (p2y + wp1.dy) * scale,
|
||||
p2x, p2y, newW);
|
||||
pair.second = Conic(m.dx, m.dy, (p2x + wp1.dx) * scale,
|
||||
(p2y + wp1.dy) * scale, p2x, p2y, newW);
|
||||
}
|
||||
|
||||
/// Computes number of binary subdivisions of the curve given
|
||||
@@ -2,7 +2,6 @@
|
||||
// Use of this source code is governed by a BSD-style license that can be
|
||||
// found in the LICENSE file.
|
||||
|
||||
|
||||
part of engine;
|
||||
|
||||
/// A complex, one-dimensional subset of a plane.
|
||||
@@ -509,7 +508,8 @@ class SurfacePath implements ui.Path {
|
||||
assert(path != null); // path is checked on the engine side
|
||||
assert(offsetIsValid(offset));
|
||||
if (matrix4 != null) {
|
||||
_addPathWithMatrix(path as SurfacePath, offset.dx, offset.dy, toMatrix32(matrix4));
|
||||
_addPathWithMatrix(
|
||||
path as SurfacePath, offset.dx, offset.dy, toMatrix32(matrix4));
|
||||
} else {
|
||||
_addPath(path as SurfacePath, offset.dx, offset.dy);
|
||||
}
|
||||
@@ -547,7 +547,8 @@ class SurfacePath implements ui.Path {
|
||||
if (matrix4 != null) {
|
||||
final Float32List matrix32 = toMatrix32(matrix4);
|
||||
assert(matrix4IsValid(matrix32));
|
||||
_extendWithPathAndMatrix(path as SurfacePath, offset.dx, offset.dy, matrix32);
|
||||
_extendWithPathAndMatrix(
|
||||
path as SurfacePath, offset.dx, offset.dy, matrix32);
|
||||
} else {
|
||||
_extendWithPath(path as SurfacePath, offset.dx, offset.dy);
|
||||
}
|
||||
@@ -100,7 +100,8 @@ class _SurfacePathMeasure {
|
||||
return false;
|
||||
}
|
||||
++_subPathIndex;
|
||||
_contours.add(_PathContourMeasure(_path.subpaths[_subPathIndex], forceClosed));
|
||||
_contours
|
||||
.add(_PathContourMeasure(_path.subpaths[_subPathIndex], forceClosed));
|
||||
return true;
|
||||
}
|
||||
|
||||
@@ -705,7 +706,8 @@ class SurfacePathMetric implements ui.PathMetric {
|
||||
/// `start` and `end` are pinned to legal values (0..[length])
|
||||
/// Returns null if the segment is 0 length or `start` > `stop`.
|
||||
/// Begin the segment with a moveTo if `startWithMoveTo` is true.
|
||||
ui.Path? extractPath(double start, double end, {bool startWithMoveTo = true}) {
|
||||
ui.Path? extractPath(double start, double end,
|
||||
{bool startWithMoveTo = true}) {
|
||||
return _measure.extractPath(contourIndex, start, end,
|
||||
startWithMoveTo: startWithMoveTo);
|
||||
}
|
||||
@@ -992,5 +994,5 @@ void _chopQuadAt(
|
||||
|
||||
// Interpolate between two doubles (Not using lerpDouble here since it null
|
||||
// checks and treats values as 0).
|
||||
double _interpolate(double startValue, double endValue, double t)
|
||||
=> (startValue * (1 - t)) + endValue * t;
|
||||
double _interpolate(double startValue, double endValue, double t) =>
|
||||
(startValue * (1 - t)) + endValue * t;
|
||||
@@ -2,7 +2,6 @@
|
||||
// Use of this source code is governed by a BSD-style license that can be
|
||||
// found in the LICENSE file.
|
||||
|
||||
|
||||
part of engine;
|
||||
|
||||
/// Converts [path] to SVG path syntax to be used as "d" attribute in path
|
||||
Reference in New Issue
Block a user