Allow drawing HiDPI bitmaps with GTK3

1. Override wxWindow::GetContentScaleFactor() to use gdk_window_get_scale_factor()
   when available, and to use correct scale (1.0) otherwise, as wxDC::GetPPI()
   (used by overridden method) is not properly implemented for wxGTK
2. Record scale in wxBitmap(wxImage&) ctor and wxBitmap::CreateScaled()
3. Adjust cairo scale for drawing bitmap, and (inversely) for drawing on bitmap
This commit is contained in:
Paul Cornett
2016-02-14 13:12:52 -08:00
parent ed09b7b6c0
commit f95fd11e08
5 changed files with 49 additions and 4 deletions

View File

@@ -90,7 +90,10 @@ public:
{ return Create(sz.GetWidth(), sz.GetHeight(), depth); }
bool Create(int width, int height, const wxDC& WXUNUSED(dc))
{ return Create(width,height); }
#ifdef __WXGTK3__
virtual bool CreateScaled(int w, int h, int depth, double scale) wxOVERRIDE;
virtual double GetScaleFactor() const wxOVERRIDE;
#endif
virtual int GetHeight() const wxOVERRIDE;
virtual int GetWidth() const wxOVERRIDE;