Skip to content

Migrate gradient creation to the new SkShaders API#180766

Merged
auto-submit[bot] merged 1 commit into
flutter:masterfrom
bungeman:new_gradient
Jan 17, 2026
Merged

Migrate gradient creation to the new SkShaders API#180766
auto-submit[bot] merged 1 commit into
flutter:masterfrom
bungeman:new_gradient

Conversation

@bungeman

@bungeman bungeman commented Jan 9, 2026

Copy link
Copy Markdown
Contributor

Update calls from the deprecated SkGradientShader::MakeLinear and SkGradientShader::MakeRadial to the new SkShaders::LinearGradient and SkShaders::RadialGradient functions. This implies updating the gradient color specifications from SkColor to SkColor4f. The macro SK_SUPPORT_LEGACY_UNSPANNED_GRADIENTS is removed.

@github-actions github-actions Bot added the engine flutter/engine related. See also e: labels. label Jan 9, 2026

@gemini-code-assist gemini-code-assist Bot left a comment

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

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

Code Review

This pull request migrates gradient creation to the new Skia SkShaders API, which is a good modernization step. The changes are well-contained and correctly update the API calls and associated data types like SkColor4f. I've included a couple of suggestions: one to refactor duplicated code for better maintainability in dl_sk_conversions.cc, and another to improve precision in a test case in dl_rendering_unittests.cc to ensure correctness.

Comment thread engine/src/flutter/display_list/skia/dl_sk_conversions.cc Outdated
Comment thread engine/src/flutter/display_list/testing/dl_rendering_unittests.cc Outdated
@bungeman bungeman force-pushed the new_gradient branch 2 times, most recently from 7ebe2a7 to 74be125 Compare January 12, 2026 20:48
@bungeman bungeman force-pushed the new_gradient branch 6 times, most recently from 558b22d to 2909b11 Compare January 15, 2026 19:35
Update calls from the deprecated SkGradientShader::MakeLinear and
SkGradientShader::MakeRadial to the new SkShaders::LinearGradient and
SkShaders::RadialGradient functions. This implies updating the gradient
color specifications from SkColor to SkColor4f. The macro
SK_SUPPORT_LEGACY_UNSPANNED_GRADIENTS is removed.

@flar flar left a comment

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

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

LGTM

@jason-simmons jason-simmons added the autosubmit Merge PR when tree becomes green via auto submit App label Jan 16, 2026
@auto-submit auto-submit Bot added this pull request to the merge queue Jan 17, 2026
Merged via the queue into flutter:master with commit e9693c6 Jan 17, 2026
181 checks passed
@flutter-dashboard flutter-dashboard Bot removed the autosubmit Merge PR when tree becomes green via auto submit App label Jan 17, 2026
engine-flutter-autoroll added a commit to engine-flutter-autoroll/packages that referenced this pull request Jan 17, 2026
engine-flutter-autoroll added a commit to engine-flutter-autoroll/packages that referenced this pull request Jan 17, 2026
engine-flutter-autoroll added a commit to engine-flutter-autoroll/packages that referenced this pull request Jan 17, 2026
engine-flutter-autoroll added a commit to engine-flutter-autoroll/packages that referenced this pull request Jan 18, 2026
engine-flutter-autoroll added a commit to engine-flutter-autoroll/packages that referenced this pull request Jan 18, 2026
engine-flutter-autoroll added a commit to engine-flutter-autoroll/packages that referenced this pull request Jan 19, 2026
calltekk pushed a commit to calltekk/flutter that referenced this pull request Jan 19, 2026
Update calls from the deprecated SkGradientShader::MakeLinear and
SkGradientShader::MakeRadial to the new SkShaders::LinearGradient and
SkShaders::RadialGradient functions. This implies updating the gradient
color specifications from SkColor to SkColor4f. The macro
SK_SUPPORT_LEGACY_UNSPANNED_GRADIENTS is removed.
engine-flutter-autoroll added a commit to engine-flutter-autoroll/packages that referenced this pull request Jan 19, 2026
engine-flutter-autoroll added a commit to engine-flutter-autoroll/packages that referenced this pull request Jan 19, 2026
engine-flutter-autoroll added a commit to engine-flutter-autoroll/packages that referenced this pull request Jan 20, 2026
engine-flutter-autoroll added a commit to engine-flutter-autoroll/packages that referenced this pull request Jan 20, 2026
engine-flutter-autoroll added a commit to engine-flutter-autoroll/packages that referenced this pull request Jan 20, 2026
engine-flutter-autoroll added a commit to engine-flutter-autoroll/packages that referenced this pull request Jan 20, 2026
engine-flutter-autoroll added a commit to engine-flutter-autoroll/packages that referenced this pull request Jan 20, 2026
engine-flutter-autoroll added a commit to engine-flutter-autoroll/packages that referenced this pull request Jan 21, 2026
engine-flutter-autoroll added a commit to engine-flutter-autoroll/packages that referenced this pull request Jan 21, 2026
engine-flutter-autoroll added a commit to engine-flutter-autoroll/packages that referenced this pull request Jan 21, 2026
engine-flutter-autoroll added a commit to engine-flutter-autoroll/packages that referenced this pull request Jan 22, 2026
engine-flutter-autoroll added a commit to engine-flutter-autoroll/packages that referenced this pull request Jan 22, 2026
engine-flutter-autoroll added a commit to engine-flutter-autoroll/packages that referenced this pull request Jan 22, 2026
engine-flutter-autoroll added a commit to engine-flutter-autoroll/packages that referenced this pull request Jan 23, 2026
flutter-zl pushed a commit to flutter-zl/flutter that referenced this pull request Feb 10, 2026
Update calls from the deprecated SkGradientShader::MakeLinear and
SkGradientShader::MakeRadial to the new SkShaders::LinearGradient and
SkShaders::RadialGradient functions. This implies updating the gradient
color specifications from SkColor to SkColor4f. The macro
SK_SUPPORT_LEGACY_UNSPANNED_GRADIENTS is removed.
liuyq pushed a commit to liuyq/flutter that referenced this pull request Apr 3, 2026
refer to the following commit:
    e9693c6("Migrate gradient creation to the new SkShaders API (flutter#180766)")

Signed-off-by: Yongqin Liu <yongqin.liu@linaro.org>
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

engine flutter/engine related. See also e: labels.

Projects

None yet

Development

Successfully merging this pull request may close these issues.

3 participants