Ticket #2047: blit-dst-only.patch

File blit-dst-only.patch, 729 bytes (added by awi, 4 years ago)

Set source DC to NULL for 'destination-only' blit operations.

  • \src/msw/dc.cpp

    diff -uNr wxWidgets-trunk\src/msw/dc.cpp wxWidgets-work\src/msw/dc.cpp
    old new  
    22262226           return false;
    22272227    }
    22282228
     2229    // For all blit operations where only destination DC is involved, source DC needs to be set to NULL.
     2230    // Otherwise, strange artifacts can be visible on the output bitmap.
     2231    if( dwRop == WHITENESS || dwRop == BLACKNESS || dwRop == DSTINVERT || dwRop == DSTCOPY )
     2232    {
     2233        *(const_cast<HDC*>(&hdcSrc)) = NULL;    // Just to assign NULL to const non-pointer variable :)
     2234    }
     2235
    22292236    bool success = false;
    22302237
    22312238    if (useMask)