diff options
author | 2013-10-14 20:02:44 +0000 | |
---|---|---|
committer | 2013-10-14 20:02:44 +0000 | |
commit | 0cd2ac6c721120a2628524dad91798aa3e7ec41d (patch) | |
tree | e74814132e499fdbb2fcb74c325b316da1a2a557 /src/pipe/SkGPipeWrite.cpp | |
parent | ea476e1725f38688b79aadf4c5e36c10c3141927 (diff) |
change SkAnnotation to not inherit from SkFlattenable (does not need dynamic factories)
BUG=
R=scroggo@google.com
Review URL: https://codereview.chromium.org/26606004
git-svn-id: http://skia.googlecode.com/svn/trunk@11762 2bbb7eff-a529-9590-31e7-b0007b416f81
Diffstat (limited to 'src/pipe/SkGPipeWrite.cpp')
-rw-r--r-- | src/pipe/SkGPipeWrite.cpp | 21 |
1 files changed, 20 insertions, 1 deletions
diff --git a/src/pipe/SkGPipeWrite.cpp b/src/pipe/SkGPipeWrite.cpp index 58ba102988..05fbb484a5 100644 --- a/src/pipe/SkGPipeWrite.cpp +++ b/src/pipe/SkGPipeWrite.cpp @@ -48,7 +48,6 @@ static SkFlattenable* get_paintflat(const SkPaint& paint, unsigned paintFlat) { case kShader_PaintFlat: return paint.getShader(); case kImageFilter_PaintFlat: return paint.getImageFilter(); case kXfermode_PaintFlat: return paint.getXfermode(); - case kAnnotation_PaintFlat: return paint.getAnnotation(); } SkDEBUGFAIL("never gets here"); return NULL; @@ -1123,6 +1122,26 @@ void SkGPipeCanvas::writePaint(const SkPaint& paint) { // SkDebugf("[%d] %08X\n", i, storage[i]); } } + + // + // Do these after we've written kPaintOp_DrawOp + + if (base.getAnnotation() != paint.getAnnotation()) { + if (NULL == paint.getAnnotation()) { + this->writeOp(kSetAnnotation_DrawOp, 0, 0); + } else { + SkOrderedWriteBuffer buffer(1024); + paint.getAnnotation()->writeToBuffer(buffer); + size = buffer.bytesWritten(); + + SkAutoMalloc storage(size); + buffer.writeToMemory(storage.get()); + + this->writeOp(kSetAnnotation_DrawOp, 0, 1); + fWriter.write32(size); + fWriter.write(storage.get(), size); + } + } } /////////////////////////////////////////////////////////////////////////////// |