Bug 934286: Ifdef Mozilla specific cairo function usage. r=mattwoodrow

This commit is contained in:
Bas Schouten 2013-11-04 00:57:36 +01:00
parent c05f717a33
commit 196f0e4ade
2 changed files with 17 additions and 1 deletions

View File

@ -114,6 +114,7 @@ GetCairoSurfaceSize(cairo_surface_t* surface, IntSize& size)
}
#endif
#ifdef CAIRO_HAS_WIN32_SURFACE
#ifdef MOZ2D_HAS_MOZ_CAIRO
case CAIRO_SURFACE_TYPE_WIN32:
case CAIRO_SURFACE_TYPE_WIN32_PRINTING:
{
@ -121,6 +122,21 @@ GetCairoSurfaceSize(cairo_surface_t* surface, IntSize& size)
size.height = cairo_win32_surface_get_height(surface);
return true;
}
#else
case CAIRO_SURFACE_TYPE_WIN32:
{
cairo_surface_t *img = cairo_win32_surface_get_image(surface);
if (!img) {
// XXX - fix me
MOZ_ASSERT(false);
return true;
}
size.width = cairo_image_surface_get_width(img);
size.height = cairo_image_surface_get_height(img);
return true;
}
#endif
#endif
default:

View File

@ -5,7 +5,7 @@
VPATH = $(srcdir) $(srcdir)/unittest
DEFINES += -DMOZ_GFX -DUSE_CAIRO -DGFX2D_INTERNAL
DEFINES += -DMOZ_GFX -DUSE_CAIRO -DGFX2D_INTERNAL -DMOZ2D_HAS_MOZ_CAIRO
ifeq ($(MOZ_WIDGET_TOOLKIT),$(findstring $(MOZ_WIDGET_TOOLKIT),android gtk2 gtk3 gonk qt))
DEFINES += -DMOZ_ENABLE_FREETYPE