Index: include/core/SkImageFilter.h |
diff --git a/include/core/SkImageFilter.h b/include/core/SkImageFilter.h |
index dce6b133b46b79d32bfcbf7dad13223fb61af148..5870f7f2d66c95fef304c06da68a4a7e6bbca969 100644 |
--- a/include/core/SkImageFilter.h |
+++ b/include/core/SkImageFilter.h |
@@ -178,6 +178,7 @@ public: |
bool asAColorFilter(SkColorFilter** filterPtr) const { |
return this->countInputs() > 0 && |
NULL == this->getInput(0) && |
+ !this->affectsTransparentBlack() && |
this->isColorFilterNode(filterPtr); |
} |
@@ -214,6 +215,9 @@ public: |
// Default impl returns union of all input bounds. |
virtual void computeFastBounds(const SkRect&, SkRect*) const; |
+ // Can this filter DAG compute the resulting bounds of an object-space rectangle? |
+ bool canComputeFastBounds() const; |
+ |
/** |
* Create an SkMatrixImageFilter, which transforms its input by the given matrix. |
*/ |
@@ -362,6 +366,14 @@ protected: |
virtual bool asFragmentProcessor(GrFragmentProcessor**, GrProcessorDataManager*, GrTexture*, |
const SkMatrix&, const SkIRect& bounds) const; |
+ /** |
+ * Returns true if this filter can cause transparent black pixels to become |
+ * visible (ie., alpha > 0). The default implementation returns false. This |
+ * function is non-recursive, i.e., only queries this filter and not its |
+ * inputs. |
+ */ |
+ virtual bool affectsTransparentBlack() const; |
+ |
private: |
friend class SkGraphics; |
static void PurgeCache(); |