removed virtual GetSelectedBitmap() from the base wxDC class, it only makes sense for wxMemoryDC

git-svn-id: https://svn.wxwidgets.org/svn/wx/wxWidgets/trunk@45146 c3d73ce0-8a6f-49c7-b76d-6d57e0e08775
This commit is contained in:
Vadim Zeitlin
2007-03-30 15:27:08 +00:00
parent ba5787676d
commit e19a8aea87
3 changed files with 13 additions and 7 deletions

View File

@@ -95,7 +95,6 @@ public:
virtual void ComputeScaleAndOrigin();
virtual GdkWindow* GetGDKWindow() const { return NULL; }
virtual wxBitmap GetSelectedBitmap() const { return wxNullBitmap; }
protected:
// implementation

View File

@@ -35,14 +35,17 @@ public:
virtual void SetTextBackground( const wxColour &col );
// implementation
virtual wxBitmap GetSelectedBitmap() const { return m_selected; }
wxBitmap GetSelectedBitmap() const { return m_selected; }
wxBitmap m_selected;
protected:
void DoGetSize( int *width, int *height ) const;
virtual void DoSelect(const wxBitmap& bitmap);
virtual wxBitmap DoGetAsBitmap(const wxRect *subrect) const
{ return subrect == NULL ? GetSelectedBitmap() : GetSelectedBitmap().GetSubBitmap(*subrect); }
{
wxBitmap bmp = GetSelectedBitmap();
return subrect ? bmp.GetSubBitmap(*subrect) : bmp;
}
private:
void Init();

View File

@@ -1217,8 +1217,14 @@ bool wxWindowDC::DoBlit( wxCoord xdest, wxCoord ydest,
xsrc = source->LogicalToDeviceX(xsrc);
ysrc = source->LogicalToDeviceY(ysrc);
wxBitmap selected;
wxMemoryDC *memDC = wxDynamicCast(source, wxMemoryDC);
wxBitmap selected = source->GetSelectedBitmap();
if ( memDC )
{
selected = memDC->GetSelectedBitmap();
if ( !selected.IsOk() )
return false;
}
bool use_bitmap_method = false;
bool is_mono = false;
@@ -1229,8 +1235,6 @@ bool wxWindowDC::DoBlit( wxCoord xdest, wxCoord ydest,
ysrcMask = ysrc;
}
if (memDC && !selected.Ok()) return false;
if (selected.Ok())
{
is_mono = (selected.GetDepth() == 1);