[Webkit-unassigned] [Bug 77464] [chromium] LayerChromium::setNeedsDisplay does not apply contents scale correctly

bugzilla-daemon at webkit.org bugzilla-daemon at webkit.org
Thu Feb 16 18:37:38 PST 2012


https://bugs.webkit.org/show_bug.cgi?id=77464





--- Comment #6 from Sami Kyostila <skyostil at google.com>  2012-02-16 18:37:38 PST ---
(In reply to comment #4)
> (From update of attachment 124799 [details])
> What happens for a non-full-layer invalidation of a scaled layer?  I.e. if the layer's contents are 200x200 but it's displayed at 100x100, and WebKit sends us an invalidation rect 50x50 at 0x0, I think that should map to an invalidation of 50x50 at 0x0 on the tiles, not 25x25 at 0x0.  Right?

This is a bit involved because page scale is handled differently for the root layer vs. child layers.

For the root layer, invalidations (setNeedsDisplayRect) are in scaled coordinates, because GraphicsLayer::setAppliesPageScale() is enabled, and as a result LayerChromium::contentsScale() is always 1. This means that setNeedsDisplayRect(50x50 at 0x0) from WebKit corresponds to 100x100 at 0x0 in CSS pixels, but is 50x50 at 0x0 in tile pixels. So assuming 100x100 pixel tiles, we would paint the upper left quadrant of the single tile backing the layer.

For child layers, WebKit's invalidation rects are given in unscaled coordinates. So in your example a setNeedsDisplayRect(50x50 at 0x0) from WebKit actually means the 50x50 at 0x0 CSS rectangle inside the layer, or 25x25 at 0x0 in tile pixels. Therefore we would paint 25x25 at 0x0 in the single backing tile.

If you think this is madness then I'd tend to agree. I hope to make things a little more consistent once the dust settles.

Note that my patch does not change behavior for the root layer since contents scale is not used there.

-- 
Configure bugmail: https://bugs.webkit.org/userprefs.cgi?tab=email
------- You are receiving this mail because: -------
You are the assignee for the bug.



More information about the webkit-unassigned mailing list