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

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: 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
« no previous file with comments | « 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 bc94f73cb1791230a5362d6d299fd7ff6544be3a..8e20eada3b45cbf4d1672daf0cea1387705018a1 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() {
@@ -28,7 +26,7 @@ void ReplayTask::draw() {
picture.endRecording();
SkBitmap bitmap;
- bitmap.setConfig(fConfig, fGM->width(), fGM->height());
+ bitmap.setConfig(fReference.config(), fGM->width(), fGM->height());
bitmap.allocPixels();
bitmap.eraseColor(0x00000000);
@@ -36,8 +34,9 @@ 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())) {
bungeman-skia 2013/10/16 17:22:54 I know it isn't technically in the skia style guid
mtklein 2013/10/16 17:27:47 Done.
this->fail();
}
}
« no previous file with comments | « dm/DMReplayTask.h ('k') | dm/DMUtil.h » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698