diff --git a/gfx/thebes/public/gfxPDFSurface.h b/gfx/thebes/public/gfxPDFSurface.h index c1a6721b6841..c908dd060fc7 100644 --- a/gfx/thebes/public/gfxPDFSurface.h +++ b/gfx/thebes/public/gfxPDFSurface.h @@ -40,8 +40,6 @@ #include "gfxASurface.h" -#include - class NS_EXPORT gfxPDFSurface : public gfxASurface { THEBES_DECL_ISUPPORTS_INHERITED @@ -51,8 +49,12 @@ public: double height_in_points); virtual ~gfxPDFSurface(); + void SetDPI(double x, double y); + void GetDPI(double *xDPI, double *yDPI); private: + double mXDPI; + double mYDPI; }; #endif /* GFX_WINDOWSSURFACE_H */ diff --git a/gfx/thebes/src/gfxPDFSurface.cpp b/gfx/thebes/src/gfxPDFSurface.cpp index d977157d991c..f3233c045df7 100644 --- a/gfx/thebes/src/gfxPDFSurface.cpp +++ b/gfx/thebes/src/gfxPDFSurface.cpp @@ -37,9 +37,12 @@ #include "gfxPDFSurface.h" +#include + THEBES_IMPL_REFCOUNTING(gfxPDFSurface) gfxPDFSurface::gfxPDFSurface(const char *filename, double width, double height) + : mXDPI(-1), mYDPI(-1) { Init(cairo_pdf_surface_create(filename, width, height)); } @@ -48,3 +51,18 @@ gfxPDFSurface::~gfxPDFSurface() { Destroy(); } + +void +gfxPDFSurface::SetDPI(double xDPI, double yDPI) +{ + mXDPI = xDPI; + mYDPI = yDPI; + cairo_pdf_surface_set_dpi(CairoSurface(), xDPI, yDPI); +} + +void +gfxPDFSurface::GetDPI(double *xDPI, double *yDPI) +{ + *xDPI = mXDPI; + *yDPI = mYDPI; +}