aboutsummaryrefslogtreecommitdiffhomepage
path: root/include/utils/SkPaintFilterCanvas.h
diff options
context:
space:
mode:
authorGravatar fmalita <fmalita@chromium.org>2015-08-17 08:05:13 -0700
committerGravatar Commit bot <commit-bot@chromium.org>2015-08-17 08:05:13 -0700
commitf433bb2bebd441cc0b2b152e8fbf79eac43baf5d (patch)
tree50748556c038b4ed2a5dec143061b737c8df44ac /include/utils/SkPaintFilterCanvas.h
parent340f3074b49de089e7e8cf9495fd54f67b7f9b8a (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.h9
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,