Merge branch 'gcdc-without-display'

Make it possible to use wxGCDC without a display.

See https://github.com/wxWidgets/wxWidgets/pull/1044
This commit is contained in:
Vadim Zeitlin
2018-12-08 00:51:33 +01:00
14 changed files with 80 additions and 40 deletions

View File

@@ -686,6 +686,16 @@ protected:
// for rendering on higher-resolution DCs such as printer ones
static float GetFontPointSizeAdjustment(float dpi);
// Return the number of pixels per mm in the horizontal and vertical
// directions, respectively.
//
// If the physical size of the DC is not known, or doesn't make sense, as
// for a SVG DC, for example, a fixed value corresponding to the standard
// DPI is used.
double GetMMToPXx() const;
double GetMMToPXy() const;
// window on which the DC draws or NULL
wxWindow *m_window;
@@ -715,9 +725,12 @@ protected:
double m_contentScaleFactor; // used by high resolution displays (retina)
// what is a mm on a screen you don't know the size of?
double m_mm_to_pix_x,
m_mm_to_pix_y;
// Pixel per mm in horizontal and vertical directions.
//
// These variables are computed on demand by GetMMToPX[xy]() functions,
// don't access them directly other than for assigning to them.
mutable double m_mm_to_pix_x,
m_mm_to_pix_y;
// bounding and clipping boxes
wxCoord m_minX, m_minY, m_maxX, m_maxY; // Bounding box is stored in device units.

View File

@@ -60,6 +60,10 @@ public:
#if defined(__WXMSW__) && wxUSE_ENH_METAFILE
wxGCDCImpl( wxDC *owner, const wxEnhMetaFileDC& dc );
#endif
// Ctor using an existing graphics context given to wxGCDC ctor.
wxGCDCImpl(wxDC *owner, wxGraphicsContext* context);
wxGCDCImpl( wxDC *owner );
virtual ~wxGCDCImpl();

View File

@@ -157,8 +157,6 @@ private:
protected:
wxIDirectFBSurfacePtr m_surface;
double m_mm_to_pix_x, m_mm_to_pix_y;
friend class WXDLLIMPEXP_FWD_CORE wxOverlayImpl; // for Init
wxDECLARE_ABSTRACT_CLASS(wxDFBDCImpl);