fix compilation error for wxUSE_DC_CACHEING==0; use more descriptive variables names

git-svn-id: https://svn.wxwidgets.org/svn/wx/wxWidgets/trunk@51425 c3d73ce0-8a6f-49c7-b76d-6d57e0e08775
This commit is contained in:
Vadim Zeitlin
2008-01-28 15:25:21 +00:00
parent e0749635a5
commit a619d8c959

View File

@@ -2028,23 +2028,23 @@ bool wxMSWDCImpl::DoStretchBlit(wxCoord xdest, wxCoord ydest,
WXMICROWIN_CHECK_HDC_RET(false) WXMICROWIN_CHECK_HDC_RET(false)
wxDCImpl *impl = source->GetImpl(); wxMSWDCImpl *implSrc = wxDynamicCast( source->GetImpl(), wxMSWDCImpl );
wxMSWDCImpl *msw_impl = wxDynamicCast( impl, wxMSWDCImpl ); if ( !implSrc )
if (!msw_impl)
{ {
// TODO: Do we want to be able to blit // TODO: Do we want to be able to blit from other DCs too?
// from other DCs too?
return false; return false;
} }
const HDC hdcSrc = GetHdcOf(*implSrc);
// if either the source or destination has alpha channel, we must use // if either the source or destination has alpha channel, we must use
// AlphaBlt() as other function don't handle it correctly // AlphaBlt() as other function don't handle it correctly
const wxBitmap& bmpSrc = msw_impl->GetSelectedBitmap(); const wxBitmap& bmpSrc = implSrc->GetSelectedBitmap();
if ( bmpSrc.IsOk() && (bmpSrc.HasAlpha() || if ( bmpSrc.IsOk() && (bmpSrc.HasAlpha() ||
(m_selectedBitmap.IsOk() && m_selectedBitmap.HasAlpha())) ) (m_selectedBitmap.IsOk() && m_selectedBitmap.HasAlpha())) )
{ {
if ( AlphaBlt(GetHdc(), xdest, ydest, dstWidth, dstHeight, if ( AlphaBlt(GetHdc(), xdest, ydest, dstWidth, dstHeight,
xsrc, ysrc, srcWidth, srcHeight, GetHdcOf(*msw_impl), bmpSrc) ) xsrc, ysrc, srcWidth, srcHeight, hdcSrc, bmpSrc) )
return true; return true;
} }
@@ -2124,7 +2124,7 @@ bool wxMSWDCImpl::DoStretchBlit(wxCoord xdest, wxCoord ydest,
( (
GetHdc(), GetHdc(),
xdest, ydest, dstWidth, dstHeight, xdest, ydest, dstWidth, dstHeight,
GetHdcOf(*msw_impl), hdcSrc,
xsrc, ysrc, xsrc, ysrc,
(HBITMAP)mask->GetMaskBitmap(), (HBITMAP)mask->GetMaskBitmap(),
xsrcMask, ysrcMask, xsrcMask, ysrcMask,
@@ -2143,7 +2143,7 @@ bool wxMSWDCImpl::DoStretchBlit(wxCoord xdest, wxCoord ydest,
#if wxUSE_DC_CACHEING #if wxUSE_DC_CACHEING
// create a temp buffer bitmap and DCs to access it and the mask // create a temp buffer bitmap and DCs to access it and the mask
wxDCCacheEntry* dcCacheEntry1 = FindDCInCache(NULL, msw_impl->GetHDC()); wxDCCacheEntry* dcCacheEntry1 = FindDCInCache(NULL, hdcSrc);
dc_mask = (HDC) dcCacheEntry1->m_dc; dc_mask = (HDC) dcCacheEntry1->m_dc;
wxDCCacheEntry* dcCacheEntry2 = FindDCInCache(dcCacheEntry1, GetHDC()); wxDCCacheEntry* dcCacheEntry2 = FindDCInCache(dcCacheEntry1, GetHDC());
@@ -2155,7 +2155,7 @@ bool wxMSWDCImpl::DoStretchBlit(wxCoord xdest, wxCoord ydest,
buffer_bmap = (HBITMAP) bitmapCacheEntry->m_bitmap; buffer_bmap = (HBITMAP) bitmapCacheEntry->m_bitmap;
#else // !wxUSE_DC_CACHEING #else // !wxUSE_DC_CACHEING
// create a temp buffer bitmap and DCs to access it and the mask // create a temp buffer bitmap and DCs to access it and the mask
dc_mask = ::CreateCompatibleDC(GetHdcOf(*source)); dc_mask = ::CreateCompatibleDC(hdcSrc);
dc_buffer = ::CreateCompatibleDC(GetHdc()); dc_buffer = ::CreateCompatibleDC(GetHdc());
buffer_bmap = ::CreateCompatibleBitmap(GetHdc(), dstWidth, dstHeight); buffer_bmap = ::CreateCompatibleBitmap(GetHdc(), dstWidth, dstHeight);
#endif // wxUSE_DC_CACHEING/!wxUSE_DC_CACHEING #endif // wxUSE_DC_CACHEING/!wxUSE_DC_CACHEING
@@ -2175,7 +2175,7 @@ bool wxMSWDCImpl::DoStretchBlit(wxCoord xdest, wxCoord ydest,
// copy src to buffer using selected raster op // copy src to buffer using selected raster op
if ( !::StretchBlt(dc_buffer, 0, 0, (int)dstWidth, (int)dstHeight, if ( !::StretchBlt(dc_buffer, 0, 0, (int)dstWidth, (int)dstHeight,
GetHdcOf(*msw_impl), xsrc, ysrc, srcWidth, srcHeight, dwRop) ) hdcSrc, xsrc, ysrc, srcWidth, srcHeight, dwRop) )
{ {
wxLogLastError(wxT("StretchBlt")); wxLogLastError(wxT("StretchBlt"));
} }
@@ -2286,7 +2286,7 @@ bool wxMSWDCImpl::DoStretchBlit(wxCoord xdest, wxCoord ydest,
( (
GetHdc(), GetHdc(),
xdest, ydest, dstWidth, dstHeight, xdest, ydest, dstWidth, dstHeight,
GetHdcOf(*msw_impl), hdcSrc,
xsrc, ysrc, srcWidth, srcHeight, xsrc, ysrc, srcWidth, srcHeight,
dwRop dwRop
) ) ) )
@@ -2306,7 +2306,7 @@ bool wxMSWDCImpl::DoStretchBlit(wxCoord xdest, wxCoord ydest,
GetHdc(), GetHdc(),
xdest, ydest, xdest, ydest,
(int)dstWidth, (int)dstHeight, (int)dstWidth, (int)dstHeight,
GetHdcOf(*msw_impl), hdcSrc,
xsrc, ysrc, xsrc, ysrc,
dwRop dwRop
) ) ) )