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 278 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
289 | 289 |
290 SkBitmap bitmap; | 290 SkBitmap bitmap; |
291 SkISize size = canvas->getDeviceSize(); | 291 SkISize size = canvas->getDeviceSize(); |
292 setup_bitmap(&bitmap, size.width(), size.height()); | 292 setup_bitmap(&bitmap, size.width(), size.height()); |
293 | 293 |
294 canvas->readPixels(&bitmap, 0, 0); | 294 canvas->readPixels(&bitmap, 0, 0); |
295 force_all_opaque(bitmap); | 295 force_all_opaque(bitmap); |
296 BitmapAndDigest bitmapAndDigest(bitmap); | 296 BitmapAndDigest bitmapAndDigest(bitmap); |
297 | 297 |
298 SkString escapedInputFilename(inputFilename); | 298 SkString escapedInputFilename(inputFilename); |
299 replace_char(&escapedInputFilename, '.', '_'); | 299 escapedInputFilename.replace('.', '_'); |
300 | 300 |
301 // TODO(epoger): what about including the config type within outputFilename?
That way, | 301 // TODO(epoger): what about including the config type within outputFilename?
That way, |
302 // we could combine results of different config types without conflicting fi
lenames. | 302 // we could combine results of different config types without conflicting fi
lenames. |
303 SkString outputFilename; | 303 SkString outputFilename; |
304 const char *outputSubdirPtr = NULL; | 304 const char *outputSubdirPtr = NULL; |
305 if (useChecksumBasedFilenames) { | 305 if (useChecksumBasedFilenames) { |
306 ImageDigest *imageDigestPtr = bitmapAndDigest.getImageDigestPtr(); | 306 ImageDigest *imageDigestPtr = bitmapAndDigest.getImageDigestPtr(); |
307 outputSubdirPtr = escapedInputFilename.c_str(); | 307 outputSubdirPtr = escapedInputFilename.c_str(); |
308 outputFilename.set(imageDigestPtr->getHashType()); | 308 outputFilename.set(imageDigestPtr->getHashType()); |
309 outputFilename.append("_"); | 309 outputFilename.append("_"); |
(...skipping 532 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
842 PictureRenderer* CreateGatherPixelRefsRenderer(const GrContext::Options& opts) { | 842 PictureRenderer* CreateGatherPixelRefsRenderer(const GrContext::Options& opts) { |
843 return SkNEW_ARGS(GatherRenderer, (opts)); | 843 return SkNEW_ARGS(GatherRenderer, (opts)); |
844 } | 844 } |
845 #else | 845 #else |
846 PictureRenderer* CreateGatherPixelRefsRenderer() { | 846 PictureRenderer* CreateGatherPixelRefsRenderer() { |
847 return SkNEW(GatherRenderer); | 847 return SkNEW(GatherRenderer); |
848 } | 848 } |
849 #endif | 849 #endif |
850 | 850 |
851 } // namespace sk_tools | 851 } // namespace sk_tools |
OLD | NEW |