diff options
Diffstat (limited to 'src/core/SkPictureRecord.cpp')
-rw-r--r-- | src/core/SkPictureRecord.cpp | 15 |
1 files changed, 15 insertions, 0 deletions
diff --git a/src/core/SkPictureRecord.cpp b/src/core/SkPictureRecord.cpp index 77756a9746..f0f3402790 100644 --- a/src/core/SkPictureRecord.cpp +++ b/src/core/SkPictureRecord.cpp @@ -1,4 +1,5 @@ #include "SkPictureRecord.h" +#include "SkShape.h" #include "SkTSearch.h" #define MIN_WRITER_SIZE 16384 @@ -353,6 +354,20 @@ void SkPictureRecord::drawPicture(SkPicture& picture) { validate(); } +void SkPictureRecord::drawShape(SkShape* shape) { + addDraw(DRAW_SHAPE); + + int index = fShapes.find(shape); + if (index < 0) { // not found + index = fShapes.count(); + *fShapes.append() = shape; + shape->ref(); + } + // follow the convention of recording a 1-based index + addInt(index + 1); + validate(); +} + void SkPictureRecord::drawVertices(VertexMode vmode, int vertexCount, const SkPoint vertices[], const SkPoint texs[], const SkColor colors[], SkXfermode*, |