Changeset 5333 for trunk/src


Ignore:
Timestamp:
Mar 19, 2001, 8:27:53 PM (24 years ago)
Author:
sandervl
Message:

check y inversion during dib section resync

Location:
trunk/src/gdi32
Files:
2 edited

Legend:

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

    r4873 r5333  
    1 /* $Id: dibsect.cpp,v 1.45 2001-01-05 23:25:30 sandervl Exp $ */
     1/* $Id: dibsect.cpp,v 1.46 2001-03-19 19:27:53 sandervl Exp $ */
    22
    33/*
     
    600600        DIBSection *destdib = DIBSection::findHDC(hdcDest);
    601601        if(destdib) {
    602             destdib->sync(hps, nYdest, nDestHeight);
     602            destdib->sync(hps, nYdest, nDestHeight, FALSE);
    603603        }
    604604#ifdef INVERT
     
    619619}
    620620//******************************************************************************
    621 int WIN32API GetDIBits(HDC hdc, HBITMAP hBitmap, UINT uStartScan, UINT cScanLines,
    622                        void *lpvBits, BITMAPINFO_W * lpbi, UINT uUsage);
    623 
    624 //******************************************************************************
    625 void DIBSection::sync(HDC hdc, DWORD nYdest, DWORD nDestHeight)
     621//******************************************************************************
     622void DIBSection::sync(HDC hdc, DWORD nYdest, DWORD nDestHeight, BOOL orgYInversion)
    626623{
    627624 APIRET rc;
    628625 char  *destBuf;
    629626
    630   dprintf(("Sync destination dibsection %x (%x)", handle, hdc));
    631 
    632 #if 0
    633   BITMAPINFO_W *tmphdr = (BITMAPINFO_W *)malloc(os2bmphdrsize + sizeof(BITMAPINFO_W));
    634   tmphdr->bmiHeader.biSize = sizeof(BITMAPINFOHEADER_W);
    635   GetDIBits(hdc, handle, nYdest, nDestHeight, NULL, tmphdr, 0);
    636   destBuf = GetDIBObject() + nYdest*dibinfo.dsBm.bmWidthBytes;
    637   rc = GetDIBits(hdc, handle, nYdest, nDestHeight, destBuf, tmphdr, 0);
    638 #ifdef DEBUG_PALETTE
    639   if(rc && tmphdr->bmiHeader.biBitCount <= 8) {
    640     for(int i=0;i<(1<<tmphdr->bmiHeader.biBitCount);i++)
    641     {
    642         dprintf2(("Index %d : 0x%08X\n",i, *((ULONG*)(&tmphdr->bmiColors[i])) ));
    643     }
    644   }
    645 #endif
    646 
    647 #else
     627  dprintf(("Sync destination dibsection %x (%x) (%d,%d) flip %d", handle, hdc, nYdest, nDestHeight, fFlip));
     628
    648629  BITMAPINFO2 *tmphdr = (BITMAPINFO2 *)malloc(os2bmphdrsize);
    649630  memcpy(tmphdr, pOS2bmp, os2bmphdrsize);
     631
     632#ifdef INVERT
     633  int oldyinversion = 0;
     634  if(orgYInversion == TRUE) {
     635      oldyinversion = GpiQueryYInversion(hdc);
     636      dprintf(("Sync destination dibsection: hdc y inversion = %d", oldyinversion));
     637      if(oldyinversion != 0) {
     638          GpiEnableYInversion(hdc, 0);
     639      }
     640  }
     641#endif
    650642
    651643  if(fFlip & FLIP_VERT) {
     
    666658        destBuf = GetDIBObject() + nYdest*dibinfo.dsBm.bmWidthBytes;
    667659        rc = GpiQueryBitmapBits(hdc, nYdest, nDestHeight, destBuf,
    668                           tmphdr);
     660                                tmphdr);
     661
    669662#ifdef DEBUG_PALETTE
    670663        if(rc != GPI_ALTERROR && tmphdr->cBitCount <= 8) {
     
    676669#endif
    677670  }
    678 #endif
     671
    679672#if 0
    680673  if(dibinfo.dsBitfields[1] == 0x3E0) {//RGB 555?
     
    693686    DebugInt3();
    694687  }
     688
     689#ifdef INVERT
     690  if(oldyinversion) GpiEnableYInversion(hdc, oldyinversion);
     691#endif
     692
    695693}
    696694//******************************************************************************
  • trunk/src/gdi32/dibsect.h

    r4574 r5333  
    1 /* $Id: dibsect.h,v 1.22 2000-11-09 18:16:56 sandervl Exp $ */
     1/* $Id: dibsect.h,v 1.23 2001-03-19 19:27:53 sandervl Exp $ */
    22
    33/*
     
    9797                           int nSrcWidth, int nSrcHeight,
    9898                           DWORD Rop);
    99               void  sync(HDC hdc, DWORD nYdest, DWORD nDestHeight);
     99              void  sync(HDC hdc, DWORD nYdest, DWORD nDestHeight, BOOL orgYInversion = TRUE);
    100100              void  sync(DWORD xDst, DWORD yDst, DWORD widthDst, DWORD heightDst, PVOID bits);
    101101               int  SetDIBColorTable(int startIdx, int cEntries, RGBQUAD *rgb);
Note: See TracChangeset for help on using the changeset viewer.