[Webkit-unassigned] [Bug 93467] Change ImageSource to be asynchronous.

bugzilla-daemon at webkit.org bugzilla-daemon at webkit.org
Wed Aug 8 20:08:32 PDT 2012


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





--- Comment #2 from Hin-Chung Lam <hclam at google.com>  2012-08-08 20:08:57 PST ---
High level comments first.

I wonder if it is better to make ImageSource a full asynchronous interface. Which is:

class ImageSource {
  public:
    ImageSource(ImageSourceObserver* observer, ...);

    void requestFrameAtIndex(size_t index, bool useAsynchronousDecodingIfPossible = false);
};

class ImageSourceObserver {
  public:
    virtual void didDecodeFrameAtIndex(size_t, NativeImagePtr);
};

And then create a wrapper of SynchronousImageSource:

class SynchronousImageSource : public ImageSourceObserver {
  public:
    SynchronousImageSource(...) : m_imageSource(this, ...) {
    }

    virtual void didDecodeFrameAtIndex(size_t index, NativaImagePtr frame) {
      m_frames[index] = frame;
    }

    NativeImagePtr createFrameAtIndex(size_t index) {
      m_imageSource.requestFrameAtIndex(index);
      return m_frames[index];
    }

  private:
    Vector<NativeImagePtr> m_frames;
    ImageSource m_imageSource;
};

This way we make ImageSource fully asynchronous and separate a synchronous interface. We'll also need to move image decoding in frameDurationAtIndex() and orientationAtIndex() to ImageDecoder such that individual decoder can decide how to implement it. The latter can be done separately though.

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