From 9be91c8d671725b14372a861aaffa6a2262da9ce Mon Sep 17 00:00:00 2001 From: Stefan Csomor Date: Mon, 8 Sep 2014 14:12:04 +0000 Subject: [PATCH] added d2d git-svn-id: https://svn.wxwidgets.org/svn/wx/wxWidgets/trunk@77559 c3d73ce0-8a6f-49c7-b76d-6d57e0e08775 --- include/wx/graphics.h | 11 +++++++++ include/wx/msw/setup0.h | 49 ++++++++++++++++++++++++++++++++++++++--- 2 files changed, 57 insertions(+), 3 deletions(-) diff --git a/include/wx/graphics.h b/include/wx/graphics.h index 6bb970a9c9..6ab3cab2bf 100644 --- a/include/wx/graphics.h +++ b/include/wx/graphics.h @@ -795,6 +795,17 @@ public: static wxGraphicsRenderer* GetDefaultRenderer(); static wxGraphicsRenderer* GetCairoRenderer(); + +#ifdef __WXMSW__ +#if wxUSE_GRAPHICS_GDIPLUS + static wxGraphicsRenderer* GetGDIPlusRenderer(); +#endif + +#if wxUSE_GRAPHICS_DIRECT2D + static wxGraphicsRenderer* GetDirect2DRenderer(); +#endif +#endif + // Context virtual wxGraphicsContext * CreateContext( const wxWindowDC& dc) = 0; diff --git a/include/wx/msw/setup0.h b/include/wx/msw/setup0.h index 4e52291982..f968ecdbdb 100644 --- a/include/wx/msw/setup0.h +++ b/include/wx/msw/setup0.h @@ -731,6 +731,23 @@ // Enable the new wxGraphicsPath and wxGraphicsContext classes for an advanced // 2D drawing API. (Still somewhat experimental) // +// Recommended setting: 1 if supported by the compilation environment +// +// notice that we can't use wxCHECK_VISUALC_VERSION() here as this file is +// included from wx/platform.h before wxCHECK_VISUALC_VERSION() is defined +#ifdef _MSC_VER +# define wxUSE_GRAPHICS_CONTEXT 1 +#else + // Disable support for other Windows compilers, enable it if your compiler + // comes with new enough SDK or you installed the headers manually. + // + // Notice that this will be set by configure under non-Windows platforms + // anyhow so the value there is not important. +# define wxUSE_GRAPHICS_CONTEXT 0 +#endif + +// Enable wxGraphicsContext implementation using the GDI+ API. +// // Please note that on Windows gdiplus.dll is loaded dynamically which means // that nothing special needs to be done as long as you don't use // wxGraphicsContext at all or only use it on XP and later systems but you @@ -743,18 +760,44 @@ // yourself. If you do, change the setting below manually. // // Recommended setting: 1 if supported by the compilation environment - +// // notice that we can't use wxCHECK_VISUALC_VERSION() here as this file is // included from wx/platform.h before wxCHECK_VISUALC_VERSION() is defined #ifdef _MSC_VER -# define wxUSE_GRAPHICS_CONTEXT 1 +# define wxUSE_GRAPHICS_GDIPLUS 1 #else // Disable support for other Windows compilers, enable it if your compiler // comes with new enough SDK or you installed the headers manually. // // Notice that this will be set by configure under non-Windows platforms // anyhow so the value there is not important. -# define wxUSE_GRAPHICS_CONTEXT 0 +# define wxUSE_GRAPHICS_GDIPLUS 0 +#endif + +// Enable wxGraphicsContext implementation using the Direct2D API. +// +// The Direct2D API requires Windows 7 or Windows Vista with Service +// Pack 2 (SP2) and Platform Update for Windows Vista and later. +// +// Default is 1 when available +// +// Recommended setting: 1 if supported by the Windows platform. +// +// notice that we can't use wxCHECK_VISUALC_VERSION() here as this file is +// included from wx/platform.h before wxCHECK_VISUALC_VERSION() is defined +#ifdef _MSC_VER +# if _MSC_VER >= 1500 +# define wxUSE_GRAPHICS_DIRECT2D 1 +# else +# define wxUSE_GRAPHICS_DIRECT2D 0 +# endif +#else + // Disable support for other Windows compilers, enable it if your compiler + // comes with new enough SDK or you installed the headers manually. + // + // Notice that this will be set by configure under non-Windows platforms + // anyhow so the value there is not important. +# define wxUSE_GRAPHICS_DIRECT2D 0 #endif // Enable wxGraphicsContext implementation using Cairo library.