Bug 129859 - Subpixel rendering: Transform origin is miscalculated when RenderLayer's offsetfromRenderer has device pixel fraction value.
Summary: Subpixel rendering: Transform origin is miscalculated when RenderLayer's offs...
Status: RESOLVED FIXED
Alias: None
Product: WebKit
Classification: Unclassified
Component: Layout and Rendering (show other bugs)
Version: 528+ (Nightly build)
Hardware: Unspecified Unspecified
: P2 Normal
Assignee: zalan
URL:
Keywords:
Depends on: 129961
Blocks:
  Show dependency treegraph
 
Reported: 2014-03-06 20:35 PST by zalan
Modified: 2014-03-19 07:26 PDT (History)
7 users (show)

See Also:


Attachments
Patch (5.85 KB, patch)
2014-03-08 18:33 PST, zalan
no flags Details | Formatted Diff | Diff
Patch (9.20 KB, patch)
2014-03-09 17:04 PDT, zalan
buildbot: commit-queue-
Details | Formatted Diff | Diff
Archive of layout-test-results from webkit-ews-10 for mac-mountainlion-wk2 (493.61 KB, application/zip)
2014-03-09 18:10 PDT, Build Bot
no flags Details
Archive of layout-test-results from webkit-ews-03 for mac-mountainlion (523.76 KB, application/zip)
2014-03-09 18:32 PDT, Build Bot
no flags Details
Archive of layout-test-results from webkit-ews-11 for mac-mountainlion-wk2 (495.35 KB, application/zip)
2014-03-09 19:05 PDT, Build Bot
no flags Details
Archive of layout-test-results from webkit-ews-07 for mac-mountainlion (522.97 KB, application/zip)
2014-03-09 19:34 PDT, Build Bot
no flags Details
Patch (14.22 KB, patch)
2014-03-11 20:44 PDT, zalan
no flags Details | Formatted Diff | Diff
Patch (14.99 KB, patch)
2014-03-18 20:14 PDT, zalan
no flags Details | Formatted Diff | Diff

Note You need to log in before you can comment on or make changes to this bug.
Description zalan 2014-03-06 20:35:57 PST
Miscalculated transform origin produces off by one rendering errors for transforms like rotate.
Comment 1 zalan 2014-03-08 16:44:36 PST
This patch requires to be able to test hidpi compositing layers. bug 129961
Comment 2 zalan 2014-03-08 18:33:11 PST
Created attachment 226244 [details]
Patch
Comment 3 Simon Fraser (smfr) 2014-03-08 19:41:42 PST
Comment on attachment 226244 [details]
Patch

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

> Source/WebCore/rendering/RenderLayerBacking.cpp:845
> +        LayoutRect layerBounds(LayoutPoint(roundedForPainting(offsetFromParent, deviceScaleFactor)), borderBox.size());

It's a bit odd that the origin is device-pixel snapped, but the size is not. Does this work for large boxes where a percentage transform-origin could be visibly affected by the exact size?
Comment 4 zalan 2014-03-08 19:43:05 PST
(In reply to comment #3)
> (From update of attachment 226244 [details])
> View in context: https://bugs.webkit.org/attachment.cgi?id=226244&action=review
> 
> > Source/WebCore/rendering/RenderLayerBacking.cpp:845
> > +        LayoutRect layerBounds(LayoutPoint(roundedForPainting(offsetFromParent, deviceScaleFactor)), borderBox.size());
> 
> It's a bit odd that the origin is device-pixel snapped, but the size is not. Does this work for large boxes where a percentage transform-origin could be visibly affected by the exact size?

Good catch. It is most likely incorrect.
Comment 5 zalan 2014-03-09 17:04:39 PDT
Created attachment 226262 [details]
Patch
Comment 6 zalan 2014-03-09 17:04:55 PDT
Comment on attachment 226262 [details]
Patch

EWSing
Comment 7 Build Bot 2014-03-09 18:10:22 PDT
Comment on attachment 226262 [details]
Patch

Attachment 226262 [details] did not pass mac-wk2-ews (mac-wk2):
Output: http://webkit-queues.appspot.com/results/6043000496979968

New failing tests:
compositing/columns/composited-columns.html
compositing/repaint/resize-repaint.html
compositing/visibility/visibility-image-layers-dynamic.html
compositing/repaint/invalidations-on-composited-layers.html
compositing/geometry/limit-layer-bounds-opacity-transition.html
Comment 8 Build Bot 2014-03-09 18:10:25 PDT
Created attachment 226263 [details]
Archive of layout-test-results from webkit-ews-10 for mac-mountainlion-wk2

The attached test failures were seen while running run-webkit-tests on the mac-wk2-ews.
Bot: webkit-ews-10  Port: mac-mountainlion-wk2  Platform: Mac OS X 10.8.5
Comment 9 Build Bot 2014-03-09 18:32:14 PDT
Comment on attachment 226262 [details]
Patch

Attachment 226262 [details] did not pass mac-ews (mac):
Output: http://webkit-queues.appspot.com/results/4645108901216256

New failing tests:
compositing/columns/composited-columns.html
compositing/repaint/resize-repaint.html
compositing/visibility/visibility-image-layers-dynamic.html
compositing/repaint/invalidations-on-composited-layers.html
compositing/geometry/limit-layer-bounds-opacity-transition.html
Comment 10 Build Bot 2014-03-09 18:32:17 PDT
Created attachment 226264 [details]
Archive of layout-test-results from webkit-ews-03 for mac-mountainlion

The attached test failures were seen while running run-webkit-tests on the mac-ews.
Bot: webkit-ews-03  Port: mac-mountainlion  Platform: Mac OS X 10.8.5
Comment 11 Build Bot 2014-03-09 19:05:01 PDT
Comment on attachment 226262 [details]
Patch

Attachment 226262 [details] did not pass mac-wk2-ews (mac-wk2):
Output: http://webkit-queues.appspot.com/results/6612167415562240

New failing tests:
compositing/columns/composited-columns.html
compositing/repaint/resize-repaint.html
compositing/visibility/visibility-image-layers-dynamic.html
compositing/repaint/invalidations-on-composited-layers.html
compositing/geometry/limit-layer-bounds-opacity-transition.html
Comment 12 Build Bot 2014-03-09 19:05:05 PDT
Created attachment 226265 [details]
Archive of layout-test-results from webkit-ews-11 for mac-mountainlion-wk2

The attached test failures were seen while running run-webkit-tests on the mac-wk2-ews.
Bot: webkit-ews-11  Port: mac-mountainlion-wk2  Platform: Mac OS X 10.8.5
Comment 13 Build Bot 2014-03-09 19:34:02 PDT
Comment on attachment 226262 [details]
Patch

Attachment 226262 [details] did not pass mac-ews (mac):
Output: http://webkit-queues.appspot.com/results/6541343404851200

New failing tests:
compositing/columns/composited-columns.html
compositing/repaint/resize-repaint.html
compositing/visibility/visibility-image-layers-dynamic.html
compositing/repaint/invalidations-on-composited-layers.html
compositing/geometry/limit-layer-bounds-opacity-transition.html
Comment 14 Build Bot 2014-03-09 19:34:05 PDT
Created attachment 226271 [details]
Archive of layout-test-results from webkit-ews-07 for mac-mountainlion

The attached test failures were seen while running run-webkit-tests on the mac-ews.
Bot: webkit-ews-07  Port: mac-mountainlion  Platform: Mac OS X 10.8.5
Comment 15 zalan 2014-03-11 20:44:33 PDT
Created attachment 226469 [details]
Patch
Comment 16 Simon Fraser (smfr) 2014-03-11 21:00:14 PDT
Comment on attachment 226469 [details]
Patch

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

> LayoutTests/platform/mac/compositing/visibility/visibility-image-layers-dynamic-expected.txt:114
> +          (anchor 0.50 0.50)

Are these just slightly different from 0.5? Maybe we need to print more precision.

> Source/WebCore/rendering/RenderLayerBacking.cpp:848
> +        FloatPoint3D anchor(enclosingRelativeCompositingBounds.width() != 0.0f ? ((layerOffset.x() - enclosingRelativeCompositingBounds.x()) + transformOrigin.x())
> +            / enclosingRelativeCompositingBounds.width() : 0.5f, enclosingRelativeCompositingBounds.height() != 0.0f ? ((layerOffset.y() - enclosingRelativeCompositingBounds.y())

0.0f -> 0, 0.5f -> 0.5
Comment 17 zalan 2014-03-18 20:14:52 PDT
Created attachment 227150 [details]
Patch
Comment 18 zalan 2014-03-18 20:15:40 PDT
Comment on attachment 227150 [details]
Patch

EWS testing.
Comment 19 zalan 2014-03-18 20:22:50 PDT
(In reply to comment #16)
> (From update of attachment 226469 [details])
> View in context: https://bugs.webkit.org/attachment.cgi?id=226469&action=review
> 
> > LayoutTests/platform/mac/compositing/visibility/visibility-image-layers-dynamic-expected.txt:114
> > +          (anchor 0.50 0.50)
> 
> Are these just slightly different from 0.5? Maybe we need to print more precision.
bug 130442

> 
> > Source/WebCore/rendering/RenderLayerBacking.cpp:848
> > +        FloatPoint3D anchor(enclosingRelativeCompositingBounds.width() != 0.0f ? ((layerOffset.x() - enclosingRelativeCompositingBounds.x()) + transformOrigin.x())
> > +            / enclosingRelativeCompositingBounds.width() : 0.5f, enclosingRelativeCompositingBounds.height() != 0.0f ? ((layerOffset.y() - enclosingRelativeCompositingBounds.y())
> 
> 0.0f -> 0, 0.5f -> 0.5
done.
Comment 20 WebKit Commit Bot 2014-03-19 07:26:02 PDT
Comment on attachment 227150 [details]
Patch

Clearing flags on attachment: 227150

Committed r165892: <http://trac.webkit.org/changeset/165892>
Comment 21 WebKit Commit Bot 2014-03-19 07:26:07 PDT
All reviewed patches have been landed.  Closing bug.