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

Side by Side Diff: dm/DMCpuTask.cpp

Issue 179233005: DM: make GPU tasks multithreaded again. Big refactor. (Closed) Base URL: https://skia.googlesource.com/skia.git@master
Patch Set: default 1 GPU thread Created 6 years, 9 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 | « dm/DMCpuTask.h ('k') | dm/DMExpectationsTask.h » ('j') | no next file with comments »
Toggle Intra-line Diffs ('i') | Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
OLDNEW
(Empty)
1 #include "DMCpuTask.h"
2 #include "DMExpectationsTask.h"
3 #include "DMPipeTask.h"
4 #include "DMReplayTask.h"
5 #include "DMSerializeTask.h"
6 #include "DMTileGridTask.h"
7 #include "DMUtil.h"
8 #include "DMWriteTask.h"
9
10 namespace DM {
11
12 CpuTask::CpuTask(const char* config,
13 Reporter* reporter,
14 TaskRunner* taskRunner,
15 const Expectations& expectations,
16 skiagm::GMRegistry::Factory gmFactory,
17 SkColorType colorType)
18 : Task(reporter, taskRunner)
19 , fGMFactory(gmFactory)
20 , fGM(fGMFactory(NULL))
21 , fName(UnderJoin(fGM->getName(), config))
22 , fExpectations(expectations)
23 , fColorType(colorType)
24 {}
25
26 void CpuTask::draw() {
27 SkBitmap bitmap;
28 SetupBitmap(fColorType, fGM.get(), &bitmap);
29
30 SkCanvas canvas(bitmap);
31 canvas.concat(fGM->getInitialTransform());
32 fGM->draw(&canvas);
33 canvas.flush();
34
35 #define SPAWN(ChildTask, ...) this->spawnChild(SkNEW_ARGS(ChildTask, (*this, __V A_ARGS__)))
36 SPAWN(ExpectationsTask, fExpectations, bitmap);
37
38 SPAWN(PipeTask, fGMFactory(NULL), bitmap, false, false);
39 SPAWN(PipeTask, fGMFactory(NULL), bitmap, true, false);
40 SPAWN(PipeTask, fGMFactory(NULL), bitmap, true, true);
41 SPAWN(ReplayTask, fGMFactory(NULL), bitmap, false);
42 SPAWN(ReplayTask, fGMFactory(NULL), bitmap, true);
43 SPAWN(SerializeTask, fGMFactory(NULL), bitmap);
44 SPAWN(TileGridTask, fGMFactory(NULL), bitmap, SkISize::Make(16,16));
45
46 SPAWN(WriteTask, bitmap);
47 #undef SPAWN
48 }
49
50 bool CpuTask::shouldSkip() const {
51 if (kRGB_565_SkColorType == fColorType && (fGM->getFlags() & skiagm::GM::kSk ip565_Flag)) {
52 return true;
53 }
54 if (fGM->getFlags() & skiagm::GM::kGPUOnly_Flag) {
55 return true;
56 }
57 return false;
58 }
59
60 } // namespace DM
OLDNEW
« no previous file with comments | « dm/DMCpuTask.h ('k') | dm/DMExpectationsTask.h » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698