b=352488, canvas drawWindow causes transform change in source window; also 324803, drawwindow sometimes fails on cairo builds, r=stuart

This commit is contained in:
vladimir%pobox.com 2006-10-26 15:24:15 +00:00
parent 86622fa411
commit 5f16d02aa3
2 changed files with 12 additions and 1 deletions

View File

@ -143,6 +143,13 @@ public:
gfxFloat& x0() { return mat.x0; }
gfxFloat& y0() { return mat.y0; }
const gfxFloat& xx() const { return mat.xx; }
const gfxFloat& xy() const { return mat.xy; }
const gfxFloat& yx() const { return mat.yx; }
const gfxFloat& yy() const { return mat.yy; }
const gfxFloat& x0() const { return mat.x0; }
const gfxFloat& y0() const { return mat.y0; }
// matrix operations
/**
* Resets this matrix to the identity matrix.

View File

@ -160,7 +160,10 @@ gfxWindowsFont::CairoScaledFont()
void
gfxWindowsFont::UpdateCTM(const gfxMatrix& aMatrix)
{
if (aMatrix.ToCairoMatrix().yy == mCTM.ToCairoMatrix().yy)
if (aMatrix.yy() == mCTM.yy() &&
aMatrix.xx() == mCTM.xx() &&
aMatrix.xy() == mCTM.xy() &&
aMatrix.yx() == mCTM.yx())
return;
Destroy();
@ -553,6 +556,7 @@ gfxWindowsTextRun::MeasureOrDrawReallyFast(gfxContext *aContext,
NS_ASSERTION(aDC, "No DC");
nsRefPtr<gfxWindowsFont> currentFont = mGroup->GetFontAt(0);
currentFont->UpdateCTM(aContext->CurrentMatrix());
HFONT hfont = currentFont->GetHFONT();
SelectObject(aDC, hfont);