Modified Pipe Reader to read an atom at a time
http://codereview.appspot.com/4636043/
git-svn-id: http://skia.googlecode.com/svn/trunk@1623 2bbb7eff-a529-9590-31e7-b0007b416f81
diff --git a/src/pipe/SkGPipeRead.cpp b/src/pipe/SkGPipeRead.cpp
index ecb19fd..6665abb 100644
--- a/src/pipe/SkGPipeRead.cpp
+++ b/src/pipe/SkGPipeRead.cpp
@@ -527,7 +527,7 @@
}
SkGPipeReader::Status SkGPipeReader::playback(const void* data, size_t length,
- size_t* bytesRead) {
+ size_t* bytesRead, bool readAtom) {
if (NULL == fCanvas) {
return kError_Status;
}
@@ -559,6 +559,15 @@
break;
}
table[op](canvas, &reader, op32, fState);
+ if (readAtom &&
+ (table[op] != paintOp_rp &&
+ table[op] != def_Typeface_rp &&
+ table[op] != def_PaintFlat_rp &&
+ table[op] != name_PaintFlat_rp
+ )) {
+ status = kReadAtom_Status;
+ break;
+ }
}
if (bytesRead) {