Skip to content

Commit 3ba65e6

Browse files
committed
Revert "gfxlib2: force 96 dpi scaling on windows 7 to fix an issue with high dpi modes - no change for windows 10"
This reverts commit 294c20b.
1 parent beed41f commit 3ba65e6

File tree

2 files changed

+2
-26
lines changed

2 files changed

+2
-26
lines changed

changelog.txt

Lines changed: 0 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -13,7 +13,6 @@ Version 1.09.0
1313
- fbc: gen gcc: allow compiling with GCC 4.5 and older, by avoiding -Wno-unused-but-set-variable (TeeEmCee)
1414
- fbc: internal function fbcQueryGcc() to ask gcc for the correct as & ld to use (TeeEmCee)
1515
- rtlib: freebsd: minimum thread stacksize 8192 KiB
16-
- gfxlib2: force 96 dpi scaling on windows 7 to fix an issue with high dpi modes - no change for windows 10
1716

1817
[added]
1918
- fbc: add '-z fbrt' command line option to link against libfbrt*.a instead of libfb*.a

src/gfxlib2/win32/gfx_driver_d2d.c

Lines changed: 2 additions & 25 deletions
Original file line numberDiff line numberDiff line change
@@ -13,7 +13,6 @@
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

Comments
 (0)