Bug 87840

Summary: [Qt] Support IMAGE_DECODER_DOWN_SAMPLING flag
Product: WebKit Reporter: Allan Sandfeld Jensen <allan.jensen>
Component: ImagesAssignee: Allan Sandfeld Jensen <allan.jensen>
Status: RESOLVED FIXED    
Severity: Normal CC: webkit.review.bot, zoltan
Priority: P2    
Version: 528+ (Nightly build)   
Hardware: Unspecified   
OS: Unspecified   
Attachments:
Description Flags
Patch
none
Patch none

Description Allan Sandfeld Jensen 2012-05-30 03:57:56 PDT
Currently the Qt platform does not work correctly with the IMAGE_DECODER_DOWN_SAMPLING flag set.
Comment 1 Allan Sandfeld Jensen 2012-05-30 05:18:39 PDT
Created attachment 144784 [details]
Patch
Comment 2 Kenneth Rohde Christiansen 2012-05-30 06:09:11 PDT
Comment on attachment 144784 [details]
Patch

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

> Source/WebCore/platform/graphics/Image.cpp:173
> +    const IntSize origSize = size();

realSize?

> Source/WebCore/platform/graphics/Image.cpp:175
> +    // We assume down-sampling zoom rates in X direction and in Y direction are same.

Could we assert that assumption?

> Source/WebCore/platform/graphics/qt/ImageQt.cpp:250
> +    adjustSourceRectForDownSampling(wtfNormalizedSrc, wtfImageSize);

Impossible to see that these are out variables. Can we please use pointers

FloatRect newNormalizedSource(normalizedSrc);
adjustSourceRectForDownSampling(&newNormalizedSource, IntSize(image->size());
normalizedSrc = QRectF(newNormalizedSource);
Comment 3 Allan Sandfeld Jensen 2012-05-30 07:22:02 PDT
(In reply to comment #2)
> (From update of attachment 144784 [details])
> View in context: https://bugs.webkit.org/attachment.cgi?id=144784&action=review
> 
> > Source/WebCore/platform/graphics/Image.cpp:173
> > +    const IntSize origSize = size();
> 
> realSize?
> 
> > Source/WebCore/platform/graphics/Image.cpp:175
> > +    // We assume down-sampling zoom rates in X direction and in Y direction are same.
> 
> Could we assert that assumption?
> 
> > Source/WebCore/platform/graphics/qt/ImageQt.cpp:250
> > +    adjustSourceRectForDownSampling(wtfNormalizedSrc, wtfImageSize);
> 
> Impossible to see that these are out variables. Can we please use pointers
> 

The entire function is moved from ImageOpenVG.cpp and only slightly modified, but I guess that shouldn't stop me from making it prettier. Not sure about realSize though, I might as well argue that the scaledSize is the real size.
Comment 4 Allan Sandfeld Jensen 2012-05-30 08:01:57 PDT
Created attachment 144819 [details]
Patch
Comment 5 WebKit Review Bot 2012-05-30 11:49:06 PDT
Comment on attachment 144819 [details]
Patch

Clearing flags on attachment: 144819

Committed r118947: <http://trac.webkit.org/changeset/118947>
Comment 6 WebKit Review Bot 2012-05-30 11:49:10 PDT
All reviewed patches have been landed.  Closing bug.