Merge branch 'dpi-scaling-factor'

Add DPI scaling factor and revert content scaling factor behaviour in
wxMSW and other ports not using logical pixels to be 3.0 compatible.

See https://github.com/wxWidgets/wxWidgets/pull/1985
This commit is contained in:
Vadim Zeitlin
2020-07-20 15:55:23 +02:00
25 changed files with 92 additions and 88 deletions

View File

@@ -258,11 +258,6 @@ public:
// as a parameter
wxGLContextAttrs& GetGLCTXAttrs() { return m_GLCTXAttrs; }
// Return the factor to apply to transform window coordinates (e.g. sizes)
// to OpenGL coordinates: it can be different from 1 on the platforms where
// logical pixels are different from physical ones (i.e. wxGTK3 and wxOSX).
virtual double GetOpenGLScaleFactor() const;
// deprecated methods using the implicit wxGLContext
#if WXWIN_COMPATIBILITY_2_8
wxDEPRECATED( wxGLContext* GetContext() const );

View File

@@ -60,8 +60,6 @@ public:
virtual bool SetBackgroundStyle(wxBackgroundStyle style) wxOVERRIDE;
virtual double GetOpenGLScaleFactor() const wxOVERRIDE;
// implement wxGLCanvasX11 methods
// --------------------------------

View File

@@ -77,7 +77,6 @@ public:
virtual bool CanGetTextExtent() const wxOVERRIDE;
virtual int GetDepth() const wxOVERRIDE;
virtual wxSize GetPPI() const wxOVERRIDE;
virtual double GetContentScaleFactor() const wxOVERRIDE;
virtual void SetMapMode(wxMappingMode mode) wxOVERRIDE;

View File

@@ -100,7 +100,6 @@ public:
// implement wxGLCanvasBase methods
virtual bool SwapBuffers() wxOVERRIDE;
virtual double GetOpenGLScaleFactor() const wxOVERRIDE;
// Mac-specific functions
// ----------------------

View File

@@ -529,10 +529,16 @@ public:
return wxSize( wxMax( client.x, best.x ), wxMax( client.y, best.y ) );
}
// returns the magnification of the content of this window
// e.g. 2.0 for a window on a retina screen
// Return the magnification of the content of this window for the platforms
// using logical pixels different from physical ones, i.e. those for which
// wxHAVE_DPI_INDEPENDENT_PIXELS is defined. For the other ones, always
// returns 1, regardless of DPI scale factor returned by the function below.
virtual double GetContentScaleFactor() const;
// Return the ratio of the DPI used by this window to the standard DPI,
// e.g. 1 for standard DPI screens and 2 for "200% scaling".
double GetDPIScaleFactor() const;
// return the size of the left/right and top/bottom borders in x and y
// components of the result respectively
virtual wxSize GetWindowBorderSize() const;
@@ -961,7 +967,7 @@ public:
// DPI-independent pixels, or DIPs, are pixel values for the standard
// 96 DPI display, they are scaled to take the current resolution into
// account (i.e. multiplied by the same factor as returned by
// GetContentScaleFactor()) if necessary for the current platform.
// GetDPIScaleFactor()) if necessary for the current platform.
//
// To support monitor-specific resolutions, prefer using the non-static
// member functions or use a valid (non-null) window pointer.