aboutsummaryrefslogtreecommitdiffhomepage
path: root/include
diff options
context:
space:
mode:
authorGravatar reed@android.com <reed@android.com@2bbb7eff-a529-9590-31e7-b0007b416f81>2009-12-04 21:32:27 +0000
committerGravatar reed@android.com <reed@android.com@2bbb7eff-a529-9590-31e7-b0007b416f81>2009-12-04 21:32:27 +0000
commitcb60844b34766aad4151df5e87c144d4a57e9abe (patch)
tree293a58c2a6e98685bffaa05ca4f5e8afbc3ecf5a /include
parentb1501a3cde99f68c9c419d9db4ad15b8fed814f3 (diff)
add drawData() to canvas, to record data blobs
git-svn-id: http://skia.googlecode.com/svn/trunk@452 2bbb7eff-a529-9590-31e7-b0007b416f81
Diffstat (limited to 'include')
-rw-r--r--include/core/SkCanvas.h8
-rw-r--r--include/utils/SkDumpCanvas.h4
-rw-r--r--include/utils/SkProxyCanvas.h3
3 files changed, 13 insertions, 2 deletions
diff --git a/include/core/SkCanvas.h b/include/core/SkCanvas.h
index 8fba6cf49d..40b5c56171 100644
--- a/include/core/SkCanvas.h
+++ b/include/core/SkCanvas.h
@@ -626,6 +626,14 @@ public:
const uint16_t indices[], int indexCount,
const SkPaint& paint);
+ /** Send a blob of data to the canvas.
+ For canvases that draw, this call is effectively a no-op, as the data
+ is not parsed, but just ignored. However, this call exists for
+ subclasses like SkPicture's recording canvas, that can store the data
+ and then play it back later (via another call to drawData).
+ */
+ virtual void drawData(const void* data, size_t length);
+
//////////////////////////////////////////////////////////////////////////
/** Get the current bounder object.
diff --git a/include/utils/SkDumpCanvas.h b/include/utils/SkDumpCanvas.h
index 6f16c92faf..3731bef822 100644
--- a/include/utils/SkDumpCanvas.h
+++ b/include/utils/SkDumpCanvas.h
@@ -34,7 +34,8 @@ public:
kDrawText_Verb,
kDrawPicture_Verb,
kDrawShape_Verb,
- kDrawVertices_Verb
+ kDrawVertices_Verb,
+ kDrawData_Verb
};
/** Subclasses of this are installed on the DumpCanvas, and then called for
@@ -102,6 +103,7 @@ public:
const SkColor colors[], SkXfermode* xmode,
const uint16_t indices[], int indexCount,
const SkPaint& paint);
+ virtual void drawData(const void*, size_t);
private:
Dumper* fDumper;
diff --git a/include/utils/SkProxyCanvas.h b/include/utils/SkProxyCanvas.h
index f2e57abf84..082e0fdee8 100644
--- a/include/utils/SkProxyCanvas.h
+++ b/include/utils/SkProxyCanvas.h
@@ -75,7 +75,8 @@ public:
const SkColor colors[], SkXfermode* xmode,
const uint16_t indices[], int indexCount,
const SkPaint& paint);
-
+ virtual void drawData(const void* data, size_t length);
+
virtual SkBounder* setBounder(SkBounder* bounder);
virtual SkDrawFilter* setDrawFilter(SkDrawFilter* filter);