[Webkit-unassigned] [Bug 28308] allow down-sampling images during decoding
bugzilla-daemon at webkit.org
bugzilla-daemon at webkit.org
Fri Aug 14 11:08:43 PDT 2009
https://bugs.webkit.org/show_bug.cgi?id=28308
--- Comment #3 from Yong Li <yong.li at torchmobile.com> 2009-08-14 11:08:42 PDT ---
(In reply to comment #2)
> (From update of attachment 34851 [details])
> Looking much, much better! A few issues:
> Shift this block down below to the next 'if (m_decoder)' and you eliminate an
> extra conditional and a nested one at that.
They are different. this 'if (m_decoder)' is reached only for the first time,
where the below one is reached every time.
> Why is this templated?
To be faster. template argument is kind of const values.
>
> Why do you remove this assert and change the behavior of this method even when
> IMAGE_DECODER_DOWN_SAMPLING is disabled?
info becomes useless except in this ASSERT. I removed 'info' argument. ASSERT
is not necessary because the caller takes care of that.
>
> > while (info->output_scanline < info->output_height) {
> > /* Request one scanline. Returns 0 or 1 scanlines. */
> > - if (jpeg_read_scanlines(info, samples, 1) != 1)
> > + int sourceY = info->output_scanline;
> > + int sourceRows = jpeg_read_scanlines(info, samples, 1);
> > + if (sourceRows != 1) {
> > + if (sourceRows != 0)
> > + m_failed = true;
> > return false;
> > + }
>
> Another change that is not guarded by ENABLE(IMAGE_DECODER_DOWN_SAMPLING)
I can remove the sourceRows change. sourceY is used to record the current row.
With this change, there can be more code shared.
--
Configure bugmail: https://bugs.webkit.org/userprefs.cgi?tab=email
------- You are receiving this mail because: -------
You are the assignee for the bug.
More information about the webkit-unassigned
mailing list