aboutsummaryrefslogtreecommitdiffhomepage
path: root/src/utils/SkPaintFilterCanvas.cpp
diff options
context:
space:
mode:
Diffstat (limited to 'src/utils/SkPaintFilterCanvas.cpp')
-rw-r--r--src/utils/SkPaintFilterCanvas.cpp10
1 files changed, 10 insertions, 0 deletions
diff --git a/src/utils/SkPaintFilterCanvas.cpp b/src/utils/SkPaintFilterCanvas.cpp
index e504c72119..6092058ee1 100644
--- a/src/utils/SkPaintFilterCanvas.cpp
+++ b/src/utils/SkPaintFilterCanvas.cpp
@@ -172,6 +172,16 @@ void SkPaintFilterCanvas::onDrawPicture(const SkPicture* picture, const SkMatrix
}
}
+void SkPaintFilterCanvas::onDrawDrawable(SkDrawable* drawable, const SkMatrix* matrix) {
+ // There is no paint to filter in this case, but we can still filter on type.
+ // Subclasses need to unroll the drawable explicity (by overriding this method) in
+ // order to actually filter nested content.
+ AutoPaintFilter apf(this, kDrawable_Type, nullptr);
+ if (apf.shouldDraw()) {
+ this->INHERITED::onDrawDrawable(drawable, matrix);
+ }
+}
+
void SkPaintFilterCanvas::onDrawText(const void* text, size_t byteLength, SkScalar x, SkScalar y,
const SkPaint& paint) {
AutoPaintFilter apf(this, kText_Type, paint);