Changeset 3184 for trunk/src


Ignore:
Timestamp:
Mar 21, 2000, 8:46:47 PM (25 years ago)
Author:
sandervl
Message:

added rgb555 conversion to dibsection blits

File:
1 edited

Legend:

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

    r2853 r3184  
    1 /* $Id: dibsect.cpp,v 1.20 2000-02-21 20:26:45 sandervl Exp $ */
     1/* $Id: dibsect.cpp,v 1.21 2000-03-21 19:46:47 sandervl Exp $ */
    22
    33/*
     
    2323#include "dibsect.h"
    2424#include <vmutex.h>
     25#include <win32api.h>
    2526#include <winconst.h>
    2627#include <win32wnd.h>
     28#include <cpuhlp.h>
    2729#include "oslibgpi.h"
     30#include "rgbcvt.h"
    2831
    2932#define DBG_LOCALLOG    DBG_dibsect
    3033#include "dbglocal.h"
    31 
    32 //Win32 apis used:
    33 HWND WIN32API WindowFromDC(HDC hdc);
    34 BOOL   WINAPI UnmapViewOfFile(LPVOID addr);
    35 LPVOID WINAPI MapViewOfFile(HANDLE mapping, DWORD access, DWORD offset_high,
    36                             DWORD offset_low, DWORD count);
    3734
    3835static VMutex dibMutex;
     
    329326 POINTL point[4];
    330327 LONG   rc;
     328 PVOID  bitmapBits = NULL;
    331329
    332330  HWND hwndDest = WindowFromDC(hdcDest);
     
    381379#endif
    382380
    383   rc = GpiDrawBits(hps, bmpBits, pOS2bmp, 4, &point[0], ROP_SRCCOPY, BBO_OR);
     381  //SvL: Optimize this.. (don't convert entire bitmap if only a part will be blitted to the dc)
     382  if(dibinfo.dsBitfields[1] == 0x3E0) {//RGB 555?
     383        dprintf(("DIBSection::BitBlt; convert rgb 555 to 565"));
     384
     385        bitmapBits = (WORD *)malloc(pOS2bmp->cbImage);
     386        if(CPUFeatures & CPUID_MMX) {
     387                RGB555to565MMX((WORD *)bitmapBits, (WORD *)bmpBits, pOS2bmp->cbImage/sizeof(WORD));
     388        }
     389        else    RGB555to565((WORD *)bitmapBits, (WORD *)bmpBits, pOS2bmp->cbImage/sizeof(WORD));
     390        rc = GpiDrawBits(hps, bitmapBits, pOS2bmp, 4, &point[0], ROP_SRCCOPY, BBO_OR);
     391        free(bitmapBits);
     392  }
     393  else  rc = GpiDrawBits(hps, bmpBits, pOS2bmp, 4, &point[0], ROP_SRCCOPY, BBO_OR);
    384394
    385395  if(hwndDest != 0)
Note: See TracChangeset for help on using the changeset viewer.