Expose approximateBytesUsed for Picture (flutter/engine#5378)

This commit is contained in:
Dan Field 2018-06-12 15:34:23 -04:00 committed by GitHub
parent ab0c8a6516
commit 32b1182b0b
2 changed files with 8 additions and 1 deletions

View File

@ -3404,6 +3404,12 @@ class Picture extends NativeFieldWrapperClass2 {
/// Release the resources used by this object. The object is no longer usable
/// after this method is called.
void dispose() native 'Picture_dispose';
/// Returns the approximate number of bytes allocated for this object.
///
/// The actual size of this picture may be larger, particularly if it contains
/// references to image or other large objects.
int get approximateBytesUsed native 'Picture_GetAllocationSize';
}
/// Records a [Picture] containing a sequence of graphical operations.

View File

@ -18,7 +18,8 @@ IMPLEMENT_WRAPPERTYPEINFO(ui, Picture);
#define FOR_EACH_BINDING(V) \
V(Picture, toImage) \
V(Picture, dispose)
V(Picture, dispose) \
V(Picture, GetAllocationSize)
DART_BIND_ALL(Picture, FOR_EACH_BINDING)