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

Unified Diff: dm/DMReplayTask.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 side-by-side diff with in-line comments
Download patch
« dm/DMReplayTask.h ('K') | « dm/DMReplayTask.h ('k') | dm/DMUtil.h » ('j') | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: dm/DMReplayTask.cpp
diff --git a/dm/DMReplayTask.cpp b/dm/DMReplayTask.cpp
index 7e183f6cbd44e4a45d276f906f0eaadca117ba60..e5f392cee4a13dbed0f802c6dfedd836d31be165 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();
}
}
« dm/DMReplayTask.h ('K') | « dm/DMReplayTask.h ('k') | dm/DMUtil.h » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698