Index: include/utils/SkPaintFilterCanvas.h |
diff --git a/include/utils/SkPaintFilterCanvas.h b/include/utils/SkPaintFilterCanvas.h |
index 0ad7e251b6e54759a850a9c6c04fbbba4d7362db..f2bfaa70e1c54b41bb93a41ff9fba12b9fa444e1 100644 |
--- a/include/utils/SkPaintFilterCanvas.h |
+++ b/include/utils/SkPaintFilterCanvas.h |
@@ -48,13 +48,24 @@ public: |
protected: |
/** |
* Called with the paint that will be used to draw the specified type. |
- * The implementation may modify the paint as they wish. |
+ * If not null, the implementation may modify the paint as they wish. |
* |
- * Note: The base implementation calls onFilterPaint() for top-level/explicit paints only. |
+ * The result bool is used to determine whether the draw op is to be |
+ * executed (true) or skipped (false). |
+ * |
+ * Note: The base implementation calls onFilter() for top-level/explicit paints only. |
* To also filter encapsulated paints (e.g. SkPicture, SkTextBlob), clients may need to |
* override the relevant methods (i.e. drawPicture, drawTextBlob). |
*/ |
- virtual void onFilterPaint(SkPaint* paint, Type type) const = 0; |
+ virtual bool onFilter(SkPaint* paint, Type type) const { |
+ if (paint) { |
f(malita)
2016/01/11 19:29:44
Legacy/transient semantics. To be converted to a
|
+ this->onFilterPaint(paint, type); |
+ } |
+ return true; |
+ } |
+ |
+ // DEPRECATED - do not use |
+ virtual void onFilterPaint(SkPaint*, Type) const { } |
void onDrawPaint(const SkPaint&) override; |
void onDrawPoints(PointMode, size_t count, const SkPoint pts[], const SkPaint&) override; |