未验证 提交 9e315e64 编写于 作者: S sjindel-google 提交者: GitHub

Remove entries from dart_vm_entry_points.txt and use annotations (#6226)

The `dart_vm_entry_points.txt` file is now deprecated in favor of annotations.
Support for parsing and generating the entry-points files will be removed from Dart shortly.
上级 cdbe2146
......@@ -15,6 +15,7 @@ class Scene extends NativeFieldWrapperClass2 {
/// or extended directly.
///
/// To create a Scene object, use a [SceneBuilder].
@pragma('vm:entry-point')
Scene._();
......@@ -45,6 +46,7 @@ class Scene extends NativeFieldWrapperClass2 {
/// it to the scene using [addPicture].
class SceneBuilder extends NativeFieldWrapperClass2 {
/// Creates an empty [SceneBuilder] object.
@pragma('vm:entry-point')
SceneBuilder() { _constructor(); }
void _constructor() native 'SceneBuilder_constructor';
......
......@@ -589,6 +589,7 @@ class Rect {
Rect._();
/// Construct a rectangle from its left, top, right, and bottom edges.
@pragma('vm:entry-point')
Rect.fromLTRB(double left, double top, double right, double bottom) {
_value
..[0] = left
......
......@@ -12,6 +12,7 @@ dynamic _decodeJSON(String message) {
return message != null ? json.decode(message) : null;
}
@pragma('vm:entry-point')
void _updateWindowMetrics(double devicePixelRatio,
double width,
double height,
......@@ -43,13 +44,16 @@ typedef _LocaleClosure = String Function();
String _localeClosure() => window._locale.toString();
@pragma('vm:entry-point')
_LocaleClosure _getLocaleClosure() => _localeClosure;
@pragma('vm:entry-point')
void _updateLocale(String languageCode, String countryCode) {
window._locale = new Locale(languageCode, countryCode);
_invoke(window.onLocaleChanged, window._onLocaleChangedZone);
}
@pragma('vm:entry-point')
void _updateUserSettingsData(String jsonData) {
final Map<String, dynamic> data = json.decode(jsonData);
_updateTextScaleFactor(data['textScaleFactor'].toDouble());
......@@ -65,11 +69,13 @@ void _updateAlwaysUse24HourFormat(bool alwaysUse24HourFormat) {
window._alwaysUse24HourFormat = alwaysUse24HourFormat;
}
@pragma('vm:entry-point')
void _updateSemanticsEnabled(bool enabled) {
window._semanticsEnabled = enabled;
_invoke(window.onSemanticsEnabledChanged, window._onSemanticsEnabledChangedZone);
}
@pragma('vm:entry-point')
void _updateAccessibilityFeatures(int values) {
final AccessibilityFeatures newFeatures = new AccessibilityFeatures._(values);
if (newFeatures == window._accessibilityFeatures)
......@@ -78,6 +84,7 @@ void _updateAccessibilityFeatures(int values) {
_invoke(window.onAccessibilityFeaturesChanged, window._onAccessibilityFlagsChangedZone);
}
@pragma('vm:entry-point')
void _dispatchPlatformMessage(String name, ByteData data, int responseId) {
if (window.onPlatformMessage != null) {
_invoke3<String, ByteData, PlatformMessageResponseCallback>(
......@@ -94,11 +101,13 @@ void _dispatchPlatformMessage(String name, ByteData data, int responseId) {
}
}
@pragma('vm:entry-point')
void _dispatchPointerDataPacket(ByteData packet) {
if (window.onPointerDataPacket != null)
_invoke1<PointerDataPacket>(window.onPointerDataPacket, window._onPointerDataPacketZone, _unpackPointerDataPacket(packet));
}
@pragma('vm:entry-point')
void _dispatchSemanticsAction(int id, int action, ByteData args) {
_invoke3<int, SemanticsAction, ByteData>(
window.onSemanticsAction,
......@@ -109,10 +118,12 @@ void _dispatchSemanticsAction(int id, int action, ByteData args) {
);
}
@pragma('vm:entry-point')
void _beginFrame(int microseconds) {
_invoke1<Duration>(window.onBeginFrame, window._onBeginFrameZone, new Duration(microseconds: microseconds));
}
@pragma('vm:entry-point')
void _drawFrame() {
_invoke(window.onDrawFrame, window._onDrawFrameZone);
}
......
......@@ -27,6 +27,7 @@ Future<developer.ServiceExtensionResponse> _scheduleFrame(
}));
}
@pragma('vm:entry-point')
void _setupHooks() {
assert(() {
// In debug mode, register the schedule frame extension.
......@@ -54,7 +55,9 @@ Function _getCallbackFromHandle(int handle) native 'GetCallbackFromHandle';
// Required for gen_snapshot to work correctly.
int _isolateId;
@pragma('vm:entry-point')
Function _getPrintClosure() => _print;
@pragma('vm:entry-point')
Function _getScheduleMicrotaskClosure() => _scheduleMicrotask;
// Though the "main" symbol is not included in any of the libraries imported
......@@ -62,4 +65,5 @@ Function _getScheduleMicrotaskClosure() => _scheduleMicrotask;
// symbol is only necessary for precompilation. It is marked as a stanalone
// entry point into the VM. This prevents the precompiler from tree shaking
// away "main".
@pragma('vm:entry-point')
Function _getMainClosure() => main;
......@@ -102,6 +102,7 @@ class Color {
/// For example, to get a fully opaque orange, you would use `const
/// Color(0xFFFF9000)` (`FF` for the alpha, `FF` for the red, `90` for the
/// green, and `00` for the blue).
@pragma('vm:entry-point')
const Color(int value) : value = value & 0xFFFFFFFF;
/// Construct a color from the lower 8 bits of four integers.
......@@ -1485,9 +1486,14 @@ class _ImageInfo {
_ImageInfo(this.width, this.height, this.format, this.rowBytes) {
rowBytes ??= width * 4;
}
@pragma('vm:entry-point', 'get')
int width;
@pragma('vm:entry-point', 'get')
int height;
@pragma('vm:entry-point', 'get')
int format;
@pragma('vm:entry-point', 'get')
int rowBytes;
}
......@@ -1502,6 +1508,7 @@ class Image extends NativeFieldWrapperClass2 {
/// or extended directly.
///
/// To obtain an [Image] object, use [instantiateImageCodec].
@pragma('vm:entry-point')
Image._();
/// The number of image pixels along the image's horizontal axis.
......@@ -1549,6 +1556,7 @@ class FrameInfo extends NativeFieldWrapperClass2 {
///
/// To obtain an instance of the [FrameInfo] interface, see
/// [Codec.getNextFrame].
@pragma('vm:entry-point')
FrameInfo._();
/// The duration this frame should be shown.
......@@ -1566,6 +1574,7 @@ class Codec extends NativeFieldWrapperClass2 {
///
/// To obtain an instance of the [Codec] interface, see
/// [instantiateImageCodec].
@pragma('vm:entry-point')
Codec._();
/// Number of frames in this image.
......@@ -1752,6 +1761,7 @@ enum PathOperation {
/// used to create clip regions using [Canvas.clipPath].
class Path extends NativeFieldWrapperClass2 {
/// Create a new empty [Path] object.
@pragma('vm:entry-point')
Path() { _constructor(); }
void _constructor() native 'Path_constructor';
......@@ -2401,6 +2411,7 @@ class ImageFilter extends NativeFieldWrapperClass2 {
class Shader extends NativeFieldWrapperClass2 {
/// This class is created by the engine, and should not be instantiated
/// or extended directly.
@pragma('vm:entry-point')
Shader._();
}
......@@ -2664,6 +2675,7 @@ class ImageShader extends Shader {
/// direction and y direction respectively. The fourth argument gives the
/// matrix to apply to the effect. All the arguments are required and must not
/// be null.
@pragma('vm:entry-point')
ImageShader(Image image, TileMode tmx, TileMode tmy, Float64List matrix4) :
assert(image != null), // image is checked on the engine side
assert(tmx != null),
......@@ -2828,6 +2840,7 @@ class Canvas extends NativeFieldWrapperClass2 {
///
/// To end the recording, call [PictureRecorder.endRecording] on the
/// given recorder.
@pragma('vm:entry-point')
Canvas(PictureRecorder recorder, [ Rect cullRect ]) : assert(recorder != null) {
if (recorder.isRecording)
throw new ArgumentError('"recorder" must not already be associated with another Canvas.');
......@@ -3545,6 +3558,7 @@ class Picture extends NativeFieldWrapperClass2 {
/// or extended directly.
///
/// To create a [Picture], use a [PictureRecorder].
@pragma('vm:entry-point')
Picture._();
/// Creates an image from this picture.
......@@ -3575,6 +3589,7 @@ class PictureRecorder extends NativeFieldWrapperClass2 {
/// Creates a new idle PictureRecorder. To associate it with a
/// [Canvas] and begin recording, pass this [PictureRecorder] to the
/// [Canvas] constructor.
@pragma('vm:entry-point')
PictureRecorder() { _constructor(); }
void _constructor() native 'PictureRecorder_constructor';
......@@ -3640,4 +3655,3 @@ Future<T> _futurize<T>(_Callbacker<T> callbacker) {
throw new Exception(error);
return completer.future;
}
......@@ -552,6 +552,7 @@ class SemanticsFlag {
/// [Window.updateSemantics] to update the semantics conveyed to the user.
class SemanticsUpdateBuilder extends NativeFieldWrapperClass2 {
/// Creates an empty [SemanticsUpdateBuilder] object.
@pragma('vm:entry-point')
SemanticsUpdateBuilder() { _constructor(); }
void _constructor() native 'SemanticsUpdateBuilder_constructor';
......@@ -727,6 +728,7 @@ class SemanticsUpdate extends NativeFieldWrapperClass2 {
/// or extended directly.
///
/// To create a SemanticsUpdate object, use a [SemanticsUpdateBuilder].
@pragma('vm:entry-point')
SemanticsUpdate._();
/// Releases the resources used by this semantics update.
......
......@@ -750,6 +750,7 @@ class TextBox {
this.direction,
);
@pragma('vm:entry-point')
TextBox._(
this.left,
this.top,
......@@ -948,6 +949,7 @@ class Paragraph extends NativeFieldWrapperClass2 {
/// or extended directly.
///
/// To create a [Paragraph] object, use a [ParagraphBuilder].
@pragma('vm:entry-point')
Paragraph._();
/// The amount of horizontal space this paragraph occupies.
......@@ -1035,6 +1037,7 @@ class Paragraph extends NativeFieldWrapperClass2 {
class ParagraphBuilder extends NativeFieldWrapperClass2 {
/// Creates a [ParagraphBuilder] object, which is used to create a
/// [Paragraph].
@pragma('vm:entry-point')
ParagraphBuilder(ParagraphStyle style) { _constructor(style._encoded, style._fontFamily, style._fontSize, style._lineHeight, style._ellipsis, _encodeLocale(style._locale)); }
void _constructor(Int32List encoded, String fontFamily, double fontSize, double lineHeight, String ellipsis, String locale) native 'ParagraphBuilder_constructor';
......
dart:_internal,::,_printClosure
dart:async,::,_setScheduleImmediateClosure
dart:io,::,_getUriBaseClosure
dart:io,::,_setupHooks
dart:io,_Platform,_localeClosure
dart:io,_Platform,set:_nativeScript
dart:isolate,::,_getIsolateScheduleImmediateClosure
dart:isolate,::,_setupHooks
dart:isolate,::,_startMainIsolate
dart:ui,::,_beginFrame
dart:ui,::,_dispatchPlatformMessage
dart:ui,::,_dispatchPointerDataPacket
dart:ui,::,_dispatchSemanticsAction
dart:ui,::,_drawFrame
dart:ui,::,_getLocaleClosure
dart:ui,::,_getMainClosure
dart:ui,::,_getPrintClosure
dart:ui,::,_getScheduleMicrotaskClosure
dart:ui,::,_setupHooks
dart:ui,::,_updateLocale
dart:ui,::,_updateSemanticsEnabled
dart:ui,::,_updateAccessibilityFeatures
dart:ui,::,_updateUserSettingsData
dart:ui,::,_updateWindowMetrics
dart:ui,_ImageInfo,get:width
dart:ui,_ImageInfo,get:height
dart:ui,_ImageInfo,get:format
dart:ui,_ImageInfo,get:rowBytes
dart:ui,Canvas,Canvas.
dart:ui,Codec,Codec._
dart:ui,Color,Color.
dart:ui,FrameInfo,FrameInfo._
dart:ui,Image,Image._
dart:ui,ImageShader,ImageShader.
dart:ui,Paragraph,Paragraph._
dart:ui,ParagraphBuilder,ParagraphBuilder.
dart:ui,Path,Path.
dart:ui,Picture,Picture._
dart:ui,PictureRecorder,PictureRecorder.
dart:ui,Rect,Rect.fromLTRB
dart:ui,Scene,Scene._
dart:ui,SceneBuilder,SceneBuilder.
dart:ui,SemanticsUpdate,SemanticsUpdate._
dart:ui,SemanticsUpdateBuilder,SemanticsUpdateBuilder.
dart:ui,Shader,Shader._
dart:ui,TextBox,TextBox._
# Please don't add entries to this file.
# Use the @pragma('vm:entry-point') annotation instead.
Markdown is supported
0% .
You are about to add 0 people to the discussion. Proceed with caution.
先完成此消息的编辑!
想要评论请 注册