Bug 291817 - allow cairo to be used as the svg renderer on win32.

r=pavlov, a=asa.
This commit is contained in:
tor%cs.brown.edu 2005-04-26 00:21:23 +00:00
parent 977dfa358d
commit 94df15fb13
2 changed files with 16 additions and 0 deletions

View File

@ -108,3 +108,7 @@ endif
ifneq (,$(filter mac cocoa,$(MOZ_WIDGET_TOOLKIT))) ifneq (,$(filter mac cocoa,$(MOZ_WIDGET_TOOLKIT)))
LOCAL_INCLUDES += -I$(topsrcdir)/gfx/src/mac LOCAL_INCLUDES += -I$(topsrcdir)/gfx/src/mac
endif endif
ifeq ($(MOZ_WIDGET_TOOLKIT), windows)
LOCAL_INCLUDES += -I$(topsrcdir)/gfx/src/windows
endif

View File

@ -56,6 +56,11 @@
extern "C" { extern "C" {
#include <cairo-quartz.h> #include <cairo-quartz.h>
} }
#elif defined(XP_WIN)
#include "nsDrawingSurfaceWin.h"
extern "C" {
#include <cairo-win32.h>
}
#else #else
#include "nsRenderingContextGTK.h" #include "nsRenderingContextGTK.h"
#include <gdk/gdkx.h> #include <gdk/gdkx.h>
@ -154,6 +159,13 @@ nsSVGCairoCanvas::Init(nsIRenderingContext *ctx,
cairo_set_target_quartz_context(mCR, mQuartzRef, cairo_set_target_quartz_context(mCR, mQuartzRef,
portRect.right - portRect.left, portRect.right - portRect.left,
portRect.bottom - portRect.top); portRect.bottom - portRect.top);
#elif defined(XP_WIN)
nsDrawingSurfaceWin *surface;
HDC hdc;
ctx->GetDrawingSurface((nsIDrawingSurface**)&surface);
surface->GetDimensions(&mWidth, &mHeight);
surface->GetDC(&hdc);
cairo_set_target_win32(mCR, hdc);
#else #else
nsDrawingSurfaceGTK *surface; nsDrawingSurfaceGTK *surface;
ctx->GetDrawingSurface((nsIDrawingSurface**)&surface); ctx->GetDrawingSurface((nsIDrawingSurface**)&surface);