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

Side by Side Diff: dm/DMGpuTask.cpp

Issue 108963002: DM: Add support for reading a directory of images with --expectations (-r). (Closed) Base URL: https://skia.googlecode.com/svn/trunk
Patch Set: comments etc Created 7 years 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 | Annotate | Revision Log
« no previous file with comments | « dm/DMGpuTask.h ('k') | dm/DMUtil.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 "DMGpuTask.h" 1 #include "DMGpuTask.h"
2 2
3 #include "DMChecksumTask.h" 3 #include "DMExpectationsTask.h"
4 #include "DMUtil.h" 4 #include "DMUtil.h"
5 #include "DMWriteTask.h" 5 #include "DMWriteTask.h"
6 #include "SkCommandLineFlags.h" 6 #include "SkCommandLineFlags.h"
7 #include "SkGpuDevice.h" 7 #include "SkGpuDevice.h"
8 #include "SkTLS.h" 8 #include "SkTLS.h"
9 9
10 namespace DM { 10 namespace DM {
11 11
12 GpuTask::GpuTask(const char* name, 12 GpuTask::GpuTask(const char* name,
13 Reporter* reporter, 13 Reporter* reporter,
14 TaskRunner* taskRunner, 14 TaskRunner* taskRunner,
15 const skiagm::ExpectationsSource& expectations, 15 const Expectations& expectations,
16 skiagm::GMRegistry::Factory gmFactory, 16 skiagm::GMRegistry::Factory gmFactory,
17 SkBitmap::Config config, 17 SkBitmap::Config config,
18 GrContextFactory::GLContextType contextType, 18 GrContextFactory::GLContextType contextType,
19 int sampleCount) 19 int sampleCount)
20 : Task(reporter, taskRunner) 20 : Task(reporter, taskRunner)
21 , fGM(gmFactory(NULL)) 21 , fGM(gmFactory(NULL))
22 , fName(UnderJoin(fGM->shortName(), name)) 22 , fName(UnderJoin(fGM->shortName(), name))
23 , fExpectations(expectations.get(Png(fName).c_str())) 23 , fExpectations(expectations)
24 , fConfig(config) 24 , fConfig(config)
25 , fContextType(contextType) 25 , fContextType(contextType)
26 , fSampleCount(sampleCount) 26 , fSampleCount(sampleCount)
27 {} 27 {}
28 28
29 static void* new_gr_context_factory() { 29 static void* new_gr_context_factory() {
30 return SkNEW(GrContextFactory); 30 return SkNEW(GrContextFactory);
31 } 31 }
32 32
33 static void delete_gr_context_factory(void* factory) { 33 static void delete_gr_context_factory(void* factory) {
(...skipping 19 matching lines...) Expand all
53 canvas.flush(); 53 canvas.flush();
54 54
55 SkBitmap bitmap; 55 SkBitmap bitmap;
56 bitmap.setConfig(fConfig, SkScalarCeilToInt(fGM->width()), SkScalarCeilToInt (fGM->height())); 56 bitmap.setConfig(fConfig, SkScalarCeilToInt(fGM->width()), SkScalarCeilToInt (fGM->height()));
57 canvas.readPixels(&bitmap, 0, 0); 57 canvas.readPixels(&bitmap, 0, 0);
58 58
59 #if GR_CACHE_STATS 59 #if GR_CACHE_STATS
60 gr->printCacheStats(); 60 gr->printCacheStats();
61 #endif 61 #endif
62 62
63 this->spawnChild(SkNEW_ARGS(ChecksumTask, (*this, fExpectations, bitmap))); 63 this->spawnChild(SkNEW_ARGS(ExpectationsTask, (*this, fExpectations, bitmap) ));
64 this->spawnChild(SkNEW_ARGS(WriteTask, (*this, bitmap))); 64 this->spawnChild(SkNEW_ARGS(WriteTask, (*this, bitmap)));
65 } 65 }
66 66
67 bool GpuTask::shouldSkip() const { 67 bool GpuTask::shouldSkip() const {
68 return SkToBool(fGM->getFlags() & skiagm::GM::kSkipGPU_Flag); 68 return SkToBool(fGM->getFlags() & skiagm::GM::kSkipGPU_Flag);
69 } 69 }
70 70
71 } // namespace DM 71 } // namespace DM
OLDNEW
« no previous file with comments | « dm/DMGpuTask.h ('k') | dm/DMUtil.h » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698