diff options
author | Jose Fonseca <jfonseca@vmware.com> | 2016-08-31 18:34:12 +0100 |
---|---|---|
committer | Jose Fonseca <jfonseca@vmware.com> | 2016-08-31 18:34:12 +0100 |
commit | e9916d5da557a66eb446c3dcf66d688f5781f473 (patch) | |
tree | e705f12fde5e775ae3129edd7ec7de8da8ee9e78 | |
parent | ac1df3747a30d12e63e6f1fd52ee3aaa0e4ab33d (diff) |
wgltrace: Emit fake string marker with GDI font for all wglUseFont* entrypoints.
-rw-r--r-- | wrappers/wgltrace.py | 32 |
1 files changed, 19 insertions, 13 deletions
diff --git a/wrappers/wgltrace.py b/wrappers/wgltrace.py index d4830a17..5a2974c2 100644 --- a/wrappers/wgltrace.py +++ b/wrappers/wgltrace.py @@ -83,6 +83,24 @@ class WglTracer(GlTracer): print ' }' print ' gltrace::releaseContext((uintptr_t)hglrc);' + # Emit a fake string marker describing the current GDI font + if function.name.startswith('wglUseFont'): + print r' HFONT hFont = static_cast<HFONT>(GetCurrentObject(hdc, OBJ_FONT));' + print r' if (hFont != nullptr) {' + print r' LOGFONT lf;' + print r' if (GetObject(hFont, sizeof lf, &lf) != 0) {' + print r' std::ostringstream ss;' + print r' ss << "lfFaceName = " << lf.lfFaceName' + print r' << ", lfHeight = " << lf.lfHeight' + print r' << ", lfWeight = " << lf.lfWeight;' + print r' if (lf.lfItalic) ss << ", lfItalic = 1";' + print r' if (lf.lfUnderline) ss << ", lfUnderline = 1";' + print r' if (lf.lfStrikeOut) ss << ", lfStrikeOut = 1";' + print r' _fakeStringMarker(ss.str());' + print r' }' + print r' }' + print + # Emit fake glBitmap calls in the trace on wglUseFontBitmapsA. # This enables to capture the real bitmaps and replay them outside Windows. # @@ -111,19 +129,7 @@ class WglTracer(GlTracer): print r' if (_result) {' - print r' HFONT hFont = (HFONT)GetCurrentObject(hdc, OBJ_FONT);' - print r' assert (hFont != nullptr);' - print r' LOGFONT lf;' - print r' if (GetObject(hFont, sizeof lf, &lf) != 0) {' - print r' std::ostringstream ss;' - print r' ss << "lfFaceName = " << lf.lfFaceName' - print r' << ", lfHeight = " << lf.lfHeight' - print r' << ", lfWeight = " << lf.lfWeight;' - print r' if (lf.lfItalic) ss << ", lfItalic = 1";' - print r' if (lf.lfUnderline) ss << ", lfUnderline = 1";' - print r' if (lf.lfStrikeOut) ss << ", lfStrikeOut = 1";' - print r' _fakeStringMarker(ss.str());' - print r' }' + print r' assert(hFont != nullptr);' print print r' BOOL bRet;' |