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

Side by Side Diff: src/images/SkImageDecoder_libpng.cpp

Issue 54603004: Revert "Revert "add SK_ATTR_DEPRECATED -- will need to disable for chrome, since it triggers a warn… (Closed) Base URL: https://skia.googlecode.com/svn/trunk
Patch Set: Created 7 years, 1 month 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 | « src/images/SkImageDecoder.cpp ('k') | src/images/SkImageDecoder_libwebp.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 /* 2 /*
3 * Copyright 2006 The Android Open Source Project 3 * Copyright 2006 The Android Open Source Project
4 * 4 *
5 * Use of this source code is governed by a BSD-style license that can be 5 * Use of this source code is governed by a BSD-style license that can be
6 * found in the LICENSE file. 6 * found in the LICENSE file.
7 */ 7 */
8 8
9 9
10 #include "SkImageDecoder.h" 10 #include "SkImageDecoder.h"
(...skipping 1105 matching lines...) Expand 10 before | Expand all | Expand 10 after
1116 bool doEncode(SkWStream* stream, const SkBitmap& bm, 1116 bool doEncode(SkWStream* stream, const SkBitmap& bm,
1117 const bool& hasAlpha, int colorType, 1117 const bool& hasAlpha, int colorType,
1118 int bitDepth, SkBitmap::Config config, 1118 int bitDepth, SkBitmap::Config config,
1119 png_color_8& sig_bit); 1119 png_color_8& sig_bit);
1120 1120
1121 typedef SkImageEncoder INHERITED; 1121 typedef SkImageEncoder INHERITED;
1122 }; 1122 };
1123 1123
1124 bool SkPNGImageEncoder::onEncode(SkWStream* stream, const SkBitmap& bitmap, 1124 bool SkPNGImageEncoder::onEncode(SkWStream* stream, const SkBitmap& bitmap,
1125 int /*quality*/) { 1125 int /*quality*/) {
1126 SkBitmap::Config config = bitmap.getConfig(); 1126 SkBitmap::Config config = bitmap.config();
1127 1127
1128 const bool hasAlpha = !bitmap.isOpaque(); 1128 const bool hasAlpha = !bitmap.isOpaque();
1129 int colorType = PNG_COLOR_MASK_COLOR; 1129 int colorType = PNG_COLOR_MASK_COLOR;
1130 int bitDepth = 8; // default for color 1130 int bitDepth = 8; // default for color
1131 png_color_8 sig_bit; 1131 png_color_8 sig_bit;
1132 1132
1133 switch (config) { 1133 switch (config) {
1134 case SkBitmap::kIndex8_Config: 1134 case SkBitmap::kIndex8_Config:
1135 colorType |= PNG_COLOR_MASK_PALETTE; 1135 colorType |= PNG_COLOR_MASK_PALETTE;
1136 // fall through to the ARGB_8888 case 1136 // fall through to the ARGB_8888 case
(...skipping 154 matching lines...) Expand 10 before | Expand all | Expand 10 after
1291 return SkImageDecoder::kUnknown_Format; 1291 return SkImageDecoder::kUnknown_Format;
1292 } 1292 }
1293 1293
1294 SkImageEncoder* sk_libpng_efactory(SkImageEncoder::Type t) { 1294 SkImageEncoder* sk_libpng_efactory(SkImageEncoder::Type t) {
1295 return (SkImageEncoder::kPNG_Type == t) ? SkNEW(SkPNGImageEncoder) : NULL; 1295 return (SkImageEncoder::kPNG_Type == t) ? SkNEW(SkPNGImageEncoder) : NULL;
1296 } 1296 }
1297 1297
1298 static SkImageDecoder_DecodeReg gDReg(sk_libpng_dfactory); 1298 static SkImageDecoder_DecodeReg gDReg(sk_libpng_dfactory);
1299 static SkImageDecoder_FormatReg gFormatReg(get_format_png); 1299 static SkImageDecoder_FormatReg gFormatReg(get_format_png);
1300 static SkImageEncoder_EncodeReg gEReg(sk_libpng_efactory); 1300 static SkImageEncoder_EncodeReg gEReg(sk_libpng_efactory);
OLDNEW
« no previous file with comments | « src/images/SkImageDecoder.cpp ('k') | src/images/SkImageDecoder_libwebp.cpp » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698