aboutsummaryrefslogtreecommitdiffhomepage
path: root/include/core/SkCanvas.h
diff options
context:
space:
mode:
authorGravatar reed <reed@google.com>2016-03-04 16:36:20 -0800
committerGravatar Commit bot <commit-bot@chromium.org>2016-03-04 16:36:20 -0800
commitf70b531daaf47db1ee95c70da9843f1dd1f418d3 (patch)
tree85965584497549d7729c301075ff2ec9d1dc2c81 /include/core/SkCanvas.h
parente77875aa425d51cc8db3463343a6308f9d2aadcc (diff)
Move annotations to canvas virtual (patchset #8 id:140001 of https://codereview.chromium.org/1744103002/ )"
Diffstat (limited to 'include/core/SkCanvas.h')
-rw-r--r--include/core/SkCanvas.h14
1 files changed, 14 insertions, 0 deletions
diff --git a/include/core/SkCanvas.h b/include/core/SkCanvas.h
index c23d748e78..1b4571a09c 100644
--- a/include/core/SkCanvas.h
+++ b/include/core/SkCanvas.h
@@ -22,6 +22,7 @@ class GrRenderTarget;
class SkBaseDevice;
class SkCanvasClipVisitor;
class SkClipStack;
+class SkData;
class SkDraw;
class SkDrawable;
class SkDrawFilter;
@@ -1072,6 +1073,18 @@ public:
void drawDrawable(SkDrawable* drawable, const SkMatrix* = NULL);
void drawDrawable(SkDrawable*, SkScalar x, SkScalar y);
+ /**
+ * Send an "annotation" to the canvas. The annotation is a key/value pair, where the key is
+ * a null-terminated utf8 string, and the value is a blob of data stored in an SkData
+ * (which may be null). The annotation is associated with the specified rectangle.
+ *
+ * The caller still retains its ownership of the data (if any).
+ *
+ * Note: on may canvas types, this information is ignored, but some canvases (e.g. recording
+ * a picture or drawing to a PDF document) will pass on this information.
+ */
+ void drawAnnotation(const SkRect&, const char key[], SkData* value);
+
//////////////////////////////////////////////////////////////////////////
#ifdef SK_INTERNAL
#ifndef SK_SUPPORT_LEGACY_DRAWFILTER
@@ -1221,6 +1234,7 @@ protected:
virtual void didConcat(const SkMatrix&) {}
virtual void didSetMatrix(const SkMatrix&) {}
+ virtual void onDrawAnnotation(const SkRect&, const char key[], SkData* value);
virtual void onDrawDRRect(const SkRRect&, const SkRRect&, const SkPaint&);
virtual void onDrawText(const void* text, size_t byteLength, SkScalar x,