-
Notifications
You must be signed in to change notification settings - Fork 6k
add DlPaint object for optional use with DisplayListBuilder #32860
Conversation
| // if (flags.applies_path_effect()) { | ||
| // setPathEffect(sk_ref_sp(paint.getPathEffect())); | ||
| // } |
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.
Commented out code.
We need this right? Text can do it?
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 waiting for the DlPathEffect PR to land which will happen any day/hour now. It's just waiting for the developer to rebase one of their PRs.
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.
Can you add a TODO with a link to the issue/PR?
| class DlColor { | ||
| public: | ||
| DlColor() : argb(0xFF000000) {} | ||
| DlColor(uint32_t argb) : argb(argb) {} | ||
|
|
||
| uint32_t argb; | ||
|
|
||
| bool operator==(DlColor const& other) const { return argb == other.argb; } | ||
| bool operator!=(DlColor const& other) const { return argb != other.argb; } | ||
| }; |
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: any reason to not just have this be a typedef?
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.
A couple of nit-ty reasons.
- SkColor being a typedef means you can't overload off of it.
- Other type-safety-ish consequences
- (In my "verbose DL compare" code, for example, I had to wrap all SkColors in a class to get them to print easily)
- Potentially these can contain a 4-float version, but I haven't decided how to manage that distinction yet.
- Starting with a (simple, non-virtual) class will demonstrate if there are any negative consequences as we move forward with this
dnfield
left a comment
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.
LGTM
Fixes: flutter/flutter#102368
This PR adds a DlPaint object which can encapsulate the standard attributes that Flutter uses. It also adds overloads to the draw calls in DisplayListBuilder that take this object and makes sure the stream is updated with the necessary attributes it contains. (i.e.
builder.drawRect(rect, DlPaint()))The stream of records still remains stateful (for now), and the Dispatcher interface is still stateful, but that can evolve in the future for convenience of developers needing to interpret the DisplayLists.