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

Unified Diff: ui/gfx/codec/png_codec.cc

Issue 2927893002: Remove FORMAT_RGB from gfx::PngCodec (Closed)
Patch Set: Compile fixes Created 3 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 side-by-side diff with in-line comments
Download patch
« no previous file with comments | « ui/gfx/codec/png_codec.h ('k') | ui/gfx/codec/png_codec_unittest.cc » ('j') | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: ui/gfx/codec/png_codec.cc
diff --git a/ui/gfx/codec/png_codec.cc b/ui/gfx/codec/png_codec.cc
index 69a00c19449403b6a3853627217af1e18b838cfc..fe4020596fc9c3ba32609719060a727554b07e81 100644
--- a/ui/gfx/codec/png_codec.cc
+++ b/ui/gfx/codec/png_codec.cc
@@ -206,9 +206,6 @@ void DecodeInfoCallback(png_struct* png_ptr, png_info* info_ptr) {
// Pick our row format converter necessary for this data.
if (!input_has_alpha) {
switch (state->output_format) {
- case PNGCodec::FORMAT_RGB:
- state->output_channels = 3;
- break;
case PNGCodec::FORMAT_RGBA:
state->output_channels = 4;
png_set_add_alpha(png_ptr, 0xFF, PNG_FILLER_AFTER);
@@ -225,10 +222,6 @@ void DecodeInfoCallback(png_struct* png_ptr, png_info* info_ptr) {
}
} else {
switch (state->output_format) {
- case PNGCodec::FORMAT_RGB:
- state->output_channels = 3;
- png_set_strip_alpha(png_ptr);
- break;
case PNGCodec::FORMAT_RGBA:
state->output_channels = 4;
break;
@@ -634,12 +627,6 @@ bool EncodeWithCompressionLevel(const unsigned char* input,
int input_color_components, output_color_components;
int png_output_color_type;
switch (format) {
- case PNGCodec::FORMAT_RGB:
- input_color_components = 3;
- output_color_components = 3;
- png_output_color_type = PNG_COLOR_TYPE_RGB;
- break;
-
case PNGCodec::FORMAT_RGBA:
input_color_components = 4;
if (discard_transparency) {
« no previous file with comments | « ui/gfx/codec/png_codec.h ('k') | ui/gfx/codec/png_codec_unittest.cc » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698