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

Unified Diff: dm/DMSKPTask.cpp

Issue 288823002: DM: tweaks (Closed) Base URL: https://skia.googlesource.com/skia.git@master
Patch Set: oops Created 6 years, 7 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 | dm/DMWriteTask.h » ('j') | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: dm/DMSKPTask.cpp
diff --git a/dm/DMSKPTask.cpp b/dm/DMSKPTask.cpp
index 3eb4c5d6f11d76219d9af96f8be16f3e35d519ed..53f8408b99efa9edeeca768cfb4373325408e42f 100644
--- a/dm/DMSKPTask.cpp
+++ b/dm/DMSKPTask.cpp
@@ -5,8 +5,17 @@
namespace DM {
-SKPTask::SKPTask(Reporter* r, TaskRunner* tr, SkPicture* pic, SkString name)
- : CpuTask(r, tr), fPicture(SkRef(pic)), fName(name) {}
+// foo_bar.skp -> foo-bar_skp
+static SkString filename_to_task_name(SkString filename) {
+ for (size_t i = 0; i < filename.size(); i++) {
+ if ('_' == filename[i]) { filename[i] = '-'; }
+ if ('.' == filename[i]) { filename[i] = '_'; }
+ }
+ return filename;
+}
+
+SKPTask::SKPTask(Reporter* r, TaskRunner* tr, SkPicture* pic, SkString filename)
+ : CpuTask(r, tr), fPicture(SkRef(pic)), fName(filename_to_task_name(filename)) {}
void SKPTask::draw() {
SkBitmap bitmap;
@@ -17,7 +26,7 @@ void SKPTask::draw() {
(*this, fPicture, bitmap, RecordTask::kNoOptimize_Mode)));
this->spawnChild(SkNEW_ARGS(RecordTask,
(*this, fPicture, bitmap, RecordTask::kOptimize_Mode)));
- this->spawnChild(SkNEW_ARGS(WriteTask, (*this, bitmap, WriteTask::kVerbatim_Mode)));
+ this->spawnChild(SkNEW_ARGS(WriteTask, (*this, bitmap)));
}
} // namespace DM
« no previous file with comments | « no previous file | dm/DMWriteTask.h » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698