twiz@google.com | 6cf5303 | 2012-06-22 18:55:55 +0000 | [diff] [blame] | 1 | /* |
| 2 | * Copyright 2012 Google Inc. |
| 3 | * |
| 4 | * Use of this source code is governed by a BSD-style license that can be |
| 5 | * found in the LICENSE file. |
| 6 | */ |
| 7 | |
| 8 | #ifndef picture_utils_DEFINED |
| 9 | #define picture_utils_DEFINED |
| 10 | #include "SkTypes.h" |
| 11 | |
| 12 | class SkBitmap; |
| 13 | class SkFILEStream; |
| 14 | class SkString; |
| 15 | class SkPicture; |
| 16 | |
| 17 | namespace sk_tools { |
| 18 | // Creates a posix style filepath by concatenating name onto dir with a |
| 19 | // forward slash into path. |
keyar@chromium.org | 1cbd47c | 2012-07-13 18:22:59 +0000 | [diff] [blame] | 20 | void make_filepath(SkString* path, const SkString&, const SkString& name); |
twiz@google.com | 6cf5303 | 2012-06-22 18:55:55 +0000 | [diff] [blame] | 21 | |
keyar@chromium.org | d1dc920 | 2012-07-09 18:32:08 +0000 | [diff] [blame] | 22 | // Returns the last part of the path (file name or leaf directory name) |
| 23 | // |
| 24 | // This basically just looks for a foward slash or backslash (windows |
| 25 | // only) |
| 26 | void get_basename(SkString* basename, const SkString& path); |
| 27 | |
keyar@chromium.org | 163b567 | 2012-08-01 17:53:29 +0000 | [diff] [blame] | 28 | // Returns true if the string ends with % |
| 29 | bool is_percentage(char* const string); |
| 30 | |
twiz@google.com | 6cf5303 | 2012-06-22 18:55:55 +0000 | [diff] [blame] | 31 | // Prepares the bitmap so that it can be written. |
| 32 | // |
| 33 | // Specifically, it configures the bitmap, allocates pixels and then |
| 34 | // erases the pixels to transparent black. |
| 35 | void setup_bitmap(SkBitmap* bitmap, int width, int height); |
| 36 | } |
| 37 | |
| 38 | #endif // picture_utils_DEFINED |