freetype-commit
[Top][All Lists]
Advanced

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

[Git][freetype/freetype-demos][master] 2 commits: This reverts commit 45


From: Alexei Podtelezhnikov (@apodtele)
Subject: [Git][freetype/freetype-demos][master] 2 commits: This reverts commit 454797135a90.
Date: Mon, 23 May 2022 02:48:50 +0000

Alexei Podtelezhnikov pushed to branch master at FreeType / FreeType Demo Programs

Commits:

1 changed file:

Changes:

  • graph/win32/grwin32.c
    ... ... @@ -174,6 +174,11 @@ gr_win32_surface_refresh_rectangle(
    174 174
       if ( w <= 0 || h <= 0 )
    
    175 175
         return;
    
    176 176
     
    
    177
    +  rect.left   = x;
    
    178
    +  rect.top    = y;
    
    179
    +  rect.right  = x + w;
    
    180
    +  rect.bottom = y + h;
    
    181
    +
    
    177 182
     #ifdef SWIZZLE
    
    178 183
       if ( bitmap->mode == gr_pixel_mode_rgb24 )
    
    179 184
       {
    
    ... ... @@ -225,11 +230,6 @@ gr_win32_surface_refresh_rectangle(
    225 230
         }
    
    226 231
       }
    
    227 232
     
    
    228
    -  rect.left   = x;
    
    229
    -  rect.top    = y;
    
    230
    -  rect.right  = x + w;
    
    231
    -  rect.bottom = y + h;
    
    232
    -
    
    233 233
       InvalidateRect( surface->window, &rect, FALSE );
    
    234 234
       UpdateWindow( surface->window );
    
    235 235
     }
    
    ... ... @@ -250,26 +250,9 @@ gr_win32_surface_set_icon( grWin32Surface* surface,
    250 250
       int       s[] = { GetSystemMetrics( SM_CYSMICON ),
    
    251 251
                         GetSystemMetrics( SM_CYICON ) };
    
    252 252
       WPARAM    wParam;
    
    253
    -  HDC       hDC;
    
    254
    -  VOID*     bts;
    
    255 253
       ICONINFO  ici = { TRUE };
    
    256 254
       HICON     hIcon;
    
    257 255
     
    
    258
    -  /* NOTE: The Mingw64 header file `wingdi.h` defines this macro as `sRGB`,
    
    259
    -   * which triggers the `-Wmultichar` warning during compilation, so replace
    
    260
    -   * it with the corresponding numerical value.
    
    261
    -   */
    
    262
    -#ifdef __MINGW64__
    
    263
    -# undef  LCS_sRGB
    
    264
    -# define LCS_sRGB  0x73524742
    
    265
    -#endif
    
    266
    -
    
    267
    -  BITMAPV4HEADER  hdr = { sizeof( BITMAPV4HEADER ),
    
    268
    -                          0, 0, 1, 32, BI_BITFIELDS, 0, 0, 0, 0, 0,
    
    269
    -                          0x00FF0000, 0x0000FF00, 0x000000FF, 0xFF000000,
    
    270
    -                          LCS_sRGB };
    
    271
    -
    
    272
    -
    
    273 256
       if ( !icon )
    
    274 257
         return s[1];
    
    275 258
       else if ( icon->mode != gr_pixel_mode_rgb32 )
    
    ... ... @@ -281,20 +264,14 @@ gr_win32_surface_set_icon( grWin32Surface* surface,
    281 264
       else
    
    282 265
         return 0;
    
    283 266
     
    
    284
    -  ici.hbmMask  = CreateBitmap( icon->width, icon->rows, 1, 1, NULL);
    
    285
    -
    
    286
    -  hdr.bV4Width  =  icon->width;
    
    287
    -  hdr.bV4Height = -icon->rows;
    
    288
    -
    
    289
    -  hDC = GetDC( NULL );
    
    290
    -  ici.hbmColor = CreateDIBSection( hDC, (LPBITMAPINFO)&hdr,
    
    291
    -                                   DIB_RGB_COLORS, &bts, NULL, 0 );
    
    292
    -  ReleaseDC( NULL, hDC );
    
    293
    -
    
    294
    -  memcpy( bts, icon->buffer, icon->rows * icon->width * 4 );
    
    267
    +  ici.hbmMask  = CreateBitmap( icon->width, icon->rows, 1,  1, NULL );
    
    268
    +  ici.hbmColor = CreateBitmap( icon->width, icon->rows, 1, 32, icon->buffer );
    
    295 269
     
    
    296 270
       hIcon = CreateIconIndirect( &ici );
    
    297 271
     
    
    272
    +  DeleteObject( ici.hbmMask );
    
    273
    +  DeleteObject( ici.hbmColor );
    
    274
    +
    
    298 275
       PostMessage( surface->window, WM_SETICON, wParam, (LPARAM)hIcon );
    
    299 276
     
    
    300 277
       switch( wParam )
    


  • reply via email to

    [Prev in Thread] Current Thread [Next in Thread]