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 284 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
295 | 295 |
296 SkBitmap bitmap; | 296 SkBitmap bitmap; |
297 SkISize size = canvas->getDeviceSize(); | 297 SkISize size = canvas->getDeviceSize(); |
298 setup_bitmap(&bitmap, size.width(), size.height()); | 298 setup_bitmap(&bitmap, size.width(), size.height()); |
299 | 299 |
300 canvas->readPixels(&bitmap, 0, 0); | 300 canvas->readPixels(&bitmap, 0, 0); |
301 force_all_opaque(bitmap); | 301 force_all_opaque(bitmap); |
302 BitmapAndDigest bitmapAndDigest(bitmap); | 302 BitmapAndDigest bitmapAndDigest(bitmap); |
303 | 303 |
304 SkString escapedInputFilename(inputFilename); | 304 SkString escapedInputFilename(inputFilename); |
305 replace_char(&escapedInputFilename, '.', '_'); | 305 escapedInputFilename.replace('.', '_'); |
306 | 306 |
307 // TODO(epoger): what about including the config type within outputFilename?
That way, | 307 // TODO(epoger): what about including the config type within outputFilename?
That way, |
308 // we could combine results of different config types without conflicting fi
lenames. | 308 // we could combine results of different config types without conflicting fi
lenames. |
309 SkString outputFilename; | 309 SkString outputFilename; |
310 const char *outputSubdirPtr = NULL; | 310 const char *outputSubdirPtr = NULL; |
311 if (useChecksumBasedFilenames) { | 311 if (useChecksumBasedFilenames) { |
312 ImageDigest *imageDigestPtr = bitmapAndDigest.getImageDigestPtr(); | 312 ImageDigest *imageDigestPtr = bitmapAndDigest.getImageDigestPtr(); |
313 outputSubdirPtr = escapedInputFilename.c_str(); | 313 outputSubdirPtr = escapedInputFilename.c_str(); |
314 outputFilename.set(imageDigestPtr->getHashType()); | 314 outputFilename.set(imageDigestPtr->getHashType()); |
315 outputFilename.append("_"); | 315 outputFilename.append("_"); |
(...skipping 537 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
853 PictureRenderer* CreateGatherPixelRefsRenderer(const GrContext::Options& opts) { | 853 PictureRenderer* CreateGatherPixelRefsRenderer(const GrContext::Options& opts) { |
854 return SkNEW_ARGS(GatherRenderer, (opts)); | 854 return SkNEW_ARGS(GatherRenderer, (opts)); |
855 } | 855 } |
856 #else | 856 #else |
857 PictureRenderer* CreateGatherPixelRefsRenderer() { | 857 PictureRenderer* CreateGatherPixelRefsRenderer() { |
858 return SkNEW(GatherRenderer); | 858 return SkNEW(GatherRenderer); |
859 } | 859 } |
860 #endif | 860 #endif |
861 | 861 |
862 } // namespace sk_tools | 862 } // namespace sk_tools |
OLD | NEW |