diff options
author | fmalita <fmalita@chromium.org> | 2015-08-17 08:05:13 -0700 |
---|---|---|
committer | Commit bot <commit-bot@chromium.org> | 2015-08-17 08:05:13 -0700 |
commit | f433bb2bebd441cc0b2b152e8fbf79eac43baf5d (patch) | |
tree | 50748556c038b4ed2a5dec143061b737c8df44ac /include/utils/SkPaintFilterCanvas.h | |
parent | 340f3074b49de089e7e8cf9495fd54f67b7f9b8a (diff) |
SkPaintFilterCanvas should inherit the target canvas state
Currently, SkPaintFilterCanvas does not provide any help in cloning
target canvas state. While that could be handled in subclasses, it is
easy to miss (see linked bug).
This CL adds a new constructor variant which ensures that the initial
matrix and clip bounds are inherited from the target canvas.
BUG=516790
R=reed@google.com,robertphillips@google.com
Review URL: https://codereview.chromium.org/1294013002
Diffstat (limited to 'include/utils/SkPaintFilterCanvas.h')
-rw-r--r-- | include/utils/SkPaintFilterCanvas.h | 9 |
1 files changed, 9 insertions, 0 deletions
diff --git a/include/utils/SkPaintFilterCanvas.h b/include/utils/SkPaintFilterCanvas.h index da0333e7e6..d693758797 100644 --- a/include/utils/SkPaintFilterCanvas.h +++ b/include/utils/SkPaintFilterCanvas.h @@ -16,8 +16,17 @@ */ class SK_API SkPaintFilterCanvas : public SkNWayCanvas { public: + /** + * DEPRECATED: use the variant below. + */ SkPaintFilterCanvas(int width, int height); + /** + * The new SkPaintFilterCanvas is configured for forwarding to the + * specified canvas. Also copies the target canvas matrix and clip bounds. + */ + SkPaintFilterCanvas(SkCanvas* canvas); + enum Type { kPaint_Type, kPoint_Type, |