Add wxBitmap(wxImage, wxDC) ctor to all ports
This ctor was previously present only in wxMSW, make it available in all ports to allow the same code to compile everywhere. In most of them wxDC argument is simply ignored, but in wxGTK and wxOSX it is used to assign the appropriate scale factor for the new bitmap. Enable previously wxMSW-only unit test checking for this.
This commit is contained in:
@@ -32,7 +32,10 @@ public:
|
||||
wxBitmap(const wxString &filename, wxBitmapType type = wxBITMAP_DEFAULT_TYPE);
|
||||
wxBitmap(const char* const* bits);
|
||||
#if wxUSE_IMAGE
|
||||
wxBitmap(const wxImage& image, int depth = -1, double WXUNUSED(scale) = 1.0);
|
||||
wxBitmap(const wxImage& image, int depth = -1, double scale = 1.0)
|
||||
{ InitFromImage(image, depth, scale); }
|
||||
wxBitmap(const wxImage& image, const wxDC& WXUNUSED(dc))
|
||||
{ InitFromImage(image, -1, 1.0); }
|
||||
#endif
|
||||
|
||||
bool Create(const wxIDirectFBSurfacePtr& surface);
|
||||
@@ -86,6 +89,8 @@ protected:
|
||||
virtual wxGDIRefData *CreateGDIRefData() const;
|
||||
virtual wxGDIRefData *CloneGDIRefData(const wxGDIRefData *data) const;
|
||||
|
||||
void InitFromImage(const wxImage& image, int depth, double scale);
|
||||
|
||||
bool CreateWithFormat(int width, int height, int dfbFormat);
|
||||
|
||||
wxDECLARE_DYNAMIC_CLASS(wxBitmap);
|
||||
|
||||
Reference in New Issue
Block a user