diff options
author | Florin Malita <fmalita@chromium.org> | 2017-09-21 15:28:29 -0400 |
---|---|---|
committer | Skia Commit-Bot <skia-commit-bot@chromium.org> | 2017-09-22 14:01:27 +0000 |
commit | adaeaedc28ff708dbe1380fe54480bb77ed007d8 (patch) | |
tree | 66457d2f45abff9dfaac8c162123019f30479856 /src/utils/SkPaintFilterCanvas.cpp | |
parent | 8aa4569c139a7a7ac38c62b25e3af40309cc2ee2 (diff) |
Add missing onDrawDrawable() overrides to utility canvases
Change-Id: Ia5a7c523263e2c4744e0f3a743c6a4433760a4be
Reviewed-on: https://skia-review.googlesource.com/49770
Reviewed-by: Stan Iliev <stani@google.com>
Reviewed-by: Mike Reed <reed@google.com>
Commit-Queue: Florin Malita <fmalita@chromium.org>
Diffstat (limited to 'src/utils/SkPaintFilterCanvas.cpp')
-rw-r--r-- | src/utils/SkPaintFilterCanvas.cpp | 10 |
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); |