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

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

Issue 23163007: pdfviewer: make pdfviewer compile on mac Base URL: http://skia.googlecode.com/svn/trunk/
Patch Set: Created 7 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 | Annotate | Revision Log
« no previous file with comments | « experimental/PdfViewer/SkPdfUtils.cpp ('k') | experimental/PdfViewer/copy_files.py » ('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 21 matching lines...) Expand all
32 static const Format gFormats[] = { 32 static const Format gFormats[] = {
33 { SkImageEncoder::kBMP_Type, SkImageDecoder::kBMP_Format, ".bmp" }, 33 { SkImageEncoder::kBMP_Type, SkImageDecoder::kBMP_Format, ".bmp" },
34 { SkImageEncoder::kGIF_Type, SkImageDecoder::kGIF_Format, ".gif" }, 34 { SkImageEncoder::kGIF_Type, SkImageDecoder::kGIF_Format, ".gif" },
35 { SkImageEncoder::kICO_Type, SkImageDecoder::kICO_Format, ".ico" }, 35 { SkImageEncoder::kICO_Type, SkImageDecoder::kICO_Format, ".ico" },
36 { SkImageEncoder::kJPEG_Type, SkImageDecoder::kJPEG_Format, ".jpg" }, 36 { SkImageEncoder::kJPEG_Type, SkImageDecoder::kJPEG_Format, ".jpg" },
37 { SkImageEncoder::kPNG_Type, SkImageDecoder::kPNG_Format, ".png" }, 37 { SkImageEncoder::kPNG_Type, SkImageDecoder::kPNG_Format, ".png" },
38 { SkImageEncoder::kWBMP_Type, SkImageDecoder::kWBMP_Format, ".wbmp" }, 38 { SkImageEncoder::kWBMP_Type, SkImageDecoder::kWBMP_Format, ".wbmp" },
39 { SkImageEncoder::kWEBP_Type, SkImageDecoder::kWEBP_Format, ".webp" } 39 { SkImageEncoder::kWEBP_Type, SkImageDecoder::kWEBP_Format, ".webp" }
40 }; 40 };
41 41
42 SkISize opaqueSize(const SkBitmap& bm) { 42 static SkISize opaqueSize(const SkBitmap& bm) {
43 int width = 1; 43 int width = 1;
44 int height = 1; 44 int height = 1;
45 for (int y = 0 ; y < bm.height(); y++) { 45 for (int y = 0 ; y < bm.height(); y++) {
46 for (int x = 0 ; x < bm.width(); x++) { 46 for (int x = 0 ; x < bm.width(); x++) {
47 SkColor color = bm.getColor(x, y); 47 SkColor color = bm.getColor(x, y);
48 if (SkColorGetA(color) != 0) { 48 if (SkColorGetA(color) != 0) {
49 height = y + 1; 49 height = y + 1;
50 width = width > (x + 1) ? width : x + 1; 50 width = width > (x + 1) ? width : x + 1;
51 } 51 }
52 } 52 }
(...skipping 114 matching lines...) Expand 10 before | Expand all | Expand 10 after
167 } 167 }
168 168
169 return 0; 169 return 0;
170 } 170 }
171 171
172 #if !defined SK_BUILD_FOR_IOS 172 #if !defined SK_BUILD_FOR_IOS
173 int main(int argc, char * const argv[]) { 173 int main(int argc, char * const argv[]) {
174 return tool_main(argc, (char**) argv); 174 return tool_main(argc, (char**) argv);
175 } 175 }
176 #endif 176 #endif
OLDNEW
« no previous file with comments | « experimental/PdfViewer/SkPdfUtils.cpp ('k') | experimental/PdfViewer/copy_files.py » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698