Module: wine
Branch: stable
Commit: c229ad767b250475abaa4311b1749eab8e5df940
URL: http://source.winehq.org/git/wine.git/?a=commit;h=c229ad767b250475abaa4311b…
Author: Dmitry Timoshkov <dmitry(a)codeweavers.com>
Date: Thu Feb 24 18:19:56 2011 +0800
gdi32: Use graphics mode specified at the EMF creation time when playing EMR_EXTTEXTOUT record.
(cherry picked from commit 9bc5946cdedda3925f958667683d092f2ed4ea2e)
---
dlls/gdi32/enhmetafile.c | 16 ++++++++++++++++
1 files changed, 16 insertions(+), 0 deletions(-)
diff --git a/dlls/gdi32/enhmetafile.c b/dlls/gdi32/enhmetafile.c
index 15f7c1b..b8863fd 100644
--- a/dlls/gdi32/enhmetafile.c
+++ b/dlls/gdi32/enhmetafile.c
@@ -1133,6 +1133,7 @@ BOOL WINAPI PlayEnhMetaFileRecord(
const EMREXTTEXTOUTA *pExtTextOutA = (const EMREXTTEXTOUTA *)mr;
RECT rc;
const INT *dx = NULL;
+ int old_mode;
rc.left = pExtTextOutA->emrtext.rcl.left;
rc.top = pExtTextOutA->emrtext.rcl.top;
@@ -1142,6 +1143,11 @@ BOOL WINAPI PlayEnhMetaFileRecord(
pExtTextOutA->emrtext.ptlReference.x, pExtTextOutA->emrtext.ptlReference.y,
rc.left, rc.top, rc.right, rc.bottom, pExtTextOutA->emrtext.fOptions);
+ old_mode = SetGraphicsMode(hdc, pExtTextOutA->iGraphicsMode);
+ /* Reselect the font back into the dc so that the transformation
+ gets updated. */
+ SelectObject(hdc, GetCurrentObject(hdc, OBJ_FONT));
+
/* Linux version of pstoedit produces EMFs with offDx set to 0.
* These files can be enumerated and played under Win98 just
* fine, but at least Win2k chokes on them.
@@ -1153,6 +1159,8 @@ BOOL WINAPI PlayEnhMetaFileRecord(
pExtTextOutA->emrtext.fOptions, &rc,
(LPCSTR)((const BYTE *)mr + pExtTextOutA->emrtext.offString), pExtTextOutA->emrtext.nChars,
dx);
+
+ SetGraphicsMode(hdc, old_mode);
break;
}
@@ -1161,6 +1169,7 @@ BOOL WINAPI PlayEnhMetaFileRecord(
const EMREXTTEXTOUTW *pExtTextOutW = (const EMREXTTEXTOUTW *)mr;
RECT rc;
const INT *dx = NULL;
+ int old_mode;
rc.left = pExtTextOutW->emrtext.rcl.left;
rc.top = pExtTextOutW->emrtext.rcl.top;
@@ -1170,6 +1179,11 @@ BOOL WINAPI PlayEnhMetaFileRecord(
pExtTextOutW->emrtext.ptlReference.x, pExtTextOutW->emrtext.ptlReference.y,
rc.left, rc.top, rc.right, rc.bottom, pExtTextOutW->emrtext.fOptions);
+ old_mode = SetGraphicsMode(hdc, pExtTextOutW->iGraphicsMode);
+ /* Reselect the font back into the dc so that the transformation
+ gets updated. */
+ SelectObject(hdc, GetCurrentObject(hdc, OBJ_FONT));
+
/* Linux version of pstoedit produces EMFs with offDx set to 0.
* These files can be enumerated and played under Win98 just
* fine, but at least Win2k chokes on them.
@@ -1181,6 +1195,8 @@ BOOL WINAPI PlayEnhMetaFileRecord(
pExtTextOutW->emrtext.fOptions, &rc,
(LPCWSTR)((const BYTE *)mr + pExtTextOutW->emrtext.offString), pExtTextOutW->emrtext.nChars,
dx);
+
+ SetGraphicsMode(hdc, old_mode);
break;
}
Module: wine
Branch: stable
Commit: 53baeddd67c018683c5f2e252c10dd51dfb7bcc7
URL: http://source.winehq.org/git/wine.git/?a=commit;h=53baeddd67c018683c5f2e252…
Author: Henri Verbeet <hverbeet(a)codeweavers.com>
Date: Mon Nov 8 11:50:34 2010 +0100
wined3d: Don't use floating point textures without ARB_texture_float.
The floating point formats from ARB_texture_rg are only defined when
ARB_texture_float is also supported. It would have been nice if the formats
table itself was able to express this, but as far as I'm aware this is only an
issue for ARB_texture_rg, so it's probably not worth changing.
(cherry picked from commit 7a64870014b22f4c9ce1b2557f1ab18ef425f226)
---
dlls/wined3d/utils.c | 6 ++++++
1 files changed, 6 insertions(+), 0 deletions(-)
diff --git a/dlls/wined3d/utils.c b/dlls/wined3d/utils.c
index b63a5f8..49a2659 100644
--- a/dlls/wined3d/utils.c
+++ b/dlls/wined3d/utils.c
@@ -1136,6 +1136,12 @@ static BOOL init_format_texture_info(struct wined3d_gl_info *gl_info)
if (!gl_info->supported[format_texture_info[i].extension]) continue;
+ /* ARB_texture_rg defines floating point formats, but only if
+ * ARB_texture_float is also supported. */
+ if (!gl_info->supported[ARB_TEXTURE_FLOAT]
+ && (desc->Flags & WINED3DFMT_FLAG_FLOAT))
+ continue;
+
desc = &gl_info->gl_formats[fmt_idx];
desc->glInternal = format_texture_info[i].gl_internal;
desc->glGammaInternal = format_texture_info[i].gl_srgb_internal;