RESOLVED INVALID 107359
[Mac] Use pageScaleFactor * deviceScaleFactor in requiresTiledLayer() and computePixelAlignment() of GraphicsLayerCA.
https://bugs.webkit.org/show_bug.cgi?id=107359
Summary [Mac] Use pageScaleFactor * deviceScaleFactor in requiresTiledLayer() and com...
Dongseong Hwang
Reported 2013-01-18 21:46:56 PST
Currently GraphicsLayerCA uses pageScaleFactor in requiresTiledLayer() and computePixelAlignment(), but we must use pageScaleFactor * deviceScaleFactor in them. It is because: 1. requiresTiledLayer() uses the scale to compute an actual layer size in the device pixel unit. 2. computePixelAlignment() uses the scale to compute an aligned layer position in the device pixel unit.
Attachments
Patch (3.94 KB, patch)
2013-01-18 21:53 PST, Dongseong Hwang
no flags
Dongseong Hwang
Comment 1 2013-01-18 21:53:03 PST
WebKit Commit Bot
Comment 2 2013-05-13 19:10:39 PDT
Comment on attachment 183603 [details] Patch Clearing flags on attachment: 183603 Committed r150047: <http://trac.webkit.org/changeset/150047>
WebKit Commit Bot
Comment 3 2013-05-13 19:10:41 PDT
All reviewed patches have been landed. Closing bug.
Simon Fraser (smfr)
Comment 4 2013-05-13 23:16:19 PDT
Comment on attachment 183603 [details] Patch This sis wrong. We used to do this, and it causes pages to have different behavior on Retina and non-retina devices, which is undesirable. We’re not required to fall into tiled layers for larger surfaces; it’s just a memory optimization. Please revert the change.
Dongseong Hwang
Comment 5 2013-05-14 01:16:32 PDT
(In reply to comment #4) > (From update of attachment 183603 [details]) > This sis wrong. We used to do this, and it causes pages to have different behavior on Retina and non-retina devices, which is undesirable. We’re not required to fall into tiled layers for larger surfaces; it’s just a memory optimization. > > Please revert the change. Thank you for explanation. Can I ask a question?, because I don't fully catch up yet. In my understand of your explanation, it means that On Ratina, WebKit draws content on the same sized backing store and scales 2 times on the device. is it right? Let me say that the device scale factor on Ratina is 2. My curiosity is as follow: First of all, below code also causes different behavior on Retina and non-retina devices. afaik, layer's backing store on Ratina will be 2 times bigger than it on non-ratina, because contentsScale is 2 times bigger on Ratina. void GraphicsLayerCA::updateContentsScale(float pageScaleFactor) { float contentsScale = clampedContentsScaleForScale(pageScaleFactor * deviceScaleFactor()); m_layer->setContentsScale(contentsScale); if (drawsContent()) m_layer->setNeedsDisplay(); } In addition, backing store on Ratina should be two times bigger to draw text clearly. Even after rethinking, imo, my patch seems to be correct..
Simon Fraser (smfr)
Comment 6 2013-05-14 10:41:23 PDT
(In reply to comment #5) > (In reply to comment #4) > > (From update of attachment 183603 [details] [details]) > > This sis wrong. We used to do this, and it causes pages to have different behavior on Retina and non-retina devices, which is undesirable. We’re not required to fall into tiled layers for larger surfaces; it’s just a memory optimization. > > > > Please revert the change. > > Thank you for explanation. Can I ask a question?, because I don't fully catch up yet. > > In my understand of your explanation, it means that On Ratina, WebKit draws content on the same sized backing store and scales 2 times on the device. is it right? Correct. > Let me say that the device scale factor on Ratina is 2. > > My curiosity is as follow: > > First of all, below code also causes different behavior on Retina and non-retina devices. afaik, layer's backing store on Ratina will be 2 times bigger than it on non-ratina, because contentsScale is 2 times bigger on Ratina. Actually 4x in memory use. > void GraphicsLayerCA::updateContentsScale(float pageScaleFactor) > { > float contentsScale = clampedContentsScaleForScale(pageScaleFactor * deviceScaleFactor()); Right, this is clamping based on the estimated memory use for the layer. Actually that could be pageScaleFactor * deviceScaleFactor() * deviceScaleFactor(). > m_layer->setContentsScale(contentsScale); > if (drawsContent()) > m_layer->setNeedsDisplay(); > } > > In addition, backing store on Ratina should be two times bigger to draw text clearly. > > Even after rethinking, imo, my patch seems to be correct.. It is theoretically correct, but introduces unwanted behavior. I want the layer size threshold at which requiresTiledLayer() returns true to be the same for retina and non-retina devices. That does mean that we allow layer memory use on retina to be larger before we fall into tiled layers, but we're willing to live with that. I'm curious about what device you care about that's using GraphicsLayerCA?
Dongseong Hwang
Comment 7 2013-05-14 10:58:12 PDT
(In reply to comment #6) > It is theoretically correct, but introduces unwanted behavior. I want the layer size threshold at which requiresTiledLayer() returns true to be the same for retina and non-retina devices. That does mean that we allow layer memory use on retina to be larger before we fall into tiled layers, but we're willing to live with that. I see. I'm ok to roll back this patch. I can not do it because I don't have committer permission. > I'm curious about what device you care about that's using GraphicsLayerCA? Nothing. On this January, when I read GraphicsLayerCA to understand original GraphicsLayer implementation, I just found the point to conflict with what I understood. I'm sorry for noise.
Simon Fraser (smfr)
Comment 8 2013-05-15 12:12:25 PDT
Note You need to log in before you can comment on or make changes to this bug.