aboutsummaryrefslogtreecommitdiffhomepage
path: root/include/core/SkTextBlob.h
diff options
context:
space:
mode:
authorGravatar fmalita <fmalita@chromium.org>2014-08-28 13:59:42 -0700
committerGravatar Commit bot <commit-bot@chromium.org>2014-08-28 13:59:42 -0700
commit228a6f275d7c5c17c48c20b57df971d9848f5dff (patch)
tree9fa67d0d6d91b04b319e5b1d3184174632657ec8 /include/core/SkTextBlob.h
parentbedec8456ff0ea814ed1bba748a86678f458d063 (diff)
SkTextBlob GPipe serialization.
Instead of relying on unrolling blobs in SkCanvas, serialize when passing through a GPipe. This is a prerequisite for pushing the blob draw op to the device. R=mtklein@google.com, reed@google.com, robertphillips@google.com Author: fmalita@chromium.org Review URL: https://codereview.chromium.org/511783005
Diffstat (limited to 'include/core/SkTextBlob.h')
-rw-r--r--include/core/SkTextBlob.h18
1 files changed, 14 insertions, 4 deletions
diff --git a/include/core/SkTextBlob.h b/include/core/SkTextBlob.h
index af29933b4f..0fb2402d3d 100644
--- a/include/core/SkTextBlob.h
+++ b/include/core/SkTextBlob.h
@@ -32,6 +32,20 @@ public:
*/
uint32_t uniqueID() const;
+ /**
+ * Serialize to a buffer.
+ */
+ void flatten(SkWriteBuffer&) const;
+
+ /**
+ * Recreate an SkTextBlob that was serialized into a buffer.
+ *
+ * @param SkReadBuffer Serialized blob data.
+ * @return A new SkTextBlob representing the serialized data, or NULL if the buffer is
+ * invalid.
+ */
+ static const SkTextBlob* CreateFromBuffer(SkReadBuffer&);
+
private:
enum GlyphPositioning {
kDefault_Positioning = 0, // Default glyph advances -- zero scalars per glyph.
@@ -70,13 +84,9 @@ private:
SkTextBlob(uint16_t* glyphs, SkScalar* pos, const SkTArray<Run>* runs, const SkRect& bounds);
- void flatten(SkWriteBuffer&) const;
- static const SkTextBlob* CreateFromBuffer(SkReadBuffer&);
-
static unsigned ScalarsPerGlyph(GlyphPositioning pos);
friend class SkCanvas;
- friend class SkPictureData;
friend class SkTextBlobBuilder;
friend class TextBlobTester;