| 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 925 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 936 static_cast<JDIMENSION>(decoded_size_.Height())); | 936 static_cast<JDIMENSION>(decoded_size_.Height())); |
| 937 | 937 |
| 938 if (!buffer.AllocatePixelData(info->output_width, info->output_height, | 938 if (!buffer.AllocatePixelData(info->output_width, info->output_height, |
| 939 ColorSpaceForSkImages())) | 939 ColorSpaceForSkImages())) |
| 940 return SetFailed(); | 940 return SetFailed(); |
| 941 | 941 |
| 942 buffer.ZeroFillPixelData(); | 942 buffer.ZeroFillPixelData(); |
| 943 // The buffer is transparent outside the decoded area while the image is | 943 // The buffer is transparent outside the decoded area while the image is |
| 944 // loading. The image will be marked fully opaque in Complete(). | 944 // loading. The image will be marked fully opaque in Complete(). |
| 945 buffer.SetStatus(ImageFrame::kFramePartial); | 945 buffer.SetStatus(ImageFrame::kFramePartial); |
| 946 buffer.SetHasAlpha(true); | |
| 947 | 946 |
| 948 // For JPEGs, the frame always fills the entire image. | 947 // For JPEGs, the frame always fills the entire image. |
| 949 buffer.SetOriginalFrameRect(IntRect(IntPoint(), Size())); | 948 buffer.SetOriginalFrameRect(IntRect(IntPoint(), Size())); |
| 950 } | 949 } |
| 951 | 950 |
| 952 #if defined(TURBO_JPEG_RGB_SWIZZLE) | 951 #if defined(TURBO_JPEG_RGB_SWIZZLE) |
| 953 if (turboSwizzled(info->out_color_space)) { | 952 if (turboSwizzled(info->out_color_space)) { |
| 954 while (info->output_scanline < info->output_height) { | 953 while (info->output_scanline < info->output_height) { |
| 955 unsigned char* row = reinterpret_cast_ptr<unsigned char*>( | 954 unsigned char* row = reinterpret_cast_ptr<unsigned char*>( |
| 956 buffer.GetAddr(0, info->output_scanline)); | 955 buffer.GetAddr(0, info->output_scanline)); |
| (...skipping 51 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 1008 // has failed. | 1007 // has failed. |
| 1009 if (!reader_->Decode(only_size) && IsAllDataReceived()) | 1008 if (!reader_->Decode(only_size) && IsAllDataReceived()) |
| 1010 SetFailed(); | 1009 SetFailed(); |
| 1011 | 1010 |
| 1012 // If decoding is done or failed, we don't need the JPEGImageReader anymore. | 1011 // If decoding is done or failed, we don't need the JPEGImageReader anymore. |
| 1013 if (IsComplete(this, only_size) || Failed()) | 1012 if (IsComplete(this, only_size) || Failed()) |
| 1014 reader_.reset(); | 1013 reader_.reset(); |
| 1015 } | 1014 } |
| 1016 | 1015 |
| 1017 } // namespace blink | 1016 } // namespace blink |
| OLD | NEW |