Chromium Code Reviews| OLD | NEW |
|---|---|
| 1 /* | 1 /* |
| 2 * Copyright (C) Research In Motion Limited 2009-2010. All rights reserved. | 2 * Copyright (C) Research In Motion Limited 2009-2010. All rights reserved. |
| 3 * | 3 * |
| 4 * This library is free software; you can redistribute it and/or | 4 * This library is free software; you can redistribute it and/or |
| 5 * modify it under the terms of the GNU Library General Public | 5 * modify it under the terms of the GNU Library General Public |
| 6 * License as published by the Free Software Foundation; either | 6 * License as published by the Free Software Foundation; either |
| 7 * version 2 of the License, or (at your option) any later version. | 7 * version 2 of the License, or (at your option) any later version. |
| 8 * | 8 * |
| 9 * This library is distributed in the hope that it will be useful, | 9 * This library is distributed in the hope that it will be useful, |
| 10 * but WITHOUT ANY WARRANTY; without even the implied warranty of | 10 * but WITHOUT ANY WARRANTY; without even the implied warranty of |
| (...skipping 128 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... | |
| 139 decode(index); | 139 decode(index); |
| 140 PlatformInstrumentation::didDecodeImage(); | 140 PlatformInstrumentation::didDecodeImage(); |
| 141 } | 141 } |
| 142 | 142 |
| 143 frame->notifyBitmapIfPixelsChanged(); | 143 frame->notifyBitmapIfPixelsChanged(); |
| 144 return frame; | 144 return frame; |
| 145 } | 145 } |
| 146 | 146 |
| 147 bool ImageDecoder::frameHasAlphaAtIndex(size_t index) const | 147 bool ImageDecoder::frameHasAlphaAtIndex(size_t index) const |
| 148 { | 148 { |
| 149 return !frameIsCompleteAtIndex(index) || m_frameBufferCache[index].hasAlpha( ); | 149 return index >= m_frameBufferCache.size() |
| 150 || m_frameBufferCache[index].getStatus() == ImageFrame::FramePartial | |
|
aleksandar.stojiljkovic
2016/05/11 11:05:16
As I still didn't fix BMPImageDecoder alpha handli
scroggo_chromium
2016/05/11 15:17:34
FWIW, you didn't fix PNGImageDecoder (or, you fixe
Peter Kasting
2016/05/11 18:29:34
I think you want "!= ImageFrame::FrameComplete", b
aleksandar.stojiljkovic
2016/05/16 13:09:49
Now the patch fixed the former PNG and BMP decoder
scroggo_chromium
2016/05/16 20:32:08
My preference is that *if* we have two separate me
Peter Kasting
2016/05/16 20:35:53
What I want is for the following two things to be
scroggo_chromium
2016/05/16 20:40:56
Yes, that sounds good to me.
| |
| 151 || m_frameBufferCache[index].hasAlpha(); | |
| 150 } | 152 } |
| 151 | 153 |
| 152 bool ImageDecoder::frameIsCompleteAtIndex(size_t index) const | 154 bool ImageDecoder::frameIsFullyReceivedAtIndex(size_t index) const |
| 153 { | 155 { |
| 154 return (index < m_frameBufferCache.size()) && | 156 return m_isAllDataReceived; |
| 155 (m_frameBufferCache[index].getStatus() == ImageFrame::FrameComplete); | |
| 156 } | 157 } |
| 157 | 158 |
| 158 size_t ImageDecoder::frameBytesAtIndex(size_t index) const | 159 size_t ImageDecoder::frameBytesAtIndex(size_t index) const |
| 159 { | 160 { |
| 160 if (index >= m_frameBufferCache.size() || m_frameBufferCache[index].getStatu s() == ImageFrame::FrameEmpty) | 161 if (index >= m_frameBufferCache.size() || m_frameBufferCache[index].getStatu s() == ImageFrame::FrameEmpty) |
| 161 return 0; | 162 return 0; |
| 162 | 163 |
| 163 struct ImageSize { | 164 struct ImageSize { |
| 164 | 165 |
| 165 explicit ImageSize(IntSize size) | 166 explicit ImageSize(IntSize size) |
| (...skipping 192 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... | |
| 358 | 359 |
| 359 qcms_data_type dataFormat = hasAlpha ? QCMS_DATA_RGBA_8 : QCMS_DATA_RGB_8; | 360 qcms_data_type dataFormat = hasAlpha ? QCMS_DATA_RGBA_8 : QCMS_DATA_RGB_8; |
| 360 | 361 |
| 361 // FIXME: Don't force perceptual intent if the image profile contains an int ent. | 362 // FIXME: Don't force perceptual intent if the image profile contains an int ent. |
| 362 m_sourceToOutputDeviceColorTransform = adoptPtr(qcms_transform_create(inputP rofile.get(), dataFormat, gOutputDeviceProfile, QCMS_DATA_RGBA_8, QCMS_INTENT_PE RCEPTUAL)); | 363 m_sourceToOutputDeviceColorTransform = adoptPtr(qcms_transform_create(inputP rofile.get(), dataFormat, gOutputDeviceProfile, QCMS_DATA_RGBA_8, QCMS_INTENT_PE RCEPTUAL)); |
| 363 } | 364 } |
| 364 | 365 |
| 365 #endif // USE(QCMSLIB) | 366 #endif // USE(QCMSLIB) |
| 366 | 367 |
| 367 } // namespace blink | 368 } // namespace blink |
| OLD | NEW |