30 const std::shared_ptr<Geometry>& geometry)
const {
39 contents->ApplyColorFilter(
color_filter->GetCPUColorFilterProc())) {
40 needs_color_filter =
false;
43 contents->SetGeometry(geometry);
56 std::shared_ptr<Contents> input)
const {
67 std::shared_ptr<Contents> input,
68 const Matrix& effect_transform)
const {
79 bool is_solid_color)
const {
89 const Matrix& effect_transform,
95 filter->SetRenderingMode(rendering_mode);
96 filter->SetEffectTransform(effect_transform);
100 std::shared_ptr<Contents> Paint::WithColorFilter(
101 std::shared_ptr<Contents> input,
117 if (input->ApplyColorFilter(
color_filter->GetCPUColorFilterProc())) {
125 std::shared_ptr<ColorSourceContents> color_source_contents,
126 const std::shared_ptr<ColorFilter>& color_filter)
const {
129 if (color_source_contents->IsSolidColor() && !
color_filter) {
137 auto mask = std::make_shared<SolidColorContents>();
139 mask->SetGeometry(color_source_contents->GetGeometry());
150 auto expanded_local_bounds = blurred_mask->GetCoverage({});
151 if (!expanded_local_bounds.has_value()) {
152 expanded_local_bounds =
Rect();
154 color_source_contents->SetGeometry(
157 std::shared_ptr<Contents> color_contents = color_source_contents;
176 bool is_solid_color)
const {
177 if (is_solid_color) {