summaryrefslogtreecommitdiff
path: root/chromium/third_party/blink/renderer/platform/graphics/dark_mode_filter.cc
diff options
context:
space:
mode:
Diffstat (limited to 'chromium/third_party/blink/renderer/platform/graphics/dark_mode_filter.cc')
-rw-r--r--chromium/third_party/blink/renderer/platform/graphics/dark_mode_filter.cc12
1 files changed, 1 insertions, 11 deletions
diff --git a/chromium/third_party/blink/renderer/platform/graphics/dark_mode_filter.cc b/chromium/third_party/blink/renderer/platform/graphics/dark_mode_filter.cc
index fd23211ae43..cc993636d8e 100644
--- a/chromium/third_party/blink/renderer/platform/graphics/dark_mode_filter.cc
+++ b/chromium/third_party/blink/renderer/platform/graphics/dark_mode_filter.cc
@@ -142,7 +142,6 @@ sk_sp<SkColorFilter> DarkModeFilter::ApplyToImage(const SkPixmap& pixmap,
}
sk_sp<SkColorFilter> DarkModeFilter::GetImageFilter() const {
- DCHECK(immutable_.settings.image_policy == DarkModeImagePolicy::kFilterAll);
DCHECK(immutable_.image_filter);
return immutable_.image_filter;
}
@@ -174,6 +173,7 @@ absl::optional<cc::PaintFlags> DarkModeFilter::ApplyToFlagsIfNeeded(
bool DarkModeFilter::ShouldApplyToColor(SkColor color, ElementRole role) {
switch (role) {
+ case ElementRole::kSVG:
case ElementRole::kText:
DCHECK(immutable_.text_classifier);
return immutable_.text_classifier->ShouldInvertColor(color) ==
@@ -189,16 +189,6 @@ bool DarkModeFilter::ShouldApplyToColor(SkColor color, ElementRole role) {
DCHECK(immutable_.background_classifier);
return immutable_.background_classifier->ShouldInvertColor(color) ==
DarkModeResult::kApplyFilter;
- case ElementRole::kSVG:
- // 1) Inline SVG images are considered as individual shapes and do not
- // have an Image object associated with them. So they do not go through
- // the regular image classification pipeline. Do not apply any filter to
- // the SVG shapes until there is a way to get the classification for the
- // entire image to which these shapes belong.
-
- // 2) Non-inline SVG images are already classified at this point and have
- // a filter applied if necessary.
- return false;
default:
return false;
}