Bug 1267438 - Use the layer's scrolled clip during compositor hit testing. r=mstange

MozReview-Commit-ID: 2nodwaZHeWZ

--HG--
extra : rebase_source : 4a61e20fa5ea6de457132aa7e06c27e48286f28c
extra : source : 6618e805fce8e1b45241783d8ba3b5bec5ad182a
extra : histedit_source : 4b27d55d0f26de7a13ef741feef9df6f8e6c4f13
This commit is contained in:
Botond Ballo 2016-05-04 17:30:26 -04:00
parent 771407a83d
commit 29ef36444d
3 changed files with 13 additions and 2 deletions

View File

@ -372,10 +372,14 @@ public:
Maybe<ParentLayerIntRect> result;
// The layer can have a clip rect, which is considered to apply
// only to the bottommost LayerMetrics.
// The layer can have a clip rect and a scrolled clip, which are considered
// to apply only to the bottommost LayerMetricsWrapper.
// TODO: These actually apply in a different coordinate space than the
// scroll clip of the bottommost metrics, so we shouldn't be intersecting
// them with the scroll clip; bug 1269537 tracks fixing this.
if (AtBottomLayer()) {
result = mLayer->GetClipRect();
result = IntersectMaybeRects(result, mLayer->GetScrolledClipRect());
}
// The scroll metadata can have a clip rect as well.

View File

@ -851,6 +851,12 @@ Layer::CalculateScissorRect(const RenderTargetIntRect& aCurrentScissorRect)
return currentClip.Intersect(scissor);
}
Maybe<ParentLayerIntRect>
Layer::GetScrolledClipRect() const
{
return mScrolledClip ? Some(mScrolledClip->GetClipRect()) : Nothing();
}
const ScrollMetadata&
Layer::GetScrollMetadata(uint32_t aIndex) const
{

View File

@ -1302,6 +1302,7 @@ public:
gfx::CompositionOp GetMixBlendMode() const { return mMixBlendMode; }
const Maybe<ParentLayerIntRect>& GetClipRect() const { return mClipRect; }
const Maybe<LayerClip>& GetScrolledClip() const { return mScrolledClip; }
Maybe<ParentLayerIntRect> GetScrolledClipRect() const;
uint32_t GetContentFlags() { return mContentFlags; }
const gfx::IntRect& GetLayerBounds() const { return mLayerBounds; }
const LayerIntRegion& GetVisibleRegion() const { return mVisibleRegion; }