Bug 157779 - BitmapImage::destroyDecodedDataIfNecessary() should only count frames with image data
Summary: BitmapImage::destroyDecodedDataIfNecessary() should only count frames with im...
Status: RESOLVED FIXED
Alias: None
Product: WebKit
Classification: Unclassified
Component: New Bugs (show other bugs)
Version: WebKit Nightly Build
Hardware: Unspecified Unspecified
: P2 Normal
Assignee: Simon Fraser (smfr)
URL:
Keywords:
Depends on:
Blocks:
 
Reported: 2016-05-16 18:42 PDT by Simon Fraser (smfr)
Modified: 2016-05-17 14:28 PDT (History)
4 users (show)

See Also:


Attachments
Patch (3.44 KB, patch)
2016-05-16 18:51 PDT, Simon Fraser (smfr)
thorton: review+
Details | Formatted Diff | Diff

Note You need to log in before you can comment on or make changes to this bug.
Description Simon Fraser (smfr) 2016-05-16 18:42:52 PDT
BitmapImage::destroyDecodedDataIfNecessary() should only count frames with image data
Comment 1 Simon Fraser (smfr) 2016-05-16 18:51:00 PDT
Created attachment 279080 [details]
Patch
Comment 2 Said Abou-Hallawa 2016-05-16 19:05:08 PDT
Comment on attachment 279080 [details]
Patch

View in context: https://bugs.webkit.org/attachment.cgi?id=279080&action=review

Unofficial r=me

> Source/WebCore/platform/graphics/BitmapImage.h:90
> +    unsigned usedFrameBytes() const { return m_image ? m_frameBytes : 0; }

Do we need to call it usedFrameBytes()? Should not it be just named frameBytes()? I think it supposed to return the bytes of the image stored in this frame. So if the image is nil the frameBytes should be zero.
Comment 3 Simon Fraser (smfr) 2016-05-16 19:07:09 PDT
(In reply to comment #2)
> Comment on attachment 279080 [details]
> Patch
> 
> View in context:
> https://bugs.webkit.org/attachment.cgi?id=279080&action=review
> 
> Unofficial r=me
> 
> > Source/WebCore/platform/graphics/BitmapImage.h:90
> > +    unsigned usedFrameBytes() const { return m_image ? m_frameBytes : 0; }
> 
> Do we need to call it usedFrameBytes()? Should not it be just named
> frameBytes()? I think it supposed to return the bytes of the image stored in
> this frame. So if the image is nil the frameBytes should be zero.

I think it needs to be disambiguate from height*width*4 which we get from metadata. In reality, all callers but the one I changed check m_image too.
Comment 4 Simon Fraser (smfr) 2016-05-17 14:28:19 PDT
http://trac.webkit.org/changeset/201043