null-annotate compositing.dart (#18351)
diff --git a/lib/ui/compositing.dart b/lib/ui/compositing.dart
index d1f43ee..8917cea 100644
--- a/lib/ui/compositing.dart
+++ b/lib/ui/compositing.dart
@@ -22,7 +22,7 @@
/// Creates a raster image representation of the current state of the scene.
/// This is a slow operation that is performed on a background thread.
- Future<Image> toImage(int width, int height) {
+ Future<Image/*!*/>/*!*/ toImage(int/*!*/ width, int/*!*/ height) {
if (width <= 0 || height <= 0) {
throw Exception('Invalid image dimensions.');
}
@@ -275,9 +275,9 @@
/// {@endtemplate}
///
/// See [pop] for details about the operation stack.
- TransformEngineLayer pushTransform(
- Float64List matrix4, {
- TransformEngineLayer oldLayer,
+ TransformEngineLayer/*?*/ pushTransform(
+ Float64List/*!*/ matrix4, {
+ TransformEngineLayer/*?*/ oldLayer,
}) {
assert(_matrix4IsValid(matrix4));
assert(_debugCheckCanBeUsedAsOldLayer(oldLayer, 'pushTransform'));
@@ -299,10 +299,10 @@
/// {@macro dart.ui.sceneBuilder.oldLayerVsRetained}
///
/// See [pop] for details about the operation stack.
- OffsetEngineLayer pushOffset(
- double dx,
- double dy, {
- OffsetEngineLayer oldLayer,
+ OffsetEngineLayer/*?*/ pushOffset(
+ double/*!*/ dx,
+ double/*!*/ dy, {
+ OffsetEngineLayer/*?*/ oldLayer,
}) {
assert(_debugCheckCanBeUsedAsOldLayer(oldLayer, 'pushOffset'));
final EngineLayer engineLayer = EngineLayer._();
@@ -324,10 +324,10 @@
///
/// See [pop] for details about the operation stack, and [Clip] for different clip modes.
/// By default, the clip will be anti-aliased (clip = [Clip.antiAlias]).
- ClipRectEngineLayer pushClipRect(
- Rect rect, {
- Clip clipBehavior = Clip.antiAlias,
- ClipRectEngineLayer oldLayer,
+ ClipRectEngineLayer/*?*/ pushClipRect(
+ Rect/*!*/ rect, {
+ Clip/*!*/ clipBehavior = Clip.antiAlias,
+ ClipRectEngineLayer/*?*/ oldLayer,
}) {
assert(clipBehavior != null);
assert(clipBehavior != Clip.none);
@@ -352,10 +352,10 @@
///
/// See [pop] for details about the operation stack, and [Clip] for different clip modes.
/// By default, the clip will be anti-aliased (clip = [Clip.antiAlias]).
- ClipRRectEngineLayer pushClipRRect(
- RRect rrect, {
- Clip clipBehavior = Clip.antiAlias,
- ClipRRectEngineLayer oldLayer,
+ ClipRRectEngineLayer/*?*/ pushClipRRect(
+ RRect/*!*/ rrect, {
+ Clip/*!*/ clipBehavior = Clip.antiAlias,
+ ClipRRectEngineLayer/*?*/ oldLayer,
}) {
assert(clipBehavior != null);
assert(clipBehavior != Clip.none);
@@ -380,10 +380,10 @@
///
/// See [pop] for details about the operation stack. See [Clip] for different clip modes.
/// By default, the clip will be anti-aliased (clip = [Clip.antiAlias]).
- ClipPathEngineLayer pushClipPath(
- Path path, {
- Clip clipBehavior = Clip.antiAlias,
- ClipPathEngineLayer oldLayer,
+ ClipPathEngineLayer/*?*/ pushClipPath(
+ Path/*!*/ path, {
+ Clip/*!*/ clipBehavior = Clip.antiAlias,
+ ClipPathEngineLayer/*?*/ oldLayer,
}) {
assert(clipBehavior != null);
assert(clipBehavior != Clip.none);
@@ -409,10 +409,10 @@
/// {@macro dart.ui.sceneBuilder.oldLayerVsRetained}
///
/// See [pop] for details about the operation stack.
- OpacityEngineLayer pushOpacity(
- int alpha, {
- Offset offset = Offset.zero,
- OpacityEngineLayer oldLayer,
+ OpacityEngineLayer/*?*/ pushOpacity(
+ int/*!*/ alpha, {
+ Offset/*?*/ offset = Offset.zero,
+ OpacityEngineLayer/*?*/ oldLayer,
}) {
assert(_debugCheckCanBeUsedAsOldLayer(oldLayer, 'pushOpacity'));
final EngineLayer engineLayer = EngineLayer._();
@@ -434,9 +434,9 @@
/// {@macro dart.ui.sceneBuilder.oldLayerVsRetained}
///
/// See [pop] for details about the operation stack.
- ColorFilterEngineLayer pushColorFilter(
- ColorFilter filter, {
- ColorFilterEngineLayer oldLayer,
+ ColorFilterEngineLayer/*?*/ pushColorFilter(
+ ColorFilter/*!*/ filter, {
+ ColorFilterEngineLayer/*?*/ oldLayer,
}) {
assert(filter != null);
assert(_debugCheckCanBeUsedAsOldLayer(oldLayer, 'pushColorFilter'));
@@ -461,9 +461,9 @@
/// {@macro dart.ui.sceneBuilder.oldLayerVsRetained}
///
/// See [pop] for details about the operation stack.
- ImageFilterEngineLayer pushImageFilter(
- ImageFilter filter, {
- ImageFilterEngineLayer oldLayer,
+ ImageFilterEngineLayer/*?*/ pushImageFilter(
+ ImageFilter/*!*/ filter, {
+ ImageFilterEngineLayer/*?*/ oldLayer,
}) {
assert(filter != null);
assert(_debugCheckCanBeUsedAsOldLayer(oldLayer, 'pushImageFilter'));
@@ -488,9 +488,9 @@
/// {@macro dart.ui.sceneBuilder.oldLayerVsRetained}
///
/// See [pop] for details about the operation stack.
- BackdropFilterEngineLayer pushBackdropFilter(
- ImageFilter filter, {
- BackdropFilterEngineLayer oldLayer,
+ BackdropFilterEngineLayer/*?*/ pushBackdropFilter(
+ ImageFilter/*!*/ filter, {
+ BackdropFilterEngineLayer/*?*/ oldLayer,
}) {
assert(_debugCheckCanBeUsedAsOldLayer(oldLayer, 'pushBackdropFilter'));
final EngineLayer engineLayer = EngineLayer._();
@@ -512,11 +512,11 @@
/// {@macro dart.ui.sceneBuilder.oldLayerVsRetained}
///
/// See [pop] for details about the operation stack.
- ShaderMaskEngineLayer pushShaderMask(
- Shader shader,
- Rect maskRect,
- BlendMode blendMode, {
- ShaderMaskEngineLayer oldLayer,
+ ShaderMaskEngineLayer/*?*/ pushShaderMask(
+ Shader/*!*/ shader,
+ Rect/*!*/ maskRect,
+ BlendMode/*!*/ blendMode, {
+ ShaderMaskEngineLayer/*?*/ oldLayer,
}) {
assert(_debugCheckCanBeUsedAsOldLayer(oldLayer, 'pushShaderMask'));
final EngineLayer engineLayer = EngineLayer._();
@@ -560,13 +560,13 @@
///
/// See [pop] for details about the operation stack, and [Clip] for different clip modes.
// ignore: deprecated_member_use
- PhysicalShapeEngineLayer pushPhysicalShape({
- Path path,
- double elevation,
- Color color,
- Color shadowColor,
- Clip clipBehavior = Clip.none,
- PhysicalShapeEngineLayer oldLayer,
+ PhysicalShapeEngineLayer/*?*/ pushPhysicalShape({
+ Path/*!*/ path,
+ double/*!*/ elevation,
+ Color/*!*/ color,
+ Color/*?*/ shadowColor,
+ Clip/*!*/ clipBehavior = Clip.none,
+ PhysicalShapeEngineLayer/*?*/ oldLayer,
}) {
assert(_debugCheckCanBeUsedAsOldLayer(oldLayer, 'pushPhysicalShape'));
final EngineLayer engineLayer = EngineLayer._();
@@ -611,7 +611,7 @@
/// no need to call [addToScene] for its children layers.
///
/// {@macro dart.ui.sceneBuilder.oldLayerVsRetained}
- void addRetained(EngineLayer retainedLayer) {
+ void addRetained(EngineLayer/*!*/ retainedLayer) {
assert(retainedLayer is _EngineLayerWrapper);
assert(() {
final _EngineLayerWrapper layer = retainedLayer as _EngineLayerWrapper;
@@ -662,7 +662,7 @@
/// See also the [PerformanceOverlayOption] enum in the rendering library.
/// for more details.
// Values above must match constants in //engine/src/sky/compositor/performance_overlay_layer.h
- void addPerformanceOverlay(int enabledOptions, Rect bounds) {
+ void addPerformanceOverlay(int/*!*/ enabledOptions, Rect/*!*/ bounds) {
_addPerformanceOverlay(enabledOptions, bounds.left, bounds.right, bounds.top, bounds.bottom);
}
@@ -678,10 +678,10 @@
///
/// The picture is rasterized at the given offset.
void addPicture(
- Offset offset,
- Picture picture, {
- bool isComplexHint = false,
- bool willChangeHint = false,
+ Offset/*!*/ offset,
+ Picture/*!*/ picture, {
+ bool/*!*/ isComplexHint = false,
+ bool/*!*/ willChangeHint = false,
}) {
final int hints = (isComplexHint ? 1 : 0) | (willChangeHint ? 2 : 0);
_addPicture(offset.dx, offset.dy, picture, hints);
@@ -702,11 +702,11 @@
/// texture just before resizing the Android view and un-freezes it when it is
/// certain that a frame with the new size is ready.
void addTexture(
- int textureId, {
- Offset offset = Offset.zero,
- double width = 0.0,
- double height = 0.0,
- bool freeze = false,
+ int/*!*/ textureId, {
+ Offset/*!*/ offset = Offset.zero,
+ double/*!*/ width = 0.0,
+ double/*!*/ height = 0.0,
+ bool/*!*/ freeze = false,
}) {
assert(offset != null, 'Offset argument was null');
_addTexture(offset.dx, offset.dy, width, height, textureId, freeze);
@@ -732,10 +732,10 @@
/// embedded UIView. In addition to that, on iOS versions greater than 9, the Flutter frames are
/// synchronized with the UIView frames adding additional performance overhead.
void addPlatformView(
- int viewId, {
- Offset offset = Offset.zero,
- double width = 0.0,
- double height = 0.0,
+ int/*!*/ viewId, {
+ Offset/*!*/ offset = Offset.zero,
+ double/*!*/ width = 0.0,
+ double/*!*/ height = 0.0,
}) {
assert(offset != null, 'Offset argument was null');
_addPlatformView(offset.dx, offset.dy, width, height, viewId);
@@ -747,11 +747,11 @@
/// (Fuchsia-only) Adds a scene rendered by another application to the scene
/// for this application.
void addChildScene({
- Offset offset = Offset.zero,
- double width = 0.0,
- double height = 0.0,
- SceneHost sceneHost,
- bool hitTestable = true,
+ Offset/*!*/ offset = Offset.zero,
+ double/*!*/ width = 0.0,
+ double/*!*/ height = 0.0,
+ SceneHost/*!*/ sceneHost,
+ bool/*!*/ hitTestable = true,
}) {
_addChildScene(offset.dx, offset.dy, width, height, sceneHost, hitTestable);
}
@@ -765,7 +765,7 @@
/// interested in using this feature, please contact [flutter-dev](https://groups.google.com/forum/#!forum/flutter-dev).
/// We'll hopefully be able to figure out how to make this feature more useful
/// to you.
- void setRasterizerTracingThreshold(int frameInterval)
+ void setRasterizerTracingThreshold(int/*!*/ frameInterval)
native 'SceneBuilder_setRasterizerTracingThreshold';
/// Sets whether the raster cache should checkerboard cached entries. This is
@@ -783,14 +783,14 @@
///
/// Currently this interface is difficult to use by end-developers. If you're
/// interested in using this feature, please contact [flutter-dev](https://groups.google.com/forum/#!forum/flutter-dev).
- void setCheckerboardRasterCacheImages(bool checkerboard)
+ void setCheckerboardRasterCacheImages(bool/*!*/ checkerboard)
native 'SceneBuilder_setCheckerboardRasterCacheImages';
/// Sets whether the compositor should checkerboard layers that are rendered
/// to offscreen bitmaps.
///
/// This is only useful for debugging purposes.
- void setCheckerboardOffscreenLayers(bool checkerboard)
+ void setCheckerboardOffscreenLayers(bool/*!*/ checkerboard)
native 'SceneBuilder_setCheckerboardOffscreenLayers';
/// Finishes building the scene.
@@ -801,7 +801,7 @@
///
/// After calling this function, the scene builder object is invalid and
/// cannot be used further.
- Scene build() {
+ Scene/*!*/ build() {
final Scene scene = Scene._();
_build(scene);
return scene;
@@ -825,9 +825,9 @@
/// The SceneHost takes ownership of the provided ViewHolder token.
SceneHost(
dynamic viewHolderToken,
- void Function() viewConnectedCallback,
- void Function() viewDisconnectedCallback,
- void Function(bool) viewStateChangedCallback,
+ void Function()/*?*/ viewConnectedCallback,
+ void Function()/*?*/ viewDisconnectedCallback,
+ void Function(bool/*!*/)/*?*/ viewStateChangedCallback,
) {
_constructor(
viewHolderToken, viewConnectedCallback, viewDisconnectedCallback, viewStateChangedCallback);
@@ -848,12 +848,12 @@
/// Set properties on the linked scene. These properties include its bounds,
/// as well as whether it can be the target of focus events or not.
void setProperties(
- double width,
- double height,
- double insetTop,
- double insetRight,
- double insetBottom,
- double insetLeft,
- bool focusable,
+ double/*!*/ width,
+ double/*!*/ height,
+ double/*!*/ insetTop,
+ double/*!*/ insetRight,
+ double/*!*/ insetBottom,
+ double/*!*/ insetLeft,
+ bool/*!*/ focusable,
) native 'SceneHost_setProperties';
}
diff --git a/lib/web_ui/lib/src/ui/compositing.dart b/lib/web_ui/lib/src/ui/compositing.dart
index 0bdd344..2f78c08 100644
--- a/lib/web_ui/lib/src/ui/compositing.dart
+++ b/lib/web_ui/lib/src/ui/compositing.dart
@@ -14,7 +14,7 @@
abstract class Scene {
/// Creates a raster image representation of the current state of the scene.
/// This is a slow operation that is performed on a background thread.
- Future<Image> toImage(int width, int height);
+ Future<Image/*!*/>/*!*/ toImage(int width, int height);
/// Releases the resources used by this scene.
///
@@ -126,8 +126,8 @@
///
/// See [pop] for details about the operation stack.
OffsetEngineLayer pushOffset(
- double dx,
- double dy, {
+ double/*!*/ dx,
+ double/*!*/ dy, {
OffsetEngineLayer oldLayer,
});
@@ -137,7 +137,7 @@
///
/// See [pop] for details about the operation stack.
TransformEngineLayer pushTransform(
- Float64List matrix4, {
+ Float64List/*!*/ matrix4, {
TransformEngineLayer oldLayer,
});
@@ -148,8 +148,8 @@
/// See [pop] for details about the operation stack, and [Clip] for different clip modes.
/// By default, the clip will be anti-aliased (clip = [Clip.antiAlias]).
ClipRectEngineLayer pushClipRect(
- Rect rect, {
- Clip clipBehavior = Clip.antiAlias,
+ Rect/*!*/ rect, {
+ Clip/*!*/ clipBehavior = Clip.antiAlias,
ClipRectEngineLayer oldLayer,
});
@@ -159,8 +159,8 @@
///
/// See [pop] for details about the operation stack.
ClipRRectEngineLayer pushClipRRect(
- RRect rrect, {
- Clip clipBehavior,
+ RRect/*!*/ rrect, {
+ Clip/*!*/ clipBehavior,
ClipRRectEngineLayer oldLayer,
});
@@ -170,8 +170,8 @@
///
/// See [pop] for details about the operation stack.
ClipPathEngineLayer pushClipPath(
- Path path, {
- Clip clipBehavior = Clip.antiAlias,
+ Path/*!*/ path, {
+ Clip/*!*/ clipBehavior = Clip.antiAlias,
ClipPathEngineLayer oldLayer,
});
@@ -184,8 +184,8 @@
///
/// See [pop] for details about the operation stack.
OpacityEngineLayer pushOpacity(
- int alpha, {
- Offset offset = Offset.zero,
+ int/*!*/ alpha, {
+ Offset/*!*/ offset = Offset.zero,
OpacityEngineLayer oldLayer,
});
@@ -200,7 +200,7 @@
///
/// See [pop] for details about the operation stack.
ColorFilterEngineLayer pushColorFilter(
- ColorFilter filter, {
+ ColorFilter/*!*/ filter, {
ColorFilterEngineLayer oldLayer,
});
@@ -215,7 +215,7 @@
///
/// See [pop] for details about the operation stack.
ImageFilterEngineLayer pushImageFilter(
- ImageFilter filter, {
+ ImageFilter/*!*/ filter, {
ImageFilterEngineLayer oldLayer,
});
@@ -226,7 +226,7 @@
///
/// See [pop] for details about the operation stack.
BackdropFilterEngineLayer pushBackdropFilter(
- ImageFilter filter, {
+ ImageFilter/*!*/ filter, {
BackdropFilterEngineLayer oldLayer,
});
@@ -237,9 +237,9 @@
///
/// See [pop] for details about the operation stack.
ShaderMaskEngineLayer pushShaderMask(
- Shader shader,
- Rect maskRect,
- BlendMode blendMode, {
+ Shader/*!*/ shader,
+ Rect/*!*/ maskRect,
+ BlendMode/*!*/ blendMode, {
ShaderMaskEngineLayer oldLayer,
});
@@ -256,11 +256,11 @@
///
/// See [pop] for details about the operation stack, and [Clip] for different clip modes.
PhysicalShapeEngineLayer pushPhysicalShape({
- Path path,
- double elevation,
- Color color,
- Color shadowColor,
- Clip clipBehavior = Clip.none,
+ Path/*!*/ path,
+ double/*!*/ elevation,
+ Color/*!*/ color,
+ Color/*?*/ shadowColor,
+ Clip/*!*/ clipBehavior = Clip.none,
PhysicalShapeEngineLayer oldLayer,
});
@@ -272,7 +272,7 @@
/// Therefore, when implementing a subclass of the [Layer] concept defined in
/// the rendering layer of Flutter's framework, once this is called, there's
/// no need to call [addToScene] for its children layers.
- void addRetained(EngineLayer retainedLayer);
+ void addRetained(EngineLayer/*!*/ retainedLayer);
/// Ends the effect of the most recently pushed operation.
///
@@ -305,16 +305,16 @@
///
/// See also the [PerformanceOverlayOption] enum in the rendering library.
/// for more details.
- void addPerformanceOverlay(int enabledOptions, Rect bounds);
+ void addPerformanceOverlay(int/*!*/ enabledOptions, Rect/*!*/ bounds);
/// Adds a [Picture] to the scene.
///
/// The picture is rasterized at the given offset.
void addPicture(
- Offset offset,
- Picture picture, {
- bool isComplexHint = false,
- bool willChangeHint = false,
+ Offset/*!*/ offset,
+ Picture/*!*/ picture, {
+ bool/*!*/ isComplexHint = false,
+ bool/*!*/ willChangeHint = false,
});
/// Adds a backend texture to the scene.
@@ -322,11 +322,11 @@
/// The texture is scaled to the given size and rasterized at the given
/// offset.
void addTexture(
- int textureId, {
- Offset offset = Offset.zero,
- double width = 0.0,
- double height = 0.0,
- bool freeze = false,
+ int/*!*/ textureId, {
+ Offset/*!*/ offset = Offset.zero,
+ double/*!*/ width = 0.0,
+ double/*!*/ height = 0.0,
+ bool/*!*/ freeze = false,
});
/// Adds a platform view (e.g an iOS UIView) to the scene.
@@ -346,20 +346,20 @@
/// embedded UIView. In addition to that, on iOS versions greater than 9, the Flutter frames are
/// synchronized with the UIView frames adding additional performance overhead.
void addPlatformView(
- int viewId, {
- Offset offset = Offset.zero,
- double width = 0.0,
- double height = 0.0,
+ int/*!*/ viewId, {
+ Offset/*!*/ offset = Offset.zero,
+ double/*!*/ width = 0.0,
+ double/*!*/ height = 0.0,
});
/// (Fuchsia-only) Adds a scene rendered by another application to the scene
/// for this application.
void addChildScene({
- Offset offset = Offset.zero,
- double width = 0.0,
- double height = 0.0,
- SceneHost sceneHost,
- bool hitTestable = true,
+ Offset/*!*/ offset = Offset.zero,
+ double/*!*/ width = 0.0,
+ double/*!*/ height = 0.0,
+ SceneHost/*!*/ sceneHost,
+ bool/*!*/ hitTestable = true,
});
/// Sets a threshold after which additional debugging information should be
@@ -369,7 +369,7 @@
/// interested in using this feature, please contact [flutter-dev](https://groups.google.com/forum/#!forum/flutter-dev).
/// We'll hopefully be able to figure out how to make this feature more useful
/// to you.
- void setRasterizerTracingThreshold(int frameInterval);
+ void setRasterizerTracingThreshold(int/*!*/ frameInterval);
/// Sets whether the raster cache should checkerboard cached entries. This is
/// only useful for debugging purposes.
@@ -387,13 +387,13 @@
///
/// Currently this interface is difficult to use by end-developers. If you're
/// interested in using this feature, please contact [flutter-dev](https://groups.google.com/forum/#!forum/flutter-dev).
- void setCheckerboardRasterCacheImages(bool checkerboard);
+ void setCheckerboardRasterCacheImages(bool/*!*/ checkerboard);
/// Sets whether the compositor should checkerboard layers that are rendered
/// to offscreen bitmaps.
///
/// This is only useful for debugging purposes.
- void setCheckerboardOffscreenLayers(bool checkerboard);
+ void setCheckerboardOffscreenLayers(bool/*!*/ checkerboard);
/// Finishes building the scene.
///
@@ -403,18 +403,18 @@
///
/// After calling this function, the scene builder object is invalid and
/// cannot be used further.
- Scene build();
+ Scene/*!*/ build();
/// Set properties on the linked scene. These properties include its bounds,
/// as well as whether it can be the target of focus events or not.
void setProperties(
- double width,
- double height,
- double insetTop,
- double insetRight,
- double insetBottom,
- double insetLeft,
- bool focusable,
+ double/*!*/ width,
+ double/*!*/ height,
+ double/*!*/ insetTop,
+ double/*!*/ insetRight,
+ double/*!*/ insetBottom,
+ double/*!*/ insetLeft,
+ bool/*!*/ focusable,
);
}
@@ -436,9 +436,9 @@
/// The SceneHost takes ownership of the provided ViewHolder token.
SceneHost(
dynamic viewHolderToken,
- void Function() viewConnectedCallback,
- void Function() viewDisconnectedCallback,
- void Function(bool) viewStateChangedCallback,
+ void Function()/*!*/ viewConnectedCallback,
+ void Function()/*!*/ viewDisconnectedCallback,
+ void Function(bool/*!*/)/*!*/ viewStateChangedCallback,
);
/// Releases the resources associated with the SceneHost.
@@ -449,13 +449,13 @@
/// Set properties on the linked scene. These properties include its bounds,
/// as well as whether it can be the target of focus events or not.
void setProperties(
- double width,
- double height,
- double insetTop,
- double insetRight,
- double insetBottom,
- double insetLeft,
- bool focusable,
+ double/*!*/ width,
+ double/*!*/ height,
+ double/*!*/ insetTop,
+ double/*!*/ insetRight,
+ double/*!*/ insetBottom,
+ double/*!*/ insetLeft,
+ bool/*!*/ focusable,
) {
throw UnimplementedError();
}