diff options
author | 2013-10-16 19:13:38 +0000 | |
---|---|---|
committer | 2013-10-16 19:13:38 +0000 | |
commit | 66bb3d1f5e451f8501f5c28d1dc28fcef6e908e1 (patch) | |
tree | 74f5b572abe176fdc61abae703fa1747437d9587 /dm/DMReplayTask.cpp | |
parent | 4cc18156c2f998135eaff6eea7a8a0696dc98ec9 (diff) |
DM: duh, don't calculate digests unless we're going to look at them.
This doesn't cut the runtime significantly (~6s either way) but it does cut the CPU time down from ~10s to ~6s.
BUG=
R=bungeman@google.com
Author: mtklein@google.com
Review URL: https://codereview.chromium.org/27476007
git-svn-id: http://skia.googlecode.com/svn/trunk@11826 2bbb7eff-a529-9590-31e7-b0007b416f81
Diffstat (limited to 'dm/DMReplayTask.cpp')
-rw-r--r-- | dm/DMReplayTask.cpp | 14 |
1 files changed, 8 insertions, 6 deletions
diff --git a/dm/DMReplayTask.cpp b/dm/DMReplayTask.cpp index 7e183f6cbd..e5f392cee4 100644 --- a/dm/DMReplayTask.cpp +++ b/dm/DMReplayTask.cpp @@ -8,13 +8,11 @@ namespace DM { ReplayTask::ReplayTask(const char* suffix, const Task& parent, skiagm::GM* gm, - skiagm::GmResultDigest reference, - SkBitmap::Config config) + SkBitmap reference) : Task(parent) , fName(underJoin(parent.name().c_str(), suffix)) , fGM(gm) , fReference(reference) - , fConfig(config) {} void ReplayTask::draw() { @@ -30,7 +28,9 @@ void ReplayTask::draw() { picture.endRecording(); SkBitmap bitmap; - bitmap.setConfig(fConfig, SkScalarCeilToInt(fGM->width()), SkScalarCeilToInt(fGM->height())); + bitmap.setConfig(fReference.config(), + SkScalarCeilToInt(fGM->width()), + SkScalarCeilToInt(fGM->height())); bitmap.allocPixels(); bitmap.eraseColor(0x00000000); @@ -38,8 +38,10 @@ void ReplayTask::draw() { replay.drawPicture(picture); replay.flush(); - const skiagm::GmResultDigest replayDigest(bitmap); - if (!replayDigest.equals(fReference)) { + const SkAutoLockPixels mine(bitmap), theirs(fReference); + if (bitmap.getSize() != fReference.getSize() || + 0 != memcmp(bitmap.getPixels(), fReference.getPixels(), bitmap.getSize())) + { this->fail(); } } |