Ignore:
Timestamp:
Jan 11, 2004, 12:42:14 PM (22 years ago)
Author:
sandervl
Message:

Update

File:
1 edited

Legend:

Unmodified
Added
Removed
  • trunk/src/gdi32/blit.cpp

    r10167 r10373  
    1 /* $Id: blit.cpp,v 1.45 2003-07-16 10:46:16 sandervl Exp $ */
     1/* $Id: blit.cpp,v 1.46 2004-01-11 11:42:08 sandervl Exp $ */
    22
    33/*
     
    1717#include <winuser32.h>
    1818#include <dbglog.h>
     19#include "oslibgpi.h"
     20#include <dcdata.h>
    1921#include "dibsect.h"
    2022#include "rgbcvt.h"
     
    4850            rc  = dsect->BitBlt(hdcDest, nXOriginDest, nYOriginDest, nWidthDest, nHeightDest,
    4951                                nXOriginSrc, nYOriginSrc, nWidthSrc, nHeightSrc, dwRop);
    50             return rc;
     52            goto blitdone;
    5153        }
    5254    }
    5355    rc = O32_StretchBlt(hdcDest, nXOriginDest, nYOriginDest, nWidthDest, nHeightDest, hdcSrc, nXOriginSrc, nYOriginSrc, nWidthSrc, nHeightSrc, dwRop);
    54     if(DIBSection::getSection() != NULL) {
    55         DIBSection *destdib = DIBSection::findHDC(hdcDest);
    56         if(destdib) {
    57             destdib->sync(hdcDest, nYOriginDest, nHeightDest);
    58         }
    59     }
     56
     57blitdone:
     58    DIBSECTION_MARK_INVALID(hdcDest);
     59
    6060    if(rc == FALSE) {
    6161        dprintf(("!WARNING!: GDI32: StretchBlt returned FALSE; last error %x", rc, GetLastError()));
     
    7878
    7979#ifdef DEBUG
    80       POINT point1, point2;
     80    POINT point1, point2;
    8181    GetViewportOrgEx(hdcDest, &point1);
    8282    GetViewportOrgEx(hdcSrc, &point2);
     
    9090        if(dsect)
    9191        {
    92             return dsect->BitBlt(hdcDest, nXDest, nYDest, nWidth, nHeight, nXSrc, nYSrc, nWidth, nHeight, dwRop);
     92            rc = dsect->BitBlt(hdcDest, nXDest, nYDest, nWidth, nHeight, nXSrc, nYSrc, nWidth, nHeight, dwRop);
     93            goto blitdone;
    9394        }
    9495    }
     
    9899    rc = O32_BitBlt(hdcDest, nXDest, nYDest, nWidth, nHeight, hdcSrc, nXSrc, nYSrc, dwRop);
    99100
    100     if(DIBSection::getSection() != NULL) {
    101         DIBSection *destdib = DIBSection::findHDC(hdcDest);
    102         if(destdib) {
    103             destdib->sync(hdcDest, nYDest, nHeight);
    104         }
    105     }
     101blitdone:
     102    DIBSECTION_MARK_INVALID(hdcDest);
    106103    return rc;
    107104}
     
    193190    }
    194191    if(startscan != 0 || lines != info->bmiHeader.biHeight) {
    195             dprintf(("WARNING: SetDIBitsToDevice startscan != 0 || lines != info->bmiHeader.biHeight"));
     192        dprintf(("WARNING: SetDIBitsToDevice startscan != 0 || lines != info->bmiHeader.biHeight"));
    196193        dprintf(("info bmp (%d,%d)", info->bmiHeader.biWidth, info->bmiHeader.biHeight));
    197194    }
     
    209206        result = info->bmiHeader.biHeight;
    210207
    211         DIBSection *destdib = DIBSection::findHDC(hdc);
    212         if(destdib) {
    213                 if(cx == info->bmiHeader.biWidth && cy == info->bmiHeader.biHeight &&
    214                    destdib->GetBitCount() == info->bmiHeader.biBitCount &&
    215                    destdib->GetBitCount() == 8)
    216                 {
    217                         destdib->sync(xDest, yDest, cx, cy, (PVOID)bits);
    218                 }
    219                 else    destdib->sync(hdc, yDest, cy);
    220         }
     208        DIBSECTION_MARK_INVALID(hdc);
    221209    }
    222210    dprintf(("GDI32: SetDIBitsToDevice hdc:%X xDest:%d yDest:%d, cx:%d, cy:%d, xSrc:%d, ySrc:%d, startscan:%d, lines:%d \nGDI32: bits 0x%X, info 0x%X, coloruse %d returned %d",
    223                  hdc, xDest, yDest, cx, cy, xSrc, ySrc, startscan, lines, (LPVOID) bits, (PBITMAPINFO)info, coloruse, result));
     211              hdc, xDest, yDest, cx, cy, xSrc, ySrc, startscan, lines, (LPVOID) bits, (PBITMAPINFO)info, coloruse, result));
    224212    dprintf(("GDI32: SetDIBitsToDevice %d %d %d %d %x %d", info->bmiHeader.biWidth, info->bmiHeader.biHeight, info->bmiHeader.biPlanes, info->bmiHeader.biBitCount, info->bmiHeader.biCompression, info->bmiHeader.biSizeImage));
    225213
     
    358346    rc = O32_PatBlt(hdc,nXLeft,nYLeft,nWidth,nHeight,dwRop);
    359347    if(rc) {
    360         DIBSection *destdib = DIBSection::findHDC(hdc);
    361         if(destdib) {
    362                     destdib->sync(hdc, nYLeft, nHeight);
    363             }
     348        DIBSECTION_MARK_INVALID(hdc);
    364349    }
    365350    return(rc);
     
    367352//******************************************************************************
    368353//******************************************************************************
    369 BOOL WIN32API MaskBlt( HDC arg1, int arg2, int arg3, int arg4, int arg5, HDC   arg6, int arg7, int arg8, HBITMAP arg9, int arg10, int arg11, DWORD  arg12)
    370 {
    371     return O32_MaskBlt(arg1, arg2, arg3, arg4, arg5, arg6, arg7, arg8, arg9, arg10, arg11, arg12);
     354BOOL WIN32API MaskBlt( HDC hdcDest, int arg2, int arg3, int arg4, int arg5, HDC hdcSrc, int arg7, int arg8, HBITMAP arg9, int arg10, int arg11, DWORD  arg12)
     355{
     356    BOOL ret;
     357
     358    DIBSECTION_CHECK_IF_DIRTY(hdcSrc);
     359
     360    ret = O32_MaskBlt(hdcDest, arg2, arg3, arg4, arg5, hdcSrc, arg7, arg8, arg9, arg10, arg11, arg12);
     361    if(ret) {
     362        DIBSECTION_MARK_INVALID(hdcDest);
     363    }
     364    return ret;
    372365}
    373366//******************************************************************************
     
    426419        //Open32 always returns height of bitmap (regardless of how many scanlines were copied)
    427420        if(rc != heightSrc && rc != infoLoc->bmiHeader.biHeight) {
    428                     dprintf(("StretchDIBits failed with rc %x", rc));
     421            dprintf(("StretchDIBits failed with rc %x", rc));
    429422        }
    430             else {
    431                     rc = heightSrc;
    432 
    433                     DIBSection *destdib = DIBSection::findHDC(hdc);
    434                     if(destdib) {
    435                         if(widthDst == widthSrc && heightDst == heightSrc &&
    436                             destdib->GetBitCount() == infoLoc->bmiHeader.biBitCount &&
    437                             destdib->GetBitCount() == 8)
    438                 {
    439                                     destdib->sync(xDst, yDst, widthDst, heightDst, (PVOID)bits);
    440                             }
    441                             else        destdib->sync(hdc, yDst, heightDst);
    442                     }
    443             }
     423        else {
     424            rc = heightSrc;
     425
     426            DIBSECTION_MARK_INVALID(hdc);
     427        }
    444428   
    445429        return rc;
     
    489473
    490474    rc = O32_StretchDIBits(hdc, xDst, yDst, widthDst, heightDst, xSrc, ySrc,
    491                              widthSrc, heightSrc, (void *)bits,
    492                              (PBITMAPINFO)info, wUsage, dwRop);
     475                           widthSrc, heightSrc, (void *)bits,
     476                           (PBITMAPINFO)info, wUsage, dwRop);
    493477
    494478    if(compression == BI_BITFIELDS) {
     
    505489            rc = heightSrc;
    506490
    507             DIBSection *destdib = DIBSection::findHDC(hdc);
    508             if(destdib) {
    509                 if(widthDst == widthSrc && heightDst == heightSrc &&
    510                     destdib->GetBitCount() == info->bmiHeader.biBitCount &&
    511                     destdib->GetBitCount() == 8)
    512             {
    513                              destdib->sync(xDst, yDst, widthDst, heightDst, (PVOID)bits);
    514                     }
    515                     else destdib->sync(hdc, yDst, heightDst);
    516             }
     491            DIBSECTION_MARK_INVALID(hdc);
    517492    }
    518493
     
    526501                           const BITMAPINFO *info, UINT wUsage, DWORD dwRop )
    527502{
    528 
    529503    if(info->bmiHeader.biHeight < 0) {
    530504        // upside down
     
    563537int WIN32API SetStretchBltMode( HDC arg1, int  arg2)
    564538{
     539#ifdef DEBUG
    565540    if(DIBSection::getSection() != NULL)
    566541    {
     
    571546        }
    572547    }
     548#endif
    573549    return O32_SetStretchBltMode(arg1, arg2);
    574550}
Note: See TracChangeset for help on using the changeset viewer.