Chromium Code Reviews
chromiumcodereview-hr@appspot.gserviceaccount.com (chromiumcodereview-hr) | Please choose your nickname with Settings | Help | Chromium Project | Gerrit Changes | Sign out
(207)

Side by Side Diff: src/core/SkRecorder.cpp

Issue 1452193002: Respect SkPictureRecorder::kPlaybackDrawPicture_RecordFlag for SkDrawables (Closed) Base URL: https://skia.googlesource.com/skia.git@master
Patch Set: comment Created 5 years, 1 month ago
Use n/p to move between diff chunks; N/P to move between comments. Draft comments are only viewable by you.
Jump to:
View unified diff | Download patch
« no previous file with comments | « include/core/SkPictureRecorder.h ('k') | no next file » | no next file with comments »
Toggle Intra-line Diffs ('i') | Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
OLDNEW
1 /* 1 /*
2 * Copyright 2014 Google Inc. 2 * Copyright 2014 Google Inc.
3 * 3 *
4 * Use of this source code is governed by a BSD-style license that can be 4 * Use of this source code is governed by a BSD-style license that can be
5 * found in the LICENSE file. 5 * found in the LICENSE file.
6 */ 6 */
7 7
8 #include "SkBigPicture.h" 8 #include "SkBigPicture.h"
9 #include "SkCanvasPriv.h" 9 #include "SkCanvasPriv.h"
10 #include "SkPatchUtils.h" 10 #include "SkPatchUtils.h"
(...skipping 140 matching lines...) Expand 10 before | Expand all | Expand 10 after
151 151
152 void SkRecorder::onDrawRRect(const SkRRect& rrect, const SkPaint& paint) { 152 void SkRecorder::onDrawRRect(const SkRRect& rrect, const SkPaint& paint) {
153 APPEND(DrawRRect, paint, rrect); 153 APPEND(DrawRRect, paint, rrect);
154 } 154 }
155 155
156 void SkRecorder::onDrawDRRect(const SkRRect& outer, const SkRRect& inner, const SkPaint& paint) { 156 void SkRecorder::onDrawDRRect(const SkRRect& outer, const SkRRect& inner, const SkPaint& paint) {
157 APPEND(DrawDRRect, paint, outer, inner); 157 APPEND(DrawDRRect, paint, outer, inner);
158 } 158 }
159 159
160 void SkRecorder::onDrawDrawable(SkDrawable* drawable, const SkMatrix* matrix) { 160 void SkRecorder::onDrawDrawable(SkDrawable* drawable, const SkMatrix* matrix) {
161 if (!fDrawableList) { 161 if (fDrawPictureMode == Record_DrawPictureMode) {
162 fDrawableList.reset(new SkDrawableList); 162 if (!fDrawableList) {
163 fDrawableList.reset(new SkDrawableList);
164 }
165 fDrawableList->append(drawable);
166 APPEND(DrawDrawable, this->copy(matrix), drawable->getBounds(), fDrawabl eList->count() - 1);
167 } else {
168 SkASSERT(fDrawPictureMode == Playback_DrawPictureMode);
169 drawable->draw(this, matrix);
163 } 170 }
164 fDrawableList->append(drawable);
165 APPEND(DrawDrawable, this->copy(matrix), drawable->getBounds(), fDrawableLis t->count() - 1);
166 } 171 }
167 172
168 void SkRecorder::onDrawPath(const SkPath& path, const SkPaint& paint) { 173 void SkRecorder::onDrawPath(const SkPath& path, const SkPaint& paint) {
169 TRY_MINIRECORDER(drawPath, path, paint); 174 TRY_MINIRECORDER(drawPath, path, paint);
170 APPEND(DrawPath, paint, path); 175 APPEND(DrawPath, paint, path);
171 } 176 }
172 177
173 void SkRecorder::onDrawBitmap(const SkBitmap& bitmap, 178 void SkRecorder::onDrawBitmap(const SkBitmap& bitmap,
174 SkScalar left, 179 SkScalar left,
175 SkScalar top, 180 SkScalar top,
(...skipping 199 matching lines...) Expand 10 before | Expand all | Expand 10 after
375 INHERITED(onClipPath, path, op, edgeStyle); 380 INHERITED(onClipPath, path, op, edgeStyle);
376 SkRecords::RegionOpAndAA opAA(op, kSoft_ClipEdgeStyle == edgeStyle); 381 SkRecords::RegionOpAndAA opAA(op, kSoft_ClipEdgeStyle == edgeStyle);
377 APPEND(ClipPath, this->devBounds(), path, opAA); 382 APPEND(ClipPath, this->devBounds(), path, opAA);
378 } 383 }
379 384
380 void SkRecorder::onClipRegion(const SkRegion& deviceRgn, SkRegion::Op op) { 385 void SkRecorder::onClipRegion(const SkRegion& deviceRgn, SkRegion::Op op) {
381 INHERITED(onClipRegion, deviceRgn, op); 386 INHERITED(onClipRegion, deviceRgn, op);
382 APPEND(ClipRegion, this->devBounds(), deviceRgn, op); 387 APPEND(ClipRegion, this->devBounds(), deviceRgn, op);
383 } 388 }
384 389
OLDNEW
« no previous file with comments | « include/core/SkPictureRecorder.h ('k') | no next file » | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698