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

@@ -349,7 +349,7 @@ void TestGLCanvas::OnPaint(wxPaintEvent& WXUNUSED(event))
// multiple canvases: If we updated the viewport in the wxSizeEvent
// handler, changing the size of one canvas causes a viewport setting that
// is wrong when next another canvas is repainted.
const wxSize ClientSize = GetClientSize() * GetOpenGLScaleFactor();
const wxSize ClientSize = GetClientSize() * GetContentScaleFactor();
TestGLContext& canvas = wxGetApp().GetContext(this, m_useStereo);
glViewport(0, 0, ClientSize.x, ClientSize.y);

View File

@@ -280,7 +280,7 @@ void TestGLCanvas::OnSize(wxSizeEvent& event)
// This is OK here only because there is only one canvas that uses the
// context. See the cube sample for that case that multiple canvases are
// made current with one context.
const wxSize size = event.GetSize() * GetOpenGLScaleFactor();
const wxSize size = event.GetSize() * GetContentScaleFactor();
glViewport(0, 0, size.x, size.y);
}

View File

@@ -306,7 +306,7 @@ void TestGLCanvas::ResetProjectionMode()
// or more than one wxGLContext in the application.
SetCurrent(*m_glRC);
const wxSize ClientSize = GetClientSize() * GetOpenGLScaleFactor();
const wxSize ClientSize = GetClientSize() * GetContentScaleFactor();
// It's up to the application code to update the OpenGL viewport settings.
// In order to avoid extensive context switching, consider doing this in

View File

@@ -565,7 +565,7 @@ void MyGLCanvas::OnSize(wxSizeEvent& event)
SetCurrent(*m_oglContext);
// It's up to the application code to update the OpenGL viewport settings.
const wxSize size = event.GetSize() * GetOpenGLScaleFactor();
const wxSize size = event.GetSize() * GetContentScaleFactor();
m_winHeight = size.y;
m_oglManager->SetViewport(0, 0, size.x, m_winHeight);