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

Side by Side Diff: experimental/PdfViewer/chop_transparency_main.cpp

Issue 322963002: hide SkBitmap::setConfig (Closed) Base URL: https://skia.googlesource.com/skia.git@master
Patch Set: Created 6 years, 6 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 | « debugger/QT/SkRasterWidget.cpp ('k') | experimental/PdfViewer/pdf_viewer_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 2013 Google Inc. 2 * Copyright 2013 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 "SkBitmap.h" 8 #include "SkBitmap.h"
9 #include "SkColorPriv.h" 9 #include "SkColorPriv.h"
10 #include "SkCommandLineFlags.h" 10 #include "SkCommandLineFlags.h"
(...skipping 40 matching lines...) Expand 10 before | Expand all | Expand 10 after
51 height = y + 1; 51 height = y + 1;
52 width = width > (x + 1) ? width : x + 1; 52 width = width > (x + 1) ? width : x + 1;
53 } 53 }
54 } 54 }
55 } 55 }
56 56
57 return SkISize::Make(width, height); 57 return SkISize::Make(width, height);
58 } 58 }
59 59
60 static void setup_bitmap(SkBitmap* bitmap, int width, int height) { 60 static void setup_bitmap(SkBitmap* bitmap, int width, int height) {
61 bitmap->setConfig(SkBitmap::kARGB_8888_Config, width, height); 61 bitmap->allocN32Pixels(width, height);
62
63 bitmap->allocPixels();
64 } 62 }
65 63
66 64
67 static bool write_bitmap(const char outName[], const SkBitmap& bm) { 65 static bool write_bitmap(const char outName[], const SkBitmap& bm) {
68 SkISize size = opaqueSize(bm); 66 SkISize size = opaqueSize(bm);
69 SkBitmap dst; 67 SkBitmap dst;
70 setup_bitmap(&dst, size.width(), size.height()); 68 setup_bitmap(&dst, size.width(), size.height());
71 69
72 for (int y = 0 ; y < dst.height(); y++) { 70 for (int y = 0 ; y < dst.height(); y++) {
73 for (int x = 0 ; x < dst.width(); x++) { 71 for (int x = 0 ; x < dst.width(); x++) {
(...skipping 95 matching lines...) Expand 10 before | Expand all | Expand 10 after
169 } 167 }
170 168
171 return 0; 169 return 0;
172 } 170 }
173 171
174 #if !defined SK_BUILD_FOR_IOS 172 #if !defined SK_BUILD_FOR_IOS
175 int main(int argc, char * const argv[]) { 173 int main(int argc, char * const argv[]) {
176 return tool_main(argc, (char**) argv); 174 return tool_main(argc, (char**) argv);
177 } 175 }
178 #endif 176 #endif
OLDNEW
« no previous file with comments | « debugger/QT/SkRasterWidget.cpp ('k') | experimental/PdfViewer/pdf_viewer_main.cpp » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698