diff --git a/mozilla/gfx/src/nsDeviceContext.cpp b/mozilla/gfx/src/nsDeviceContext.cpp index 842e460b8eb..0ac3a68212b 100644 --- a/mozilla/gfx/src/nsDeviceContext.cpp +++ b/mozilla/gfx/src/nsDeviceContext.cpp @@ -563,6 +563,14 @@ NS_IMETHODIMP DeviceContextImpl::GetLocalFontName(const nsString& aFaceName, nsS return result; } +NS_IMETHODIMP DeviceContextImpl :: FlushFontCache(void) +{ + if (nsnull != mFontCache) + mFontCache->Flush(); + + return NS_OK; +} + NS_IMETHODIMP DeviceContextImpl::GetILColorSpace(IL_ColorSpace*& aColorSpace) { if (nsnull == mColorSpace) { diff --git a/mozilla/gfx/src/nsDeviceContext.h b/mozilla/gfx/src/nsDeviceContext.h index 53ff4c15b07..97f01958b35 100644 --- a/mozilla/gfx/src/nsDeviceContext.h +++ b/mozilla/gfx/src/nsDeviceContext.h @@ -68,6 +68,8 @@ public: NS_IMETHOD GetLocalFontName(const nsString& aFaceName, nsString& aLocalName, PRBool& aAliased); + NS_IMETHOD FlushFontCache(void); + NS_IMETHOD GetDepth(PRUint32& aDepth); NS_IMETHOD GetILColorSpace(IL_ColorSpace*& aColorSpace); diff --git a/mozilla/gfx/src/nsIDeviceContext.h b/mozilla/gfx/src/nsIDeviceContext.h index 41f244a3136..a69dea633e5 100644 --- a/mozilla/gfx/src/nsIDeviceContext.h +++ b/mozilla/gfx/src/nsIDeviceContext.h @@ -235,6 +235,13 @@ public: NS_IMETHOD GetLocalFontName(const nsString& aFaceName, nsString& aLocalName, PRBool& aAliased) = 0; + /** + * Attempt to free up resoruces by flushing out any fonts no longer + * referenced by anything other than the font cache itself. + * @return error status + */ + NS_IMETHOD FlushFontCache(void) = 0; + /** * Return the bit depth of the device. */