- Timestamp:
- Dec 31, 2001, 1:08:23 PM (24 years ago)
- Location:
- trunk/src/gdi32
- Files:
-
- 6 edited
Legend:
- Unmodified
- Added
- Removed
-
trunk/src/gdi32/blit.cpp
r7713 r7717 1 /* $Id: blit.cpp,v 1.3 6 2001-12-30 22:19:04sandervl Exp $ */1 /* $Id: blit.cpp,v 1.37 2001-12-31 12:08:20 sandervl Exp $ */ 2 2 3 3 /* … … 38 38 dprintf(("GDI32: StretchBlt Src : %x (%d, %d) size (%d, %d)\n", 39 39 hdcSrc, nXOriginSrc, nYOriginSrc, nWidthSrc, nHeightSrc)); 40 40 41 SetLastError(ERROR_SUCCESS); 41 42 if(DIBSection::getSection() != NULL) … … 48 49 nXOriginSrc, nYOriginSrc, nWidthSrc, nHeightSrc, 49 50 dwRop); 51 dprintf(("GDI32: StretchBlt returned %d", rc)); 50 52 return rc; 51 53 } … … 57 59 destdib->sync(hdcDest, nYOriginDest, nHeightDest); 58 60 } 61 } 62 if(rc == FALSE) { 63 dprintf(("!WARNING!: GDI32: StretchBlt returned FALSE; last error %x", rc, GetLastError())); 59 64 } 60 65 return rc; … … 73 78 { 74 79 BOOL rc; 80 81 POINT point1, point2; 82 GetViewportOrgEx(hdcDest, &point1); 83 GetViewportOrgEx(hdcSrc, &point2); 84 dprintf(("BitBlt: Viewport origin dest (%d,%d) src (%d,%d)", point1.x, point1.y, point2.x, point2.y)); 75 85 76 86 SetLastError(ERROR_SUCCESS); -
trunk/src/gdi32/dibsect.cpp
r7662 r7717 1 /* $Id: dibsect.cpp,v 1.6 1 2001-12-20 19:57:01sandervl Exp $ */1 /* $Id: dibsect.cpp,v 1.62 2001-12-31 12:08:20 sandervl Exp $ */ 2 2 3 3 /* … … 20 20 #include <win32type.h> 21 21 #include <misc.h> 22 #define OS2_ONLY23 #include "dibsect.h"24 #include <vmutex.h>25 22 #include <win32api.h> 26 23 #include <winconst.h> … … 28 25 #include <cpuhlp.h> 29 26 #include <dcdata.h> 27 #include "dibsect.h" 30 28 #include "oslibgpi.h" 31 29 #include "rgbcvt.h" … … 33 31 #define DBG_LOCALLOG DBG_dibsect 34 32 #include "dbglocal.h" 35 36 static VMutex dibMutex;37 33 38 34 //****************************************************************************** … … 176 172 this->iUsage = iUsage; 177 173 178 dibMutex.enter();174 lock(); 179 175 if(section == NULL) 180 176 { … … 195 191 dsect->next = this; 196 192 } 197 dibMutex.leave();193 unlock(); 198 194 } 199 195 //****************************************************************************** … … 216 212 free(pOS2bmp); 217 213 218 dibMutex.enter();214 lock(); 219 215 if(section == this) 220 216 { … … 231 227 dsect->next = this->next; 232 228 } 233 dibMutex.leave();229 unlock(); 234 230 } 235 231 //****************************************************************************** … … 489 485 hdcHeight = rect.bottom - rect.top; 490 486 hdcWidth = rect.right - rect.left; 487 dprintf(("DIBSection::BitBlt hdc size (%d,%d) (WINDOW)", hdcWidth, hdcHeight)); 491 488 } 492 489 else { 493 490 hdcHeight = pHps->bitmapHeight; 494 491 hdcWidth = pHps->bitmapWidth; 492 dprintf(("DIBSection::BitBlt hdc size (%d,%d) (BMP)", hdcWidth, hdcHeight)); 495 493 } 496 494 … … 498 496 //This messes up the two bitmaps in the opening window of Opera 6 499 497 //(choice between MDI & SDI interface) 500 #if 0501 if(nXdest + nDestWidth > hdcWidth) {502 nDestWidth = hdcWidth - nXdest;503 }504 505 if(nYdest + nDestHeight > hdcHeight) {506 nDestHeight = hdcHeight - nYdest;507 }508 #endif509 498 510 499 //win32 coordinates are relative to left top, OS/2 expects left bottom … … 513 502 514 503 point[0].x = nXdest; 504 point[1].x = nXdest + nDestWidth - 1; 505 #ifdef INVERT 515 506 point[0].y = hdcHeight - nYdest - nDestHeight; 516 point[1].x = nXdest + nDestWidth - 1;517 507 point[1].y = hdcHeight - nYdest - 1; 518 519 #if 0 520 //Don't check size here either. Let GpiDrawBits do that for us 521 if(nXsrc + nSrcWidth > pOS2bmp->cx) { 522 nSrcWidth = pOS2bmp->cx - nXsrc; 523 } 524 if(nYsrc + nSrcHeight > pOS2bmp->cy) { 525 nSrcHeight = pOS2bmp->cy - nYsrc; 526 } 508 #else 509 point[0].y = nYdest; 510 point[1].y = nYdest + nDestHeight - 1; 527 511 #endif 528 512 529 513 //target rectangle is inclusive-inclusive 530 514 point[2].x = nXsrc; 515 point[3].x = nXsrc + nSrcWidth; 516 #ifdef INVERT 531 517 point[2].y = pOS2bmp->cy - nYsrc - nSrcHeight; 532 point[3].x = nXsrc + nSrcWidth;533 518 point[3].y = pOS2bmp->cy - nYsrc; 519 #else 520 point[2].y = nYsrc; 521 point[3].y = nYsrc + nSrcHeight - 1; 522 #endif 534 523 535 524 dprintf(("DIBSection::BitBlt (%d,%d)(%d,%d) from (%d,%d)(%d,%d) dim (%d,%d)(%d,%d)", point[0].x, point[0].y, … … 540 529 oldyinversion = GpiQueryYInversion(hps); 541 530 if(oldyinversion != 0) { 531 #ifdef DEBUG 532 POINT point; 533 GetViewportOrgEx(hps, &point); 534 dprintf(("Viewport origin (%d,%d)", point.x, point.y)); 535 #endif 542 536 GpiEnableYInversion(hps, 0); 543 537 fRestoryYInversion = TRUE; … … 631 625 if(fRestoryYInversion) GpiEnableYInversion(hps, oldyinversion); 632 626 #endif 633 627 SetLastError(ERROR_SUCCESS_W); 634 628 635 629 return(TRUE); … … 661 655 dprintf(("Sync destination dibsection: hdc y inversion = %d", oldyinversion)); 662 656 if(oldyinversion != 0) { 657 #ifdef DEBUG 658 POINT point; 659 GetViewportOrgEx(hdc, &point); 660 dprintf(("Viewport origin (%d,%d)", point.x, point.y)); 661 #endif 663 662 GpiEnableYInversion(hdc, 0); 664 663 } … … 774 773 775 774 DIBSection *dsect = section; 776 dibMutex.enter();775 lock(); 777 776 778 777 do … … 780 779 if(dsect->handle == handle) 781 780 { 782 dibMutex.leave();781 unlock(); 783 782 return(dsect); 784 783 } … … 787 786 while(dsect); 788 787 789 dibMutex.leave();788 unlock(); 790 789 return(NULL); 791 790 } … … 801 800 DIBSection *dsect = section; 802 801 802 lock(); 803 803 do 804 804 { 805 805 if(dsect->hdc == hdc) 806 806 { 807 unlock(); 807 808 return(dsect); 808 809 } … … 810 811 } 811 812 while(dsect); 812 813 814 unlock(); 813 815 return(NULL); 814 816 } … … 873 875 //****************************************************************************** 874 876 //****************************************************************************** 875 DIBSection *DIBSection::section = NULL; 877 void DIBSection::initDIBSection() 878 { 879 InitializeCriticalSection(&dibcritsect); 880 } 881 //****************************************************************************** 882 //****************************************************************************** 883 DIBSection *DIBSection::section = NULL; 884 CRITICAL_SECTION DIBSection::dibcritsect; -
trunk/src/gdi32/dibsect.h
r5825 r7717 1 /* $Id: dibsect.h,v 1.2 5 2001-05-29 09:45:21 sandervl Exp $ */1 /* $Id: dibsect.h,v 1.26 2001-12-31 12:08:21 sandervl Exp $ */ 2 2 3 3 /* … … 9 9 #define __DIBSECT_H__ 10 10 11 #ifdef OS2_ ONLY11 #ifdef OS2_INCLUDED 12 12 typedef struct 13 13 { … … 61 61 typedef BITMAPINFO *LPBITMAPINFO; 62 62 63 #ifdef OS2_ ONLY63 #ifdef OS2_INCLUDED 64 64 #define DIB_RGB_COLORS 0 65 65 #define DIB_PAL_COLORS 1 … … 113 113 static DIBSection *findHDC(HDC hdc); 114 114 static void deleteSection(HANDLE handle); 115 116 static void initDIBSection(); 117 118 static void lock() { EnterCriticalSection(&dibcritsect); }; 119 static void unlock() { LeaveCriticalSection(&dibcritsect); }; 120 115 121 protected: 116 122 … … 129 135 DIBSection* next; // Next DIB section 130 136 static DIBSection* section; // List of DIB sections 137 138 static CRITICAL_SECTION dibcritsect; 131 139 }; 132 140 -
trunk/src/gdi32/gdi32.cpp
r7675 r7717 1 /* $Id: gdi32.cpp,v 1.7 8 2001-12-23 16:40:10sandervl Exp $ */1 /* $Id: gdi32.cpp,v 1.79 2001-12-31 12:08:22 sandervl Exp $ */ 2 2 3 3 /* … … 227 227 228 228 if(newHdc) STATS_CreateCompatibleDC(hdc, newHdc); 229 230 229 OSLibGpiSetCp(newHdc, oldcp); 231 230 dprintf(("CreateCompatibleDC %X returned %x", hdc, newHdc)); … … 922 921 COLORREF WIN32API GetTextColor( HDC hdc) 923 922 { 924 dprintf(("GDI32: GetTextColor %x", hdc)); 925 return O32_GetTextColor(hdc); 926 } 927 //****************************************************************************** 928 //****************************************************************************** 923 COLORREF color; 924 925 color = O32_GetTextColor(hdc); 926 dprintf(("GDI32: GetTextColor %x -> %x", hdc, color)); 927 return color; 928 } 929 929 //****************************************************************************** 930 930 //****************************************************************************** -
trunk/src/gdi32/initgdi32.cpp
r7640 r7717 1 /* $Id: initgdi32.cpp,v 1.1 0 2001-12-16 15:29:55sandervl Exp $1 /* $Id: initgdi32.cpp,v 1.11 2001-12-31 12:08:23 sandervl Exp $ 2 2 * 3 3 * DLL entry point … … 26 26 #define INCL_DOSMODULEMGR 27 27 #define INCL_DOSPROCESS 28 #define INCL_GPI 28 29 #include <os2wrap.h> //Odin32 OS/2 api wrappers 29 30 #include <stdlib.h> … … 31 32 #include <string.h> 32 33 #include <odin.h> 33 #include <win32 type.h>34 #include <win32api.h> 34 35 #include <winconst.h> 35 36 #include <odinlx.h> 36 37 #include <misc.h> /*PLF Wed 98-03-18 23:18:15*/ 37 #define DBG_LOCALLOG DBG_initterm38 #include "dbglocal.h"39 38 #include "region.h" 40 39 #include <initdll.h> 41 40 #include <stats.h> 41 #include "dibsect.h" 42 43 #define DBG_LOCALLOG DBG_initterm 44 #include "dbglocal.h" 42 45 43 46 extern "C" { … … 94 97 return 0UL; 95 98 } 99 DIBSection::initDIBSection(); 96 100 dllHandle = RegisterLxDll(hModule, OdinLibMain, (PVOID)&gdi32_PEResTab, 97 101 GDI32_MAJORIMAGE_VERSION, GDI32_MINORIMAGE_VERSION, -
trunk/src/gdi32/oslibgdi.cpp
r5931 r7717 1 /* $Id: oslibgdi.cpp,v 1. 7 2001-06-08 11:03:33 sandervl Exp $ */1 /* $Id: oslibgdi.cpp,v 1.8 2001-12-31 12:08:23 sandervl Exp $ */ 2 2 3 3 /* … … 14 14 #include <stdlib.h> 15 15 #include <string.h> 16 #include <win32 type.h>16 #include <win32api.h> 17 17 #include <misc.h> 18 #define OS2_ONLY19 18 #include "dibsect.h" 20 19 #include "oslibgdi.h"
Note:
See TracChangeset
for help on using the changeset viewer.