Skip to content

Commit

Permalink
adopt new DlColorFilter objects (#12)
Browse files Browse the repository at this point in the history
  • Loading branch information
flar authored and dnfield committed Apr 27, 2022
1 parent ca3433d commit e768f4d
Show file tree
Hide file tree
Showing 2 changed files with 16 additions and 3 deletions.
17 changes: 15 additions & 2 deletions impeller/display_list/display_list_dispatcher.cc
Original file line number Diff line number Diff line change
Expand Up @@ -79,9 +79,22 @@ void DisplayListDispatcher::setShader(sk_sp<SkShader> shader) {
}

// |flutter::Dispatcher|
void DisplayListDispatcher::setColorFilter(sk_sp<SkColorFilter> filter) {
void DisplayListDispatcher::setColorFilter(
const flutter::DlColorFilter* filter) {
// Needs https://github.com/flutter/flutter/issues/95434
UNIMPLEMENTED;
if (filter == nullptr) {
// Reset everything
return;
}
switch (filter->type()) {
case flutter::DlColorFilter::kBlend:
case flutter::DlColorFilter::kMatrix:
case flutter::DlColorFilter::kSrgbToLinearGamma:
case flutter::DlColorFilter::kLinearToSrgbGamma:
case flutter::DlColorFilter::kUnknown:
UNIMPLEMENTED;
break;
}
}

// |flutter::Dispatcher|
Expand Down
2 changes: 1 addition & 1 deletion impeller/display_list/display_list_dispatcher.h
Original file line number Diff line number Diff line change
Expand Up @@ -48,7 +48,7 @@ class DisplayListDispatcher final : public flutter::Dispatcher {
void setShader(sk_sp<SkShader> shader) override;

// |flutter::Dispatcher|
void setColorFilter(sk_sp<SkColorFilter> filter) override;
void setColorFilter(const flutter::DlColorFilter* filter) override;

// |flutter::Dispatcher|
void setInvertColors(bool invert) override;
Expand Down

0 comments on commit e768f4d

Please sign in to comment.