Ignore:
Timestamp:
Dec 15, 2001, 7:51:16 PM (24 years ago)
Author:
sandervl
Message:

Added statistics for font, bitmap, pen, brush & region objects.

File:
1 edited

Legend:

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

    r7330 r7635  
    1 /* $Id: gdi32.cpp,v 1.76 2001-11-13 15:42:05 sandervl Exp $ */
     1/* $Id: gdi32.cpp,v 1.77 2001-12-15 18:50:26 sandervl Exp $ */
    22
    33/*
     
    2525#include <winuser32.h>
    2626#include "font.h"
     27#include <stats.h>
    2728
    2829#define DBG_LOCALLOG    DBG_gdi32
     
    7778//******************************************************************************
    7879//******************************************************************************
    79 HBRUSH WIN32API CreatePatternBrush(HBITMAP arg1)
    80 {
    81  HBRUSH brush;
    82 
    83     brush = O32_CreatePatternBrush(arg1);
    84     dprintf(("GDI32: CreatePatternBrush from bitmap %X returned %X\n", arg1, brush));
    85     return(brush);
    86 }
    87 //******************************************************************************
    88 //******************************************************************************
    8980ODINFUNCTION3(HPEN, CreatePen, int, fnPenStyle, int, nWidth, COLORREF, crColor)
    9081{
     82 HPEN hPen;
     83
    9184    //CB: todo: PS_DOT is different in Win32 (. . . . and not - - - -)
    9285    //    Open32 looks like LINETYPE_SHORTDASH instead of LINETYPE_DOT!!!
    9386    //    -> difficult to fix without performance decrease!
    9487
    95     return O32_CreatePen(fnPenStyle,nWidth,crColor);
     88    hPen = O32_CreatePen(fnPenStyle,nWidth,crColor);
     89    if(hPen) STATS_CreatePen(hPen, fnPenStyle,nWidth,crColor);
     90    return hPen;
    9691}
    9792//******************************************************************************
     
    9994HPEN WIN32API CreatePenIndirect(const LOGPEN * lplgpn)
    10095{
     96 HPEN hPen;
     97
    10198    dprintf(("GDI32: CreatePenIndirect %x", lplgpn));
    102     return O32_CreatePenIndirect(lplgpn);
     99    hPen = O32_CreatePenIndirect(lplgpn);
     100    if(hPen) STATS_CreatePenIndirect(hPen, lplgpn);
     101    return hPen;
     102}
     103//******************************************************************************
     104//******************************************************************************
     105HPEN WIN32API ExtCreatePen(DWORD dwPenStyle, DWORD dwWidth, const LOGBRUSH *lplb,
     106                           DWORD dwStyleCount, const DWORD *lpStyle)
     107{
     108 HPEN hPen;
     109
     110    hPen = O32_ExtCreatePen(dwPenStyle, dwWidth, lplb, dwStyleCount, lpStyle);
     111    dprintf(("GDI32: ExtCreatePen %x %x %x %x %x returned %x", dwPenStyle, dwWidth, lplb, dwStyleCount, lpStyle, hPen));
     112    if(hPen) STATS_ExtCreatePen(hPen, dwPenStyle, dwWidth, lplb, dwStyleCount, lpStyle);
     113    return hPen;
     114}
     115//******************************************************************************
     116//******************************************************************************
     117HBRUSH WIN32API CreatePatternBrush(HBITMAP hBitmap)
     118{
     119 HBRUSH hBrush;
     120
     121    hBrush = O32_CreatePatternBrush(hBitmap);
     122    if(hBrush) STATS_CreatePatternBrush(hBrush, hBitmap);
     123
     124    dprintf(("GDI32: CreatePatternBrush from bitmap %X returned %X\n", hBitmap, hBrush));
     125    return(hBrush);
     126}
     127//******************************************************************************
     128//******************************************************************************
     129ODINFUNCTION1(HBRUSH, CreateSolidBrush, COLORREF, color)
     130{
     131    HBRUSH hBrush;
     132
     133    hBrush = O32_CreateSolidBrush(color);
     134    if(hBrush) STATS_CreateSolidBrush(hBrush, color);
     135    return(hBrush);
     136}
     137//******************************************************************************
     138//******************************************************************************
     139HBRUSH WIN32API CreateBrushIndirect( const LOGBRUSH *pLogBrush)
     140{
     141 HBRUSH hBrush;
     142
     143    hBrush = O32_CreateBrushIndirect((LPLOGBRUSH)pLogBrush);
     144    dprintf(("GDI32: CreateBrushIndirect %x %x %x returned %x", pLogBrush->lbStyle, pLogBrush->lbColor, pLogBrush->lbHatch, hBrush));
     145    if(hBrush) STATS_CreateBrushIndirect(hBrush, (LPLOGBRUSH)pLogBrush);
     146    return hBrush;
     147}
     148//******************************************************************************
     149//******************************************************************************
     150HBRUSH WIN32API CreateHatchBrush(int fnStyle, COLORREF clrref)
     151{
     152 HBRUSH hBrush;
     153 
     154    dprintf(("GDI32: CreateHatchBrush %x %x", fnStyle, clrref));
     155    hBrush = O32_CreateHatchBrush(fnStyle, clrref);
     156    if(hBrush) STATS_CreateHatchBrush(hBrush, fnStyle, clrref);
     157    return hBrush;
    103158}
    104159//******************************************************************************
     
    106161HBRUSH WIN32API CreateDIBPatternBrushPt( const VOID * buffer, UINT usage)
    107162{
     163 HBRUSH hBrush;
     164
    108165    dprintf(("GDI32: CreateDIBPatternBrushPt %x %x", buffer, usage));
    109     return O32_CreateDIBPatternBrushPt(buffer, usage);
     166    hBrush = O32_CreateDIBPatternBrushPt(buffer, usage);
     167    if(hBrush) STATS_CreateDIBPatternBrushPt(hBrush, buffer, usage);
     168    return hBrush;
    110169}
    111170/*****************************************************************************
     
    151210  }
    152211  else {
    153       dprintf(("ERROR: CreateDIBPatternBrush (%08xh, %08xh) -> INVALID memory handle!!",
     212      dprintf(("!ERROR!: CreateDIBPatternBrush (%08xh, %08xh) -> INVALID memory handle!!",
    154213                hglbDIBPacked, fuColorSpec));
    155214  }
     
    166225    if (!oldcp) /* If new DC is to be created */
    167226        oldcp = GetDisplayCodepage();
     227
     228    if(newHdc) STATS_CreateCompatibleDC(hdc, newHdc);
    168229
    169230    OSLibGpiSetCp(newHdc, oldcp);
     
    197258  }
    198259
     260  STATS_DeleteDC(hdc);
    199261  return O32_DeleteDC(hdc);
    200262}
     
    310372    dprintf(("GDI32: CloseFigure %x", hdc));
    311373    return O32_CloseFigure(hdc);
    312 }
    313 //******************************************************************************
    314 //******************************************************************************
    315 HBRUSH WIN32API CreateBrushIndirect( const LOGBRUSH *pLogBrush)
    316 {
    317  HBRUSH hBrush;
    318 
    319     hBrush = O32_CreateBrushIndirect((LPLOGBRUSH)pLogBrush);
    320     dprintf(("GDI32: CreateBrushIndirect %x %x %x returned %x", pLogBrush->lbStyle, pLogBrush->lbColor, pLogBrush->lbHatch, hBrush));
    321     return hBrush;
    322374}
    323375//******************************************************************************
     
    342394    if(hdc) {
    343395        OSLibGpiSetCp(hdc, GetDisplayCodepage());
     396        STATS_CreateDCA(hdc, lpszDriver, lpszDevice, lpszOutput, lpInitData);
    344397    }
    345398
     
    422475//******************************************************************************
    423476//******************************************************************************
    424 HBRUSH WIN32API CreateHatchBrush( int arg1, COLORREF  arg2)
    425 {
    426     dprintf(("GDI32: CreateHatchBrush"));
    427     return O32_CreateHatchBrush(arg1, arg2);
    428 }
    429 //******************************************************************************
    430 //******************************************************************************
    431477HDC WIN32API CreateICA(LPCSTR lpszDriver, LPCSTR lpszDevice, LPCSTR lpszOutput,
    432478                       const DEVMODEA *lpdvmInit)
    433479{
    434480 static char *szDisplay = "DISPLAY";
     481 HDC          hdc;
    435482
    436483    dprintf(("GDI32: CreateICA"));
     
    443490        lpszDriver = lpszDevice;
    444491    }
    445     return O32_CreateIC(lpszDriver, lpszDevice, lpszOutput, lpdvmInit);
     492    hdc = O32_CreateIC(lpszDriver, lpszDevice, lpszOutput, lpdvmInit);
     493    if(hdc) STATS_CreateICA(hdc, lpszDriver, lpszDevice, lpszOutput, lpdvmInit);
     494    return hdc;
    446495}
    447496//******************************************************************************
     
    519568//******************************************************************************
    520569//******************************************************************************
    521 ODINFUNCTION1(HBRUSH, CreateSolidBrush, COLORREF, color)
    522 {
    523     return O32_CreateSolidBrush(color);
    524 }
    525 //******************************************************************************
    526 //******************************************************************************
    527570BOOL WIN32API Ellipse(HDC hdc, int nLeftRect, int nTopRect, int nRightRect,
    528571                      int nBottomRect)
     
    631674//******************************************************************************
    632675//******************************************************************************
    633 int WIN32API EnumObjects( HDC hdc, int objType, GOBJENUMPROC objFunc, LPARAM lParam)
    634 {
    635     //calling convention differences
    636     dprintf(("ERROR: GDI32: EnumObjects STUB"));
    637 //    return O32_EnumObjects(arg1, arg2, arg3, arg4);
    638     return 0;
    639 }
    640 //******************************************************************************
    641 //******************************************************************************
    642676int WIN32API Escape( HDC hdc, int nEscape, int cbInput, LPCSTR lpvInData, PVOID lpvOutData)
    643677{
     
    651685
    652686    return rc;
    653 }
    654 //******************************************************************************
    655 //******************************************************************************
    656 HPEN WIN32API ExtCreatePen( DWORD arg1, DWORD arg2, const LOGBRUSH * arg3, DWORD arg4, const DWORD *  arg5)
    657 {
    658     dprintf(("GDI32: ExtCreatePen"));
    659     return O32_ExtCreatePen(arg1, arg2, arg3, arg4, arg5);
    660687}
    661688//******************************************************************************
     
    778805    dprintf(("GDI32: GetCharWidth32W might not work properly %x %x %x %x", hdc, iFirstChar, iLastChar, pWidthArray));
    779806    return O32_GetCharWidth(hdc, iFirstChar, iLastChar, pWidthArray);
    780 }
    781 //******************************************************************************
    782 //******************************************************************************
    783 HANDLE WIN32API GetCurrentObject( HDC hdc, UINT arg2)
    784 {
    785     dprintf(("GDI32: GetCurrentObject %x %x", hdc, arg2));
    786     return (HANDLE)O32_GetCurrentObject(hdc, arg2);
    787807}
    788808//******************************************************************************
     
    11571177//******************************************************************************
    11581178//******************************************************************************
    1159 //******************************************************************************
    1160 //******************************************************************************
    1161 BOOL WIN32API UnrealizeObject( HGDIOBJ hObject)
    1162 {
    1163     dprintf(("GDI32: UnrealizeObject %x", hObject));
    1164     return O32_UnrealizeObject(hObject);
    1165 }
    1166 //******************************************************************************
    1167 //******************************************************************************
    11681179BOOL WIN32API WidenPath( HDC hdc)
    11691180{
Note: See TracChangeset for help on using the changeset viewer.