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

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

Issue 1219873002: Thread through a flag to force SkPicture::playback() when recording subpictures. (Closed) Base URL: https://skia.googlesource.com/skia@master
Patch Set: no need to change here. Created 5 years, 5 months 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') | src/core/SkRecorder.h » ('j') | 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 "SkData.h" 9 #include "SkData.h"
10 #include "SkDrawable.h" 10 #include "SkDrawable.h"
(...skipping 20 matching lines...) Expand all
31 fFlags = recordFlags; 31 fFlags = recordFlags;
32 32
33 if (bbhFactory) { 33 if (bbhFactory) {
34 fBBH.reset((*bbhFactory)(cullRect)); 34 fBBH.reset((*bbhFactory)(cullRect));
35 SkASSERT(fBBH.get()); 35 SkASSERT(fBBH.get());
36 } 36 }
37 37
38 if (!fRecord) { 38 if (!fRecord) {
39 fRecord.reset(SkNEW(SkRecord)); 39 fRecord.reset(SkNEW(SkRecord));
40 } 40 }
41 fRecorder->reset(fRecord.get(), cullRect, &fMiniRecorder); 41 SkRecorder::DrawPictureMode dpm = (recordFlags & kPlaybackDrawPicture_Record Flag)
42 ? SkRecorder::Playback_DrawPictureMode
43 : SkRecorder::Record_DrawPictureMode;
44 fRecorder->reset(fRecord.get(), cullRect, dpm, &fMiniRecorder);
42 fActivelyRecording = true; 45 fActivelyRecording = true;
43 return this->getRecordingCanvas(); 46 return this->getRecordingCanvas();
44 } 47 }
45 48
46 SkCanvas* SkPictureRecorder::getRecordingCanvas() { 49 SkCanvas* SkPictureRecorder::getRecordingCanvas() {
47 return fActivelyRecording ? fRecorder.get() : nullptr; 50 return fActivelyRecording ? fRecorder.get() : nullptr;
48 } 51 }
49 52
50 SkPicture* SkPictureRecorder::endRecordingAsPicture() { 53 SkPicture* SkPictureRecorder::endRecordingAsPicture() {
51 fActivelyRecording = false; 54 fActivelyRecording = false;
(...skipping 137 matching lines...) Expand 10 before | Expand all | Expand 10 after
189 (fRecord, fBBH, fRecorder->detachDrawabl eList(), 192 (fRecord, fBBH, fRecorder->detachDrawabl eList(),
190 fCullRect, 193 fCullRect,
191 SkToBool(fFlags & kComputeSaveLayerInfo _RecordFlag))); 194 SkToBool(fFlags & kComputeSaveLayerInfo _RecordFlag)));
192 195
193 // release our refs now, so only the drawable will be the owner. 196 // release our refs now, so only the drawable will be the owner.
194 fRecord.reset(NULL); 197 fRecord.reset(NULL);
195 fBBH.reset(NULL); 198 fBBH.reset(NULL);
196 199
197 return drawable; 200 return drawable;
198 } 201 }
OLDNEW
« no previous file with comments | « include/core/SkPictureRecorder.h ('k') | src/core/SkRecorder.h » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698