| 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 280 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 291 canvas->readPixels(&bitmap, 0, 0); | 291 canvas->readPixels(&bitmap, 0, 0); |
| 292 force_all_opaque(bitmap); | 292 force_all_opaque(bitmap); |
| 293 BitmapAndDigest bitmapAndDigest(bitmap); | 293 BitmapAndDigest bitmapAndDigest(bitmap); |
| 294 | 294 |
| 295 SkString escapedInputFilename(inputFilename); | 295 SkString escapedInputFilename(inputFilename); |
| 296 replace_char(&escapedInputFilename, '.', '_'); | 296 replace_char(&escapedInputFilename, '.', '_'); |
| 297 | 297 |
| 298 // TODO(epoger): what about including the config type within outputFilename?
That way, | 298 // TODO(epoger): what about including the config type within outputFilename?
That way, |
| 299 // we could combine results of different config types without conflicting fi
lenames. | 299 // we could combine results of different config types without conflicting fi
lenames. |
| 300 SkString outputFilename; | 300 SkString outputFilename; |
| 301 const ImageDigest *imageDigestPtr = bitmapAndDigest.getImageDigestPtr(); | |
| 302 const char *outputSubdirPtr = NULL; | 301 const char *outputSubdirPtr = NULL; |
| 303 if (useChecksumBasedFilenames) { | 302 if (useChecksumBasedFilenames) { |
| 303 const ImageDigest *imageDigestPtr = bitmapAndDigest.getImageDigestPtr(); |
| 304 outputSubdirPtr = escapedInputFilename.c_str(); | 304 outputSubdirPtr = escapedInputFilename.c_str(); |
| 305 outputFilename.set(imageDigestPtr->getHashType()); | 305 outputFilename.set(imageDigestPtr->getHashType()); |
| 306 outputFilename.append("_"); | 306 outputFilename.append("_"); |
| 307 outputFilename.appendU64(imageDigestPtr->getHashValue()); | 307 outputFilename.appendU64(imageDigestPtr->getHashValue()); |
| 308 } else { | 308 } else { |
| 309 outputFilename.set(escapedInputFilename); | 309 outputFilename.set(escapedInputFilename); |
| 310 if (NULL != tileNumberPtr) { | 310 if (NULL != tileNumberPtr) { |
| 311 outputFilename.append("-tile"); | 311 outputFilename.append("-tile"); |
| 312 outputFilename.appendS32(*tileNumberPtr); | 312 outputFilename.appendS32(*tileNumberPtr); |
| 313 } | 313 } |
| (...skipping 635 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 949 virtual SkString getConfigNameInternal() SK_OVERRIDE { | 949 virtual SkString getConfigNameInternal() SK_OVERRIDE { |
| 950 return SkString("picture_clone"); | 950 return SkString("picture_clone"); |
| 951 } | 951 } |
| 952 }; | 952 }; |
| 953 | 953 |
| 954 PictureRenderer* CreatePictureCloneRenderer() { | 954 PictureRenderer* CreatePictureCloneRenderer() { |
| 955 return SkNEW(PictureCloneRenderer); | 955 return SkNEW(PictureCloneRenderer); |
| 956 } | 956 } |
| 957 | 957 |
| 958 } // namespace sk_tools | 958 } // namespace sk_tools |
| OLD | NEW |