aboutsummaryrefslogtreecommitdiffhomepage
diff options
context:
space:
mode:
-rw-r--r--include/pipe/SkGPipe.h7
-rw-r--r--src/pipe/SkGPipeRead.cpp11
2 files changed, 14 insertions, 4 deletions
diff --git a/include/pipe/SkGPipe.h b/include/pipe/SkGPipe.h
index 897766f08e..cd10384084 100644
--- a/include/pipe/SkGPipe.h
+++ b/include/pipe/SkGPipe.h
@@ -31,13 +31,14 @@ public:
enum Status {
kDone_Status, //!< no more data expected from reader
kEOF_Status, //!< need more data from reader
- kError_Status //!< encountered error
+ kError_Status, //!< encountered error
+ kReadAtom_Status//!< finished reading an atom
};
// data must be 4-byte aligned
// length must be a multiple of 4
- Status playback(const void* data, size_t length, size_t* bytesRead = NULL);
-
+ Status playback(const void* data, size_t length, size_t* bytesRead = NULL,
+ bool readAtom = false);
private:
SkCanvas* fCanvas;
class SkGPipeState* fState;
diff --git a/src/pipe/SkGPipeRead.cpp b/src/pipe/SkGPipeRead.cpp
index ecb19fd059..6665abb3ff 100644
--- a/src/pipe/SkGPipeRead.cpp
+++ b/src/pipe/SkGPipeRead.cpp
@@ -527,7 +527,7 @@ SkGPipeReader::~SkGPipeReader() {
}
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 @@ SkGPipeReader::Status SkGPipeReader::playback(const void* data, size_t length,
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) {