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

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

Issue 1962563002: Fix ImageDecoder::frameIsCompleteAtIndex - fully received instead of decoded. (Closed) Base URL: https://chromium.googlesource.com/chromium/src.git@master
Patch Set: PNG alpha & partial decode fixes. Created 4 years, 7 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) 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
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
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
OLDNEW

Powered by Google App Engine
This is Rietveld 408576698