| 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 #ifndef picture_utils_DEFINED | 8 #ifndef picture_utils_DEFINED |
| 9 #define picture_utils_DEFINED | 9 #define picture_utils_DEFINED |
| 10 | 10 |
| (...skipping 35 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 46 void get_basename(SkString* basename, const SkString& path); | 46 void get_basename(SkString* basename, const SkString& path); |
| 47 | 47 |
| 48 // Returns true if the string ends with % | 48 // Returns true if the string ends with % |
| 49 bool is_percentage(const char* const string); | 49 bool is_percentage(const char* const string); |
| 50 | 50 |
| 51 // Prepares the bitmap so that it can be written. | 51 // Prepares the bitmap so that it can be written. |
| 52 // | 52 // |
| 53 // Specifically, it configures the bitmap, allocates pixels and then | 53 // Specifically, it configures the bitmap, allocates pixels and then |
| 54 // erases the pixels to transparent black. | 54 // erases the pixels to transparent black. |
| 55 void setup_bitmap(SkBitmap* bitmap, int width, int height); | 55 void setup_bitmap(SkBitmap* bitmap, int width, int height); |
| 56 } | 56 |
| 57 /** |
| 58 * Write a bitmap file to disk. |
| 59 * |
| 60 * @param bm the bitmap to record |
| 61 * @param dirPath directory within which to write the image file |
| 62 * @param subdirOrNull subdirectory within dirPath, or NULL to just write in
to dirPath |
| 63 * @param baseName last part of the filename |
| 64 * |
| 65 * @return true if written out successfully |
| 66 */ |
| 67 bool write_bitmap_to_disk(const SkBitmap& bm, const SkString& dirPath, |
| 68 const char *subdirOrNull, const SkString& baseName
); |
| 69 |
| 70 } // namespace sk_tools |
| 57 | 71 |
| 58 #endif // picture_utils_DEFINED | 72 #endif // picture_utils_DEFINED |
| OLD | NEW |