зеркало из https://github.com/mozilla/gecko-dev.git
Bug 1295094 - Part 8. Implement nsSVGIntegrationUtils::PaintMaskAndClipPath r=mstange
MozReview-Commit-ID: EbIUVDXuHa0 --HG-- extra : rebase_source : f9c76291cfc78352268f9cf3a32376fcac96d018
This commit is contained in:
Родитель
949553410d
Коммит
40076dcfa1
|
@ -6689,7 +6689,7 @@ nsDisplaySVGEffects::PaintAsLayer(nsDisplayListBuilder* aBuilder,
|
|||
aManager, mOpacityItemCreated);
|
||||
|
||||
image::DrawResult result =
|
||||
nsSVGIntegrationUtils::PaintFramesWithEffects(params);
|
||||
nsSVGIntegrationUtils::PaintMaskAndClipPath(params);
|
||||
|
||||
nsDisplaySVGEffectsGeometry::UpdateDrawResult(this, result);
|
||||
}
|
||||
|
|
|
@ -747,7 +747,7 @@ BlendToTarget(const nsSVGIntegrationUtils::PaintFramesParams& aParams,
|
|||
}
|
||||
|
||||
DrawResult
|
||||
nsSVGIntegrationUtils::PaintFramesWithEffects(const PaintFramesParams& aParams)
|
||||
nsSVGIntegrationUtils::PaintMaskAndClipPath(const PaintFramesParams& aParams)
|
||||
{
|
||||
/* SVG defines the following rendering model:
|
||||
*
|
||||
|
@ -755,7 +755,7 @@ nsSVGIntegrationUtils::PaintFramesWithEffects(const PaintFramesParams& aParams)
|
|||
* 2. Apply filter
|
||||
* 3. Apply clipping, masking, group opacity
|
||||
*
|
||||
* We follow this, but perform a couple of optimizations:
|
||||
* We handle #3 here and perform a couple of optimizations:
|
||||
*
|
||||
* + Use cairo's clipPath when representable natively (single object
|
||||
* clip region).
|
||||
|
@ -889,23 +889,13 @@ nsSVGIntegrationUtils::PaintFramesWithEffects(const PaintFramesParams& aParams)
|
|||
}
|
||||
|
||||
/* Paint the child */
|
||||
if (effectProperties.HasValidFilter() && !aParams.builder->IsForGenerateGlyphMask()) {
|
||||
RegularFramePaintCallback callback(aParams.builder, aParams.layerManager,
|
||||
offsetToUserSpace);
|
||||
|
||||
nsRegion dirtyRegion = aParams.dirtyRect - offsetToBoundingBox;
|
||||
gfxMatrix tm = nsSVGIntegrationUtils::GetCSSPxToDevPxMatrix(frame);
|
||||
nsFilterInstance::PaintFilteredFrame(frame, target->GetDrawTarget(),
|
||||
tm, &callback, &dirtyRegion);
|
||||
} else {
|
||||
target->SetMatrix(matrixAutoSaveRestore.Matrix());
|
||||
BasicLayerManager* basic = static_cast<BasicLayerManager*>(aParams.layerManager);
|
||||
RefPtr<gfxContext> oldCtx = basic->GetTarget();
|
||||
basic->SetTarget(target);
|
||||
aParams.layerManager->EndTransaction(FrameLayerBuilder::DrawPaintedLayer,
|
||||
aParams.builder);
|
||||
basic->SetTarget(oldCtx);
|
||||
}
|
||||
target->SetMatrix(matrixAutoSaveRestore.Matrix());
|
||||
BasicLayerManager* basic = static_cast<BasicLayerManager*>(aParams.layerManager);
|
||||
RefPtr<gfxContext> oldCtx = basic->GetTarget();
|
||||
basic->SetTarget(target);
|
||||
aParams.layerManager->EndTransaction(FrameLayerBuilder::DrawPaintedLayer,
|
||||
aParams.builder);
|
||||
basic->SetTarget(oldCtx);
|
||||
|
||||
if (shouldApplyClipPath || shouldApplyBasicShape) {
|
||||
context.Restore();
|
||||
|
|
|
@ -147,7 +147,7 @@ public:
|
|||
* Paint non-SVG frame with SVG effects.
|
||||
*/
|
||||
static DrawResult
|
||||
PaintFramesWithEffects(const PaintFramesParams& aParams);
|
||||
PaintMaskAndClipPath(const PaintFramesParams& aParams);
|
||||
|
||||
static DrawResult
|
||||
PaintFilter(const PaintFramesParams& aParams);
|
||||
|
|
Загрузка…
Ссылка в новой задаче