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

Side by Side Diff: tools/picture_utils.cpp

Issue 428443002: Cleanup: Rename SkOSPath functions. (Closed) Base URL: https://skia.googlesource.com/skia.git@master
Patch Set: fix Created 6 years, 4 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/lua/lua_pictures.cpp ('k') | tools/render_pdfs_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 "SkBitmap.h" 9 #include "SkBitmap.h"
10 #include "SkColorPriv.h" 10 #include "SkColorPriv.h"
(...skipping 37 matching lines...) Expand 10 before | Expand all | Expand 10 after
48 48
49 void setup_bitmap(SkBitmap* bitmap, int width, int height) { 49 void setup_bitmap(SkBitmap* bitmap, int width, int height) {
50 bitmap->allocN32Pixels(width, height); 50 bitmap->allocN32Pixels(width, height);
51 bitmap->eraseColor(SK_ColorTRANSPARENT); 51 bitmap->eraseColor(SK_ColorTRANSPARENT);
52 } 52 }
53 53
54 bool write_bitmap_to_disk(const SkBitmap& bm, const SkString& dirPath, 54 bool write_bitmap_to_disk(const SkBitmap& bm, const SkString& dirPath,
55 const char *subdirOrNull, const SkString& baseName ) { 55 const char *subdirOrNull, const SkString& baseName ) {
56 SkString partialPath; 56 SkString partialPath;
57 if (subdirOrNull) { 57 if (subdirOrNull) {
58 partialPath = SkOSPath::SkPathJoin(dirPath.c_str(), subdirOrNull); 58 partialPath = SkOSPath::Join(dirPath.c_str(), subdirOrNull);
59 sk_mkdir(partialPath.c_str()); 59 sk_mkdir(partialPath.c_str());
60 } else { 60 } else {
61 partialPath.set(dirPath); 61 partialPath.set(dirPath);
62 } 62 }
63 SkString fullPath = SkOSPath::SkPathJoin(partialPath.c_str(), baseName.c _str()); 63 SkString fullPath = SkOSPath::Join(partialPath.c_str(), baseName.c_str() );
64 if (SkImageEncoder::EncodeFile(fullPath.c_str(), bm, SkImageEncoder::kPN G_Type, 100)) { 64 if (SkImageEncoder::EncodeFile(fullPath.c_str(), bm, SkImageEncoder::kPN G_Type, 100)) {
65 return true; 65 return true;
66 } else { 66 } else {
67 SkDebugf("Failed to write the bitmap to %s.\n", fullPath.c_str()); 67 SkDebugf("Failed to write the bitmap to %s.\n", fullPath.c_str());
68 return false; 68 return false;
69 } 69 }
70 } 70 }
71 71
72 } // namespace sk_tools 72 } // namespace sk_tools
OLDNEW
« no previous file with comments | « tools/lua/lua_pictures.cpp ('k') | tools/render_pdfs_main.cpp » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698