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

Side by Side Diff: src/record/SkRecording.cpp

Issue 290653004: Remove SkRecorder's kWriteOnly mode. (Closed) Base URL: https://skia.googlesource.com/skia.git@master
Patch Set: rebase Created 6 years, 6 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 | « src/record/SkRecorder.cpp ('k') | tests/RecordDrawTest.cpp » ('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 "SkRecording.h" 8 #include "SkRecording.h"
9 9
10 #include "SkRecord.h" 10 #include "SkRecord.h"
11 #include "SkRecordOpts.h" 11 #include "SkRecordOpts.h"
12 #include "SkRecordDraw.h" 12 #include "SkRecordDraw.h"
13 #include "SkRecorder.h" 13 #include "SkRecorder.h"
14 14
15 namespace EXPERIMENTAL { 15 namespace EXPERIMENTAL {
16 16
17 SkPlayback::SkPlayback(const SkRecord* record) : fRecord(record) {} 17 SkPlayback::SkPlayback(const SkRecord* record) : fRecord(record) {}
18 18
19 SkPlayback::~SkPlayback() {} 19 SkPlayback::~SkPlayback() {}
20 20
21 void SkPlayback::draw(SkCanvas* canvas) const { 21 void SkPlayback::draw(SkCanvas* canvas) const {
22 SkASSERT(fRecord.get() != NULL); 22 SkASSERT(fRecord.get() != NULL);
23 SkRecordDraw(*fRecord, canvas); 23 SkRecordDraw(*fRecord, canvas);
24 } 24 }
25 25
26 SkRecording::SkRecording(int width, int height) 26 SkRecording::SkRecording(int width, int height)
27 : fRecord(SkNEW(SkRecord)) 27 : fRecord(SkNEW(SkRecord))
28 , fRecorder(SkNEW_ARGS(SkRecorder, (SkRecorder::kReadWrite_Mode, fRecord.get (), width, height))) 28 , fRecorder(SkNEW_ARGS(SkRecorder, (fRecord.get(), width, height)))
29 {} 29 {}
30 30
31 SkPlayback* SkRecording::releasePlayback() { 31 SkPlayback* SkRecording::releasePlayback() {
32 SkASSERT(fRecorder->unique()); 32 SkASSERT(fRecorder->unique());
33 fRecorder->forgetRecord(); 33 fRecorder->forgetRecord();
34 SkRecordOptimize(fRecord.get()); 34 SkRecordOptimize(fRecord.get());
35 return SkNEW_ARGS(SkPlayback, (fRecord.detach())); 35 return SkNEW_ARGS(SkPlayback, (fRecord.detach()));
36 } 36 }
37 37
38 SkRecording::~SkRecording() {} 38 SkRecording::~SkRecording() {}
39 39
40 SkCanvas* SkRecording::canvas() { 40 SkCanvas* SkRecording::canvas() {
41 return fRecord.get() ? fRecorder.get() : NULL; 41 return fRecord.get() ? fRecorder.get() : NULL;
42 } 42 }
43 43
44 } // namespace EXPERIMENTAL 44 } // namespace EXPERIMENTAL
OLDNEW
« no previous file with comments | « src/record/SkRecorder.cpp ('k') | tests/RecordDrawTest.cpp » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698