mirror of
https://gitlab.winehq.org/wine/wine-gecko.git
synced 2024-09-13 09:24:08 -07:00
Bug 1231303 - Moz2Dify nsFilterInstance. r=roc.
This commit is contained in:
parent
d3527e598c
commit
8da5bffaea
@ -58,7 +58,7 @@ UserSpaceMetricsForFrame(nsIFrame* aFrame)
|
||||
|
||||
nsresult
|
||||
nsFilterInstance::PaintFilteredFrame(nsIFrame *aFilteredFrame,
|
||||
gfxContext& aContext,
|
||||
DrawTarget* aDrawTarget,
|
||||
const gfxMatrix& aTransform,
|
||||
nsSVGFilterPaintCallback *aPaintCallback,
|
||||
const nsRegion *aDirtyArea)
|
||||
@ -71,7 +71,7 @@ nsFilterInstance::PaintFilteredFrame(nsIFrame *aFilteredFrame,
|
||||
if (!instance.IsInitialized()) {
|
||||
return NS_OK;
|
||||
}
|
||||
return instance.Render(&aContext);
|
||||
return instance.Render(aDrawTarget);
|
||||
}
|
||||
|
||||
nsRegion
|
||||
@ -457,34 +457,34 @@ nsFilterInstance::BuildSourceImage(DrawTarget* aTargetDT)
|
||||
}
|
||||
|
||||
nsresult
|
||||
nsFilterInstance::Render(gfxContext* aContext)
|
||||
nsFilterInstance::Render(DrawTarget* aDrawTarget)
|
||||
{
|
||||
MOZ_ASSERT(mTargetFrame, "Need a frame for rendering");
|
||||
|
||||
nsIntRect filterRect = mPostFilterDirtyRegion.GetBounds().Intersect(OutputFilterSpaceBounds());
|
||||
nsIntRect filterRect =
|
||||
mPostFilterDirtyRegion.GetBounds().Intersect(OutputFilterSpaceBounds());
|
||||
gfxMatrix ctm = GetFilterSpaceToDeviceSpaceTransform();
|
||||
|
||||
if (filterRect.IsEmpty() || ctm.IsSingular()) {
|
||||
return NS_OK;
|
||||
}
|
||||
|
||||
RefPtr<DrawTarget> dt = aContext->GetDrawTarget();
|
||||
|
||||
AutoRestoreTransform autoRestoreTransform(dt);
|
||||
Matrix newTM = ToMatrix(ctm).PreTranslate(filterRect.x, filterRect.y) * dt->GetTransform();
|
||||
dt->SetTransform(newTM);
|
||||
AutoRestoreTransform autoRestoreTransform(aDrawTarget);
|
||||
Matrix newTM = ToMatrix(ctm).PreTranslate(filterRect.x, filterRect.y) *
|
||||
aDrawTarget->GetTransform();
|
||||
aDrawTarget->SetTransform(newTM);
|
||||
|
||||
ComputeNeededBoxes();
|
||||
|
||||
nsresult rv = BuildSourceImage(dt);
|
||||
nsresult rv = BuildSourceImage(aDrawTarget);
|
||||
if (NS_FAILED(rv))
|
||||
return rv;
|
||||
rv = BuildSourcePaints(dt);
|
||||
rv = BuildSourcePaints(aDrawTarget);
|
||||
if (NS_FAILED(rv))
|
||||
return rv;
|
||||
|
||||
FilterSupport::RenderFilterDescription(
|
||||
dt, mFilterDescription, IntRectToRect(filterRect),
|
||||
aDrawTarget, mFilterDescription, IntRectToRect(filterRect),
|
||||
mSourceGraphic.mSourceSurface, mSourceGraphic.mSurfaceRect,
|
||||
mFillPaint.mSourceSurface, mFillPaint.mSurfaceRect,
|
||||
mStrokePaint.mSourceSurface, mStrokePaint.mSurfaceRect,
|
||||
|
@ -77,7 +77,7 @@ public:
|
||||
* border box).
|
||||
*/
|
||||
static nsresult PaintFilteredFrame(nsIFrame *aFilteredFrame,
|
||||
gfxContext& aContext,
|
||||
DrawTarget* aDrawTarget,
|
||||
const gfxMatrix& aTransform,
|
||||
nsSVGFilterPaintCallback *aPaintCallback,
|
||||
const nsRegion* aDirtyArea);
|
||||
@ -150,12 +150,12 @@ public:
|
||||
bool IsInitialized() const { return mInitialized; }
|
||||
|
||||
/**
|
||||
* Draws the filter output into aContext. The area that
|
||||
* Draws the filter output into aDrawTarget. The area that
|
||||
* needs to be painted must have been specified before calling this method
|
||||
* by passing it as the aPostFilterDirtyRegion argument to the
|
||||
* nsFilterInstance constructor.
|
||||
*/
|
||||
nsresult Render(gfxContext* aContext);
|
||||
nsresult Render(DrawTarget* aDrawTarget);
|
||||
|
||||
const FilterDescription& ExtractDescriptionAndAdditionalImages(nsTArray<RefPtr<SourceSurface>>& aOutAdditionalImages)
|
||||
{
|
||||
|
@ -590,7 +590,8 @@ nsSVGIntegrationUtils::PaintFramesWithEffects(gfxContext& aContext,
|
||||
|
||||
nsRegion dirtyRegion = aDirtyRect - offsetToBoundingBox;
|
||||
gfxMatrix tm = nsSVGIntegrationUtils::GetCSSPxToDevPxMatrix(aFrame);
|
||||
nsFilterInstance::PaintFilteredFrame(aFrame, *target, tm, &callback, &dirtyRegion);
|
||||
nsFilterInstance::PaintFilteredFrame(aFrame, target->GetDrawTarget(),
|
||||
tm, &callback, &dirtyRegion);
|
||||
} else {
|
||||
target->SetMatrix(matrixAutoSaveRestore.Matrix());
|
||||
BasicLayerManager* basic = static_cast<BasicLayerManager*>(aLayerManager);
|
||||
|
@ -690,8 +690,9 @@ nsSVGUtils::PaintFrameWithEffects(nsIFrame *aFrame,
|
||||
dirtyRegion = &tmpDirtyRegion;
|
||||
}
|
||||
SVGPaintCallback paintCallback;
|
||||
nsFilterInstance::PaintFilteredFrame(aFrame, *target, aTransform,
|
||||
&paintCallback, dirtyRegion);
|
||||
nsFilterInstance::PaintFilteredFrame(aFrame, target->GetDrawTarget(),
|
||||
aTransform, &paintCallback,
|
||||
dirtyRegion);
|
||||
} else {
|
||||
svgChildFrame->PaintSVG(*target, aTransform, aDirtyRect);
|
||||
}
|
||||
|
Loading…
Reference in New Issue
Block a user