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

Side by Side Diff: tools/picture_utils.cpp

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/picture_utils.h ('k') | tools/render_pictures_main.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 #include "picture_utils.h" 8 #include "picture_utils.h"
9 #include "SkColorPriv.h" 9 #include "SkColorPriv.h"
10 #include "SkBitmap.h" 10 #include "SkBitmap.h"
(...skipping 18 matching lines...) Expand all
29 } 29 }
30 30
31 SkAutoLockPixels lock(bitmap); 31 SkAutoLockPixels lock(bitmap);
32 for (int y = 0; y < bitmap.height(); y++) { 32 for (int y = 0; y < bitmap.height(); y++) {
33 for (int x = 0; x < bitmap.width(); x++) { 33 for (int x = 0; x < bitmap.width(); x++) {
34 *bitmap.getAddr32(x, y) |= (SK_A32_MASK << SK_A32_SHIFT); 34 *bitmap.getAddr32(x, y) |= (SK_A32_MASK << SK_A32_SHIFT);
35 } 35 }
36 } 36 }
37 } 37 }
38 38
39 void replace_char(SkString* str, const char oldChar, const char newChar) {
40 if (NULL == str) {
41 return;
42 }
43 for (size_t i = 0; i < str->size(); ++i) {
44 if (oldChar == str->operator[](i)) {
45 str->operator[](i) = newChar;
46 }
47 }
48 }
49
39 void make_filepath(SkString* path, const SkString& dir, const SkString& name ) { 50 void make_filepath(SkString* path, const SkString& dir, const SkString& name ) {
40 size_t len = dir.size(); 51 size_t len = dir.size();
41 path->set(dir); 52 path->set(dir);
42 if (0 < len && '/' != dir[len - 1]) { 53 if (0 < len && '/' != dir[len - 1]) {
43 path->append("/"); 54 path->append("/");
44 } 55 }
45 path->append(name); 56 path->append(name);
46 } 57 }
47 58
48 void get_basename(SkString* basename, const SkString& path) { 59 void get_basename(SkString* basename, const SkString& path) {
(...skipping 33 matching lines...) Expand 10 before | Expand all | Expand 10 after
82 SkString skString(string); 93 SkString skString(string);
83 return skString.endsWith("%"); 94 return skString.endsWith("%");
84 } 95 }
85 96
86 void setup_bitmap(SkBitmap* bitmap, int width, int height) { 97 void setup_bitmap(SkBitmap* bitmap, int width, int height) {
87 bitmap->setConfig(SkBitmap::kARGB_8888_Config, width, height); 98 bitmap->setConfig(SkBitmap::kARGB_8888_Config, width, height);
88 bitmap->allocPixels(); 99 bitmap->allocPixels();
89 bitmap->eraseColor(SK_ColorTRANSPARENT); 100 bitmap->eraseColor(SK_ColorTRANSPARENT);
90 } 101 }
91 } 102 }
OLDNEW
« no previous file with comments | « tools/picture_utils.h ('k') | tools/render_pictures_main.cpp » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698