diff --git a/common/gal/opengl/opengl_gal.cpp b/common/gal/opengl/opengl_gal.cpp index 16799a8cbb..579f84102c 100644 --- a/common/gal/opengl/opengl_gal.cpp +++ b/common/gal/opengl/opengl_gal.cpp @@ -159,8 +159,10 @@ GLuint GL_BITMAP_CACHE::cacheBitmap( const BITMAP_BASE* aBitmap ) { CACHED_BITMAP bmp; - bmp.w = aBitmap->GetSizePixels().x; - bmp.h = aBitmap->GetSizePixels().y; + const wxImage& imgData = *aBitmap->GetOriginalImageData(); + + bmp.w = imgData.GetSize().x; + bmp.h = imgData.GetSize().y; // The bitmap size needs to be a multiple of 4. // This is easiest to achieve by ensuring that each row @@ -186,8 +188,6 @@ GLuint GL_BITMAP_CACHE::cacheBitmap( const BITMAP_BASE* aBitmap ) bmp.size = ( bmp.w + extra_w ) * bmp.h * 4; auto buf = std::make_unique( bmp.size ); - const wxImage& imgData = *aBitmap->GetOriginalImageData(); - for( int y = 0; y < bmp.h; y++ ) { for( int x = 0; x < bmp.w; x++ )