Bug 1229662 (part 3) - Remove AzureState::fillRule. r=jrmuizel.

AzureState::fillRule is never set to any value other than FILL_WINDING. It can
be removed. Note that TransformedCopyToBuilder() and CopyToBuilder()'s FillRule
arguments both default to FILL_WINDING.
This commit is contained in:
Nicholas Nethercote 2015-12-06 18:18:00 -08:00
parent 4ff95800ee
commit a83fab898e
2 changed files with 9 additions and 30 deletions

View File

@ -532,18 +532,6 @@ gfxContext::CurrentMiterLimit() const
return CurrentState().strokeOptions.mMiterLimit;
}
void
gfxContext::SetFillRule(FillRule rule)
{
CurrentState().fillRule = rule;
}
FillRule
gfxContext::CurrentFillRule() const
{
return CurrentState().fillRule;
}
// clipping
void
gfxContext::Clip(const Rect& rect)
@ -1015,18 +1003,18 @@ gfxContext::EnsurePath()
Matrix mat = mTransform;
mat.Invert();
mat = mPathTransform * mat;
mPathBuilder = mPath->TransformedCopyToBuilder(mat, CurrentState().fillRule);
mPathBuilder = mPath->TransformedCopyToBuilder(mat);
mPath = mPathBuilder->Finish();
mPathBuilder = nullptr;
mTransformChanged = false;
}
if (CurrentState().fillRule == mPath->GetFillRule()) {
if (FillRule::FILL_WINDING == mPath->GetFillRule()) {
return;
}
mPathBuilder = mPath->CopyToBuilder(CurrentState().fillRule);
mPathBuilder = mPath->CopyToBuilder();
mPath = mPathBuilder->Finish();
mPathBuilder = nullptr;
@ -1047,13 +1035,13 @@ gfxContext::EnsurePathBuilder()
if (mPath) {
if (!mTransformChanged) {
mPathBuilder = mPath->CopyToBuilder(CurrentState().fillRule);
mPathBuilder = mPath->CopyToBuilder();
mPath = nullptr;
} else {
Matrix invTransform = mTransform;
invTransform.Invert();
Matrix toNewUS = mPathTransform * invTransform;
mPathBuilder = mPath->TransformedCopyToBuilder(toNewUS, CurrentState().fillRule);
mPathBuilder = mPath->TransformedCopyToBuilder(toNewUS);
}
return;
}
@ -1061,7 +1049,7 @@ gfxContext::EnsurePathBuilder()
DebugOnly<PathBuilder*> oldPath = mPathBuilder.get();
if (!mPathBuilder) {
mPathBuilder = mDT->CreatePathBuilder(CurrentState().fillRule);
mPathBuilder = mDT->CreatePathBuilder(FillRule::FILL_WINDING);
if (mPathIsRect) {
mPathBuilder->MoveTo(mRect.TopLeft());
@ -1084,7 +1072,7 @@ gfxContext::EnsurePathBuilder()
Matrix toNewUS = mPathTransform * invTransform;
RefPtr<Path> path = mPathBuilder->Finish();
mPathBuilder = path->TransformedCopyToBuilder(toNewUS, CurrentState().fillRule);
mPathBuilder = path->TransformedCopyToBuilder(toNewUS);
}
mPathIsRect = false;
@ -1193,8 +1181,8 @@ gfxContext::ChangeTransform(const Matrix &aNewMatrix, bool aUpdatePatternTransfo
mRect = toNewUS.TransformBounds(mRect);
mRect.NudgeToIntegers();
} else {
mPathBuilder = mDT->CreatePathBuilder(CurrentState().fillRule);
mPathBuilder = mDT->CreatePathBuilder(FillRule::FILL_WINDING);
mPathBuilder->MoveTo(toNewUS * mRect.TopLeft());
mPathBuilder->LineTo(toNewUS * mRect.TopRight());
mPathBuilder->LineTo(toNewUS * mRect.BottomRight());

View File

@ -366,13 +366,6 @@ public:
void SetMiterLimit(gfxFloat limit);
gfxFloat CurrentMiterLimit() const;
/**
** Fill Properties
**/
void SetFillRule(FillRule rule);
FillRule CurrentFillRule() const;
/**
* Sets the operator used for all further drawing. The operator affects
* how drawing something will modify the destination. For example, the
@ -496,7 +489,6 @@ private:
AzureState()
: op(mozilla::gfx::CompositionOp::OP_OVER)
, color(0, 0, 0, 1.0f)
, fillRule(mozilla::gfx::FillRule::FILL_WINDING)
, aaMode(mozilla::gfx::AntialiasMode::SUBPIXEL)
, patternTransformChanged(false)
{}
@ -516,7 +508,6 @@ private:
};
nsTArray<PushedClip> pushedClips;
nsTArray<Float> dashPattern;
mozilla::gfx::FillRule fillRule;
StrokeOptions strokeOptions;
RefPtr<DrawTarget> drawTarget;
mozilla::gfx::AntialiasMode aaMode;