From f660b655e03db57a5e2bb0509e049a9e69df1b16 Mon Sep 17 00:00:00 2001 From: José Fonseca Date: Wed, 18 Jun 2014 15:15:12 +0100 Subject: d2d1trace: Don't provide d2d1.dll/dwrite.dll stubs. Just like done for DXGI. --- cli/cli_trace.cpp | 7 +++++++ common/trace_api.hpp | 1 + wrappers/CMakeLists.txt | 25 ++++--------------------- wrappers/d2d1.def | 10 ---------- wrappers/d2d1trace.def | 10 ++++++++++ wrappers/dwrite.def | 4 ---- wrappers/dwritetrace.cpp | 6 ------ 7 files changed, 22 insertions(+), 41 deletions(-) delete mode 100644 wrappers/d2d1.def create mode 100644 wrappers/d2d1trace.def delete mode 100644 wrappers/dwrite.def delete mode 100644 wrappers/dwritetrace.cpp diff --git a/cli/cli_trace.cpp b/cli/cli_trace.cpp index e5b0cfdc..ac89636e 100644 --- a/cli/cli_trace.cpp +++ b/cli/cli_trace.cpp @@ -122,6 +122,10 @@ traceProgram(trace::API api, wrapperFilename = "dxgitrace.dll"; useInject = true; break; + case trace::API_D2D1: + wrapperFilename = "d2d1trace.dll"; + useInject = true; + break; #endif default: std::cerr << "error: unsupported API\n"; @@ -326,6 +330,9 @@ command(int argc, char *argv[]) strcmp(optarg, "d3d11") == 0 || strcmp(optarg, "d3d11_1") == 0) { api = trace::API_DXGI; + } else if (strcmp(optarg, "d2d") == 0 || + strcmp(optarg, "d2d1") == 0) { + api = trace::API_D2D1; } else { std::cerr << "error: unknown API `" << optarg << "`\n"; usage(); diff --git a/common/trace_api.hpp b/common/trace_api.hpp index 3d491fe1..3ddda7ef 100644 --- a/common/trace_api.hpp +++ b/common/trace_api.hpp @@ -49,6 +49,7 @@ enum API { API_D3D8, API_D3D9, API_DXGI, // D3D10.x, D3D11.x + API_D2D1, // Direct2D }; diff --git a/wrappers/CMakeLists.txt b/wrappers/CMakeLists.txt index 9e998fc9..bc44f4ae 100644 --- a/wrappers/CMakeLists.txt +++ b/wrappers/CMakeLists.txt @@ -155,7 +155,7 @@ if (WIN32) ${CMAKE_SOURCE_DIR}/specs/winapi.py ${CMAKE_SOURCE_DIR}/specs/stdapi.py ) - add_library (dxgitrace SHARED + add_library (dxgitrace MODULE ${DXGITRACE_DEF} dxgitrace.cpp d3dcommonshader.cpp @@ -169,10 +169,7 @@ if (WIN32) set_target_properties (dxgitrace PROPERTIES PREFIX "" ) - install (TARGETS dxgitrace - RUNTIME DESTINATION ${WRAPPER_INSTALL_DIR} COMPONENT RUNTIME - LIBRARY DESTINATION ${WRAPPER_INSTALL_DIR} COMPONENT RUNTIME - ) + install (TARGETS dxgitrace LIBRARY DESTINATION ${WRAPPER_INSTALL_DIR}) endif () # d2d1.dll, dwrite.dll @@ -197,7 +194,7 @@ if (WIN32) ${CMAKE_SOURCE_DIR}/specs/winapi.py ${CMAKE_SOURCE_DIR}/specs/stdapi.py ) - add_library (d2d1trace SHARED d2d1.def d2d1trace.cpp) + add_library (d2d1trace MODULE d2d1trace.def d2d1trace.cpp) target_link_libraries (d2d1trace common ${ZLIB_LIBRARIES} @@ -205,22 +202,8 @@ if (WIN32) ) set_target_properties (d2d1trace PROPERTIES PREFIX "" - OUTPUT_NAME d2d1 - ) - # http://www.cmake.org/pipermail/cmake/2009-March/028221.html - install (TARGETS d2d1trace - RUNTIME DESTINATION ${WRAPPER_INSTALL_DIR} COMPONENT RUNTIME - LIBRARY DESTINATION ${WRAPPER_INSTALL_DIR} COMPONENT RUNTIME - ) - - # dwrite.dll is just an empty stub for d2d1.dll - add_library (dwritetrace MODULE dwrite.def dwritetrace.cpp) - target_link_libraries (dwritetrace d2d1trace) - set_target_properties (dwritetrace - PROPERTIES PREFIX "" - OUTPUT_NAME dwrite ) - install (TARGETS dwritetrace LIBRARY DESTINATION ${WRAPPER_INSTALL_DIR}) + install (TARGETS d2d1trace LIBRARY DESTINATION ${WRAPPER_INSTALL_DIR}) endif (DirectX_D2D1_INCLUDE_DIR) # opengl32.dll diff --git a/wrappers/d2d1.def b/wrappers/d2d1.def deleted file mode 100644 index a897bf9d..00000000 --- a/wrappers/d2d1.def +++ /dev/null @@ -1,10 +0,0 @@ -LIBRARY "d2d1" - -EXPORTS - D2D1CreateFactory @1 - D2D1MakeRotateMatrix @2 - D2D1MakeSkewMatrix @3 - D2D1IsMatrixInvertible @4 - D2D1InvertMatrix @5 - - DWriteCreateFactory diff --git a/wrappers/d2d1trace.def b/wrappers/d2d1trace.def new file mode 100644 index 00000000..a897bf9d --- /dev/null +++ b/wrappers/d2d1trace.def @@ -0,0 +1,10 @@ +LIBRARY "d2d1" + +EXPORTS + D2D1CreateFactory @1 + D2D1MakeRotateMatrix @2 + D2D1MakeSkewMatrix @3 + D2D1IsMatrixInvertible @4 + D2D1InvertMatrix @5 + + DWriteCreateFactory diff --git a/wrappers/dwrite.def b/wrappers/dwrite.def deleted file mode 100644 index 4dcdba1d..00000000 --- a/wrappers/dwrite.def +++ /dev/null @@ -1,4 +0,0 @@ -LIBRARY "d2d1" - -EXPORTS - DWriteCreateFactory diff --git a/wrappers/dwritetrace.cpp b/wrappers/dwritetrace.cpp deleted file mode 100644 index 9ca69d63..00000000 --- a/wrappers/dwritetrace.cpp +++ /dev/null @@ -1,6 +0,0 @@ -#include - -EXTERN_C BOOL WINAPI -DllMain(HINSTANCE hinstDLL, DWORD fdwReason, LPVOID lpvReserved) { - return TRUE; -} -- cgit v1.2.3