From 0888b7534c4b3b1cb17ac428881334e1169c3d9f Mon Sep 17 00:00:00 2001 From: "commit-bot@chromium.org" Date: Mon, 10 Feb 2014 16:39:40 +0000 Subject: [PATCH] DM: catch -r foo -w foo. BUG=skia: R=reed@google.com Author: mtklein@google.com Review URL: https://codereview.chromium.org/152223003 git-svn-id: http://skia.googlecode.com/svn/trunk@13383 2bbb7eff-a529-9590-31e7-b0007b416f81 --- dm/DMWriteTask.cpp | 5 +++++ 1 file changed, 5 insertions(+) diff --git a/dm/DMWriteTask.cpp b/dm/DMWriteTask.cpp index faa20a2..dc31d29 100644 --- a/dm/DMWriteTask.cpp +++ b/dm/DMWriteTask.cpp @@ -91,6 +91,11 @@ static SkString path_to_expected_image(const char* root, const Task& task) { } bool WriteTask::Expectations::check(const Task& task, SkBitmap bitmap) const { + if (!FLAGS_writePath.isEmpty() && 0 == strcmp(FLAGS_writePath[0], fRoot)) { + SkDebugf("We seem to be reading and writing %s concurrently. This won't work.\n", fRoot); + return false; + } + // PNG is stored unpremultiplied, and going from premul to unpremul to premul is lossy. To // skirt this problem, we decode the PNG into an unpremul bitmap, convert our bitmap to unpremul // if needed, and compare those. Each image goes once from premul to unpremul, never back. -- 2.7.4