Bug 587395: Expose whether DWrite is enabled through nsIGfxInfo. r=joedrew

This commit is contained in:
Jeff Muizelaar 2010-08-16 09:15:03 +02:00
parent 8e08f7907f
commit 024d8acf0d
3 changed files with 12 additions and 0 deletions

View File

@ -213,6 +213,9 @@ public:
#ifdef CAIRO_HAS_DWRITE_FONT
IDWriteFactory *GetDWriteFactory() { return mDWriteFactory; }
inline PRBool DWriteEnabled() { return !!mDWriteFactory; }
#else
inline PRBool DWriteEnabled() { return PR_FALSE; }
#endif
#ifdef CAIRO_HAS_D2D_SURFACE
cairo_device_t *GetD2DDevice() { return mD2DDevice; }

View File

@ -38,9 +38,12 @@
#include "nsISupports.idl"
/* NOTE: this interface is completely undesigned, not stable and likely to change */
[scriptable, uuid(5C05E5B7-0FCC-4070-BF6B-58BC33ECA427)]
interface nsIGfxInfo : nsISupports
{
readonly attribute boolean D2DEnabled;
readonly attribute boolean DWriteEnabled;
};

View File

@ -47,3 +47,9 @@ nsresult GfxInfo::GetD2DEnabled(PRBool *aEnabled)
*aEnabled = gfxWindowsPlatform::GetPlatform()->GetRenderMode() == gfxWindowsPlatform::RENDER_DIRECT2D;
return NS_OK;
}
nsresult GfxInfo::GetDWriteEnabled(PRBool *aEnabled)
{
*aEnabled = gfxWindowsPlatform::GetPlatform()->DWriteEnabled();
return NS_OK;
}