Skip to content

[CP] Do not create incomplete DlColorSource objects from Skia gradients #103173

@flar

Description

@flar

issue_link

#102947

Commit Hash

b1b0a5a

Target

stable

Impacted Users

any Flutter dev using a matrix in a text gradient in 2.13(-pre)

Impact Description

Gradients have an optional matrix that controls how their stop locations appear in the frame. If a Gradient is used to render text then we will fumble that matrix and render the gradient incorrectly.

Workaround

In some cases, the matrix can be directly applied to, for example, the end points of a linear gradient, but that isn't true for all gradient types or all matrix types. A skewing gradient affects the perpendicular vectors of a gradient which can distort it in ways that applying the matrix to the geometry cannot achieve.

Risk

low

Test Coverage

yes

Validation Steps

The original commit above had API tests to verify that we were implementing the API that was causing the problem correctly, but it did not contain a golden test to verify that we were rendering the correct output.

A golden test was merged immediately after the fix and can be found in flutter/engine#33153

Running that golden test, or the test case in the original issue (both are basically the same code), will demonstrate the fix.

Metadata

Metadata

Assignees

No one assigned

    Labels

    cp: approvedApproved cherry-pick requestcp: reviewCherry-picks in the review queue

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions