зеркало из https://github.com/mozilla/gecko-dev.git
Bug 602757. Part 1: Create gfxContextAutoDisableSubpixelAntialiasing helper. r=vlad,a=blocking
This commit is contained in:
Родитель
38e3e7272a
Коммит
64c483c0b7
|
@ -791,4 +791,27 @@ private:
|
|||
gfxMatrix mMatrix;
|
||||
};
|
||||
|
||||
|
||||
class THEBES_API gfxContextAutoDisableSubpixelAntialiasing {
|
||||
public:
|
||||
gfxContextAutoDisableSubpixelAntialiasing(gfxContext *aContext, PRBool aDisable)
|
||||
{
|
||||
if (aDisable) {
|
||||
mSurface = aContext->CurrentSurface();
|
||||
mSubpixelAntialiasingEnabled = mSurface->GetSubpixelAntialiasingEnabled();
|
||||
mSurface->SetSubpixelAntialiasingEnabled(PR_FALSE);
|
||||
}
|
||||
}
|
||||
~gfxContextAutoDisableSubpixelAntialiasing()
|
||||
{
|
||||
if (mSurface) {
|
||||
mSurface->SetSubpixelAntialiasingEnabled(mSubpixelAntialiasingEnabled);
|
||||
}
|
||||
}
|
||||
|
||||
private:
|
||||
nsRefPtr<gfxASurface> mSurface;
|
||||
PRPackedBool mSubpixelAntialiasingEnabled;
|
||||
};
|
||||
|
||||
#endif /* GFX_CONTEXT_H */
|
||||
|
|
Загрузка…
Ссылка в новой задаче