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

Unified Diff: dm/DMWriteTask.cpp

Issue 152223003: DM: catch -r foo -w foo. (Closed) Base URL: https://skia.googlesource.com/skia.git@master
Patch Set: Created 6 years, 10 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 | « no previous file | no next file » | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: dm/DMWriteTask.cpp
diff --git a/dm/DMWriteTask.cpp b/dm/DMWriteTask.cpp
index faa20a2cc340b1e2a0e902cf6979dd7b47a6d578..dc31d292a397d47d31715905dce47bf75e35398c 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.
« no previous file with comments | « no previous file | no next file » | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698