From f7f8b8ea47fa138ecfa7b0d2ef1a9c461569e032 Mon Sep 17 00:00:00 2001 From: "michaelp%netscape.com" Date: Wed, 2 Dec 1998 00:36:08 +0000 Subject: [PATCH] added FlushFontCache() method. git-svn-id: svn://10.0.0.236/trunk@15583 18797224-902f-48f8-a5cc-f745e15eee43 --- mozilla/gfx/src/nsDeviceContext.cpp | 8 ++++++++ mozilla/gfx/src/nsDeviceContext.h | 2 ++ mozilla/gfx/src/nsIDeviceContext.h | 7 +++++++ 3 files changed, 17 insertions(+) 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. */