[Webkit-unassigned] [Bug 94190] New: Make the API of ImageDecoder decode a frame explicitly.

bugzilla-daemon at webkit.org bugzilla-daemon at webkit.org
Wed Aug 15 23:10:39 PDT 2012


https://bugs.webkit.org/show_bug.cgi?id=94190

           Summary: Make the API of ImageDecoder decode a frame
                    explicitly.
           Product: WebKit
           Version: 528+ (Nightly build)
          Platform: Unspecified
        OS/Version: Unspecified
            Status: UNCONFIRMED
          Severity: Normal
          Priority: P2
         Component: Images
        AssignedTo: webkit-unassigned at lists.webkit.org
        ReportedBy: luxtella at company100.net


This is a preparation for asynchronous image decoding. Asynchronous image decoding needs to query a frame, alpha, duration and completion without triggering image decoding. So this patch seperates image decoding from the query functions.

Introduced ImageDecoder::decodeAtIndex. We must call decodeAtIndex() to decode the given frame. ImageDecoder::frameBufferAtIndex does not decode the frame anymore and just returns the given frame buffer if it is cached.

This change delegates ImageSource::frameDurationAtIndex and ImageSource::frameIsCompleteAtIndex to ImageDecoder. It is more natural for ImageDecoder to return meta data as r125154 delegated ImageSource::frameHasAlphaAtIndex to ImageSource. For example, GIFImageDecoder can return a specific duration value, but other ImageDecoders always return 0.

Currently, both queries of ImageSource trigger image decoding. This change also makes both methods of ImageDecoder not decode anymore, and just return the cached meta data of the requested frame as ImageDecoder::frameHasAlphaAtIndex has done since r125154.

SynchronousImage uses frameIsCompleteAtIndex(), so SynchronousImage is changed to explicitly call ImageSource::requestFrameAtIndex before calling ImageSource::frameIsCompleteAtIndex because ImageSource::frameIsCompleteAtIndex does not decode.

These query methods are also used by BitmapImage::didDecodeFrameAtIndex. Currently BitmapImage::didDecodeFrameAtIndex does not correctly use both methods, because didDecodeFrameAtIndex() is a callback function for asynchronous image decoding and both methods in didDecodeFrameAtIndex() decode the frame synchronously, which will cause an unexpected behavior after implementing asynchronous image decoder. This change fixes a potential bug in BitmapImage::didDecodeFrameAtIndex.

-- 
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