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

Side by Side Diff: third_party/WebKit/Source/platform/image-decoders/jpeg/JPEGImageDecoder.cpp

Issue 2756463003: Remove opaque alpha channel special case (Closed)
Patch Set: Fix gif detecting if a frame claims to have transparency Created 3 years, 9 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
OLDNEW
1 /* 1 /*
2 * Copyright (C) 2006 Apple Computer, Inc. 2 * Copyright (C) 2006 Apple Computer, Inc.
3 * 3 *
4 * Portions are Copyright (C) 2001-6 mozilla.org 4 * Portions are Copyright (C) 2001-6 mozilla.org
5 * 5 *
6 * Other contributors: 6 * Other contributors:
7 * Stuart Parmenter <stuart@mozilla.com> 7 * Stuart Parmenter <stuart@mozilla.com>
8 * 8 *
9 * This library is free software; you can redistribute it and/or 9 * This library is free software; you can redistribute it and/or
10 * modify it under the terms of the GNU Lesser General Public 10 * modify it under the terms of the GNU Lesser General Public
(...skipping 927 matching lines...) Expand 10 before | Expand all | Expand 10 after
938 static_cast<JDIMENSION>(m_decodedSize.height())); 938 static_cast<JDIMENSION>(m_decodedSize.height()));
939 939
940 if (!buffer.allocatePixelData(info->output_width, info->output_height, 940 if (!buffer.allocatePixelData(info->output_width, info->output_height,
941 colorSpaceForSkImages())) 941 colorSpaceForSkImages()))
942 return setFailed(); 942 return setFailed();
943 943
944 buffer.zeroFillPixelData(); 944 buffer.zeroFillPixelData();
945 // The buffer is transparent outside the decoded area while the image is 945 // The buffer is transparent outside the decoded area while the image is
946 // loading. The image will be marked fully opaque in complete(). 946 // loading. The image will be marked fully opaque in complete().
947 buffer.setStatus(ImageFrame::FramePartial); 947 buffer.setStatus(ImageFrame::FramePartial);
948 buffer.setHasAlpha(true);
Peter Kasting 2017/03/22 23:37:47 I think this already got removed in another CL?
cblume 2017/05/08 10:28:02 I don't see it in any of my other CLs after a quic
949 948
950 // For JPEGs, the frame always fills the entire image. 949 // For JPEGs, the frame always fills the entire image.
951 buffer.setOriginalFrameRect(IntRect(IntPoint(), size())); 950 buffer.setOriginalFrameRect(IntRect(IntPoint(), size()));
952 } 951 }
953 952
954 #if defined(TURBO_JPEG_RGB_SWIZZLE) 953 #if defined(TURBO_JPEG_RGB_SWIZZLE)
955 if (turboSwizzled(info->out_color_space)) { 954 if (turboSwizzled(info->out_color_space)) {
956 while (info->output_scanline < info->output_height) { 955 while (info->output_scanline < info->output_height) {
957 unsigned char* row = reinterpret_cast_ptr<unsigned char*>( 956 unsigned char* row = reinterpret_cast_ptr<unsigned char*>(
958 buffer.getAddr(0, info->output_scanline)); 957 buffer.getAddr(0, info->output_scanline));
(...skipping 51 matching lines...) Expand 10 before | Expand all | Expand 10 after
1010 // has failed. 1009 // has failed.
1011 if (!m_reader->decode(onlySize) && isAllDataReceived()) 1010 if (!m_reader->decode(onlySize) && isAllDataReceived())
1012 setFailed(); 1011 setFailed();
1013 1012
1014 // If decoding is done or failed, we don't need the JPEGImageReader anymore. 1013 // If decoding is done or failed, we don't need the JPEGImageReader anymore.
1015 if (isComplete(this, onlySize) || failed()) 1014 if (isComplete(this, onlySize) || failed())
1016 m_reader.reset(); 1015 m_reader.reset();
1017 } 1016 }
1018 1017
1019 } // namespace blink 1018 } // namespace blink
OLDNEW

Powered by Google App Engine
This is Rietveld 408576698