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

Side by Side Diff: dm/DMCpuTask.cpp

Issue 27476007: DM: duh, don't calculate digests unless we're going to look at them. (Closed) Base URL: https://skia.googlecode.com/svn/trunk
Patch Set: sync and merge Created 7 years, 2 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 | Annotate | Revision Log
OLDNEW
1 #include "DMCpuTask.h" 1 #include "DMCpuTask.h"
2 #include "DMReplayTask.h" 2 #include "DMReplayTask.h"
3 #include "DMUtil.h" 3 #include "DMUtil.h"
4 #include "SkCommandLineFlags.h" 4 #include "SkCommandLineFlags.h"
5 5
6 DEFINE_bool(replay, false, "If true, run replay tests for each CpuTask."); 6 DEFINE_bool(replay, false, "If true, run replay tests for each CpuTask.");
7 // TODO(mtklein): add the other various options 7 // TODO(mtklein): add the other various options
8 8
9 namespace DM { 9 namespace DM {
10 10
(...skipping 15 matching lines...) Expand all
26 SkBitmap bitmap; 26 SkBitmap bitmap;
27 bitmap.setConfig(fConfig, SkScalarCeilToInt(fGM->width()), SkScalarCeilToInt (fGM->height())); 27 bitmap.setConfig(fConfig, SkScalarCeilToInt(fGM->width()), SkScalarCeilToInt (fGM->height()));
28 bitmap.allocPixels(); 28 bitmap.allocPixels();
29 bitmap.eraseColor(0x00000000); 29 bitmap.eraseColor(0x00000000);
30 SkCanvas canvas(bitmap); 30 SkCanvas canvas(bitmap);
31 31
32 canvas.concat(fGM->getInitialTransform()); 32 canvas.concat(fGM->getInitialTransform());
33 fGM->draw(&canvas); 33 fGM->draw(&canvas);
34 canvas.flush(); 34 canvas.flush();
35 35
36 const skiagm::GmResultDigest digest(bitmap); 36 if (!meetsExpectations(fExpectations, bitmap)) {
37 if (!meetsExpectations(fExpectations, digest)) {
38 this->fail(); 37 this->fail();
39 } 38 }
40 39
41 if (FLAGS_replay) { 40 if (FLAGS_replay) {
42 this->spawnChild(SkNEW_ARGS(ReplayTask, 41 this->spawnChild(SkNEW_ARGS(ReplayTask,
43 ("replay", *this, fGMFactory(NULL), digest, f Config))); 42 ("replay", *this, fGMFactory(NULL), bitmap))) ;
44 } 43 }
45 } 44 }
46 45
47 bool CpuTask::shouldSkip() const { 46 bool CpuTask::shouldSkip() const {
48 if (SkBitmap::kRGB_565_Config == fConfig && (fGM->getFlags() & skiagm::GM::k Skip565_Flag)) { 47 if (SkBitmap::kRGB_565_Config == fConfig && (fGM->getFlags() & skiagm::GM::k Skip565_Flag)) {
49 return true; 48 return true;
50 } 49 }
51 if (fGM->getFlags() & skiagm::GM::kGPUOnly_Flag) { 50 if (fGM->getFlags() & skiagm::GM::kGPUOnly_Flag) {
52 return true; 51 return true;
53 } 52 }
54 return false; 53 return false;
55 } 54 }
56 55
57 } // namespace DM 56 } // namespace DM
OLDNEW
« no previous file with comments | « dm/DMComparisonTask.cpp ('k') | dm/DMReplayTask.h » ('j') | dm/DMReplayTask.h » ('J')

Powered by Google App Engine
This is Rietveld 408576698