1313#include <d2d1.h>
1414#include <dxgi.h>
1515#include <stdlib.h>
16- #include "VersionHelpers.h"
1716
1817/* Defining DEBUG or D2D_DEBUG will turn on debugging for Direct2D & Direct3D
1918// (if it's used). To see any output from them you'll need to install
@@ -194,7 +193,6 @@ typedef struct D2DGlobalState
194193 ID2D1HwndRenderTarget * pHwndTarget ; /* The guy that lets us render to a window */
195194 } NonLayered ;
196195 } RenderParams ;
197- BOOL isWin10 ;
198196} D2DGlobalState ;
199197
200198/* We could statically allocate the state as a global, but that would
@@ -236,7 +234,6 @@ static D2DGlobalState* CreateGlobalState(HWND hwnd, HMODULE hD2D, ID2D1Factory*
236234 }
237235 ++ i ;
238236 }
239- pState -> isWin10 = IsWindows10OrGreater ();
240237 if (!SetProp (hwnd , MAKEINTRESOURCE (D2D_PROP_ID ), (HANDLE )pState )) {
241238 free (pState );
242239 pState = NULL ;
@@ -625,20 +622,8 @@ static void D2DCommonPaintInternal(D2DGlobalState* pGlobalState)
625622 dirtyRect .bottom = ((pLastDirtyRow - pDirtyStart ) + 1 ) * scanlineSize ;
626623 drawRect .left = dirtyRect .left ;
627624 drawRect .right = dirtyRect .right ;
628-
629- if ( pGlobalState -> isWin10 ) {
630- drawRect .top = dirtyRect .top ;
631- drawRect .bottom = dirtyRect .bottom ;
632- }
633- else {
634- /* on win7 the update / scaling doesn't work correctly.
635- // Only thing that seems to work at this point is if
636- // we update the entire window. (jeffm)
637- */
638- drawRect .top = 0 ;
639- drawRect .bottom = winHeight ;
640- }
641-
625+ drawRect .top = dirtyRect .top ;
626+ drawRect .bottom = dirtyRect .bottom ;
642627
643628 DBG_TEXT ("%s - dirty rect L-%lu, T-%lu, R-%lu, B-%lu" , dirtyRect .left , dirtyRect .top , dirtyRect .right , dirtyRect .bottom );
644629
@@ -655,14 +640,6 @@ static void D2DCommonPaintInternal(D2DGlobalState* pGlobalState)
655640
656641 ID2D1Bitmap_CopyFromMemory (pBackBuffer , & dirtyRect , pBitmapDataSrc , stride );
657642
658- if ( !pGlobalState -> isWin10 )
659- {
660- /* win7 seems to handle ID2D1RenderTarget_DrawBitmap() differently
661- // than on win10. Force the DPI for the render target otherwise
662- // we get weird scaling when system is in a high-dpi mode (jeffm).
663- */
664- ID2D1RenderTarget_SetDpi ( pRT , 96 , 96 );
665- }
666643 ID2D1RenderTarget_BeginDraw (pRT );
667644 ID2D1RenderTarget_DrawBitmap (pRT , pBackBuffer , & drawRect , 1.0f , D2D1_BITMAP_INTERPOLATION_MODE_LINEAR , & drawRect );
668645 if (pGlobalState -> Paint )
0 commit comments