Skip to content
This repository was archived by the owner on Feb 25, 2025. It is now read-only.

Conversation

@flar
Copy link
Contributor

@flar flar commented Apr 22, 2022

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.

Comment on lines +328 to +330
// if (flags.applies_path_effect()) {
// setPathEffect(sk_ref_sp(paint.getPathEffect()));
// }
Copy link
Contributor

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?

Copy link
Contributor Author

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.

Copy link
Contributor

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?

Comment on lines +16 to +25
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; }
};
Copy link
Contributor

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?

Copy link
Contributor Author

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

Copy link
Contributor

@dnfield dnfield left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

LGTM

@flar flar added the waiting for tree to go green This PR is approved and tested, but waiting for the tree to be green to land. label Apr 22, 2022
@fluttergithubbot fluttergithubbot merged commit e881225 into flutter:main Apr 22, 2022
engine-flutter-autoroll added a commit to engine-flutter-autoroll/flutter that referenced this pull request Apr 23, 2022
engine-flutter-autoroll added a commit to engine-flutter-autoroll/flutter that referenced this pull request Apr 23, 2022
engine-flutter-autoroll added a commit to engine-flutter-autoroll/flutter that referenced this pull request Apr 23, 2022
Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.

Labels

waiting for tree to go green This PR is approved and tested, but waiting for the tree to be green to land.

Projects

None yet

Development

Successfully merging this pull request may close these issues.

Create a DlPaint object for use in building DisplayLists

3 participants