Bug 1064737 pt 1 - Enable WOFF2 support in OTS. r=jdaggett
authorJonathan Kew <jkew@mozilla.com>
Sat, 04 Oct 2014 10:05:14 +0100
changeset 208816 689da8627d4d1b05988353924fc915557546e3c1
parent 208815 06200548262b5ebe423723a81b7b4299aa492012
child 208817 f9c7c0ea55700422809f442ae16bdb2ca6e015c4
push id1
push userroot
push dateMon, 20 Oct 2014 17:29:22 +0000
reviewersjdaggett
bugs1064737
milestone35.0a1
Bug 1064737 pt 1 - Enable WOFF2 support in OTS. r=jdaggett
gfx/ots/include/opentype-sanitiser.h
gfx/ots/src/moz.build
gfx/ots/src/woff2.cc
--- a/gfx/ots/include/opentype-sanitiser.h
+++ b/gfx/ots/include/opentype-sanitiser.h
@@ -236,13 +236,13 @@ class OTS_API OTSContext {
     virtual TableAction GetTableAction(uint32_t tag) { return ots::TABLE_ACTION_DEFAULT; }
 };
 
 // Force to disable debug output even when the library is compiled with
 // -DOTS_DEBUG.
 void DisableDebugOutput();
 
 // Enable WOFF2 support(experimental).
-void EnableWOFF2();
+void OTS_API EnableWOFF2();
 
 }  // namespace ots
 
 #endif  // OPENTYPE_SANITISER_H_
--- a/gfx/ots/src/moz.build
+++ b/gfx/ots/src/moz.build
@@ -39,16 +39,17 @@ UNIFIED_SOURCES += [
     'metrics.cc',
     'name.cc',
     'os2.cc',
     'ots.cc',
     'post.cc',
     'prep.cc',
     'vhea.cc',
     'vmtx.cc',
+    'woff2.cc',
 ]
 
 MSVC_ENABLE_PGO = True
 
 if CONFIG['GKMEDIAS_SHARED_LIBRARY']:
     NO_VISIBILITY_FLAGS = True
 
 FINAL_LIBRARY = 'gkmedias'
@@ -56,10 +57,11 @@ FINAL_LIBRARY = 'gkmedias'
 DEFINES['PACKAGE_VERSION'] = '"moz"'
 DEFINES['PACKAGE_BUGREPORT'] = '"http://bugzilla.mozilla.org/"'
 DEFINES['NOMINMAX'] = True
 
 if CONFIG['OS_TARGET'] == 'WINNT':
     DEFINES['OTS_DLL'] = True
     DEFINES['OTS_DLL_EXPORTS'] = True
 
-# Disable WOFF2 support.
-DEFINES['OTS_DISABLE_WOFF2'] = True;
+USE_LIBS += [
+    'brotli',
+]
--- a/gfx/ots/src/woff2.cc
+++ b/gfx/ots/src/woff2.cc
@@ -6,17 +6,17 @@
 // Condensed file format.
 
 #include <cassert>
 #include <cstdlib>
 #include <vector>
 
 #include <zlib.h>
 
-#include "third_party/brotli/src/brotli/dec/decode.h"
+#include "decode.h"
 
 #include "opentype-sanitiser.h"
 #include "ots-memory-stream.h"
 #include "ots.h"
 #include "woff2.h"
 
 namespace {