Bug 87840 - [Qt] Support IMAGE_DECODER_DOWN_SAMPLING flag
Summary: [Qt] Support IMAGE_DECODER_DOWN_SAMPLING flag
Status: RESOLVED FIXED
Alias: None
Product: WebKit
Classification: Unclassified
Component: Images (show other bugs)
Version: 528+ (Nightly build)
Hardware: Unspecified Unspecified
: P2 Normal
Assignee: Allan Sandfeld Jensen
URL:
Keywords:
Depends on:
Blocks:
 
Reported: 2012-05-30 03:57 PDT by Allan Sandfeld Jensen
Modified: 2012-05-30 11:49 PDT (History)
2 users (show)

See Also:


Attachments
Patch (6.24 KB, patch)
2012-05-30 05:18 PDT, Allan Sandfeld Jensen
no flags Details | Formatted Diff | Diff
Patch (5.81 KB, patch)
2012-05-30 08:01 PDT, Allan Sandfeld Jensen
no flags Details | Formatted Diff | Diff

Note You need to log in before you can comment on or make changes to this bug.
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.