mirror of
https://github.com/mozilla/gecko-dev.git
synced 2024-10-22 17:55:50 +00:00
Bug 1168263 - Introduce a helper function IntersectMaybeRects(). r=kats
This commit is contained in:
parent
136d0a9d64
commit
8e6d03a7b3
@ -771,6 +771,20 @@ MoveScrollbarForLayerMargin(Layer* aRoot, FrameMetrics::ViewID aRootScrollId,
|
||||
}
|
||||
#endif
|
||||
|
||||
template <typename Units>
|
||||
Maybe<IntRectTyped<Units>>
|
||||
IntersectMaybeRects(const Maybe<IntRectTyped<Units>>& a,
|
||||
const Maybe<IntRectTyped<Units>>& b)
|
||||
{
|
||||
if (!a) {
|
||||
return b;
|
||||
} else if (!b) {
|
||||
return a;
|
||||
} else {
|
||||
return Some(a->Intersect(*b));
|
||||
}
|
||||
}
|
||||
|
||||
bool
|
||||
AsyncCompositionManager::ApplyAsyncContentTransformToTree(Layer *aLayer,
|
||||
bool* aOutFoundRoot)
|
||||
@ -886,11 +900,7 @@ AsyncCompositionManager::ApplyAsyncContentTransformToTree(Layer *aLayer,
|
||||
// move with this APZC.
|
||||
if (metrics.HasClipRect()) {
|
||||
ParentLayerIntRect clip = metrics.ClipRect();
|
||||
if (asyncClip) {
|
||||
asyncClip = Some(clip.Intersect(*asyncClip));
|
||||
} else {
|
||||
asyncClip = Some(clip);
|
||||
}
|
||||
asyncClip = IntersectMaybeRects(Some(clip), asyncClip);
|
||||
}
|
||||
|
||||
// Do the same for the ancestor mask layers: ancestorMaskLayers contains
|
||||
|
Loading…
Reference in New Issue
Block a user