Chromium Code Reviews| Index: src/pipe/SkGPipeRead.cpp |
| diff --git a/src/pipe/SkGPipeRead.cpp b/src/pipe/SkGPipeRead.cpp |
| index a5f714480ecc50a5799d6f05b51f58c64c5a63b0..858581b1357d5949dbda29f03f79b5cd17b5fe57 100644 |
| --- a/src/pipe/SkGPipeRead.cpp |
| +++ b/src/pipe/SkGPipeRead.cpp |
| @@ -15,6 +15,7 @@ |
| #include "SkReader32.h" |
| #include "SkStream.h" |
| +#include "SkAnnotation.h" |
| #include "SkColorFilter.h" |
| #include "SkDrawLooper.h" |
| #include "SkMaskFilter.h" |
| @@ -53,9 +54,6 @@ static void set_paintflat(SkPaint* paint, SkFlattenable* obj, unsigned paintFlat |
| case kXfermode_PaintFlat: |
| paint->setXfermode((SkXfermode*)obj); |
| break; |
| - case kAnnotation_PaintFlat: |
| - paint->setAnnotation((SkAnnotation*)obj); |
| - break; |
| default: |
| SkDEBUGFAIL("never gets here"); |
| } |
| @@ -672,6 +670,17 @@ static void typeface_rp(SkCanvas*, SkReader32* reader, uint32_t, |
| p->setTypeface(static_cast<SkTypeface*>(reader->readPtr())); |
| } |
| +static void annotation_rp(SkCanvas*, SkReader32* reader, uint32_t, |
| + SkGPipeState* state) { |
| + SkPaint* p = state->editPaint(); |
| + |
| + size_t size = reader->readInt(); |
|
scroggo
2013/10/14 18:47:19
Should this be cast from int32_t to size_t?
Also,
reed1
2013/10/14 19:38:41
const -- done
changed readInt to readU32, to match
|
| + SkAutoMalloc storage(size); |
| + reader->read(storage.get(), size); |
| + SkOrderedReadBuffer buffer(storage.get(), size); |
| + p->setAnnotation(SkNEW_ARGS(SkAnnotation, (buffer)))->unref(); |
|
scroggo
2013/10/14 18:47:19
If the buffer has size 0, won't SkAnnotation's con
reed1
2013/10/14 19:38:41
Done.
|
| +} |
| + |
| /////////////////////////////////////////////////////////////////////////////// |
| static void def_Typeface_rp(SkCanvas*, SkReader32*, uint32_t, SkGPipeState* state) { |
| @@ -755,6 +764,8 @@ static const ReadProc gReadTable[] = { |
| paintOp_rp, |
| typeface_rp, |
| + annotation_rp, |
| + |
| def_Typeface_rp, |
| def_PaintFlat_rp, |
| def_Bitmap_rp, |