-
Notifications
You must be signed in to change notification settings - Fork 28.6k
Lazy skwasm paths and object arenas. #168996
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
base: master
Are you sure you want to change the base?
Conversation
// Use of this source code is governed by a BSD-style license that can be | ||
// found in the LICENSE file. | ||
|
||
abstract class Collectable { |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
nit: Flutter codebase prefers American English (e.g. "color" instead of "colour"), so this should probably be "Collectible".
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Collectable
is fine American English. 😄
@@ -740,7 +741,7 @@ class EnginePlatformDispatcher extends ui.PlatformDispatcher { | |||
// order to perform golden tests in Flutter framework because on the HTML | |||
// renderer, golden tests render to DOM and then take a browser screenshot, | |||
// https://github.com/flutter/flutter/issues/137073. | |||
if (shouldRender || renderer.rendererTag == 'html') { | |||
if (shouldRender) { |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
👏
@@ -234,7 +234,7 @@ class SkwasmPath extends SkwasmObjectWrapper<RawPath> implements ScenePath { | |||
SkwasmPath.fromHandle(pathCombine(operation.index, path1.handle, path2.handle)); | |||
|
|||
@override | |||
ui.PathMetrics computeMetrics({bool forceClosed = false}) { | |||
DisposablePathMetrics computeMetrics({bool forceClosed = false}) { |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
I'm curious why not be more specific here and say SkwasmPathMetrics
?
@@ -35,6 +35,7 @@ abstract class Renderer { | |||
} | |||
} | |||
|
|||
Arena get frameArena; |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
The arena itself seems to be renderer-agnostic. Should we put it in EnginePlatformDispatcher
instead?
LazyPath.fromLazyPath(LazyPath other) | ||
: fillType = other.fillType, | ||
constructors = other.constructors, | ||
initializer = other.initializer, | ||
_commands = List.from(other._commands); |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
If there's a way to copy a SkwasmPath
(and it's cheap), would it be beneficial to also copy _cachedPath
to avoid re-applying all the commands later?
No description provided.