| OLD | NEW |
| 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 928 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 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 | 945 |
| 946 // The buffer is transparent outside the decoded area while the image is | 946 // The buffer is transparent outside the decoded area while the image is |
| 947 // loading. The image will be marked fully opaque in complete(). | 947 // loading. The image will be marked fully opaque in complete(). |
| 948 buffer.setStatus(ImageFrame::FramePartial); | 948 buffer.setStatus(ImageFrame::FramePartial); |
| 949 buffer.setHasAlpha(true); | |
| 950 | 949 |
| 951 // For JPEGs, the frame always fills the entire image. | 950 // For JPEGs, the frame always fills the entire image. |
| 952 buffer.setOriginalFrameRect(IntRect(IntPoint(), size())); | 951 buffer.setOriginalFrameRect(IntRect(IntPoint(), size())); |
| 953 } | 952 } |
| 954 | 953 |
| 955 #if defined(TURBO_JPEG_RGB_SWIZZLE) | 954 #if defined(TURBO_JPEG_RGB_SWIZZLE) |
| 956 if (turboSwizzled(info->out_color_space)) { | 955 if (turboSwizzled(info->out_color_space)) { |
| 957 while (info->output_scanline < info->output_height) { | 956 while (info->output_scanline < info->output_height) { |
| 958 unsigned char* row = reinterpret_cast_ptr<unsigned char*>( | 957 unsigned char* row = reinterpret_cast_ptr<unsigned char*>( |
| 959 buffer.getAddr(0, info->output_scanline)); | 958 buffer.getAddr(0, info->output_scanline)); |
| (...skipping 51 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 1011 // has failed. | 1010 // has failed. |
| 1012 if (!m_reader->decode(onlySize) && isAllDataReceived()) | 1011 if (!m_reader->decode(onlySize) && isAllDataReceived()) |
| 1013 setFailed(); | 1012 setFailed(); |
| 1014 | 1013 |
| 1015 // If decoding is done or failed, we don't need the JPEGImageReader anymore. | 1014 // If decoding is done or failed, we don't need the JPEGImageReader anymore. |
| 1016 if (isComplete(this, onlySize) || failed()) | 1015 if (isComplete(this, onlySize) || failed()) |
| 1017 m_reader.reset(); | 1016 m_reader.reset(); |
| 1018 } | 1017 } |
| 1019 | 1018 |
| 1020 } // namespace blink | 1019 } // namespace blink |
| OLD | NEW |