Bug 710509: Allow Skia to be easily switched off. r=khuey
authorBas Schouten <bschouten@mozilla.com>
Wed, 14 Dec 2011 08:04:32 -0500
changeset 82551 0838277b7bd9db745b7eaff8fc56399c6b4b79ed
parent 82550 245c74c2f4dd008a9b2c8fb725f7848f649bee15
child 82552 0db4673fa6b52da23e343c519bfe799f3813209e
push id4023
push userkhuey@mozilla.com
push dateWed, 14 Dec 2011 13:09:13 +0000
treeherdermozilla-inbound@6a1184c51eae [default view] [failures only]
perfherder[talos] [build metrics] [platform microbench] (compared to previous push)
reviewerskhuey
bugs710509
milestone11.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 710509: Allow Skia to be easily switched off. r=khuey
config/autoconf.mk.in
configure.in
gfx/2d/Makefile.in
gfx/Makefile.in
toolkit/library/Makefile.in
--- a/config/autoconf.mk.in
+++ b/config/autoconf.mk.in
@@ -473,16 +473,17 @@ endif
 
 QCMS_LIBS	= @QCMS_LIBS@
 
 MOZ_HARFBUZZ_LIBS = @MOZ_HARFBUZZ_LIBS@
 MOZ_GRAPHITE_LIBS = @MOZ_GRAPHITE_LIBS@
 MOZ_GRAPHITE = @MOZ_GRAPHITE@
 MOZ_OTS_LIBS = @MOZ_OTS_LIBS@
 MOZ_SKIA_LIBS = @MOZ_SKIA_LIBS@
+MOZ_ENABLE_SKIA = @MOZ_ENABLE_SKIA@
 
 MOZ_NATIVE_SQLITE = @MOZ_NATIVE_SQLITE@
 SQLITE_CFLAGS     = @SQLITE_CFLAGS@
 SQLITE_LIBS       = @SQLITE_LIBS@
 
 NSPR_CONFIG	= @NSPR_CONFIG@
 NSPR_CFLAGS	= @NSPR_CFLAGS@
 NSPR_LIBS	= @NSPR_LIBS@
--- a/configure.in
+++ b/configure.in
@@ -8014,16 +8014,31 @@ if test -z "${GLIB_GMODULE_LIBS}" \
     GLIB_GMODULE_LIBS=`$GLIB_CONFIG gmodule --libs`
 fi
 
 AC_SUBST(GLIB_CFLAGS)
 AC_SUBST(GLIB_LIBS)
 AC_SUBST(GLIB_GMODULE_LIBS)
 
 dnl ========================================================
+dnl Graphics checks.
+dnl ========================================================
+
+if test "${OS_ARCH}" = "WINNT" -o "${OS_ARCH}" = "Darwin" -o "${OS_TARGET}" = "Android"; then
+MOZ_ENABLE_SKIA=1
+else
+MOZ_ENABLE_SKIA=
+fi
+
+MOZ_ARG_ENABLE_BOOL(skia,
+[  --enable-skia   Enable use of Skia],
+MOZ_ENABLE_SKIA=1,
+MOZ_ENABLE_SKIA=)
+
+dnl ========================================================
 dnl Check for cairo
 dnl ========================================================
 MOZ_CAIRO_CFLAGS='-I$(LIBXUL_DIST)/include/cairo'
 
 MOZ_TREE_CAIRO=1
 MOZ_ARG_ENABLE_BOOL(system-cairo,
 [  --enable-system-cairo   Use system cairo (located with pkgconfig)],
 MOZ_TREE_CAIRO=,
@@ -8193,17 +8208,23 @@ dnl ====================================
 dnl OTS
 dnl ========================================================
 MOZ_OTS_LIBS='$(DEPTH)/gfx/ots/src/$(LIB_PREFIX)mozots.$(LIB_SUFFIX)'
 AC_SUBST(MOZ_OTS_LIBS)
 
 dnl ========================================================
 dnl Skia 
 dnl ========================================================
-MOZ_SKIA_LIBS='$(DEPTH)/gfx/skia/$(LIB_PREFIX)skia.$(LIB_SUFFIX)'
+if test "$MOZ_ENABLE_SKIA"; then
+  MOZ_SKIA_LIBS='$(DEPTH)/gfx/skia/$(LIB_PREFIX)skia.$(LIB_SUFFIX)'
+  AC_DEFINE(MOZ_ENABLE_SKIA)
+else
+  MOZ_SKIA_LIBS=
+fi
+AC_SUBST(MOZ_ENABLE_SKIA)
 AC_SUBST(MOZ_SKIA_LIBS)
 
 dnl ========================================================
 dnl disable xul
 dnl ========================================================
 MOZ_ARG_DISABLE_BOOL(xul,
 [  --disable-xul           Disable XUL],
     MOZ_XUL= )
--- a/gfx/2d/Makefile.in
+++ b/gfx/2d/Makefile.in
@@ -70,57 +70,62 @@ CPPSRCS	= \
         DrawTargetCairo.cpp \
         SourceSurfaceCairo.cpp \
         Blur.cpp \
         $(NULL)
 
 
 DEFINES += -DMOZ_GFX -DUSE_CAIRO
 
-ifeq (cocoa,$(MOZ_WIDGET_TOOLKIT))
+ifdef MOZ_ENABLE_SKIA
 CPPSRCS	+= \
-		SourceSurfaceSkia.cpp \
-		DrawTargetSkia.cpp \
-		PathSkia.cpp \
+        SourceSurfaceSkia.cpp \
+        DrawTargetSkia.cpp \
+        PathSkia.cpp \
         ScaledFontSkia.cpp \
-		ScaledFontMac.cpp \
         $(NULL)
+
 DEFINES += -DUSE_SKIA
+
+endif
+
+ifeq (cocoa,$(MOZ_WIDGET_TOOLKIT))
+ifdef MOZ_ENABLE_SKIA
+CPPSRCS += \
+        ScaledFontMac.cpp \
+        $(NULL)
+
+endif
 endif
 
 ifeq (android,$(MOZ_WIDGET_TOOLKIT))
-CPPSRCS	+= \
-		SourceSurfaceSkia.cpp \
-		DrawTargetSkia.cpp \
-        ScaledFontSkia.cpp \
-		PathSkia.cpp \
-        $(NULL)
-DEFINES += -DUSE_SKIA -DSK_BUILD_FOR_ANDROID_NDK
+DEFINES += -DSK_BUILD_FOR_ANDROID_NDK
 endif
 
 DEFINES += -DSK_A32_SHIFT=24 -DSK_R32_SHIFT=16 -DSK_G32_SHIFT=8 -DSK_B32_SHIFT=0
 
 ifdef MOZ_DEBUG
 DEFINES += -DGFX_LOG_DEBUG -DGFX_LOG_WARNING
 endif
 
 ifeq ($(MOZ_WIDGET_TOOLKIT),windows)
 CPPSRCS	+= \
         DrawTargetD2D.cpp \
         SourceSurfaceD2D.cpp \
         SourceSurfaceD2DTarget.cpp \
         PathD2D.cpp \
         ScaledFontDWrite.cpp \
-        SourceSurfaceSkia.cpp \
-        DrawTargetSkia.cpp \
-        PathSkia.cpp \
-        ScaledFontSkia.cpp \
+        $(NULL)
+DEFINES += -DWIN32
+
+ifdef MOZ_ENABLE_SKIA
+CPPSRCS += \
         ScaledFontWin.cpp \
         $(NULL)
-DEFINES += -DWIN32 -DUSE_SKIA
+endif
 endif
 
 #ifeq ($(MOZ_WIDGET_TOOLKIT),cocoa)
 #CPPSRCS	+= \
 #        DrawTargetCG.cpp \
 #        SourceSurfaceCG.cpp \
 #	$(NULL)
 #
--- a/gfx/Makefile.in
+++ b/gfx/Makefile.in
@@ -49,17 +49,17 @@ DIRS		= cairo
 endif
 
 ifdef MOZ_GRAPHITE
 DIRS		+= graphite2/src
 endif
 
 DIRS		+= 2d ycbcr angle src qcms gl layers harfbuzz/src ots/src thebes ipc
 
-ifeq (,$(filter-out cocoa android windows,$(MOZ_WIDGET_TOOLKIT)))
+ifdef MOZ_ENABLE_SKIA
 DIRS        += skia
 endif
 
 ifdef ENABLE_TESTS
 TOOL_DIRS	+= tests
 endif
 
 include $(topsrcdir)/config/rules.mk
--- a/toolkit/library/Makefile.in
+++ b/toolkit/library/Makefile.in
@@ -408,17 +408,17 @@ ifeq ($(OS_ARCH),Linux)
 EXTRA_DSO_LDOPTS += $(MOZ_ALSA_LIBS)
 endif
 endif
 
 ifdef HAVE_CLOCK_MONOTONIC
 EXTRA_DSO_LDOPTS += $(REALTIME_LIBS)
 endif
 
-ifeq (,$(filter-out cocoa android windows,$(MOZ_WIDGET_TOOLKIT)))
+ifdef MOZ_ENABLE_SKIA
 EXTRA_DSO_LDOPTS += $(MOZ_SKIA_LIBS)
 endif
 
 ifeq (android,$(MOZ_WIDGET_TOOLKIT))
 OS_LIBS += -lGLESv2
 endif
 
 ifeq (gonk,$(MOZ_WIDGET_TOOLKIT))