[webkit-reviews] review requested: [Bug 27965] ImageSourceFoo.cpp contains lots of Copy+Paste code and should be refactored : [Attachment 34625] Merge in ImageSourceSkia.cpp

bugzilla-daemon at webkit.org bugzilla-daemon at webkit.org
Tue Aug 11 17:56:49 PDT 2009

Peter Kasting <pkasting at google.com> has asked  for review:
Bug 27965: ImageSourceFoo.cpp contains lots of Copy+Paste code and should be

Attachment 34625: Merge in ImageSourceSkia.cpp

------- Additional Comments from Peter Kasting <pkasting at google.com>
Merge in ImageSourceSkia.cpp.

There are only a few issues of note:

* As with Cairo, Skia doesn't really need the "#include SkBitmap.h" it had, so
I didn't port that over.

* Didn't bother adding the Skia check for if the decoder had failed before
calling setData(), since every decode but XBM already checks that, and XBM is
going away soon.

* Expanded the Cairo rejection of 0-height files to include 0-width and
negative-dimension files as well.  I am told these aren't valid for any popular
image formats anyway, and at least the BMP/ICO decoders I wrote already reject
them.  Even though Skia didn't have this, it seemed like a safe and appropriate
thing to do.

* Didn't bother porting over the Skia check for ImageDecoder::supportsAlpha()
in frameHasAlphaAtIndex().  Only the JPEG decoder returns false in that
function, and if the frame is complete none of the pixels should have alpha
anyway.  Once all the copies of this file are merged together I'm just going to
delete that function because no one else ever cares.

More information about the webkit-reviews mailing list