mirror of
https://github.com/mozilla/gecko-dev.git
synced 2025-01-03 23:01:31 +00:00
adding set/get DPI calls for the pdf surface
This commit is contained in:
parent
6be52a2d10
commit
2ce2647073
@ -40,8 +40,6 @@
|
||||
|
||||
#include "gfxASurface.h"
|
||||
|
||||
#include <cairo-pdf.h>
|
||||
|
||||
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 */
|
||||
|
@ -37,9 +37,12 @@
|
||||
|
||||
#include "gfxPDFSurface.h"
|
||||
|
||||
#include <cairo-pdf.h>
|
||||
|
||||
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;
|
||||
}
|
||||
|
Loading…
Reference in New Issue
Block a user