- Timestamp:
- Jul 16, 2003, 12:46:18 PM (22 years ago)
- Location:
- trunk/src/gdi32
- Files:
-
- 5 edited
Legend:
- Unmodified
- Added
- Removed
-
trunk/src/gdi32/blit.cpp
r10059 r10167 1 /* $Id: blit.cpp,v 1.4 4 2003-05-02 15:32:27sandervl Exp $ */1 /* $Id: blit.cpp,v 1.45 2003-07-16 10:46:16 sandervl Exp $ */ 2 2 3 3 /* … … 183 183 184 184 newbits = (WORD *)malloc(imgsize); 185 if(CPUFeatures & CPUID_MMX) { 186 RGB555to565MMX(newbits, (WORD *)bits, imgsize/sizeof(WORD)); 187 } 188 else 189 RGB555to565(newbits, (WORD *)bits, imgsize/sizeof(WORD)); 185 pRGB555to565(newbits, (WORD *)bits, imgsize/sizeof(WORD)); 190 186 bits = newbits; 191 187 } … … 469 465 break; 470 466 } 467 471 468 if(bitfields[1] == RGB555_GREEN_MASK) 472 469 {//RGB 555? … … 474 471 475 472 ULONG imgsize = CalcBitmapSize(info->bmiHeader.biBitCount, 476 widthSrc, heightSrc);473 abs(info->bmiHeader.biWidth), heightSrc); 477 474 ULONG offset = CalcBitmapSize(info->bmiHeader.biBitCount, 478 xSrc, ySrc)/sizeof(WORD);475 abs(info->bmiHeader.biWidth), ySrc)/sizeof(WORD); 479 476 newbits = (WORD *) HeapAlloc(GetProcessHeap(), 0, imgsize); 480 //bugbug (too much) 481 //bugbug 482 if(CPUFeatures & CPUID_MMX) { 483 RGB555to565MMX(newbits, (WORD *)bits+offset, imgsize/sizeof(WORD)); 484 } 485 else 486 RGB555to565(newbits, (WORD *)bits+offset, imgsize/sizeof(WORD)); 477 478 //we still convert too much 479 pRGB555to565(newbits, (WORD *)bits+offset, imgsize/sizeof(WORD)); 487 480 bits = newbits; 481 482 ySrc = 0; 488 483 } 489 484 //SvL: Ignore BI_BITFIELDS type (StretchDIBits fails otherwise) -
trunk/src/gdi32/dibitmap.cpp
r10088 r10167 1 /* $Id: dibitmap.cpp,v 1.4 0 2003-05-14 11:39:59sandervl Exp $ */1 /* $Id: dibitmap.cpp,v 1.41 2003-07-16 10:46:17 sandervl Exp $ */ 2 2 3 3 /* … … 112 112 113 113 newbits = (WORD *)malloc(imgsize); 114 if(CPUFeatures & CPUID_MMX) { 115 RGB555to565MMX(newbits, (WORD *)lpbInit, imgsize/sizeof(WORD)); 116 } 117 else RGB555to565(newbits, (WORD *)lpbInit, imgsize/sizeof(WORD)); 114 pRGB555to565(newbits, (WORD *)lpbInit, imgsize/sizeof(WORD)); 115 118 116 lpbInit = newbits; 119 117 } … … 496 494 lpbi->bmiHeader.biWidth, nrlines); 497 495 498 if(CPUFeatures & CPUID_MMX) { 499 RGB565to555MMX((WORD *)lpvBits, (WORD *)lpvBits, imgsize/sizeof(WORD)); 500 } 501 else RGB565to555((WORD *)lpvBits, (WORD *)lpvBits, imgsize/sizeof(WORD)); 496 pRGB565to555((WORD *)lpvBits, (WORD *)lpvBits, imgsize/sizeof(WORD)); 502 497 } 503 498 … … 515 510 void WIN32API ConvertRGB555to565(LPVOID dest, LPVOID src, UINT imgsize) 516 511 { 517 if(CPUFeatures & CPUID_MMX) { 518 RGB555to565MMX((WORD *)dest, (WORD *)src, imgsize/sizeof(WORD)); 519 } 520 else RGB555to565((WORD *)dest, (WORD *)src, imgsize/sizeof(WORD)); 512 pRGB555to565((WORD *)dest, (WORD *)src, imgsize/sizeof(WORD)); 521 513 } 522 514 //****************************************************************************** … … 592 584 593 585 newbits = (WORD *)malloc(imgsize); 594 if(CPUFeatures & CPUID_MMX) { 595 RGB555to565MMX(newbits, (WORD *)pBits, imgsize/sizeof(WORD)); 596 } 597 else RGB555to565(newbits, (WORD *)pBits, imgsize/sizeof(WORD)); 586 pRGB555to565(newbits, (WORD *)pBits, imgsize/sizeof(WORD)); 598 587 pBits = newbits; 599 588 } -
trunk/src/gdi32/dibsect.cpp
r10088 r10167 1 /* $Id: dibsect.cpp,v 1.6 6 2003-05-14 11:39:59sandervl Exp $ */1 /* $Id: dibsect.cpp,v 1.67 2003-07-16 10:46:17 sandervl Exp $ */ 2 2 3 3 /* … … 23 23 #include <winconst.h> 24 24 #include <winuser32.h> 25 #include <cpuhlp.h>26 25 #include <dcdata.h> 27 26 #include "dibsect.h" … … 626 625 if (iLength > 0) 627 626 { 628 if(CPUFeatures & CPUID_MMX) 629 RGB555to565MMX((WORD *)bmpBitsDblBuffer, (WORD *)bitmapBits, iLength/sizeof(WORD)); 630 else RGB555to565((WORD *)bmpBitsDblBuffer, (WORD *)bitmapBits, iLength/sizeof(WORD)); 627 pRGB555to565((WORD *)bmpBitsDblBuffer, (WORD *)bitmapBits, iLength/sizeof(WORD)); 631 628 } 632 629 else … … 760 757 destBuf = GetDIBObject() + nYdest*dibinfo.dsBm.bmWidthBytes; 761 758 762 if(CPUFeatures & CPUID_MMX) { 763 RGB565to555MMX((WORD *)destBuf, (WORD *)destBuf, (nDestHeight*dibinfo.dsBm.bmWidthBytes)/sizeof(WORD)); 764 } 765 else RGB565to555((WORD *)destBuf, (WORD *)destBuf, (nDestHeight*dibinfo.dsBm.bmWidthBytes)/sizeof(WORD)); 759 pRGB565to555((WORD *)destBuf, (WORD *)destBuf, (nDestHeight*dibinfo.dsBm.bmWidthBytes)/sizeof(WORD)); 766 760 } 767 761 -
trunk/src/gdi32/initgdi32.cpp
r8934 r10167 1 /* $Id: initgdi32.cpp,v 1.1 3 2002-07-29 11:26:48 sandervl Exp $1 /* $Id: initgdi32.cpp,v 1.14 2003-07-16 10:46:18 sandervl Exp $ 2 2 * 3 3 * DLL entry point … … 35 35 #include <winconst.h> 36 36 #include <odinlx.h> 37 #include <misc.h> /*PLF Wed 98-03-18 23:18:15*/ 37 #include <cpuhlp.h> 38 #include <dbglog.h> 38 39 #include "region.h" 39 40 #include <initdll.h> 40 41 #include <stats.h> 41 42 #include "dibsect.h" 43 #include "rgbcvt.h" 42 44 43 45 #define DBG_LOCALLOG DBG_initterm … … 48 50 extern DWORD gdi32_PEResTab; 49 51 } 52 50 53 static HMODULE dllHandle = 0; 54 void (_Optlink *pRGB555to565)(WORD *dest, WORD *src, ULONG num) = NULL; 55 void (_Optlink *pRGB565to555)(WORD *dest, WORD *src, ULONG num) = NULL; 56 51 57 //****************************************************************************** 52 58 //****************************************************************************** … … 97 103 } 98 104 DIBSection::initDIBSection(); 105 if(CPUFeatures & CPUID_MMX) { 106 pRGB555to565 = RGB555to565MMX; 107 pRGB565to555 = RGB565to555MMX; 108 } 109 else { 110 pRGB555to565 = RGB555to565; 111 pRGB555to565 = RGB565to555; 112 } 99 113 dllHandle = RegisterLxDll(hModule, GdiLibMain, (PVOID)&gdi32_PEResTab, 100 114 GDI32_MAJORIMAGE_VERSION, GDI32_MINORIMAGE_VERSION, -
trunk/src/gdi32/rgbcvt.h
r8871 r10167 1 //$Id: rgbcvt.h,v 1. 3 2002-07-15 10:02:30sandervl Exp $1 //$Id: rgbcvt.h,v 1.4 2003-07-16 10:46:18 sandervl Exp $ 2 2 #ifndef __RGBCVT_H__ 3 3 #define __RGBCVT_H__ … … 32 32 void _Optlink RGB565to555MMX(WORD *dest, WORD *src, ULONG num); 33 33 34 extern void (_Optlink *pRGB555to565)(WORD *dest, WORD *src, ULONG num); 35 extern void (_Optlink *pRGB565to555)(WORD *dest, WORD *src, ULONG num); 36 34 37 #endif //__RGBCVT_H__
Note:
See TracChangeset
for help on using the changeset viewer.