Remove wxHAS_BITMAP_SCALE_FACTOR

Now wxMSW also stores the scale factor, even if it doesn't use it in its
GetScaledXXX(), so it doesn't seem useful to have this symbol for
distinguishing the platforms with and without bitmap scale factor
support, when we can just use wxHAS_DPI_INDEPENDENT_PIXELS instead in
the only place where this was used.

And as this symbol was added quite recently, in 2c1f4c002d (Add
wxBitmap::SetScaleFactor(), 2021-10-23), we can hopefully just remove it
without breaking any existing code, if we do it right now.
This commit is contained in:
Vadim Zeitlin
2022-01-06 19:00:00 +00:00
parent f6fbc97c7b
commit 03cf1f4359
5 changed files with 3 additions and 27 deletions

View File

@@ -167,9 +167,6 @@ Currently the following symbols exist:
have an efficient (CPU-specific) implementation. Notice that the functions have an efficient (CPU-specific) implementation. Notice that the functions
themselves are always available but can be prohibitively slow to use when themselves are always available but can be prohibitively slow to use when
implemented in a generic way, using a critical section.} implemented in a generic way, using a critical section.}
@itemdef{wxHAS_BITMAP_SCALE_FACTOR, Defined in @c wx/bitmap.h if bitmaps
actually use scale factor under the current platform, see
wxBitmap::SetScaleFactor().}
@itemdef{wxHAS_BITMAPTOGGLEBUTTON, Defined in @c wx/tglbtn.h if @itemdef{wxHAS_BITMAPTOGGLEBUTTON, Defined in @c wx/tglbtn.h if
wxBitmapToggleButton class is available in addition to wxToggleButton.} wxBitmapToggleButton class is available in addition to wxToggleButton.}
@itemdef{wxHAS_CONFIG_TEMPLATE_RW, Defined if the currently used compiler @itemdef{wxHAS_CONFIG_TEMPLATE_RW, Defined if the currently used compiler

View File

@@ -17,10 +17,6 @@ typedef struct _GdkPixbuf GdkPixbuf;
class WXDLLIMPEXP_FWD_CORE wxPixelDataBase; class WXDLLIMPEXP_FWD_CORE wxPixelDataBase;
class WXDLLIMPEXP_FWD_CORE wxCursor; class WXDLLIMPEXP_FWD_CORE wxCursor;
#ifdef __WXGTK3__
#define wxHAS_BITMAP_SCALE_FACTOR
#endif
//----------------------------------------------------------------------------- //-----------------------------------------------------------------------------
// wxMask // wxMask
//----------------------------------------------------------------------------- //-----------------------------------------------------------------------------
@@ -89,7 +85,7 @@ public:
{ return Create(sz.GetWidth(), sz.GetHeight(), depth); } { return Create(sz.GetWidth(), sz.GetHeight(), depth); }
bool Create(int width, int height, const wxDC& WXUNUSED(dc)) bool Create(int width, int height, const wxDC& WXUNUSED(dc))
{ return Create(width,height); } { return Create(width,height); }
#ifdef wxHAS_BITMAP_SCALE_FACTOR #ifdef __WXGTK3__
virtual bool CreateScaled(int w, int h, int depth, double scale) wxOVERRIDE; virtual bool CreateScaled(int w, int h, int depth, double scale) wxOVERRIDE;
virtual void SetScaleFactor(double scale) wxOVERRIDE; virtual void SetScaleFactor(double scale) wxOVERRIDE;
virtual double GetScaleFactor() const wxOVERRIDE; virtual double GetScaleFactor() const wxOVERRIDE;

View File

@@ -13,8 +13,6 @@
#include "wx/palette.h" #include "wx/palette.h"
#define wxHAS_BITMAP_SCALE_FACTOR
// Bitmap // Bitmap
class WXDLLIMPEXP_FWD_CORE wxBitmap; class WXDLLIMPEXP_FWD_CORE wxBitmap;
class wxBitmapRefData ; class wxBitmapRefData ;

View File

@@ -816,21 +816,6 @@ public:
When creating a new bitmap, CreateScaled() can be used to specify the When creating a new bitmap, CreateScaled() can be used to specify the
correct scale factor from the beginning. correct scale factor from the beginning.
Note that this method exists in all ports, but simply does nothing in
those of them that don't use logical pixel scaling. The preprocessor
symbol @c wxHAS_BITMAP_SCALE_FACTOR can be tested to determine whether
the scale factor is really supported, e.g.
@code
bitmap.SetScaleFactor(2);
// In the other ports scale factor is always 1, so the assert would
// fail there.
#ifdef wxHAS_BITMAP_SCALE_FACTOR
wxASSERT( bitmap.GetScaleFactor() == 2 );
#endif
@endcode
@since 3.1.6 @since 3.1.6
*/ */
virtual void SetScaleFactor(double scale); virtual void SetScaleFactor(double scale);

View File

@@ -73,7 +73,7 @@ TEST_CASE("BitmapBundle::GetPreferredSize", "[bmpbundle]")
CHECK( b.GetPreferredSizeAtScale(3 ) == 3*normal ); CHECK( b.GetPreferredSizeAtScale(3 ) == 3*normal );
} }
#ifdef wxHAS_BITMAP_SCALE_FACTOR #ifdef wxHAS_DPI_INDEPENDENT_PIXELS
TEST_CASE("BitmapBundle::Scaled", "[bmpbundle]") TEST_CASE("BitmapBundle::Scaled", "[bmpbundle]")
{ {
@@ -105,7 +105,7 @@ TEST_CASE("BitmapBundle::Scaled", "[bmpbundle]")
CHECK( b.GetDefaultSize() == wxSize(32, 32) ); CHECK( b.GetDefaultSize() == wxSize(32, 32) );
} }
#endif // wxHAS_BITMAP_SCALE_FACTOR #endif // wxHAS_DPI_INDEPENDENT_PIXELS
#ifdef wxHAS_SVG #ifdef wxHAS_SVG