diff options
author | 2015-11-17 06:18:31 -0800 | |
---|---|---|
committer | 2015-11-17 06:18:31 -0800 | |
commit | aa6f739c999fc2cdd64ba7a2332d333770722d06 (patch) | |
tree | f72e4d62db47354f0ba87b79bccfb064459f577d /src/core/SkRecorder.cpp | |
parent | 1970358b6d354b54f8724c6a69e30dc4f978651f (diff) |
Respect SkPictureRecorder::kPlaybackDrawPicture_RecordFlag for SkDrawables
Review URL: https://codereview.chromium.org/1452193002
Diffstat (limited to 'src/core/SkRecorder.cpp')
-rw-r--r-- | src/core/SkRecorder.cpp | 13 |
1 files changed, 9 insertions, 4 deletions
diff --git a/src/core/SkRecorder.cpp b/src/core/SkRecorder.cpp index 0605d17fc3..a3c9513168 100644 --- a/src/core/SkRecorder.cpp +++ b/src/core/SkRecorder.cpp @@ -158,11 +158,16 @@ void SkRecorder::onDrawDRRect(const SkRRect& outer, const SkRRect& inner, const } void SkRecorder::onDrawDrawable(SkDrawable* drawable, const SkMatrix* matrix) { - if (!fDrawableList) { - fDrawableList.reset(new SkDrawableList); + if (fDrawPictureMode == Record_DrawPictureMode) { + if (!fDrawableList) { + fDrawableList.reset(new SkDrawableList); + } + fDrawableList->append(drawable); + APPEND(DrawDrawable, this->copy(matrix), drawable->getBounds(), fDrawableList->count() - 1); + } else { + SkASSERT(fDrawPictureMode == Playback_DrawPictureMode); + drawable->draw(this, matrix); } - fDrawableList->append(drawable); - APPEND(DrawDrawable, this->copy(matrix), drawable->getBounds(), fDrawableList->count() - 1); } void SkRecorder::onDrawPath(const SkPath& path, const SkPaint& paint) { |