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

Side by Side Diff: dm/DMRecordTask.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 | « no previous file | src/record/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 #include "DMRecordTask.h" 1 #include "DMRecordTask.h"
2 #include "DMUtil.h" 2 #include "DMUtil.h"
3 #include "DMWriteTask.h" 3 #include "DMWriteTask.h"
4 #include "SkCommandLineFlags.h" 4 #include "SkCommandLineFlags.h"
5 #include "SkRecord.h" 5 #include "SkRecord.h"
6 #include "SkRecordDraw.h" 6 #include "SkRecordDraw.h"
7 #include "SkRecordOpts.h" 7 #include "SkRecordOpts.h"
8 #include "SkRecorder.h" 8 #include "SkRecorder.h"
9 9
10 DEFINE_bool(skr, true, "If true, run SKR tests."); 10 DEFINE_bool(skr, true, "If true, run SKR tests.");
(...skipping 12 matching lines...) Expand all
23 : CpuTask(parent) 23 : CpuTask(parent)
24 , fOptimize(mode == kOptimize_Mode) 24 , fOptimize(mode == kOptimize_Mode)
25 , fName(UnderJoin(parent.name().c_str(), fOptimize ? "skr" : "skr-noopt")) 25 , fName(UnderJoin(parent.name().c_str(), fOptimize ? "skr" : "skr-noopt"))
26 , fPicture(SkRef(pic)) 26 , fPicture(SkRef(pic))
27 , fReference(reference) 27 , fReference(reference)
28 {} 28 {}
29 29
30 void RecordTask::draw() { 30 void RecordTask::draw() {
31 // Record into an SkRecord. 31 // Record into an SkRecord.
32 SkRecord record; 32 SkRecord record;
33 SkRecorder recorder(SkRecorder::kWriteOnly_Mode, &record, 33 SkRecorder recorder(&record, fReference.width(), fReference.height());
34 fReference.width(), fReference.height());
35 34
36 if (fGM.get()) { 35 if (fGM.get()) {
37 recorder.concat(fGM->getInitialTransform()); 36 recorder.concat(fGM->getInitialTransform());
38 fGM->draw(&recorder); 37 fGM->draw(&recorder);
39 } else { 38 } else {
40 fPicture->draw(&recorder); 39 fPicture->draw(&recorder);
41 } 40 }
42 41
43 42
44 if (fOptimize) { 43 if (fOptimize) {
(...skipping 10 matching lines...) Expand all
55 this->fail(); 54 this->fail();
56 this->spawnChild(SkNEW_ARGS(WriteTask, (*this, bitmap))); 55 this->spawnChild(SkNEW_ARGS(WriteTask, (*this, bitmap)));
57 } 56 }
58 } 57 }
59 58
60 bool RecordTask::shouldSkip() const { 59 bool RecordTask::shouldSkip() const {
61 return !FLAGS_skr; 60 return !FLAGS_skr;
62 } 61 }
63 62
64 } // namespace DM 63 } // namespace DM
OLDNEW
« no previous file with comments | « no previous file | src/record/SkRecorder.h » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698