Index: src/core/SkImageFilter.cpp |
diff --git a/src/core/SkImageFilter.cpp b/src/core/SkImageFilter.cpp |
index 6a3286ed67475510be347379142f35d8084cc5df..3b2b27710de57d6fd873aafc637d775f31ddc04b 100644 |
--- a/src/core/SkImageFilter.cpp |
+++ b/src/core/SkImageFilter.cpp |
@@ -309,9 +309,6 @@ void SkImageFilter::computeFastBounds(const SkRect& src, SkRect* dst) const { |
} |
bool SkImageFilter::canComputeFastBounds() const { |
- if (this->affectsTransparentBlack()) { |
- return false; |
- } |
for (int i = 0; i < fInputCount; i++) { |
SkImageFilter* input = this->getInput(i); |
if (input && !input->canComputeFastBounds()) { |
@@ -321,10 +318,6 @@ bool SkImageFilter::canComputeFastBounds() const { |
return true; |
} |
-bool SkImageFilter::affectsTransparentBlack() const { |
- return false; |
-} |
- |
bool SkImageFilter::onFilterImage(Proxy*, const SkBitmap&, const Context&, |
SkBitmap*, SkIPoint*) const { |
return false; |
@@ -391,6 +384,18 @@ bool SkImageFilter::filterImageGPU(Proxy* proxy, const SkBitmap& src, const Cont |
return false; |
} |
+bool SkImageFilter::asAColorFilter(SkColorFilter** filterPtr) const { |
+ SkASSERT(nullptr != filterPtr); |
+ if (!this->isColorFilterNode(filterPtr)) { |
+ return false; |
+ } |
+ if (nullptr != this->getInput(0) || (*filterPtr)->affectsTransparentBlack()) { |
+ (*filterPtr)->unref(); |
+ return false; |
+ } |
+ return true; |
+} |
+ |
bool SkImageFilter::applyCropRect(const Context& ctx, const SkBitmap& src, |
const SkIPoint& srcOffset, SkIRect* dstBounds, |
SkIRect* srcBounds) const { |