mirror of
https://gitlab.winehq.org/wine/wine-gecko.git
synced 2024-09-13 09:24:08 -07:00
Bug 1107414 - Get rid of gfxContext::FillWithOpacity. r=mattwoodrow
--HG-- extra : rebase_source : d64412c46d72a4d08be8edf1913c83bb12387b49
This commit is contained in:
parent
9934f20290
commit
b752905714
@ -238,18 +238,6 @@ gfxContext::Fill(const Pattern& aPattern)
|
||||
FillAzure(aPattern, 1.0f);
|
||||
}
|
||||
|
||||
void
|
||||
gfxContext::FillWithOpacity(gfxFloat aOpacity)
|
||||
{
|
||||
FillWithOpacity(PatternFromState(this), aOpacity);
|
||||
}
|
||||
|
||||
void
|
||||
gfxContext::FillWithOpacity(const Pattern& aPattern, gfxFloat aOpacity)
|
||||
{
|
||||
FillAzure(aPattern, Float(aOpacity));
|
||||
}
|
||||
|
||||
void
|
||||
gfxContext::MoveTo(const gfxPoint& pt)
|
||||
{
|
||||
|
@ -108,15 +108,6 @@ public:
|
||||
void Fill();
|
||||
void Fill(const Pattern& aPattern);
|
||||
|
||||
/**
|
||||
* Fill the current path according to the current settings and
|
||||
* with |aOpacity|.
|
||||
*
|
||||
* Does not consume the current path.
|
||||
*/
|
||||
void FillWithOpacity(gfxFloat aOpacity);
|
||||
void FillWithOpacity(const Pattern& aPattern, gfxFloat aOpacity);
|
||||
|
||||
/**
|
||||
* Forgets the current path.
|
||||
*/
|
||||
|
@ -200,6 +200,8 @@ gfxPatternDrawable::Draw(gfxContext* aContext,
|
||||
gfxFloat aOpacity,
|
||||
const gfxMatrix& aTransform)
|
||||
{
|
||||
DrawTarget& aDrawTarget = *aContext->GetDrawTarget();
|
||||
|
||||
if (!mPattern)
|
||||
return false;
|
||||
|
||||
@ -216,12 +218,11 @@ gfxPatternDrawable::Draw(gfxContext* aContext,
|
||||
aOpacity, aTransform);
|
||||
}
|
||||
|
||||
aContext->NewPath();
|
||||
gfxMatrix oldMatrix = mPattern->GetMatrix();
|
||||
mPattern->SetMatrix(aTransform * oldMatrix);
|
||||
aContext->SetPattern(mPattern);
|
||||
aContext->Rectangle(aFillRect);
|
||||
aContext->FillWithOpacity(aOpacity);
|
||||
DrawOptions drawOptions(aOpacity);
|
||||
aDrawTarget.FillRect(ToRect(aFillRect),
|
||||
*mPattern->GetPattern(&aDrawTarget), drawOptions);
|
||||
mPattern->SetMatrix(oldMatrix);
|
||||
return true;
|
||||
}
|
||||
|
@ -2835,9 +2835,14 @@ SVGTextDrawPathCallbacks::NotifySelectionBackgroundPathEmitted()
|
||||
GeneralPattern fillPattern;
|
||||
MakeFillPattern(&fillPattern);
|
||||
if (fillPattern.GetPattern()) {
|
||||
gfx->SetFillRule(nsSVGUtils::ToFillRule(mFrame->StyleSVG()->mFillRule));
|
||||
gfx->FillWithOpacity(fillPattern,
|
||||
mColor == NS_40PERCENT_FOREGROUND_COLOR ? 0.4 : 1.0);
|
||||
RefPtr<Path> path = gfx->GetPath();
|
||||
FillRule fillRule = nsSVGUtils::ToFillRule(mFrame->StyleSVG()->mFillRule);
|
||||
if (fillRule != path->GetFillRule()) {
|
||||
RefPtr<PathBuilder> builder = path->CopyToBuilder(fillRule);
|
||||
path = builder->Finish();
|
||||
}
|
||||
DrawOptions drawOptions(mColor == NS_40PERCENT_FOREGROUND_COLOR ? 0.4 : 1.0);
|
||||
gfx->GetDrawTarget()->Fill(path, fillPattern, drawOptions);
|
||||
}
|
||||
gfx->Restore();
|
||||
}
|
||||
|
Loading…
Reference in New Issue
Block a user