Remove LayerTreeHostImpl references to layer_id in scrolling methods. |
||
Issue descriptionLayerTreeHostImpl::ScrollLayerTo and LayerTreeHostImpl::GetScrollOffsetForLayer looked up the cc::LayerImpl from the active tree by layer_id, however the caller knows the element id and this allows us to more directly look up the scroll node and ask the scroll tree directly.
,
Nov 28
Philip, in the review you suggested removing FindActiveTreeLayerById, but there are still a few places that look up layers by ids that seem not to be obviously removable[1]. Do you think that none of these should be necessary? If so, do you think we need to maintain a complete element id to layer map (currently only track scroll layers) instead or do you expect that we should never need to look up layers? [1] For example, - NotifyTileStateChanged looks up the LayerImpl in order to call NotifyTileStateChanged which adds to the LayerImpl's damage_rect_. - RenderSurfaceImpl::MaskLayer is used to find the mask layer to append quads to it. - ComputeViewportSelectionBound tests against the bounds of the selected layer (looked up by layer id). I'm also not sure if every Layer has an element_id, given the various checks for layer id: https://cs.chromium.org/search/?q=if%5C+.*inputs_%5C.element_id&type=cs and https://cs.chromium.org/search/?q=if.*layer%5C-%5C%3Eelement_id%5C(%5C)&type=cs
,
Nov 28
I'm sorry for sending you down that path. I was wrong and FindActiveTreeLayerById is fine. It is LayerByElementId that we should be getting rid of. |
||
►
Sign in to add a comment |
||
Comment 1 by bugdroid1@chromium.org
, Jul 25