Bug 1443792 - Tighten the equivalence between a layer being scrollable and having an APZC. r=botond

If we can assume that a layer being composited has an APZC at index i if and
only if the frame metrics at index i is scrollable, then we can do the
transformations in the next patch without any change in functionality.

MozReview-Commit-ID: FRkvhwdd3nh

--HG--
extra : rebase_source : f1bee292305730079b3208e447330028c1a40727
This commit is contained in:
Kartikaya Gupta 2018-03-12 16:06:37 -04:00
Родитель bfc7d9097f
Коммит 86032d9307
2 изменённых файлов: 6 добавлений и 0 удалений

Просмотреть файл

@ -229,6 +229,8 @@ void
Layer::SetAsyncPanZoomController(uint32_t aIndex, AsyncPanZoomController *controller) Layer::SetAsyncPanZoomController(uint32_t aIndex, AsyncPanZoomController *controller)
{ {
MOZ_ASSERT(aIndex < GetScrollMetadataCount()); MOZ_ASSERT(aIndex < GetScrollMetadataCount());
// We should never be setting an APZC on a non-scrollable layer
MOZ_ASSERT(!controller || GetFrameMetrics(aIndex).IsScrollable());
mApzcs[aIndex] = controller; mApzcs[aIndex] = controller;
} }

Просмотреть файл

@ -1798,6 +1798,10 @@ public:
// and can be used anytime. // and can be used anytime.
// A layer has an APZC at index aIndex only-if GetFrameMetrics(aIndex).IsScrollable(); // A layer has an APZC at index aIndex only-if GetFrameMetrics(aIndex).IsScrollable();
// attempting to get an APZC for a non-scrollable metrics will return null. // attempting to get an APZC for a non-scrollable metrics will return null.
// The reverse is also true (that if GetFrameMetrics(aIndex).IsScrollable()
// is true, then the layer will have an APZC), although that only holds on
// the compositor-side layer tree, and only after the APZ code has had a chance
// to rebuild its internal hit-testing tree using the layer tree.
// The aIndex for these functions must be less than GetScrollMetadataCount(). // The aIndex for these functions must be less than GetScrollMetadataCount().
void SetAsyncPanZoomController(uint32_t aIndex, AsyncPanZoomController *controller); void SetAsyncPanZoomController(uint32_t aIndex, AsyncPanZoomController *controller);
AsyncPanZoomController* GetAsyncPanZoomController(uint32_t aIndex) const; AsyncPanZoomController* GetAsyncPanZoomController(uint32_t aIndex) const;