OLD | NEW |
1 /* | 1 /* |
2 * Copyright 2012 Google Inc. | 2 * Copyright 2012 Google Inc. |
3 * | 3 * |
4 * Use of this source code is governed by a BSD-style license that can be | 4 * Use of this source code is governed by a BSD-style license that can be |
5 * found in the LICENSE file. | 5 * found in the LICENSE file. |
6 */ | 6 */ |
7 | 7 |
8 #include "PictureRenderer.h" | 8 #include "PictureRenderer.h" |
9 #include "picture_utils.h" | 9 #include "picture_utils.h" |
10 #include "SamplePipeControllers.h" | 10 #include "SamplePipeControllers.h" |
(...skipping 329 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
340 SkString outputFilename(inputFilename); | 340 SkString outputFilename(inputFilename); |
341 outputFilename.remove(outputFilename.size() - 4, 4); | 341 outputFilename.remove(outputFilename.size() - 4, 4); |
342 if (NULL != numberToAppend) { | 342 if (NULL != numberToAppend) { |
343 outputFilename.appendf("%i", *numberToAppend); | 343 outputFilename.appendf("%i", *numberToAppend); |
344 } | 344 } |
345 outputFilename.append(".png"); | 345 outputFilename.append(".png"); |
346 // TODO(epoger): what about including the config type within outputFilename?
That way, | 346 // TODO(epoger): what about including the config type within outputFilename?
That way, |
347 // we could combine results of different config types without conflicting fi
lenames. | 347 // we could combine results of different config types without conflicting fi
lenames. |
348 | 348 |
349 if (NULL != jsonSummaryPtr) { | 349 if (NULL != jsonSummaryPtr) { |
350 if (!generatedHash) { | 350 SkASSERT(!generatedHash); |
351 SkAssertResult(SkBitmapHasher::ComputeDigest(bitmap, &hash)); | 351 SkAssertResult(SkBitmapHasher::ComputeDigest(bitmap, &hash)); |
352 generatedHash = true; | 352 generatedHash = true; |
353 } | 353 |
354 jsonSummaryPtr->add(outputFilename.c_str(), hash); | 354 jsonSummaryPtr->add(outputFilename.c_str(), hash); |
355 } | 355 } |
356 | 356 |
357 // Update outputFilename AFTER adding to JSON summary, but BEFORE writing ou
t the image file. | 357 // Update outputFilename AFTER adding to JSON summary, but BEFORE writing ou
t the image file. |
358 if (useChecksumBasedFilenames) { | 358 if (useChecksumBasedFilenames) { |
359 if (!generatedHash) { | 359 if (!generatedHash) { |
360 SkAssertResult(SkBitmapHasher::ComputeDigest(bitmap, &hash)); | 360 SkAssertResult(SkBitmapHasher::ComputeDigest(bitmap, &hash)); |
361 generatedHash = true; | 361 generatedHash = true; |
362 } | 362 } |
363 outputFilename.set(kJsonKey_Hashtype_Bitmap_64bitMD5); | 363 outputFilename.set(kJsonKey_Hashtype_Bitmap_64bitMD5); |
(...skipping 634 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
998 virtual SkString getConfigNameInternal() SK_OVERRIDE { | 998 virtual SkString getConfigNameInternal() SK_OVERRIDE { |
999 return SkString("picture_clone"); | 999 return SkString("picture_clone"); |
1000 } | 1000 } |
1001 }; | 1001 }; |
1002 | 1002 |
1003 PictureRenderer* CreatePictureCloneRenderer() { | 1003 PictureRenderer* CreatePictureCloneRenderer() { |
1004 return SkNEW(PictureCloneRenderer); | 1004 return SkNEW(PictureCloneRenderer); |
1005 } | 1005 } |
1006 | 1006 |
1007 } // namespace sk_tools | 1007 } // namespace sk_tools |
OLD | NEW |