use separate is-static flag for alpha channel and main data
git-svn-id: https://svn.wxwidgets.org/svn/wx/wxWidgets/trunk@33282 c3d73ce0-8a6f-49c7-b76d-6d57e0e08775
This commit is contained in:
@@ -68,8 +68,13 @@ public:
|
|||||||
unsigned char *m_alpha;
|
unsigned char *m_alpha;
|
||||||
|
|
||||||
bool m_ok;
|
bool m_ok;
|
||||||
|
|
||||||
|
// if true, m_data is pointer to static data and shouldn't be freed
|
||||||
bool m_static;
|
bool m_static;
|
||||||
|
|
||||||
|
// same as m_static but for m_alpha
|
||||||
|
bool m_staticAlpha;
|
||||||
|
|
||||||
#if wxUSE_PALETTE
|
#if wxUSE_PALETTE
|
||||||
wxPalette m_palette;
|
wxPalette m_palette;
|
||||||
#endif // wxUSE_PALETTE
|
#endif // wxUSE_PALETTE
|
||||||
@@ -93,17 +98,17 @@ wxImageRefData::wxImageRefData()
|
|||||||
m_hasMask = false;
|
m_hasMask = false;
|
||||||
|
|
||||||
m_ok = false;
|
m_ok = false;
|
||||||
m_static = false;
|
m_static =
|
||||||
|
m_staticAlpha = false;
|
||||||
}
|
}
|
||||||
|
|
||||||
wxImageRefData::~wxImageRefData()
|
wxImageRefData::~wxImageRefData()
|
||||||
{
|
{
|
||||||
if ( !m_static )
|
if ( !m_static )
|
||||||
{
|
|
||||||
free( m_data );
|
free( m_data );
|
||||||
|
if ( !m_staticAlpha )
|
||||||
free( m_alpha );
|
free( m_alpha );
|
||||||
}
|
}
|
||||||
}
|
|
||||||
|
|
||||||
wxList wxImage::sm_handlers;
|
wxList wxImage::sm_handlers;
|
||||||
|
|
||||||
@@ -997,7 +1002,7 @@ void wxImage::SetAlpha( unsigned char *alpha, bool static_data )
|
|||||||
|
|
||||||
free(M_IMGDATA->m_alpha);
|
free(M_IMGDATA->m_alpha);
|
||||||
M_IMGDATA->m_alpha = alpha;
|
M_IMGDATA->m_alpha = alpha;
|
||||||
M_IMGDATA->m_static = static_data;
|
M_IMGDATA->m_staticAlpha = static_data;
|
||||||
}
|
}
|
||||||
|
|
||||||
unsigned char *wxImage::GetAlpha() const
|
unsigned char *wxImage::GetAlpha() const
|
||||||
|
Reference in New Issue
Block a user