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 Mar 12, 2022

Fixes flutter/flutter#99997

I could have named this object DlShader to match the Skia naming, but the name "shader" which once referred to sources of color data has become a more generic term for a variety of GPU programs. I chose DlColorSource to indicate that these are the objects from which rendering objects get their source pixels.

The other "Dl" attributes have so far been directly constructible, but for the case of gradients the objects contain arbitrarily long arrays for colors and stops so I created a constructor that will inline the arrays into the allocated memory (similar to techniques used in SkVertices). Since these constructors are non-standard and since they must be executed with care, I only allow 2 locations to construct these - the DlColorSource::Make methods and the DisplayListBuilder methods that instantiate them into the DisplayList memory itself. These objects are still simple and satisfy the principles outlined in display_list_attributes.h, but their variable size dictates a slightly different construction technique.

@flar
Copy link
Contributor Author

flar commented Mar 12, 2022

When flutter/impeller#73 merges into the Impeller repo then I can adjust the DEPS for this PR and merge it.

@flar flar requested review from bdero, chinmaygarde and dnfield March 12, 2022 09:59
Copy link
Member

@chinmaygarde chinmaygarde left a comment

Choose a reason for hiding this comment

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

Apart from perhaps the defaulted virtual destructors, everything else is nits and the patch overall looks good to me. Thanks!

@flar flar force-pushed the add-DlColorSource-objects branch from 335ceb2 to 614d9a5 Compare March 15, 2022 22:11
@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 Mar 15, 2022
@fluttergithubbot fluttergithubbot merged commit dc22c4c into flutter:main Mar 15, 2022
engine-flutter-autoroll added a commit to engine-flutter-autoroll/flutter that referenced this pull request Mar 16, 2022
zanderso pushed a commit to flutter/flutter that referenced this pull request Mar 16, 2022
* 0199e90 [macOS] fix text selection when there's composing text  (flutter/engine#31936)

* 0ca0ce1 Roll Skia from 9565f4bd902b to a48a3c9417c0 (3 revisions) (flutter/engine#32044)

* a60e8c3 Switch the renderer to impeller based on the presence of a command line flag. (flutter/engine#31959)

* 24051b6 Roll Fuchsia Mac SDK from EOVjR8JSN... to jvlI1s78T... (flutter/engine#32047)

* fef6232 Roll Skia from a48a3c9417c0 to ffb49630eb1a (3 revisions) (flutter/engine#32048)

* 5a80834 [ci.yaml] Migrate remaining targets to cocoon scheduler (flutter/engine#32018)

* cd7a1e2 Support stencil buffers on OpenGL for Windows and Android (flutter/engine#31967)

* dc22c4c Add DlColorSource objects to hold information for SkShaders (flutter/engine#31981)
jason-simmons pushed a commit to jason-simmons/flutter_engine that referenced this pull request Mar 22, 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 DisplayList ColorSource (i.e. SkShader) object

4 participants