diff options
author | commit-bot@chromium.org <commit-bot@chromium.org@2bbb7eff-a529-9590-31e7-b0007b416f81> | 2014-02-10 16:39:40 +0000 |
---|---|---|
committer | commit-bot@chromium.org <commit-bot@chromium.org@2bbb7eff-a529-9590-31e7-b0007b416f81> | 2014-02-10 16:39:40 +0000 |
commit | 0888b7534c4b3b1cb17ac428881334e1169c3d9f (patch) | |
tree | 6901ab3d25f27dfd3f5d5f859e80c563ccf9428a /dm | |
parent | 6be31f42cac550dfa6fd936b36484002b6eadc9c (diff) |
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
Diffstat (limited to 'dm')
-rw-r--r-- | dm/DMWriteTask.cpp | 5 |
1 files changed, 5 insertions, 0 deletions
diff --git a/dm/DMWriteTask.cpp b/dm/DMWriteTask.cpp index faa20a2cc3..dc31d292a3 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. |