freetype-commit
[Top][All Lists]
Advanced

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

[freetype2-demos] master a007661: [graph/win32] Minor driver improvement


From: Werner Lemberg
Subject: [freetype2-demos] master a007661: [graph/win32] Minor driver improvements.
Date: Mon, 6 Feb 2023 23:40:21 -0500 (EST)

branch: master
commit a007661ed80f0949fe4c679769c31f696443be28
Author: Alexei Podtelezhnikov <apodtele@gmail.com>
Commit: Alexei Podtelezhnikov <apodtele@gmail.com>

    [graph/win32] Minor driver improvements.
    
    * graph/win32/grwin32.c: (gr_win32_device_init): Do not set icon
    or background, which is covered anyway.
    (Message_Process) [WM_PAINT]: Paint only updated rectangle.
---
 graph/win32/grwin32.c | 22 +++++++++++++++-------
 1 file changed, 15 insertions(+), 7 deletions(-)

diff --git a/graph/win32/grwin32.c b/graph/win32/grwin32.c
index 9ed9d27..d5af0df 100644
--- a/graph/win32/grwin32.c
+++ b/graph/win32/grwin32.c
@@ -665,11 +665,19 @@ LRESULT CALLBACK Message_Process( HWND handle, UINT mess,
         PAINTSTRUCT  ps;
 
         hDC = BeginPaint ( handle, &ps );
-        SetDIBitsToDevice( hDC, 0, 0,
-                           surface->root.bitmap.width,
-                           surface->root.bitmap.rows,
-                           0, 0, 0,
-                           surface->root.bitmap.rows,
+
+        LOG(( "WM_PAINT : ( %d %d %d %d )\n",
+              ps.rcPaint.left,  ps.rcPaint.top,
+              ps.rcPaint.right, ps.rcPaint.bottom ));
+
+        SetDIBitsToDevice( hDC,
+                           ps.rcPaint.left,
+                           ps.rcPaint.top,
+                           ps.rcPaint.right - ps.rcPaint.left,
+                           ps.rcPaint.bottom - ps.rcPaint.top,
+                           ps.rcPaint.left,
+                           surface->root.bitmap.rows - ps.rcPaint.bottom,
+                           0, surface->root.bitmap.rows,
                            surface->shadow_bitmap.buffer,
                            (LPBITMAPINFO)&surface->bmiHeader,
                            DIB_RGB_COLORS );
@@ -692,9 +700,9 @@ LRESULT CALLBACK Message_Process( HWND handle, UINT mess,
       /* int     cbClsExtra   */ 0,
       /* int     cbWndExtra   */ 0,
       /* HANDLE  hInstance    */ GetModuleHandle( NULL ),
-      /* HICON   hIcon        */ LoadIcon( NULL, IDI_APPLICATION),
+      /* HICON   hIcon        */ NULL,
       /* HCURSOR hCursor      */ LoadCursor( NULL, IDC_ARROW),
-      /* HBRUSH  hbrBackground*/ GetStockObject( LTGRAY_BRUSH ),
+      /* HBRUSH  hbrBackground*/ NULL,
       /* LPCTSTR lpszMenuName */ NULL,
       /* LPCTSTR lpszClassName*/ "FreeTypeTestGraphicDriver"
     };



reply via email to

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