Bug 170353

Summary: REGRESSION(r214635): Calculate image subsampling only for CG
Product: WebKit Reporter: Said Abou-Hallawa <sabouhallawa>
Component: ImagesAssignee: Said Abou-Hallawa <sabouhallawa>
Status: RESOLVED FIXED    
Severity: Normal CC: commit-queue, simon.fraser, thorton
Priority: P2    
Version: WebKit Nightly Build   
Hardware: Unspecified   
OS: Unspecified   
See Also: https://bugs.webkit.org/show_bug.cgi?id=169547
Attachments:
Description Flags
Patch
none
Patch
none
Patch
none
Patch none

Description Said Abou-Hallawa 2017-03-31 12:04:13 PDT
In the <http://trac.webkit.org/changeset/214635>, we needed to calculate the image scaling factor for all platforms. It was needed do the calculation: sizeForDrawing = sizeOfImage * imageScaleFactor. But this makes ImageSource::subsamplingLevelForScale() now returns a SubsamplingLevel not equal to SubsamplingLevel::Default if the scaleFactor is greater than { 1, 1} for all platforms. The subsamplingLevel should only be used for CG.
Comment 1 Said Abou-Hallawa 2017-03-31 12:24:03 PDT
Created attachment 305997 [details]
Patch
Comment 2 Said Abou-Hallawa 2017-03-31 12:37:34 PDT
Created attachment 306002 [details]
Patch
Comment 3 Simon Fraser (smfr) 2017-03-31 13:11:26 PDT
Comment on attachment 306002 [details]
Patch

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

> Source/WebCore/platform/graphics/GraphicsContext.h:502
> +    FloatSize scaleFactor(const FloatRect& destRect, const FloatRect& srcRect) const;

This needs a better name that explains why two rects are passed in.
Comment 4 Said Abou-Hallawa 2017-03-31 16:05:17 PDT
Created attachment 306022 [details]
Patch
Comment 5 Said Abou-Hallawa 2017-03-31 18:06:44 PDT
Comment on attachment 306002 [details]
Patch

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

>> Source/WebCore/platform/graphics/GraphicsContext.h:502
>> +    FloatSize scaleFactor(const FloatRect& destRect, const FloatRect& srcRect) const;
> 
> This needs a better name that explains why two rects are passed in.

I renamed it to scaleFactorForDrawing().
Comment 6 Said Abou-Hallawa 2017-04-09 11:05:45 PDT
Created attachment 306627 [details]
Patch
Comment 7 WebKit Commit Bot 2017-04-09 11:45:09 PDT
Comment on attachment 306627 [details]
Patch

Clearing flags on attachment: 306627

Committed r215163: <http://trac.webkit.org/changeset/215163>
Comment 8 WebKit Commit Bot 2017-04-09 11:45:10 PDT
All reviewed patches have been landed.  Closing bug.