aboutsummaryrefslogtreecommitdiffhomepage
path: root/src/effects/SkAlphaThresholdFilter.cpp
diff options
context:
space:
mode:
authorGravatar ethannicholas <ethannicholas@google.com>2016-02-22 07:42:18 -0800
committerGravatar Commit bot <commit-bot@chromium.org>2016-02-22 07:42:18 -0800
commit23e7af0e8ab8377b28e1399b4950def672284724 (patch)
treecbee927515891c54d1b9f5a4504cf8abddf17ce9 /src/effects/SkAlphaThresholdFilter.cpp
parentb6ce10a235f2b692fdc014521c4a1ecbe98a00ef (diff)
Revert of fix misc asserts and checks found by fuzzer (patchset #1 id:1 of https://codereview.chromium.org/1719913002/ )
Reason for revert: Looks to be causing failures in LayerTreeHostFilters* tests (https://build.chromium.org/p/tryserver.chromium.win/builders/win_chromium_rel_ng/builds/177297/steps/cc_unittests%20%28with%20patch%29/logs/stdio). Original issue's description: > fix misc asserts and checks found by fuzzer > > BUG=skia: > GOLD_TRYBOT_URL= https://gold.skia.org/search2?unt=true&query=source_type%3Dgm&master=false&issue=1713383002 > > TBR= > > Committed: https://skia.googlesource.com/skia/+/653db51b440491b0fb1908bf5a43dcc89c90044d TBR=reed@google.com # Skipping CQ checks because original CL landed less than 1 days ago. NOPRESUBMIT=true NOTREECHECKS=true NOTRY=true BUG=skia: Review URL: https://codereview.chromium.org/1721743002
Diffstat (limited to 'src/effects/SkAlphaThresholdFilter.cpp')
-rw-r--r--src/effects/SkAlphaThresholdFilter.cpp9
1 files changed, 1 insertions, 8 deletions
diff --git a/src/effects/SkAlphaThresholdFilter.cpp b/src/effects/SkAlphaThresholdFilter.cpp
index 406797084f..79520602b7 100644
--- a/src/effects/SkAlphaThresholdFilter.cpp
+++ b/src/effects/SkAlphaThresholdFilter.cpp
@@ -45,19 +45,11 @@ SK_DEFINE_FLATTENABLE_REGISTRAR_GROUP_START(SkAlphaThresholdFilter)
SK_DEFINE_FLATTENABLE_REGISTRAR_ENTRY(SkAlphaThresholdFilterImpl)
SK_DEFINE_FLATTENABLE_REGISTRAR_GROUP_END
-static bool outside_unit(SkScalar x) {
- return x < 0 || x > 1;
-}
SkImageFilter* SkAlphaThresholdFilter::Create(const SkRegion& region,
SkScalar innerThreshold,
SkScalar outerThreshold,
SkImageFilter* input) {
- if (outside_unit(innerThreshold) || outside_unit(outerThreshold) ||
- innerThreshold > outerThreshold)
- {
- return nullptr;
- }
return new SkAlphaThresholdFilterImpl(region, innerThreshold, outerThreshold, input);
}
@@ -342,6 +334,7 @@ void SkAlphaThresholdFilterImpl::flatten(SkWriteBuffer& buffer) const {
bool SkAlphaThresholdFilterImpl::onFilterImageDeprecated(Proxy* proxy, const SkBitmap& src,
const Context& ctx, SkBitmap* dst,
SkIPoint* offset) const {
+ SkASSERT(src.colorType() == kN32_SkColorType);
if (src.colorType() != kN32_SkColorType) {
return false;