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

Side by Side Diff: dm/DMPipeTask.cpp

Issue 286993005: refactor DM::SetupBitmap (Closed) Base URL: https://skia.googlesource.com/skia.git@master
Patch Set: Created 6 years, 7 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.cpp ('k') | dm/DMQuiltTask.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 #include "DMPipeTask.h" 1 #include "DMPipeTask.h"
2 #include "DMUtil.h" 2 #include "DMUtil.h"
3 #include "DMWriteTask.h" 3 #include "DMWriteTask.h"
4 4
5 #include "SamplePipeControllers.h" 5 #include "SamplePipeControllers.h"
6 #include "SkCommandLineFlags.h" 6 #include "SkCommandLineFlags.h"
7 #include "SkGPipe.h" 7 #include "SkGPipe.h"
8 8
9 DEFINE_bool(pipe, true, "If true, check several pipe variants against the refere nce bitmap."); 9 DEFINE_bool(pipe, true, "If true, check several pipe variants against the refere nce bitmap.");
10 10
(...skipping 27 matching lines...) Expand all
38 Mode mode) 38 Mode mode)
39 : CpuTask(parent) 39 : CpuTask(parent)
40 , fFlags(get_flags(mode)) 40 , fFlags(get_flags(mode))
41 , fName(UnderJoin(parent.name().c_str(), get_name(fFlags))) 41 , fName(UnderJoin(parent.name().c_str(), get_name(fFlags)))
42 , fGM(gm) 42 , fGM(gm)
43 , fReference(reference) 43 , fReference(reference)
44 {} 44 {}
45 45
46 void PipeTask::draw() { 46 void PipeTask::draw() {
47 SkBitmap bitmap; 47 SkBitmap bitmap;
48 SetupBitmap(fReference.colorType(), fGM.get(), &bitmap); 48 AllocatePixels(fReference, &bitmap);
49 49
50 SkCanvas canvas(bitmap); 50 SkCanvas canvas(bitmap);
51 PipeController pipeController(&canvas, &SkImageDecoder::DecodeMemory); 51 PipeController pipeController(&canvas, &SkImageDecoder::DecodeMemory);
52 SkGPipeWriter writer; 52 SkGPipeWriter writer;
53 53
54 SkCanvas* pipeCanvas = writer.startRecording(&pipeController, 54 SkCanvas* pipeCanvas = writer.startRecording(&pipeController,
55 fFlags, 55 fFlags,
56 bitmap.width(), 56 bitmap.width(),
57 bitmap.height()); 57 bitmap.height());
58 pipeCanvas->concat(fGM->getInitialTransform()); 58 pipeCanvas->concat(fGM->getInitialTransform());
(...skipping 14 matching lines...) Expand all
73 return true; 73 return true;
74 } 74 }
75 if (fFlags == SkGPipeWriter::kCrossProcess_Flag && 75 if (fFlags == SkGPipeWriter::kCrossProcess_Flag &&
76 fGM->getFlags() & skiagm::GM::kSkipPipeCrossProcess_Flag) { 76 fGM->getFlags() & skiagm::GM::kSkipPipeCrossProcess_Flag) {
77 return true; 77 return true;
78 } 78 }
79 return false; 79 return false;
80 } 80 }
81 81
82 } // namespace DM 82 } // namespace DM
OLDNEW
« no previous file with comments | « dm/DMCpuGMTask.cpp ('k') | dm/DMQuiltTask.cpp » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698