#include "wx/brush.h"
#include "wx/mgl/private.h"
-#include "wx/mgl/dcmemory.h"
+#include "wx/dcmemory.h"
// ---------------------------------------------------------------------------
if ( pix != NULL )
{
- mem.SelectObject(bitmap);
+ mem.SelectObjectAsSource(bitmap);
dc = mem.GetMGLDC();
wxCurrentDCSwitcher curDC(dc);
dc->beginPixel();
if ( mask && bitmap.GetMask() )
{
- mem.SelectObject(*bitmap.GetMask()->GetBitmap());
+ mem.SelectObjectAsSource(bitmap.GetMask()->GetBitmap());
dc = mem.GetMGLDC();
wxCurrentDCSwitcher curDC(dc);
dc->beginPixel();
mask->p[y] = 0;
for (x = 0; x < 8; x++)
if ( dc->getPixelFast(x, y) != 0 )
- mask->p[y] |= 1 << (7 - x);
+ mask->p[y] = (uchar)(mask->p[y] | (1 << (7 - x)));
}
dc->endPixel();
}
wxBrushRefData();
wxBrushRefData(const wxBrushRefData& data);
+ bool operator == (const wxBrushRefData& data) const
+ {
+ return (m_style == data.m_style &&
+ m_stipple.IsSameAs(data.m_stipple) &&
+ m_colour == data.m_colour);
+ }
+
int m_style;
wxColour m_colour;
wxBitmap m_stipple;
M_BRUSHDATA->m_style = wxSTIPPLE;
}
-wxBrush::wxBrush(const wxBrush &brush)
+bool wxBrush::operator == (const wxBrush& brush) const
{
- Ref(brush);
-}
+ if (m_refData == brush.m_refData) return true;
-wxBrush& wxBrush::operator = (const wxBrush& brush)
-{
- if (*this == brush) return (*this);
- Ref(brush);
- return *this;
-}
+ if (!m_refData || !brush.m_refData) return false;
-bool wxBrush::operator == (const wxBrush& brush) const
-{
- return m_refData == brush.m_refData;
+ return *(wxBrushRefData*)m_refData == *(wxBrushRefData*)brush.m_refData;
}
bool wxBrush::operator != (const wxBrush& brush) const
return m_refData != brush.m_refData;
}
-bool wxBrush::Ok() const
+bool wxBrush::IsOk() const
{
return ((m_refData) && M_BRUSHDATA->m_colour.Ok());
}