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() || m_frameBufferCache[index].hasAl pha(); |
|
Peter Kasting
2016/05/10 00:00:13
Will hasAlpha() return true on partially-decoded f
scroggo_chromium
2016/05/10 14:14:37
I think that is the intent. When we create a new I
aleksandar.stojiljkovic
2016/05/10 21:59:31
I disliked that we are handling "decoding partial
Peter Kasting
2016/05/11 00:33:02
Me too, frankly. I don't think that's really some
scroggo_chromium
2016/05/11 15:17:34
Is there an existing caller that needs to know whe
| |
| 150 } | 150 } |
| 151 | 151 |
| 152 bool ImageDecoder::frameIsCompleteAtIndex(size_t index) const | 152 bool ImageDecoder::frameIsFullyReceivedAtIndex(size_t index) const |
| 153 { | 153 { |
| 154 return (index < m_frameBufferCache.size()) && | 154 return m_isAllDataReceived; |
| 155 (m_frameBufferCache[index].getStatus() == ImageFrame::FrameComplete); | |
| 156 } | 155 } |
| 157 | 156 |
| 158 size_t ImageDecoder::frameBytesAtIndex(size_t index) const | 157 size_t ImageDecoder::frameBytesAtIndex(size_t index) const |
| 159 { | 158 { |
| 160 if (index >= m_frameBufferCache.size() || m_frameBufferCache[index].getStatu s() == ImageFrame::FrameEmpty) | 159 if (index >= m_frameBufferCache.size() || m_frameBufferCache[index].getStatu s() == ImageFrame::FrameEmpty) |
| 161 return 0; | 160 return 0; |
| 162 | 161 |
| 163 struct ImageSize { | 162 struct ImageSize { |
| 164 | 163 |
| 165 explicit ImageSize(IntSize size) | 164 explicit ImageSize(IntSize size) |
| (...skipping 192 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... | |
| 358 | 357 |
| 359 qcms_data_type dataFormat = hasAlpha ? QCMS_DATA_RGBA_8 : QCMS_DATA_RGB_8; | 358 qcms_data_type dataFormat = hasAlpha ? QCMS_DATA_RGBA_8 : QCMS_DATA_RGB_8; |
| 360 | 359 |
| 361 // FIXME: Don't force perceptual intent if the image profile contains an int ent. | 360 // 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)); | 361 m_sourceToOutputDeviceColorTransform = adoptPtr(qcms_transform_create(inputP rofile.get(), dataFormat, gOutputDeviceProfile, QCMS_DATA_RGBA_8, QCMS_INTENT_PE RCEPTUAL)); |
| 363 } | 362 } |
| 364 | 363 |
| 365 #endif // USE(QCMSLIB) | 364 #endif // USE(QCMSLIB) |
| 366 | 365 |
| 367 } // namespace blink | 366 } // namespace blink |
| OLD | NEW |