Skip to content

Commit

Permalink
Address CR feedback, remove useless code, clean up D2D factories.
Browse files Browse the repository at this point in the history
  • Loading branch information
MSFTFox committed Oct 5, 2016
1 parent a636741 commit ae50eac
Show file tree
Hide file tree
Showing 3 changed files with 9 additions and 13 deletions.
12 changes: 6 additions & 6 deletions Frameworks/CoreGraphics/D2DWrapper.mm
Original file line number Diff line number Diff line change
Expand Up @@ -17,17 +17,17 @@
#import <CoreGraphics/D2DWrapper.h>
#import <Starboard.h>

static const wchar_t* TAG = L"_D2DWrapper";
using namespace Microsoft::WRL;

// Helper for creating a D2DFactory
static ComPtr<ID2D1Factory> _CreateD2DFactoryInstance(D2D1_FACTORY_TYPE type) {
// Private helper for creating a D2DFactory
static ComPtr<ID2D1Factory> __CreateD2DFactoryInstance() {
ComPtr<ID2D1Factory> 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<ID2D1Factory> _GetD2DFactoryInstance() {
static ComPtr<ID2D1Factory> s_d2dFactory = _CreateD2DFactoryInstance(D2D1_FACTORY_TYPE_MULTI_THREADED);
ComPtr<ID2D1Factory> _GetD2DFactoryInstance() {
static ComPtr<ID2D1Factory> s_d2dFactory = __CreateD2DFactoryInstance();
return s_d2dFactory;
}
2 changes: 1 addition & 1 deletion build/CoreGraphics/lib/CoreGraphicsLib.vcxproj
Original file line number Diff line number Diff line change
Expand Up @@ -58,7 +58,7 @@
<ClangCompile Include="$(MSBuildThisFileDirectory)..\..\..\Frameworks\CoreGraphics\D2DWrapper.mm" />
</ItemGroup>
<ItemGroup>
<ClInclude Include="$(MSBuildThisFileDirectory)..\..\..\Frameworks\include\CoreGraphics\D2DWrapper.h" />
<ClInclude Include="..\..\..\include\CoreGraphics\D2DWrapper.h" />
</ItemGroup>
<PropertyGroup Label="Globals">
<ProjectGuid>{6293444C-1461-4CC7-9634-44AB90B8BBC3}</ProjectGuid>
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -17,12 +17,8 @@
#pragma once

#include <COMIncludes.h>
#import <wrl/implements.h>
#import <wrl/client.h>
#import <D2d1.h>
#include <COMIncludes_End.h>

using namespace std;
using namespace Microsoft::WRL;

static ComPtr<ID2D1Factory> _CreateD2DFactoryInstance(D2D1_FACTORY_TYPE type);
static ComPtr<ID2D1Factory> _GetD2DFactoryInstance();
Microsoft::WRL::ComPtr<ID2D1Factory> _GetD2DFactoryInstance();

0 comments on commit ae50eac

Please sign in to comment.