Index: src/pipe/SkGPipeWrite.cpp |
diff --git a/src/pipe/SkGPipeWrite.cpp b/src/pipe/SkGPipeWrite.cpp |
index 58ba102988c8f6a32b586f9852e70d360f69fca3..291633ac02939025c0c7ec3ba59114985c13f5c6 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,27 @@ 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); |
+ fWriter.write32(0); // we have no data |
scroggo
2013/10/14 18:47:19
0 was already written by writeOp. Why write it aga
reed1
2013/10/14 19:38:41
Done.
|
+ } else { |
+ SkOrderedWriteBuffer buffer(1024); |
+ paint.getAnnotation()->writeToBuffer(buffer); |
+ size = buffer.bytesWritten(); |
+ |
+ SkAutoMalloc storage(size); |
+ buffer.writeToMemory(storage.get()); |
+ |
+ this->writeOp(kSetAnnotation_DrawOp, 0, size); |
scroggo
2013/10/14 18:47:19
Do you think Annotations might be reused (but not
reed1
2013/10/14 19:38:41
It was considered. I think annotations are so unbe
|
+ fWriter.write32(size); |
scroggo
2013/10/14 18:47:19
As in the NULL annotation case, size was written b
reed1
2013/10/14 19:38:41
Done.
|
+ fWriter.write(storage.get(), size); |
+ } |
+ } |
} |
/////////////////////////////////////////////////////////////////////////////// |