mirror of
https://github.com/mozilla/gecko-dev.git
synced 2025-02-04 13:07:52 +00:00
Bug 1064084, part 4 - Convert all consumers of gfxContext::IdentityMatrix() to use gfxContext::SetMatrix(). r=Bas
This commit is contained in:
parent
d4d2f025b9
commit
2a0767dbda
@ -69,7 +69,7 @@ ClipToContain(gfxContext* aContext, const nsIntRect& aRect)
|
||||
deviceRect.RoundOut();
|
||||
|
||||
gfxMatrix currentMatrix = aContext->CurrentMatrix();
|
||||
aContext->IdentityMatrix();
|
||||
aContext->SetMatrix(gfxMatrix());
|
||||
aContext->NewPath();
|
||||
aContext->Rectangle(deviceRect);
|
||||
aContext->Clip();
|
||||
|
@ -112,7 +112,7 @@ nsRenderingContext::SetClip(const nsIntRegion& aRegion)
|
||||
// an existing clip.
|
||||
|
||||
gfxMatrix mat = mThebes->CurrentMatrix();
|
||||
mThebes->IdentityMatrix();
|
||||
mThebes->SetMatrix(gfxMatrix());
|
||||
|
||||
mThebes->ResetClip();
|
||||
|
||||
@ -185,7 +185,7 @@ nsRenderingContext::DrawLine(nscoord aX0, nscoord aY0,
|
||||
p0.Round();
|
||||
p1.Round();
|
||||
|
||||
mThebes->IdentityMatrix();
|
||||
mThebes->SetMatrix(gfxMatrix());
|
||||
|
||||
mThebes->NewPath();
|
||||
|
||||
@ -308,7 +308,7 @@ nsRenderingContext::FillRect(const nsRect& aRect)
|
||||
if (!ConditionRect(r))
|
||||
return;
|
||||
|
||||
mThebes->IdentityMatrix();
|
||||
mThebes->SetMatrix(gfxMatrix());
|
||||
mThebes->NewPath();
|
||||
|
||||
mThebes->Rectangle(r, true);
|
||||
|
@ -450,12 +450,6 @@ gfxContext::SetMatrix(const gfxMatrix& matrix)
|
||||
ChangeTransform(ToMatrix(matrix));
|
||||
}
|
||||
|
||||
void
|
||||
gfxContext::IdentityMatrix()
|
||||
{
|
||||
ChangeTransform(Matrix());
|
||||
}
|
||||
|
||||
gfxMatrix
|
||||
gfxContext::CurrentMatrix() const
|
||||
{
|
||||
@ -1072,7 +1066,7 @@ static gfxRect
|
||||
GetRoundOutDeviceClipExtents(gfxContext* aCtx)
|
||||
{
|
||||
gfxContextMatrixAutoSaveRestore save(aCtx);
|
||||
aCtx->IdentityMatrix();
|
||||
aCtx->SetMatrix(gfxMatrix());
|
||||
gfxRect r = aCtx->GetClipExtents();
|
||||
r.RoundOut();
|
||||
return r;
|
||||
|
@ -257,11 +257,6 @@ public:
|
||||
*/
|
||||
void SetMatrix(const gfxMatrix& matrix);
|
||||
|
||||
/**
|
||||
* Sets the transformation matrix to the identity matrix.
|
||||
*/
|
||||
void IdentityMatrix();
|
||||
|
||||
/**
|
||||
* Returns the current transformation matrix.
|
||||
*/
|
||||
|
@ -4362,7 +4362,7 @@ gfxFont::SetupGlyphExtents(gfxContext *aContext, uint32_t aGlyphID, bool aNeedTi
|
||||
gfxGlyphExtents *aExtents)
|
||||
{
|
||||
gfxContextMatrixAutoSaveRestore matrixRestore(aContext);
|
||||
aContext->IdentityMatrix();
|
||||
aContext->SetMatrix(gfxMatrix());
|
||||
|
||||
gfxRect svgBounds;
|
||||
if (mFontEntry->TryGetSVGData(this) && mFontEntry->HasSVGGlyph(aGlyphID) &&
|
||||
|
@ -450,7 +450,7 @@ struct MOZ_STACK_CLASS AutoCairoPixmanBugWorkaround
|
||||
// Clip the rounded-out-to-device-pixels bounds of the
|
||||
// transformed fill area. This is the area for the group we
|
||||
// want to push.
|
||||
mContext->IdentityMatrix();
|
||||
mContext->SetMatrix(gfxMatrix());
|
||||
gfxRect bounds = currentMatrix.TransformBounds(aFill);
|
||||
bounds.RoundOut();
|
||||
mContext->Clip(bounds);
|
||||
|
@ -5030,7 +5030,7 @@ nsContextBoxBlur::DoPaint()
|
||||
gfxContextMatrixAutoSaveRestore saveMatrix(mDestinationCtx);
|
||||
|
||||
if (mPreTransformed) {
|
||||
mDestinationCtx->IdentityMatrix();
|
||||
mDestinationCtx->SetMatrix(gfxMatrix());
|
||||
}
|
||||
|
||||
blur.Paint(mDestinationCtx);
|
||||
@ -5095,7 +5095,7 @@ nsContextBoxBlur::BlurRectangle(gfxContext* aDestinationCtx,
|
||||
if (!transform.HasNonAxisAlignedTransform() && transform._11 > 0.0 && transform._22 > 0.0) {
|
||||
scaleX = transform._11;
|
||||
scaleY = transform._22;
|
||||
aDestinationCtx->IdentityMatrix();
|
||||
aDestinationCtx->SetMatrix(gfxMatrix());
|
||||
} else {
|
||||
transform = gfxMatrix();
|
||||
}
|
||||
|
@ -1731,7 +1731,7 @@ nsObjectFrame::PaintPlugin(nsDisplayListBuilder* aBuilder,
|
||||
|
||||
if (ctx->UserToDevicePixelSnapped(frameGfxRect, false)) {
|
||||
dirtyGfxRect = ctx->UserToDevice(dirtyGfxRect);
|
||||
ctx->IdentityMatrix();
|
||||
ctx->SetMatrix(gfxMatrix());
|
||||
}
|
||||
dirtyGfxRect.RoundOut();
|
||||
|
||||
|
@ -200,7 +200,7 @@ nsSVGMaskFrame::GetMaskForMaskedFrame(gfxContext* aContext,
|
||||
// and maskArea) is important for performance.
|
||||
aContext->Save();
|
||||
nsSVGUtils::SetClipRect(aContext, aMatrix, maskArea);
|
||||
aContext->IdentityMatrix();
|
||||
aContext->SetMatrix(gfxMatrix());
|
||||
gfxRect maskSurfaceRect = aContext->GetClipExtents();
|
||||
maskSurfaceRect.RoundOut();
|
||||
aContext->Restore();
|
||||
|
@ -466,7 +466,7 @@ nsSVGPathGeometryFrame::GetBBoxContribution(const Matrix &aToBBoxUserspace,
|
||||
nsRefPtr<gfxContext> tmpCtx = new gfxContext(tmpDT);
|
||||
|
||||
GeneratePath(tmpCtx, aToBBoxUserspace);
|
||||
tmpCtx->IdentityMatrix();
|
||||
tmpCtx->SetMatrix(gfxMatrix());
|
||||
|
||||
// Be careful when replacing the following logic to get the fill and stroke
|
||||
// extents independently (instead of computing the stroke extents from the
|
||||
@ -703,7 +703,7 @@ nsSVGPathGeometryFrame::GeneratePath(gfxContext* aContext,
|
||||
const Matrix &aTransform)
|
||||
{
|
||||
if (aTransform.IsSingular()) {
|
||||
aContext->IdentityMatrix();
|
||||
aContext->SetMatrix(gfxMatrix());
|
||||
aContext->NewPath();
|
||||
return;
|
||||
}
|
||||
|
@ -838,11 +838,12 @@ nsNativeThemeGTK::DrawWidgetBackground(nsRenderingContext* aContext,
|
||||
|
||||
// translate everything so (0,0) is the top left of the drawingRect
|
||||
gfxContextAutoSaveRestore autoSR(ctx);
|
||||
if (snapXY) {
|
||||
// Rects are in device coords.
|
||||
ctx->IdentityMatrix();
|
||||
gfxMatrix tm;
|
||||
if (!snapXY) { // else rects are in device coords
|
||||
tm = ctx->CurrentMatrix();
|
||||
}
|
||||
ctx->Translate(rect.TopLeft() + gfxPoint(drawingRect.x, drawingRect.y));
|
||||
tm.Translate(rect.TopLeft() + gfxPoint(drawingRect.x, drawingRect.y));
|
||||
ctx->SetMatrix(tm);
|
||||
|
||||
NS_ASSERTION(!IsWidgetTypeDisabled(mDisabledWidgetTypes, aWidgetType),
|
||||
"Trying to render an unsafe widget!");
|
||||
|
Loading…
x
Reference in New Issue
Block a user