mirror of
https://gitlab.winehq.org/wine/wine-gecko.git
synced 2024-09-13 09:24:08 -07:00
Bug 1073942 - Paint via the Moz2D DrawTarget in nsFilterInstance::BuildSourcePaint. r=Bas
This commit is contained in:
parent
382a6eff7b
commit
ae20e92d99
@ -10,6 +10,7 @@
|
||||
#include "mozilla/UniquePtr.h"
|
||||
|
||||
// Keep others in (case-insensitive) order:
|
||||
#include "gfx2DGlue.h"
|
||||
#include "gfxPlatform.h"
|
||||
#include "gfxUtils.h"
|
||||
#include "mozilla/gfx/Helpers.h"
|
||||
@ -367,26 +368,19 @@ nsFilterInstance::BuildSourcePaint(SourceInfo *aSource,
|
||||
gfx->Multiply(mPaintTransform *
|
||||
deviceToFilterSpace *
|
||||
gfxMatrix::Translation(-neededRect.TopLeft()));
|
||||
gfx->Rectangle(FilterSpaceToUserSpace(neededRect));
|
||||
nsRefPtr<gfxPattern> pattern;
|
||||
if (aSource == &mFillPaint) {
|
||||
nsRefPtr<gfxPattern> fillPattern =
|
||||
nsSVGUtils::MakeFillPatternFor(mTargetFrame, gfx);
|
||||
if (fillPattern) {
|
||||
gfx->SetPattern(fillPattern);
|
||||
gfx->Fill();
|
||||
}
|
||||
pattern = nsSVGUtils::MakeFillPatternFor(mTargetFrame, gfx);
|
||||
} else if (aSource == &mStrokePaint) {
|
||||
nsRefPtr<gfxPattern> strokePattern =
|
||||
nsSVGUtils::MakeStrokePatternFor(mTargetFrame, gfx);
|
||||
if (strokePattern) {
|
||||
gfx->SetPattern(strokePattern);
|
||||
gfx->Fill(); // yes, filling a primitive subregion with _stroke_ paint
|
||||
}
|
||||
pattern = nsSVGUtils::MakeStrokePatternFor(mTargetFrame, gfx);
|
||||
}
|
||||
if (pattern) {
|
||||
offscreenDT->FillRect(ToRect(FilterSpaceToUserSpace(neededRect)),
|
||||
*pattern->GetPattern(offscreenDT));
|
||||
}
|
||||
gfx->Restore();
|
||||
}
|
||||
|
||||
|
||||
aSource->mSourceSurface = offscreenDT->Snapshot();
|
||||
aSource->mSurfaceRect = ToIntRect(neededRect);
|
||||
|
||||
|
Loading…
Reference in New Issue
Block a user