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

Side by Side Diff: dm/DMGpuGMTask.cpp

Issue 563723005: Add --matrix to DM, to play around with and maybe use on a bot. (Closed) Base URL: https://skia.googlesource.com/skia.git@master
Patch Set: Created 6 years, 3 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/DMPDFTask.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 "DMGpuGMTask.h" 1 #include "DMGpuGMTask.h"
2
3 #include "DMUtil.h" 2 #include "DMUtil.h"
4 #include "DMWriteTask.h" 3 #include "DMWriteTask.h"
5 #include "SkCommandLineFlags.h" 4 #include "SkCommandLineFlags.h"
6 #include "SkSurface.h" 5 #include "SkSurface.h"
7 #include "SkTLS.h" 6 #include "SkTLS.h"
8 7
9 namespace DM { 8 namespace DM {
10 9
11 GpuGMTask::GpuGMTask(const char* config, 10 GpuGMTask::GpuGMTask(const char* config,
12 Reporter* reporter, 11 Reporter* reporter,
(...skipping 15 matching lines...) Expand all
28 SkScalarCeilToInt(fGM->height()), 27 SkScalarCeilToInt(fGM->height()),
29 kN32_SkColorType, 28 kN32_SkColorType,
30 kPremul_SkAlphaType); 29 kPremul_SkAlphaType);
31 SkAutoTUnref<SkSurface> surface(NewGpuSurface(grFactory, fContextType, fGpuA PI, info, 30 SkAutoTUnref<SkSurface> surface(NewGpuSurface(grFactory, fContextType, fGpuA PI, info,
32 fSampleCount)); 31 fSampleCount));
33 if (!surface) { 32 if (!surface) {
34 this->fail("Could not create context for the config and the api."); 33 this->fail("Could not create context for the config and the api.");
35 return; 34 return;
36 } 35 }
37 SkCanvas* canvas = surface->getCanvas(); 36 SkCanvas* canvas = surface->getCanvas();
37 CanvasPreflight(canvas);
38 38
39 canvas->concat(fGM->getInitialTransform()); 39 canvas->concat(fGM->getInitialTransform());
40 fGM->draw(canvas); 40 fGM->draw(canvas);
41 canvas->flush(); 41 canvas->flush();
42 42
43 SkBitmap bitmap; 43 SkBitmap bitmap;
44 bitmap.setInfo(info); 44 bitmap.setInfo(info);
45 canvas->readPixels(&bitmap, 0, 0); 45 canvas->readPixels(&bitmap, 0, 0);
46 46
47 this->spawnChild(SkNEW_ARGS(WriteTask, (*this, "GM", bitmap))); 47 this->spawnChild(SkNEW_ARGS(WriteTask, (*this, "GM", bitmap)));
48 } 48 }
49 49
50 bool GpuGMTask::shouldSkip() const { 50 bool GpuGMTask::shouldSkip() const {
51 return kGPUDisabled || SkToBool(fGM->getFlags() & skiagm::GM::kSkipGPU_Flag) ; 51 return kGPUDisabled || SkToBool(fGM->getFlags() & skiagm::GM::kSkipGPU_Flag) ;
52 } 52 }
53 53
54 } // namespace DM 54 } // namespace DM
OLDNEW
« no previous file with comments | « dm/DMCpuGMTask.cpp ('k') | dm/DMPDFTask.cpp » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698