diff options
author | mtklein <mtklein@chromium.org> | 2014-09-08 09:12:28 -0700 |
---|---|---|
committer | Commit bot <commit-bot@chromium.org> | 2014-09-08 09:12:28 -0700 |
commit | 23c94f05cad79f6f8d303c1b4ffb6d0b91671e83 (patch) | |
tree | 33121cdefff99505ab8f4b5d662ee6ecf650c5b5 /dm | |
parent | 93f52a69443f9be16f4e98c21d1f6cf760a65f00 (diff) |
Let .skps have Expectations (i.e. work with -r) too.
BUG=skia:
R=jcgregorio@google.com, mtklein@google.com
Author: mtklein@chromium.org
Review URL: https://codereview.chromium.org/549183002
Diffstat (limited to 'dm')
-rw-r--r-- | dm/DM.cpp | 8 | ||||
-rw-r--r-- | dm/DMSKPTask.cpp | 13 | ||||
-rw-r--r-- | dm/DMSKPTask.h | 4 |
3 files changed, 19 insertions, 6 deletions
@@ -136,7 +136,9 @@ static void find_skps(SkTArray<SkString>* skps) { } static void kick_off_skps(const SkTArray<SkString>& skps, - DM::Reporter* reporter, DM::TaskRunner* tasks) { + const DM::Expectations& expectations, + DM::Reporter* reporter, + DM::TaskRunner* tasks) { for (int i = 0; i < skps.count(); ++i) { SkAutoTUnref<SkStream> stream(SkStream::NewFromFile(skps[i].c_str())); if (stream.get() == NULL) { @@ -151,7 +153,7 @@ static void kick_off_skps(const SkTArray<SkString>& skps, } SkString filename = SkOSPath::Basename(skps[i].c_str()); - tasks->add(SkNEW_ARGS(DM::SKPTask, (reporter, tasks, pic, filename))); + tasks->add(SkNEW_ARGS(DM::SKPTask, (reporter, tasks, expectations, pic, filename))); tasks->add(SkNEW_ARGS(DM::PDFTask, (reporter, tasks, pic, filename, RASTERIZE_PDF_PROC))); } @@ -237,7 +239,7 @@ int dm_main() { DM::TaskRunner tasks; kick_off_tests(tests, &reporter, &tasks); kick_off_gms(gms, configs, gpuAPI, *expectations, &reporter, &tasks); - kick_off_skps(skps, &reporter, &tasks); + kick_off_skps(skps, *expectations, &reporter, &tasks); tasks.wait(); DM::WriteTask::DumpJson(); diff --git a/dm/DMSKPTask.cpp b/dm/DMSKPTask.cpp index ece7e9a716..9e376e7eb2 100644 --- a/dm/DMSKPTask.cpp +++ b/dm/DMSKPTask.cpp @@ -1,4 +1,5 @@ #include "DMSKPTask.h" +#include "DMExpectationsTask.h" #include "DMUtil.h" #include "DMWriteTask.h" @@ -10,8 +11,15 @@ DEFINE_int32(skpMaxHeight, 1000, "Max SKPTask viewport height."); namespace DM { -SKPTask::SKPTask(Reporter* r, TaskRunner* tr, const SkPicture* pic, SkString filename) - : CpuTask(r, tr), fPicture(SkRef(pic)), fName(FileToTaskName(filename)) {} +SKPTask::SKPTask(Reporter* r, + TaskRunner* tr, + const Expectations& expectations, + const SkPicture* pic, + SkString filename) + : CpuTask(r, tr) + , fPicture(SkRef(pic)) + , fExpectations(expectations) + , fName(FileToTaskName(filename)) {} void SKPTask::draw() { const int width = SkTMin(SkScalarCeilToInt(fPicture->cullRect().width()), FLAGS_skpMaxWidth), @@ -21,6 +29,7 @@ void SKPTask::draw() { DrawPicture(*fPicture, &bitmap); this->spawnChild(SkNEW_ARGS(WriteTask, (*this, bitmap))); + this->spawnChild(SkNEW_ARGS(ExpectationsTask, (*this, fExpectations, bitmap))); } } // namespace DM diff --git a/dm/DMSKPTask.h b/dm/DMSKPTask.h index b8a288e037..6764a9ce09 100644 --- a/dm/DMSKPTask.h +++ b/dm/DMSKPTask.h @@ -1,6 +1,7 @@ #ifndef DMSKPTask_DEFINED #define DMSKPTask_DEFINED +#include "DMExpectations.h" #include "DMReporter.h" #include "DMTask.h" #include "DMTaskRunner.h" @@ -14,7 +15,7 @@ namespace DM { class SKPTask : public CpuTask { public: - SKPTask(Reporter*, TaskRunner*, const SkPicture*, SkString name); + SKPTask(Reporter*, TaskRunner*, const Expectations&, const SkPicture*, SkString name); virtual void draw() SK_OVERRIDE; virtual bool shouldSkip() const SK_OVERRIDE { return false; } @@ -22,6 +23,7 @@ public: private: SkAutoTUnref<const SkPicture> fPicture; + const Expectations& fExpectations; const SkString fName; }; |