diff options
Diffstat (limited to 'src/pipe/SkGPipeRead.cpp')
-rw-r--r-- | src/pipe/SkGPipeRead.cpp | 13 |
1 files changed, 9 insertions, 4 deletions
diff --git a/src/pipe/SkGPipeRead.cpp b/src/pipe/SkGPipeRead.cpp index 6f79e51f9a..e2cd151d28 100644 --- a/src/pipe/SkGPipeRead.cpp +++ b/src/pipe/SkGPipeRead.cpp @@ -105,14 +105,19 @@ public: } void addBitmap(int index) { - SkASSERT(fBitmaps.count() == index); - SkBitmap* bm = new SkBitmap(); + index--; + SkBitmap* bm; + if(fBitmaps.count() == index) { + bm = SkNEW(SkBitmap); + *fBitmaps.append() = bm; + } else { + bm = fBitmaps[index]; + } bm->unflatten(*fReader); - *fBitmaps.append() = bm; } SkBitmap* getBitmap(unsigned index) { - return fBitmaps[index]; + return fBitmaps[index - 1]; } void addTypeface() { |