Index: src/core/SkImageFilter.cpp |
diff --git a/src/core/SkImageFilter.cpp b/src/core/SkImageFilter.cpp |
index 6a3286ed67475510be347379142f35d8084cc5df..3f33bc3876a3e9a4a4c9ea753743941be6aa292c 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,14 @@ bool SkImageFilter::filterImageGPU(Proxy* proxy, const SkBitmap& src, const Cont |
return false; |
} |
+bool SkImageFilter::asAColorFilter(SkColorFilter** filterPtr) const { |
+ SkASSERT(nullptr != filterPtr); |
+ return this->countInputs() > 0 && |
+ NULL == this->getInput(0) && |
+ this->isColorFilterNode(filterPtr) && |
+ !(*filterPtr)->affectsTransparentBlack(); |
+} |
+ |
bool SkImageFilter::applyCropRect(const Context& ctx, const SkBitmap& src, |
const SkIPoint& srcOffset, SkIRect* dstBounds, |
SkIRect* srcBounds) const { |