Bug 98205

Summary: Round image sizes when zooming
Product: WebKit Reporter: Emil A Eklund <eae>
Component: Layout and RenderingAssignee: Emil A Eklund <eae>
Status: RESOLVED FIXED    
Severity: Normal CC: eric, japhet, leviw, webkit.review.bot
Priority: P2    
Version: 528+ (Nightly build)   
Hardware: Unspecified   
OS: Unspecified   
Attachments:
Description Flags
Patch
none
Patch none

Description Emil A Eklund 2012-10-02 15:01:34 PDT
We currently floor image sizes when zooming which can result in images being rendered at one pixel less than the actual size. This is especially likely to happen for very large images.

Downstream webkit bug: http://code.google.com/p/chromium/issues/detail?id=150802
Comment 1 Emil A Eklund 2012-10-02 15:03:50 PDT
Created attachment 166757 [details]
Patch
Comment 2 Eric Seidel (no email) 2012-10-02 15:20:53 PDT
Comment on attachment 166757 [details]
Patch

LayoutTests/platform/chromium-linux/svg/zoom/page/zoom-svg-through-object-with-percentage-size-expected.png looks like they aren't quite in the same y-offset after zooming?
Comment 3 Emil A Eklund 2012-10-02 16:33:03 PDT
The(In reply to comment #2)
> (From update of attachment 166757 [details])
> LayoutTests/platform/chromium-linux/svg/zoom/page/zoom-svg-through-object-with-percentage-size-expected.png looks like they aren't quite in the same y-offset after zooming?

Correct. This patch doesn't change that though, it only changes the size of the image to that it is the same size as the svg element.
Comment 4 Build Bot 2012-10-02 19:50:58 PDT
Comment on attachment 166757 [details]
Patch

Attachment 166757 [details] did not pass mac-ews (mac):
Output: http://queues.webkit.org/results/14123568

New failing tests:
svg/zoom/page/zoom-svg-through-object-with-percentage-size.xhtml
svg/zoom/page/zoom-svg-through-object-with-absolute-size-2.xhtml
fast/sub-pixel/zoomed-image-tiles.html
svg/zoom/page/zoom-svg-through-object-with-absolute-size.xhtml
Comment 5 Emil A Eklund 2012-10-03 12:36:18 PDT
Created attachment 166941 [details]
Patch
Comment 6 Eric Seidel (no email) 2012-10-03 13:15:45 PDT
Comment on attachment 166941 [details]
Patch

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

OK.

> Source/WebCore/loader/cache/CachedImage.cpp:268
> +    imageSize.setWidth(lroundf(imageSize.width() * widthScale));
> +    imageSize.setHeight(lroundf(imageSize.height() * heightScale));

We could have also written this in terms of LayoutUnit primatives and done this w/o #ifdefs. :)
Comment 7 Emil A Eklund 2012-10-03 13:22:27 PDT
(In reply to comment #6)
> (From update of attachment 166941 [details])
> View in context: https://bugs.webkit.org/attachment.cgi?id=166941&action=review
> 
> OK.
> 
> > Source/WebCore/loader/cache/CachedImage.cpp:268
> > +    imageSize.setWidth(lroundf(imageSize.width() * widthScale));
> > +    imageSize.setHeight(lroundf(imageSize.height() * heightScale));
> 
> We could have also written this in terms of LayoutUnit primatives and done this w/o #ifdefs. :)

I'd rather keep it as a IntSize as we need to represent images that way but yeah, I suppose we could have.
Comment 8 Emil A Eklund 2012-10-03 15:07:42 PDT
Committed r130329: <http://trac.webkit.org/changeset/130329>