Chromium Code Reviews
chromiumcodereview-hr@appspot.gserviceaccount.com (chromiumcodereview-hr) | Please choose your nickname with Settings | Help | Chromium Project | Gerrit Changes | Sign out
(1432)

Side by Side Diff: tools/picture_utils.h

Issue 226293002: add explicit filepaths to render_pictures JSON summary (Closed) Base URL: https://skia.googlesource.com/skia.git@master
Patch Set: rebase Created 6 years, 8 months ago
Use n/p to move between diff chunks; N/P to move between comments. Draft comments are only viewable by you.
Jump to:
View unified diff | Download patch
« no previous file with comments | « tools/PictureRenderer.cpp ('k') | tools/picture_utils.cpp » ('j') | no next file with comments »
Toggle Intra-line Diffs ('i') | Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
OLDNEW
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
11 #include "SkTypes.h" 11 #include "SkTypes.h"
12 12
13 class SkBitmap; 13 class SkBitmap;
14 class SkFILEStream; 14 class SkFILEStream;
15 class SkPicture; 15 class SkPicture;
16 class SkString; 16 class SkString;
17 17
18 namespace sk_tools { 18 namespace sk_tools {
19 // since PNG insists on unpremultiplying our alpha, we take no precision 19 // since PNG insists on unpremultiplying our alpha, we take no precision
20 // chances and force all pixels to be 100% opaque, otherwise on compare we 20 // chances and force all pixels to be 100% opaque, otherwise on compare we
21 // may not get a perfect match. 21 // may not get a perfect match.
22 // 22 //
23 // This expects a bitmap with a config type of 8888 and for the pixels to 23 // This expects a bitmap with a config type of 8888 and for the pixels to
24 // not be on the GPU. 24 // not be on the GPU.
25 void force_all_opaque(const SkBitmap& bitmap); 25 void force_all_opaque(const SkBitmap& bitmap);
26 26
27 /**
28 * Replaces all instances of oldChar with newChar in str.
29 *
30 * TODO: This function appears here and in skimage_main.cpp ;
31 * we should add the implementation to src/core/SkString.cpp, write tests fo r it,
32 * and remove it from elsewhere.
33 */
34 void replace_char(SkString* str, const char oldChar, const char newChar);
35
27 // Creates a posix style filepath by concatenating name onto dir with a 36 // Creates a posix style filepath by concatenating name onto dir with a
28 // forward slash into path. 37 // forward slash into path.
38 // TODO(epoger): delete in favor of SkOSPath::SkPathJoin()?
29 void make_filepath(SkString* path, const SkString&, const SkString& name); 39 void make_filepath(SkString* path, const SkString&, const SkString& name);
30 40
31 // Returns the last part of the path (file name or leaf directory name) 41 // Returns the last part of the path (file name or leaf directory name)
32 // 42 //
33 // This basically just looks for a foward slash or backslash (windows 43 // This basically just looks for a foward slash or backslash (windows
34 // only). 44 // only).
45 // TODO(epoger): delete in favor of SkOSPath::SkBasename()?
35 void get_basename(SkString* basename, const SkString& path); 46 void get_basename(SkString* basename, const SkString& path);
36 47
37 // Returns true if the string ends with % 48 // Returns true if the string ends with %
38 bool is_percentage(const char* const string); 49 bool is_percentage(const char* const string);
39 50
40 // Prepares the bitmap so that it can be written. 51 // Prepares the bitmap so that it can be written.
41 // 52 //
42 // Specifically, it configures the bitmap, allocates pixels and then 53 // Specifically, it configures the bitmap, allocates pixels and then
43 // erases the pixels to transparent black. 54 // erases the pixels to transparent black.
44 void setup_bitmap(SkBitmap* bitmap, int width, int height); 55 void setup_bitmap(SkBitmap* bitmap, int width, int height);
45 } 56 }
46 57
47 #endif // picture_utils_DEFINED 58 #endif // picture_utils_DEFINED
OLDNEW
« no previous file with comments | « tools/PictureRenderer.cpp ('k') | tools/picture_utils.cpp » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698