diff options
author | reed <reed@google.com> | 2016-03-04 16:36:20 -0800 |
---|---|---|
committer | Commit bot <commit-bot@chromium.org> | 2016-03-04 16:36:20 -0800 |
commit | f70b531daaf47db1ee95c70da9843f1dd1f418d3 (patch) | |
tree | 85965584497549d7729c301075ff2ec9d1dc2c81 /include/core/SkCanvas.h | |
parent | e77875aa425d51cc8db3463343a6308f9d2aadcc (diff) |
Move annotations to canvas virtual (patchset #8 id:140001 of https://codereview.chromium.org/1744103002/ )"
Need to land chrome change first https://codereview.chromium.org/1766723003/
BUG=skia:
GOLD_TRYBOT_URL= https://gold.skia.org/search2?unt=true&query=source_type%3Dgm&master=false&issue=1758023003
TBR=
Review URL: https://codereview.chromium.org/1758023003
Diffstat (limited to 'include/core/SkCanvas.h')
-rw-r--r-- | include/core/SkCanvas.h | 14 |
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, |