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

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

Issue 231853006: SkRecord: turn on cull annotation pass in public API. (Closed) Base URL: https://skia.googlesource.com/skia.git@master
Patch Set: rebase Created 6 years, 8 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/record/SkRecording.h ('k') | tools/bench_playback.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 "SkRecordCulling.h"
12 #include "SkRecordDraw.h"
11 #include "SkRecorder.h" 13 #include "SkRecorder.h"
12 #include "SkRecordDraw.h"
13 14
14 namespace EXPERIMENTAL { 15 namespace EXPERIMENTAL {
15 16
16 SkPlayback::SkPlayback(const SkRecord* record) : fRecord(record) {} 17 SkPlayback::SkPlayback(const SkRecord* record) : fRecord(record) {}
17 18
18 SkPlayback::~SkPlayback() { 19 SkPlayback::~SkPlayback() {
19 SkDELETE(fRecord); 20 SkDELETE(fRecord);
20 } 21 }
21 22
22 void SkPlayback::draw(SkCanvas* canvas) const { 23 void SkPlayback::draw(SkCanvas* canvas) const {
23 SkASSERT(fRecord != NULL); 24 SkASSERT(fRecord != NULL);
24 SkRecordDraw(*fRecord, canvas); 25 SkRecordDraw(*fRecord, canvas);
25 } 26 }
26 27
27 /*static*/ SkRecording* SkRecording::Create(int width, int height) { 28 /*static*/ SkRecording* SkRecording::Create(int width, int height) {
28 return SkNEW_ARGS(SkRecording, (width, height)); 29 return SkNEW_ARGS(SkRecording, (width, height));
29 } 30 }
30 31
31 SkRecording::SkRecording(int width, int height) { 32 SkRecording::SkRecording(int width, int height) {
32 SkRecord* record = SkNEW(SkRecord); 33 SkRecord* record = SkNEW(SkRecord);
33 fRecorder = SkNEW_ARGS(SkRecorder, (SkRecorder::kReadWrite_Mode, record, wid th, height)); 34 fRecorder = SkNEW_ARGS(SkRecorder, (SkRecorder::kReadWrite_Mode, record, wid th, height));
34 fRecord = record; 35 fRecord = record;
35 } 36 }
36 37
37 /*static*/ const SkPlayback* SkRecording::Delete(SkRecording* recording) { 38 /*static*/ const SkPlayback* SkRecording::Delete(SkRecording* recording) {
38 const SkRecord* record = recording->fRecord; 39 SkRecord* record = recording->fRecord;
40 SkRecordAnnotateCullingPairs(record);
39 SkDELETE(recording); 41 SkDELETE(recording);
40 return SkNEW_ARGS(SkPlayback, (record)); 42 return SkNEW_ARGS(SkPlayback, (record));
41 } 43 }
42 44
43 SkRecording::~SkRecording() { 45 SkRecording::~SkRecording() {
44 SkDELETE(fRecorder); 46 SkDELETE(fRecorder);
45 } 47 }
46 48
47 SkCanvas* SkRecording::canvas() { 49 SkCanvas* SkRecording::canvas() {
48 return fRecorder; 50 return fRecorder;
49 } 51 }
50 52
51 } // namespace EXPERIMENTAL 53 } // namespace EXPERIMENTAL
OLDNEW
« no previous file with comments | « include/record/SkRecording.h ('k') | tools/bench_playback.cpp » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698