bug 643460 pt 3 - remove gfx.downloadable_fonts.sanitize.preserve_otl_tables preference, no longer needed with new OTS version. r=jfkthame
authorMasatoshi Kimura <VYV03354@nifty.ne.jp>
Tue, 26 Apr 2011 16:29:43 +0100
changeset 68768 3007eb62abc46564a4b22d2da5d58825f0d61c38
parent 68767 32f760d04b38a52dfae7c6a9bc5d22430baf4d79
child 68853 28bc239d3d9df5f64b331e9f6ed516769036d304
child 75162 edd7fb5c83a03f18cb3844d319e6752d57262d81
push id76
push userbzbarsky@mozilla.com
push dateTue, 05 Jul 2011 17:00:57 +0000
treeherdermozilla-beta@d3a2732c35f1 [default view] [failures only]
perfherder[talos] [build metrics] [platform microbench] (compared to previous push)
reviewersjfkthame
bugs643460
milestone6.0a1
first release with
nightly linux32
nightly linux64
nightly mac
nightly win32
nightly win64
last release without
nightly linux32
nightly linux64
nightly mac
nightly win32
nightly win64
bug 643460 pt 3 - remove gfx.downloadable_fonts.sanitize.preserve_otl_tables preference, no longer needed with new OTS version. r=jfkthame
gfx/thebes/gfxPlatform.cpp
gfx/thebes/gfxPlatform.h
gfx/thebes/gfxUserFontSet.cpp
modules/libpref/src/init/all.js
--- a/gfx/thebes/gfxPlatform.cpp
+++ b/gfx/thebes/gfxPlatform.cpp
@@ -144,18 +144,16 @@ SRGBOverrideObserver::Observe(nsISupport
                    NS_LITERAL_STRING("gfx.color_mangement.force_srgb").get()),
                  "Restarting CMS on wrong pref!");
     ShutdownCMS();
     return NS_OK;
 }
 
 #define GFX_DOWNLOADABLE_FONTS_ENABLED "gfx.downloadable_fonts.enabled"
 #define GFX_DOWNLOADABLE_FONTS_SANITIZE "gfx.downloadable_fonts.sanitize"
-#define GFX_DOWNLOADABLE_FONTS_SANITIZE_PRESERVE_OTL \
-            "gfx.downloadable_fonts.sanitize.preserve_otl_tables"
 
 #define GFX_PREF_HARFBUZZ_SCRIPTS "gfx.font_rendering.harfbuzz.scripts"
 #define HARFBUZZ_SCRIPTS_DEFAULT  gfxUnicodeProperties::SHAPING_DEFAULT
 
 class FontPrefsObserver : public nsIObserver
 {
 public:
     NS_DECL_ISUPPORTS
@@ -220,17 +218,16 @@ static const char *gPrefLangNames[] = {
     "x-user-def"
 };
 
 gfxPlatform::gfxPlatform()
 {
     mUseHarfBuzzScripts = UNINITIALIZED_VALUE;
     mAllowDownloadableFonts = UNINITIALIZED_VALUE;
     mDownloadableFontsSanitize = UNINITIALIZED_VALUE;
-    mSanitizePreserveOTLTables = UNINITIALIZED_VALUE;
 }
 
 gfxPlatform*
 gfxPlatform::GetPlatform()
 {
     return gPlatform;
 }
 
@@ -442,27 +439,16 @@ gfxPlatform::SanitizeDownloadedFonts()
         mDownloadableFontsSanitize =
             GetBoolPref(GFX_DOWNLOADABLE_FONTS_SANITIZE, PR_TRUE);
     }
 
     return mDownloadableFontsSanitize;
 }
 
 PRBool
-gfxPlatform::PreserveOTLTablesWhenSanitizing()
-{
-    if (mSanitizePreserveOTLTables == UNINITIALIZED_VALUE) {
-        mSanitizePreserveOTLTables =
-            GetBoolPref(GFX_DOWNLOADABLE_FONTS_SANITIZE_PRESERVE_OTL, PR_FALSE);
-    }
-
-    return mSanitizePreserveOTLTables;
-}
-
-PRBool
 gfxPlatform::UseHarfBuzzForScript(PRInt32 aScriptCode)
 {
     if (mUseHarfBuzzScripts == UNINITIALIZED_VALUE) {
         mUseHarfBuzzScripts = HARFBUZZ_SCRIPTS_DEFAULT;
         nsCOMPtr<nsIPrefBranch2> prefs = do_GetService(NS_PREFSERVICE_CONTRACTID);
         if (prefs) {
             PRInt32 scripts;
             nsresult rv = prefs->GetIntPref(GFX_PREF_HARFBUZZ_SCRIPTS, &scripts);
@@ -1248,18 +1234,16 @@ gfxPlatform::SetupClusterBoundaries(gfxT
 void
 gfxPlatform::FontsPrefsChanged(nsIPrefBranch *aPrefBranch, const char *aPref)
 {
     NS_ASSERTION(aPref != nsnull, "null preference");
     if (!strcmp(GFX_DOWNLOADABLE_FONTS_ENABLED, aPref)) {
         mAllowDownloadableFonts = UNINITIALIZED_VALUE;
     } else if (!strcmp(GFX_DOWNLOADABLE_FONTS_SANITIZE, aPref)) {
         mDownloadableFontsSanitize = UNINITIALIZED_VALUE;
-    } else if (!strcmp(GFX_DOWNLOADABLE_FONTS_SANITIZE_PRESERVE_OTL, aPref)) {
-        mSanitizePreserveOTLTables = UNINITIALIZED_VALUE;
     } else if (!strcmp(GFX_PREF_HARFBUZZ_SCRIPTS, aPref)) {
         mUseHarfBuzzScripts = UNINITIALIZED_VALUE;
         gfxTextRunWordCache::Flush();
         gfxFontCache::GetCache()->AgeAllGenerations();
     }
 }
 
 
--- a/gfx/thebes/gfxPlatform.h
+++ b/gfx/thebes/gfxPlatform.h
@@ -253,21 +253,16 @@ public:
     PRBool DownloadableFontsEnabled();
 
     /**
      * Whether to sanitize downloaded fonts using the OTS library
      */
     PRBool SanitizeDownloadedFonts();
 
     /**
-     * Whether to preserve OpenType layout tables when sanitizing
-     */
-    PRBool PreserveOTLTablesWhenSanitizing();
-
-    /**
      * Whether to use the harfbuzz shaper (depending on script complexity).
      *
      * This allows harfbuzz to be enabled selectively via the preferences.
      */
     PRBool UseHarfBuzzForScript(PRInt32 aScriptCode);
 
     // check whether format is supported on a platform or not (if unclear, returns true)
     virtual PRBool IsFontFormatSupported(nsIURI *aFontURI, PRUint32 aFormatFlags) { return PR_FALSE; }
@@ -377,17 +372,16 @@ protected:
 
     static PRBool GetBoolPref(const char *aPref, PRBool aDefault);
 
     void AppendCJKPrefLangs(eFontPrefLang aPrefLangs[], PRUint32 &aLen, 
                             eFontPrefLang aCharLang, eFontPrefLang aPageLang);
                                                
     PRBool  mAllowDownloadableFonts;
     PRBool  mDownloadableFontsSanitize;
-    PRBool  mSanitizePreserveOTLTables;
 
     // which scripts should be shaped with harfbuzz
     PRInt32 mUseHarfBuzzScripts;
 
 private:
     virtual qcms_profile* GetPlatformCMSOutputProfile();
 
     nsRefPtr<gfxASurface> mScreenReferenceSurface;
--- a/gfx/thebes/gfxUserFontSet.cpp
+++ b/gfx/thebes/gfxUserFontSet.cpp
@@ -358,18 +358,17 @@ private:
 // Returns a newly-allocated block, or NULL in case of fatal errors.
 static const PRUint8*
 SanitizeOpenTypeData(const PRUint8* aData, PRUint32 aLength,
                      PRUint32& aSaneLength, bool aIsCompressed)
 {
     // limit output/expansion to 256MB
     ExpandingMemoryStream output(aIsCompressed ? aLength * 2 : aLength,
                                  1024 * 1024 * 256);
-    if (ots::Process(&output, aData, aLength,
-        gfxPlatform::GetPlatform()->PreserveOTLTablesWhenSanitizing())) {
+    if (ots::Process(&output, aData, aLength)) {
         aSaneLength = output.Tell();
         return static_cast<PRUint8*>(output.forget());
     } else {
         aSaneLength = 0;
         return nsnull;
     }
 }
 
--- a/modules/libpref/src/init/all.js
+++ b/modules/libpref/src/init/all.js
@@ -189,21 +189,16 @@ pref("media.autoplay.enabled", true);
 // See eCMSMode in gfx/thebes/gfxPlatform.h
 pref("gfx.color_management.mode", 2);
 pref("gfx.color_management.display_profile", "");
 pref("gfx.color_management.rendering_intent", 0);
 
 pref("gfx.downloadable_fonts.enabled", true);
 pref("gfx.downloadable_fonts.fallback_delay", 3000);
 pref("gfx.downloadable_fonts.sanitize", true);
-#ifdef XP_MACOSX
-pref("gfx.downloadable_fonts.sanitize.preserve_otl_tables", false);
-#else
-pref("gfx.downloadable_fonts.sanitize.preserve_otl_tables", true);
-#endif
 
 // see gfx/thebes/gfxUnicodeProperties.h for definitions of script bits
 #ifdef XP_MACOSX
 // use harfbuzz for default (0x01) + arabic (0x02) + hebrew (0x04)
 pref("gfx.font_rendering.harfbuzz.scripts", 7);
 #else
 // use harfbuzz for default (0x01) + arabic (0x02)
 pref("gfx.font_rendering.harfbuzz.scripts", 3);