Skip to content
This repository was archived by the owner on Feb 25, 2025. It is now read-only.
Prev Previous commit
Next Next commit
removed color filter
  • Loading branch information
gaaclarke committed Mar 8, 2024
commit 66c4d3840c91a5d9ea70f0d645f66c9adafec840
13 changes: 1 addition & 12 deletions impeller/aiks/canvas.cc
Original file line number Diff line number Diff line change
Expand Up @@ -737,20 +737,9 @@ void Canvas::DrawImageRect(const std::shared_ptr<Image>& image,
texture_contents->SetOpacity(paint.color.alpha);
texture_contents->SetDeferApplyingOpacity(paint.HasColorFilter());

bool needs_color_filter = paint.HasColorFilter();
if (needs_color_filter) {
auto color_filter = paint.GetColorFilter();
if (texture_contents->ApplyColorFilter(
color_filter->GetCPUColorFilterProc())) {
needs_color_filter = false;
}
}

std::shared_ptr<Contents> contents = texture_contents;
if (paint.mask_blur_descriptor.has_value()) {
contents = paint.mask_blur_descriptor->CreateMaskBlur(
texture_contents,
needs_color_filter ? paint.GetColorFilter() : nullptr);
contents = paint.mask_blur_descriptor->CreateMaskBlur(texture_contents);
}

Entity entity;
Expand Down
3 changes: 1 addition & 2 deletions impeller/aiks/paint.cc
Original file line number Diff line number Diff line change
Expand Up @@ -123,8 +123,7 @@ std::shared_ptr<Contents> Paint::WithColorFilter(
}

std::shared_ptr<FilterContents> Paint::MaskBlurDescriptor::CreateMaskBlur(
Copy link
Contributor

Choose a reason for hiding this comment

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

I would defer to @bdero to review the mask blur implementation. Overall code looks reasonable to me.

std::shared_ptr<TextureContents> texture_contents,
const std::shared_ptr<ColorFilter>& color_filter) const {
std::shared_ptr<TextureContents> texture_contents) const {
Scalar expand_amount = GaussianBlurFilterContents::CalculateBlurRadius(
GaussianBlurFilterContents::ScaleSigma(sigma.sigma));
texture_contents->SetSourceRect(
Expand Down
3 changes: 1 addition & 2 deletions impeller/aiks/paint.h
Original file line number Diff line number Diff line change
Expand Up @@ -45,8 +45,7 @@ struct Paint {
const std::shared_ptr<ColorFilter>& color_filter) const;

std::shared_ptr<FilterContents> CreateMaskBlur(
std::shared_ptr<TextureContents> texture_contents,
const std::shared_ptr<ColorFilter>& color_filter) const;
std::shared_ptr<TextureContents> texture_contents) const;

std::shared_ptr<FilterContents> CreateMaskBlur(
const FilterInput::Ref& input,
Expand Down