diff --git a/config/system-headers b/config/system-headers index 6544f6b7ed0..a4c34167f19 100644 --- a/config/system-headers +++ b/config/system-headers @@ -268,6 +268,11 @@ freetype/ftoutln.h freetype/ttnameid.h freetype/tttables.h freetype/t1tables.h +freetype/ftlcdfil.h +freetype/ftsizes.h +freetype/ftadvanc.h +freetype/ftbitmap.h +freetype/ftxf86.h fribidi/fribidi.h FSp_fopen.h fstream diff --git a/configure.in b/configure.in index 21f3fb702e9..afb83cf82ad 100644 --- a/configure.in +++ b/configure.in @@ -7997,7 +7997,7 @@ dnl ======================================================== dnl Graphics checks. dnl ======================================================== -if test "${OS_ARCH}" = "Darwin" -o "${MOZ_WIDGET_TOOLKIT}" = "android"; then +if test "${OS_ARCH}" = "Darwin" -o "${MOZ_WIDGET_TOOLKIT}" = "android" -o "${MOZ_WIDGET_TOOLKIT}" = "gtk2"; then MOZ_ENABLE_SKIA=1 else MOZ_ENABLE_SKIA= diff --git a/content/canvas/src/nsCanvasRenderingContext2DAzure.cpp b/content/canvas/src/nsCanvasRenderingContext2DAzure.cpp index 866fc655cc2..d9c5a861982 100644 --- a/content/canvas/src/nsCanvasRenderingContext2DAzure.cpp +++ b/content/canvas/src/nsCanvasRenderingContext2DAzure.cpp @@ -995,7 +995,7 @@ NS_NewCanvasRenderingContext2DAzure(nsIDOMCanvasRenderingContext2D** aResult) !Preferences::GetBool("gfx.canvas.azure.prefer-skia", false)) { return NS_ERROR_NOT_AVAILABLE; } -#elif !defined(XP_MACOSX) && !defined(ANDROID) +#elif !defined(XP_MACOSX) && !defined(ANDROID) && !defined(XP_LINUX) return NS_ERROR_NOT_AVAILABLE; #endif diff --git a/gfx/skia/Makefile.in b/gfx/skia/Makefile.in index 1a41171fa19..2ead7b8ea2c 100644 --- a/gfx/skia/Makefile.in +++ b/gfx/skia/Makefile.in @@ -68,6 +68,7 @@ VPATH += \ $(srcdir)/src/ports \ $(srcdir)/src/opts \ $(srcdir)/src/effects \ + $(srcdir)/src/utils \ $(NULL) EXPORTS_skia = \ @@ -319,6 +320,19 @@ DEFINES += -DSK_BUILD_FOR_ANDROID_NDK OS_CXXFLAGS += $(CAIRO_FT_CFLAGS) endif +ifeq (gtk2,$(MOZ_WIDGET_TOOLKIT)) +CPPSRCS += \ + SkFontHost_FreeType.cpp \ + SkFontHost_linux.cpp \ + SkFontHost_gamma.cpp \ + SkTime_Unix.cpp \ + SkMMapStream.cpp \ + SkOSFile.cpp \ + $(NULL) + +OS_CXXFLAGS += $(MOZ_PANGO_CFLAGS) +endif + ifeq (windows,$(MOZ_WIDGET_TOOLKIT)) EXPORTS_skia += \ include/config/sk_stdint.h \ diff --git a/gfx/thebes/gfxPlatformGtk.cpp b/gfx/thebes/gfxPlatformGtk.cpp index 94e5ab27e8e..c3614d8ccbe 100644 --- a/gfx/thebes/gfxPlatformGtk.cpp +++ b/gfx/thebes/gfxPlatformGtk.cpp @@ -56,6 +56,8 @@ #include "gfxFT2Fonts.h" #endif +#include "mozilla/gfx/2D.h" + #include "cairo.h" #include @@ -83,6 +85,9 @@ #include FT_FREETYPE_H #endif +using namespace mozilla; +using namespace mozilla::gfx; + gfxFontconfigUtils *gfxPlatformGtk::sFontconfigUtils = nsnull; #ifndef MOZ_PANGO @@ -761,3 +766,23 @@ gfxPlatformGtk::GetGdkDrawable(gfxASurface *target) return NULL; } + +RefPtr +gfxPlatformGtk::GetScaledFontForFont(gfxFont *aFont) +{ + NativeFont nativeFont; + nativeFont.mType = NATIVE_FONT_SKIA_FONT_FACE; + nativeFont.mFont = aFont; + RefPtr scaledFont = + Factory::CreateScaledFontForNativeFont(nativeFont, aFont->GetAdjustedSize()); + + return scaledFont; +} + +bool +gfxPlatformGtk::SupportsAzure(BackendType& aBackend) +{ + aBackend = BACKEND_SKIA; + return true; +} + diff --git a/gfx/thebes/gfxPlatformGtk.h b/gfx/thebes/gfxPlatformGtk.h index b383f30d7af..2ec617c19c1 100644 --- a/gfx/thebes/gfxPlatformGtk.h +++ b/gfx/thebes/gfxPlatformGtk.h @@ -66,6 +66,11 @@ public: already_AddRefed CreateOffscreenSurface(const gfxIntSize& size, gfxASurface::gfxContentType contentType); + mozilla::RefPtr + GetScaledFontForFont(gfxFont *aFont); + + virtual bool SupportsAzure(mozilla::gfx::BackendType& aBackend); + nsresult GetFontList(nsIAtom *aLangGroup, const nsACString& aGenericFamily, nsTArray& aListOfFonts); diff --git a/js/src/config/system-headers b/js/src/config/system-headers index 6544f6b7ed0..a4c34167f19 100644 --- a/js/src/config/system-headers +++ b/js/src/config/system-headers @@ -268,6 +268,11 @@ freetype/ftoutln.h freetype/ttnameid.h freetype/tttables.h freetype/t1tables.h +freetype/ftlcdfil.h +freetype/ftsizes.h +freetype/ftadvanc.h +freetype/ftbitmap.h +freetype/ftxf86.h fribidi/fribidi.h FSp_fopen.h fstream