[webkit-reviews] review granted: [Bug 124626] Allow ImageBuffer to use a backing store that is larger than necessary : [Attachment 218245] Patch

bugzilla-daemon at webkit.org bugzilla-daemon at webkit.org
Mon Dec 2 18:16:42 PST 2013


Simon Fraser (smfr) <simon.fraser at apple.com> has granted Myles C. Maxfield
<mmaxfield at apple.com>'s request for review:
Bug 124626: Allow ImageBuffer to use a backing store that is larger than
necessary
https://bugs.webkit.org/show_bug.cgi?id=124626

Attachment 218245: Patch
https://bugs.webkit.org/attachment.cgi?id=218245&action=review

------- Additional Comments from Simon Fraser (smfr) <simon.fraser at apple.com>
View in context: https://bugs.webkit.org/attachment.cgi?id=218245&action=review


> Source/WebCore/platform/graphics/cg/ImageBufferCG.cpp:103
> +    float xMagnification = 1.0 * backingStoreSize.width() /
internalSize.width();

The 1.0 * is weird. Why not static_cast<float>()?

> Source/WebCore/platform/graphics/cg/ImageBufferCG.cpp:170
> -	   ASSERT(!(reinterpret_cast<size_t>(m_data.m_data) & 2));
> +	   ASSERT(!(reinterpret_cast<intptr_t>(m_data.m_data) & 3));

You still don't explain this in the changelog. When did it get added? How was
it wrong?

> Source/WebCore/platform/graphics/cg/ImageBufferCG.cpp:203
> +static CGImageRef maybeCreateCroppedImage(CGImageRef image, const IntSize&
bounds)

This should return a RetainPtr (or some other smart pointer type). I think
createCroppedImageIfNecessary() would be a slightly better name.


More information about the webkit-reviews mailing list