X-Git-Url: https://git.saurik.com/wxWidgets.git/blobdiff_plain/127eab18f80e5b298b8c0326609ed811035e6829..51146826fc0a0a949d88f23fb9d83fc1f1ada14e:/src/mgl/brush.cpp diff --git a/src/mgl/brush.cpp b/src/mgl/brush.cpp index 7a26b387a5..b151db8a0a 100644 --- a/src/mgl/brush.cpp +++ b/src/mgl/brush.cpp @@ -16,7 +16,7 @@ #include "wx/brush.h" #include "wx/mgl/private.h" -#include "wx/mgl/dcmemory.h" +#include "wx/dcmemory.h" // --------------------------------------------------------------------------- @@ -35,7 +35,7 @@ void wxBitmapToPixPattern(const wxBitmap& bitmap, if ( pix != NULL ) { - mem.SelectObject(bitmap); + mem.SelectObjectAsSource(bitmap); dc = mem.GetMGLDC(); wxCurrentDCSwitcher curDC(dc); dc->beginPixel(); @@ -50,7 +50,7 @@ void wxBitmapToPixPattern(const wxBitmap& bitmap, if ( mask && bitmap.GetMask() ) { - mem.SelectObject(*bitmap.GetMask()->GetBitmap()); + mem.SelectObjectAsSource(bitmap.GetMask()->GetBitmap()); dc = mem.GetMGLDC(); wxCurrentDCSwitcher curDC(dc); dc->beginPixel(); @@ -76,6 +76,13 @@ public: 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; @@ -143,21 +150,13 @@ wxBrush::wxBrush(const wxBitmap &stippleBitmap) 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 @@ -165,7 +164,7 @@ 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()); }