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

Side by Side Diff: dm/DMCpuGMTask.cpp

Issue 788243008: Sketch DM refactor. (Closed) Base URL: https://skia.googlesource.com/skia.git@master
Patch Set: better failure messages, disable a few things temporarily to try to go green Created 5 years, 11 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/DMCpuGMTask.h ('k') | dm/DMGpuGMTask.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 "DMCpuGMTask.h"
2 #include "DMPipeTask.h"
3 #include "DMQuiltTask.h"
4 #include "DMSerializeTask.h"
5 #include "DMUtil.h"
6 #include "DMWriteTask.h"
7
8 namespace DM {
9
10 CpuGMTask::CpuGMTask(const char* config,
11 Reporter* reporter,
12 TaskRunner* taskRunner,
13 skiagm::GMRegistry::Factory gmFactory,
14 SkColorType colorType)
15 : CpuTask(reporter, taskRunner)
16 , fGMFactory(gmFactory)
17 , fGM(fGMFactory(NULL))
18 , fName(UnderJoin(fGM->getName(), config))
19 , fColorType(colorType)
20 {}
21
22 void CpuGMTask::draw() {
23 SkBitmap bm;
24 AllocatePixels(fColorType, fGM->getISize().width(), fGM->getISize().height() , &bm);
25
26 SkCanvas canvas(bm);
27 CanvasPreflight(&canvas);
28 canvas.concat(fGM->getInitialTransform());
29 fGM->draw(&canvas);
30 canvas.flush();
31
32 #define SPAWN(ChildTask, ...) this->spawnChild(SkNEW_ARGS(ChildTask, (*this, __V A_ARGS__)))
33 SPAWN(PipeTask, fGMFactory(NULL), bm, PipeTask::kInProcess_Mode);
34 SPAWN(PipeTask, fGMFactory(NULL), bm, PipeTask::kCrossProcess_Mode);
35 SPAWN(PipeTask, fGMFactory(NULL), bm, PipeTask::kSharedAddress_Mode);
36
37 SPAWN(QuiltTask, fGMFactory(NULL), bm, QuiltTask::kNone_BBH);
38 SPAWN(QuiltTask, fGMFactory(NULL), bm, QuiltTask::kRTree_BBH);
39
40 SPAWN(SerializeTask, fGMFactory(NULL), bm);
41
42 SPAWN(WriteTask, "GM", bm);
43 #undef SPAWN
44 }
45
46 bool CpuGMTask::shouldSkip() const {
47 if (kRGB_565_SkColorType == fColorType && (fGM->getFlags() & skiagm::GM::kSk ip565_Flag)) {
48 return true;
49 }
50 if (fGM->getFlags() & skiagm::GM::kGPUOnly_Flag) {
51 return true;
52 }
53 return false;
54 }
55
56 } // namespace DM
OLDNEW
« no previous file with comments | « dm/DMCpuGMTask.h ('k') | dm/DMGpuGMTask.h » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698