Skip to content

Report more of a Picture's actual size to the Dart VM #58438

@dnfield

Description

@dnfield

From @chinmaygarde

drawVertices and drawPoints has vertex buffers whose sizes can be appreciable (IIRC stuff like flare uses it extensively).
drawPath can have custom paths that may be large. There are path iterator APIs that you can use to walk an count the verbs and points. You should probably memoize the size here too.

All arguments that can take a paint may have a shader set on them. These shaders can reference images. In the same vein, shaders in dart:ui should also reference the correct size.

One thing I'm not clear on is whether approximateBytesUsed on SkPicture accounts for any of these - for example, I know it does not include image and font data, but it's not clear to me whether it includes vertex buffers or paths (I would expect it does include paths). At any rate, iterating paths for this purpose is probably more expensive than we want to be.

/cc @chinmaygarde @brianosman @mtklein @liyuqian who may know

Metadata

Metadata

Assignees

No one assigned

    Labels

    P1High-priority issues at the top of the work listc: performanceRelates to speed or footprint issues (see "perf:" labels)engineflutter/engine related. See also e: labels.perf: memoryPerformance issues related to memory

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions