aboutsummaryrefslogtreecommitdiffhomepage
path: root/src/core/SkRecorder.cpp
diff options
context:
space:
mode:
authorGravatar djsollen <djsollen@google.com>2015-11-17 06:18:31 -0800
committerGravatar Commit bot <commit-bot@chromium.org>2015-11-17 06:18:31 -0800
commitaa6f739c999fc2cdd64ba7a2332d333770722d06 (patch)
treef72e4d62db47354f0ba87b79bccfb064459f577d /src/core/SkRecorder.cpp
parent1970358b6d354b54f8724c6a69e30dc4f978651f (diff)
Respect SkPictureRecorder::kPlaybackDrawPicture_RecordFlag for SkDrawables
Diffstat (limited to 'src/core/SkRecorder.cpp')
-rw-r--r--src/core/SkRecorder.cpp13
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) {