author | Ryan VanderMeulen <ryanvm@gmail.com> |
Sat, 17 Dec 2016 21:59:10 -0500 | |
changeset 450785 | a7b0bf1ba2c17230e12af396c1b15cbdd4070018 |
parent 450784 | 51e47188c13255f4ade74f3c25f6044c59c4305e |
child 450786 | 39d44116e5baf579490a60acfdf3fddbb567ecbc |
child 450792 | 5baae61449c43851c961a83babe18adaa28e3c6b |
child 458114 | e0baa80362fc5b4ffeb227f381c6579f3863620e |
push id | 38944 |
push user | bmo:leftysolara@gmail.com |
push date | Sun, 18 Dec 2016 16:01:15 +0000 |
bugs | 1318266 |
milestone | 53.0a1 |
backs out | 00bb4e2f5a3c3879c6a375348cdb6ec7cdf9d7f5 55790893cab48a081059bf0b8748694605562be4 |
--- a/layout/painting/FrameLayerBuilder.cpp +++ b/layout/painting/FrameLayerBuilder.cpp @@ -4335,23 +4335,16 @@ ContainerState::ProcessDisplayItems(nsDi // (must be done after visible rect is set on layer) if (layerClip.GetRoundedRectCount() > 0) { SetupMaskLayer(ownLayer, layerClip); } } } else if (item->GetType() == nsDisplayItem::TYPE_MASK) { nsDisplayMask* maskItem = static_cast<nsDisplayMask*>(item); SetupMaskLayerForCSSMask(ownLayer, maskItem); - - nsDisplayItem* next = aList->GetBottom(); - if (next && next->GetType() == nsDisplayItem::TYPE_SCROLL_INFO_LAYER) { - // Since we do build a layer for mask, there is no need for this - // scroll info layer anymore. - aList->RemoveBottom(); - } } // Convert the visible rect to a region and give the item // a chance to try restrict it further. nsIntRegion itemVisibleRegion = itemVisibleRect; nsRegion tightBounds = item->GetTightBounds(mBuilder, &snap); if (!tightBounds.IsEmpty()) { itemVisibleRegion.AndWith(ScaleToOutsidePixels(tightBounds, snap));
--- a/layout/painting/nsDisplayList.cpp +++ b/layout/painting/nsDisplayList.cpp @@ -7348,22 +7348,23 @@ bool nsDisplayMask::ShouldPaintOnMaskLay { if (!aManager->IsCompositingCheap()) { return false; } nsSVGUtils::MaskUsage maskUsage; nsSVGUtils::DetermineMaskUsage(mFrame, mHandleOpacity, maskUsage); - if (!maskUsage.shouldGenerateMaskLayer && !maskUsage.shouldApplyClipPath && + if (!maskUsage.shouldGenerateMaskLayer && !maskUsage.shouldGenerateClipMaskLayer) { return false; } - if (maskUsage.opacity != 1.0 || maskUsage.shouldApplyBasicShape) { + if (maskUsage.opacity != 1.0 || maskUsage.shouldApplyClipPath || + maskUsage.shouldApplyBasicShape) { return false; } if (!nsSVGIntegrationUtils::IsMaskResourceReady(mFrame)) { return false; } if (gfxPrefs::DrawMaskLayer()) {
--- a/layout/svg/nsSVGClipPathFrame.cpp +++ b/layout/svg/nsSVGClipPathFrame.cpp @@ -267,16 +267,18 @@ nsSVGClipPathFrame::PaintFrameIntoMask(n mozilla::Pair<DrawResult, RefPtr<SourceSurface>> nsSVGClipPathFrame::GetClipMask(gfxContext& aReferenceContext, nsIFrame* aClippedFrame, const gfxMatrix& aMatrix, Matrix* aMaskTransform, SourceSurface* aExtraMask, const Matrix& aExtraMasksTransform) { + MOZ_ASSERT(!IsTrivial(), "Caller needs to use ApplyClipPath"); + IntPoint offset; RefPtr<DrawTarget> maskDT = CreateClipMask(aReferenceContext, offset); if (!maskDT) { return MakePair(DrawResult::SUCCESS, RefPtr<SourceSurface>()); } RefPtr<gfxContext> maskContext = gfxContext::CreateOrNull(maskDT); if (!maskContext) {
--- a/layout/svg/nsSVGIntegrationUtils.cpp +++ b/layout/svg/nsSVGIntegrationUtils.cpp @@ -751,17 +751,16 @@ nsSVGIntegrationUtils::IsMaskResourceRea DrawResult nsSVGIntegrationUtils::PaintMask(const PaintFramesParams& aParams) { nsSVGUtils::MaskUsage maskUsage; nsSVGUtils::DetermineMaskUsage(aParams.frame, aParams.handleOpacity, maskUsage); MOZ_ASSERT(maskUsage.shouldGenerateMaskLayer || - maskUsage.shouldApplyClipPath || maskUsage.shouldGenerateClipMaskLayer); nsIFrame* frame = aParams.frame; if (!ValidateSVGFrame(frame)) { return DrawResult::SUCCESS; } if (maskUsage.opacity == 0.0f) { @@ -793,17 +792,17 @@ nsSVGIntegrationUtils::PaintMask(const P firstFrame->StyleContext(), maskFrames, ctx.CurrentMatrix(), offsetToUserSpace); if (result != DrawResult::SUCCESS) { return result; } } // Paint clip-path onto ctx. - if (maskUsage.shouldGenerateClipMaskLayer || maskUsage.shouldApplyClipPath) { + if (maskUsage.shouldGenerateClipMaskLayer) { matSR.Restore(); matSR.SetContext(&ctx); SetupContextMatrix(firstFrame, aParams, offsetToBoundingBox, offsetToUserSpace, false); Matrix clipMaskTransform; gfxMatrix cssPxToDevPxMatrix = GetCSSPxToDevPxMatrix(frame);