Chromium Code Reviews
chromiumcodereview-hr@appspot.gserviceaccount.com (chromiumcodereview-hr) | Please choose your nickname with Settings | Help | Chromium Project | Gerrit Changes | Sign out
(211)

Unified Diff: src/pipe/SkGPipeRead.cpp

Issue 50523004: Little changes to SkAnnotation in pipe: (Closed) Base URL: https://skia.googlecode.com/svn/trunk
Patch Set: Created 7 years, 2 months ago
Use n/p to move between diff chunks; N/P to move between comments. Draft comments are only viewable by you.
Jump to:
View side-by-side diff with in-line comments
Download patch
« no previous file with comments | « src/pipe/SkGPipePriv.h ('k') | src/pipe/SkGPipeWrite.cpp » ('j') | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: src/pipe/SkGPipeRead.cpp
diff --git a/src/pipe/SkGPipeRead.cpp b/src/pipe/SkGPipeRead.cpp
index 789c3eded82899e23a654c3b81dcd5043d375683..877d380d61444f667ddfe8331cd5960608fe13f7 100644
--- a/src/pipe/SkGPipeRead.cpp
+++ b/src/pipe/SkGPipeRead.cpp
@@ -691,13 +691,11 @@ static void annotation_rp(SkCanvas*, SkReader32* reader, uint32_t op32,
SkGPipeState* state) {
SkPaint* p = state->editPaint();
- if (SkToBool(PaintOp_unpackData(op32))) {
- const size_t size = reader->readU32();
- SkAutoMalloc storage(size);
-
- reader->read(storage.get(), size);
- SkOrderedReadBuffer buffer(storage.get(), size);
+ const size_t size = DrawOp_unpackData(op32);
+ if (size > 0) {
+ SkOrderedReadBuffer buffer(reader->skip(size), size);
p->setAnnotation(SkNEW_ARGS(SkAnnotation, (buffer)))->unref();
+ SkASSERT(buffer.offset() == size);
} else {
p->setAnnotation(NULL);
}
« no previous file with comments | « src/pipe/SkGPipePriv.h ('k') | src/pipe/SkGPipeWrite.cpp » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698