From ae50eac55d1b15bc60f66bbd5442595691c88256 Mon Sep 17 00:00:00 2001 From: Hank Fox Date: Wed, 5 Oct 2016 13:00:12 -0700 Subject: [PATCH] Address CR feedback, remove useless code, clean up D2D factories. --- Frameworks/CoreGraphics/D2DWrapper.mm | 12 ++++++------ build/CoreGraphics/lib/CoreGraphicsLib.vcxproj | 2 +- .../include => include}/CoreGraphics/D2DWrapper.h | 8 ++------ 3 files changed, 9 insertions(+), 13 deletions(-) rename {Frameworks/include => include}/CoreGraphics/D2DWrapper.h (79%) diff --git a/Frameworks/CoreGraphics/D2DWrapper.mm b/Frameworks/CoreGraphics/D2DWrapper.mm index 4d09accebd..e9ef887ab0 100644 --- a/Frameworks/CoreGraphics/D2DWrapper.mm +++ b/Frameworks/CoreGraphics/D2DWrapper.mm @@ -17,17 +17,17 @@ #import #import -static const wchar_t* TAG = L"_D2DWrapper"; +using namespace Microsoft::WRL; -// Helper for creating a D2DFactory -static ComPtr _CreateD2DFactoryInstance(D2D1_FACTORY_TYPE type) { +// Private helper for creating a D2DFactory +static ComPtr __CreateD2DFactoryInstance() { ComPtr d2dFactory; - THROW_IF_FAILED(D2D1CreateFactory(type, d2dFactory.ReleaseAndGetAddressOf())); + THROW_IF_FAILED(D2D1CreateFactory(D2D1_FACTORY_TYPE_MULTI_THREADED, __uuidof(ID2D1Factory), &d2dFactory)); return d2dFactory; } // Helper for accessing a single static multithreaded D2DFactory instance -static ComPtr _GetD2DFactoryInstance() { - static ComPtr s_d2dFactory = _CreateD2DFactoryInstance(D2D1_FACTORY_TYPE_MULTI_THREADED); +ComPtr _GetD2DFactoryInstance() { + static ComPtr s_d2dFactory = __CreateD2DFactoryInstance(); return s_d2dFactory; } \ No newline at end of file diff --git a/build/CoreGraphics/lib/CoreGraphicsLib.vcxproj b/build/CoreGraphics/lib/CoreGraphicsLib.vcxproj index 2dc9484fa4..1d6150694f 100644 --- a/build/CoreGraphics/lib/CoreGraphicsLib.vcxproj +++ b/build/CoreGraphics/lib/CoreGraphicsLib.vcxproj @@ -58,7 +58,7 @@ - + {6293444C-1461-4CC7-9634-44AB90B8BBC3} diff --git a/Frameworks/include/CoreGraphics/D2DWrapper.h b/include/CoreGraphics/D2DWrapper.h similarity index 79% rename from Frameworks/include/CoreGraphics/D2DWrapper.h rename to include/CoreGraphics/D2DWrapper.h index 4c6c9905a6..11caaf6fd9 100644 --- a/Frameworks/include/CoreGraphics/D2DWrapper.h +++ b/include/CoreGraphics/D2DWrapper.h @@ -17,12 +17,8 @@ #pragma once #include -#import +#import #import #include -using namespace std; -using namespace Microsoft::WRL; - -static ComPtr _CreateD2DFactoryInstance(D2D1_FACTORY_TYPE type); -static ComPtr _GetD2DFactoryInstance(); \ No newline at end of file +Microsoft::WRL::ComPtr _GetD2DFactoryInstance(); \ No newline at end of file