From 44300e2f41d006c4a946b16ea52524629a065e96 Mon Sep 17 00:00:00 2001 From: Birunthan Mohanathas Date: Mon, 29 Jul 2013 20:50:32 +0300 Subject: [PATCH] Gfx: Change to use D2D 1.1 --- Common/Gfx/CanvasD2D.cpp | 11 +++++++---- Common/Gfx/CanvasD2D.h | 6 +++--- Common/Gfx/FontCollectionD2D.h | 2 +- Common/Gfx/TextFormatD2D.h | 2 +- Common/Gfx/Util/DWriteFontCollectionLoader.h | 2 +- Common/Gfx/Util/DWriteFontFileEnumerator.h | 2 +- Common/Gfx/Util/DWriteHelpers.h | 2 +- 7 files changed, 15 insertions(+), 12 deletions(-) diff --git a/Common/Gfx/CanvasD2D.cpp b/Common/Gfx/CanvasD2D.cpp index f0009359..52903fba 100644 --- a/Common/Gfx/CanvasD2D.cpp +++ b/Common/Gfx/CanvasD2D.cpp @@ -44,8 +44,8 @@ D2D1_RECT_F ToRectF(const Gdiplus::RectF& rect) namespace Gfx { UINT CanvasD2D::c_Instances = 0; -Microsoft::WRL::ComPtr CanvasD2D::c_D2DFactory; -Microsoft::WRL::ComPtr CanvasD2D::c_DWFactory; +Microsoft::WRL::ComPtr CanvasD2D::c_D2DFactory; +Microsoft::WRL::ComPtr CanvasD2D::c_DWFactory; Microsoft::WRL::ComPtr CanvasD2D::c_DWGDIInterop; Microsoft::WRL::ComPtr CanvasD2D::c_WICFactory; @@ -110,8 +110,11 @@ void CanvasD2D::Finalize() c_WICFactory.Reset(); c_DWGDIInterop.Reset(); - c_DWFactory->UnregisterFontCollectionLoader(Util::DWriteFontCollectionLoader::GetInstance()); - c_DWFactory.Reset(); + if (c_DWFactory) + { + c_DWFactory->UnregisterFontCollectionLoader(Util::DWriteFontCollectionLoader::GetInstance()); + c_DWFactory.Reset(); + } } } diff --git a/Common/Gfx/CanvasD2D.h b/Common/Gfx/CanvasD2D.h index a4841d59..1c889355 100644 --- a/Common/Gfx/CanvasD2D.h +++ b/Common/Gfx/CanvasD2D.h @@ -26,7 +26,7 @@ #include #include #include -#include +#include #include #include #include @@ -99,8 +99,8 @@ private: bool m_TextAntiAliasing; static UINT c_Instances; - static Microsoft::WRL::ComPtr c_D2DFactory; - static Microsoft::WRL::ComPtr c_DWFactory; + static Microsoft::WRL::ComPtr c_D2DFactory; + static Microsoft::WRL::ComPtr c_DWFactory; static Microsoft::WRL::ComPtr c_DWGDIInterop; static Microsoft::WRL::ComPtr c_WICFactory; }; diff --git a/Common/Gfx/FontCollectionD2D.h b/Common/Gfx/FontCollectionD2D.h index c434fa10..e59cca94 100644 --- a/Common/Gfx/FontCollectionD2D.h +++ b/Common/Gfx/FontCollectionD2D.h @@ -21,7 +21,7 @@ #include "FontCollection.h" #include -#include +#include namespace Gfx { diff --git a/Common/Gfx/TextFormatD2D.h b/Common/Gfx/TextFormatD2D.h index 86fd791a..d37e55b1 100644 --- a/Common/Gfx/TextFormatD2D.h +++ b/Common/Gfx/TextFormatD2D.h @@ -21,7 +21,7 @@ #include "TextFormat.h" #include -#include +#include #include namespace Gfx { diff --git a/Common/Gfx/Util/DWriteFontCollectionLoader.h b/Common/Gfx/Util/DWriteFontCollectionLoader.h index 0889a85f..16ab2b36 100644 --- a/Common/Gfx/Util/DWriteFontCollectionLoader.h +++ b/Common/Gfx/Util/DWriteFontCollectionLoader.h @@ -19,7 +19,7 @@ #ifndef RM_GFX_UTIL_DWRITEFONTCOLLECTIONLOADER_H_ #define RM_GFX_UTIL_DWRITEFONTCOLLECTIONLOADER_H_ -#include +#include namespace Gfx { namespace Util { diff --git a/Common/Gfx/Util/DWriteFontFileEnumerator.h b/Common/Gfx/Util/DWriteFontFileEnumerator.h index 77d2d494..d01c9187 100644 --- a/Common/Gfx/Util/DWriteFontFileEnumerator.h +++ b/Common/Gfx/Util/DWriteFontFileEnumerator.h @@ -20,7 +20,7 @@ #define RM_GFX_UTIL_DWRITEFONTFILEENUMERATOR_H_ #include -#include +#include namespace Gfx { namespace Util { diff --git a/Common/Gfx/Util/DWriteHelpers.h b/Common/Gfx/Util/DWriteHelpers.h index 4ff00413..1140e2a5 100644 --- a/Common/Gfx/Util/DWriteHelpers.h +++ b/Common/Gfx/Util/DWriteHelpers.h @@ -19,7 +19,7 @@ #ifndef RM_GFX_UTIL_DWRITEHELPERS_H_ #define RM_GFX_UTIL_DWRITEHELPERS_H_ -#include +#include namespace Gfx { namespace Util {