Skip to content
This repository was archived by the owner on Mar 30, 2019. It is now read-only.

Commit 7f451ca

Browse files
author
AndrewSt
committed
[Direct2D1] adaptation mapping
1 parent a0614e5 commit 7f451ca

7 files changed

Lines changed: 254 additions & 5 deletions

File tree

Lines changed: 76 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,76 @@
1+
// Copyright (c) 2010-2014 SharpDX - Alexandre Mutel
2+
//
3+
// Permission is hereby granted, free of charge, to any person obtaining a copy
4+
// of this software and associated documentation files (the "Software"), to deal
5+
// in the Software without restriction, including without limitation the rights
6+
// to use, copy, modify, merge, publish, distribute, sublicense, and/or sell
7+
// copies of the Software, and to permit persons to whom the Software is
8+
// furnished to do so, subject to the following conditions:
9+
//
10+
// The above copyright notice and this permission notice shall be included in
11+
// all copies or substantial portions of the Software.
12+
//
13+
// THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
14+
// IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
15+
// FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
16+
// AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
17+
// LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,
18+
// OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN
19+
// THE SOFTWARE.
20+
using System;
21+
using System.Collections.Generic;
22+
using System.Text;
23+
24+
namespace SharpDX.Direct2D1
25+
{
26+
public partial class ColorContext1
27+
{
28+
/// <summary>
29+
/// Initializes a new instance of <see cref="ColorContext1"/> class from ColorSpaceType.
30+
/// </summary>
31+
/// <param name="context">No documentation.</param>
32+
/// <param name="wicColorContext">No documentation.</param>
33+
/// <unmanaged>HRESULT ID2D1DeviceContext5::CreateColorContextFromDxgiColorSpace([In] DXGI_COLOR_SPACE_TYPE colorSpace,[Out, Fast] ID2D1ColorContext1** colorContext)</unmanaged>
34+
public ColorContext1(DeviceContext5 context, SharpDX.DXGI.ColorSpaceType colorSpace)
35+
: base(IntPtr.Zero)
36+
{
37+
context.CreateColorContextFromDxgiColorSpace(colorSpace, this);
38+
}
39+
40+
/// <summary>
41+
/// Initializes a new instance of <see cref="ColorContext1"/> class from SimpleColorProfile.
42+
/// </summary>
43+
/// <param name="context">No documentation.</param>
44+
/// <param name="wicColorContext">No documentation.</param>
45+
/// <unmanaged>HRESULT ID2D1DeviceContext5::CreateColorContextFromDxgiColorSpace([In] DXGI_COLOR_SPACE_TYPE colorSpace,[Out, Fast] ID2D1ColorContext1** colorContext)</unmanaged>
46+
public ColorContext1(DeviceContext5 context, ref SharpDX.Direct2D1.SimpleColorProfile simpleProfile)
47+
: base(IntPtr.Zero)
48+
{
49+
context.CreateColorContextFromSimpleColorProfile(ref simpleProfile, this);
50+
}
51+
52+
/// <summary>
53+
/// Initializes a new instance of <see cref="ColorContext1"/> class from ColorSpaceType.
54+
/// </summary>
55+
/// <param name="context">No documentation.</param>
56+
/// <param name="wicColorContext">No documentation.</param>
57+
/// <unmanaged>HRESULT ID2D1DeviceContext5::CreateColorContextFromDxgiColorSpace([In] DXGI_COLOR_SPACE_TYPE colorSpace,[Out, Fast] ID2D1ColorContext1** colorContext)</unmanaged>
58+
public ColorContext1(EffectContext2 context, SharpDX.DXGI.ColorSpaceType colorSpace)
59+
: base(IntPtr.Zero)
60+
{
61+
context.CreateColorContextFromDxgiColorSpace(colorSpace, this);
62+
}
63+
64+
/// <summary>
65+
/// Initializes a new instance of <see cref="ColorContext1"/> class from SimpleColorProfile.
66+
/// </summary>
67+
/// <param name="context">No documentation.</param>
68+
/// <param name="wicColorContext">No documentation.</param>
69+
/// <unmanaged>HRESULT ID2D1DeviceContext5::CreateColorContextFromDxgiColorSpace([In] DXGI_COLOR_SPACE_TYPE colorSpace,[Out, Fast] ID2D1ColorContext1** colorContext)</unmanaged>
70+
public ColorContext1(EffectContext2 context, ref SharpDX.Direct2D1.SimpleColorProfile simpleProfile)
71+
: base(IntPtr.Zero)
72+
{
73+
context.CreateColorContextFromSimpleColorProfile(ref simpleProfile, this);
74+
}
75+
}
76+
}

Source/SharpDX.Direct2D1/Device3.cs

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -33,7 +33,7 @@ public partial class Device3
3333
/// Each call to CreateDevice returns a unique <see cref="SharpDX.Direct2D1.Device3"/> object.The <see cref="SharpDX.DXGI.Device"/> object is obtained by calling QueryInterface on an ID3D10Device or an ID3D11Device.
3434
/// </remarks>
3535
/// <unmanaged>HRESULT ID2D1Factory3::CreateDevice([In] IDXGIDevice* dxgiDevice,[Out] ID2D1Device2** d2dDevice2)</unmanaged>
36-
public Device3(Factory4 factory, SharpDX.DXGI.Device3 device)
36+
public Device3(Factory4 factory, SharpDX.DXGI.Device device)
3737
: base(IntPtr.Zero)
3838
{
3939
factory.CreateDevice(device, this);
Lines changed: 42 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,42 @@
1+
// Copyright (c) 2010-2014 SharpDX - Alexandre Mutel
2+
//
3+
// Permission is hereby granted, free of charge, to any person obtaining a copy
4+
// of this software and associated documentation files (the "Software"), to deal
5+
// in the Software without restriction, including without limitation the rights
6+
// to use, copy, modify, merge, publish, distribute, sublicense, and/or sell
7+
// copies of the Software, and to permit persons to whom the Software is
8+
// furnished to do so, subject to the following conditions:
9+
//
10+
// The above copyright notice and this permission notice shall be included in
11+
// all copies or substantial portions of the Software.
12+
//
13+
// THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
14+
// IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
15+
// FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
16+
// AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
17+
// LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,
18+
// OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN
19+
// THE SOFTWARE.
20+
21+
using System;
22+
23+
namespace SharpDX.Direct2D1
24+
{
25+
public partial class Device4
26+
{
27+
/// <summary>
28+
/// Initializes a new instance of the <see cref="Device4"/> class.
29+
/// </summary>
30+
/// <param name="factory"><para>The <see cref="Factory5"/> object used when creating the <see cref="SharpDX.Direct2D1.Device3"/>. </para></param>
31+
/// <param name="device"><para>The <see cref="SharpDX.DXGI.Device"/> object used when creating the <see cref="SharpDX.Direct2D1.Device4"/>. </para></param>
32+
/// <remarks>
33+
/// Each call to CreateDevice returns a unique <see cref="SharpDX.Direct2D1.Device4"/> object.The <see cref="SharpDX.DXGI.Device4"/> object is obtained by calling QueryInterface on an ID3D10Device or an ID3D11Device.
34+
/// </remarks>
35+
/// <unmanaged>HRESULT ID2D1Factory5::CreateDevice([In] IDXGIDevice* dxgiDevice,[Out] ID2D1Device5** d2dDevice4)</unmanaged>
36+
public Device4(Factory5 factory, SharpDX.DXGI.Device device)
37+
: base(IntPtr.Zero)
38+
{
39+
factory.CreateDevice(device, this);
40+
}
41+
}
42+
}
Lines changed: 42 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,42 @@
1+
// Copyright (c) 2010-2014 SharpDX - Alexandre Mutel
2+
//
3+
// Permission is hereby granted, free of charge, to any person obtaining a copy
4+
// of this software and associated documentation files (the "Software"), to deal
5+
// in the Software without restriction, including without limitation the rights
6+
// to use, copy, modify, merge, publish, distribute, sublicense, and/or sell
7+
// copies of the Software, and to permit persons to whom the Software is
8+
// furnished to do so, subject to the following conditions:
9+
//
10+
// The above copyright notice and this permission notice shall be included in
11+
// all copies or substantial portions of the Software.
12+
//
13+
// THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
14+
// IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
15+
// FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
16+
// AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
17+
// LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,
18+
// OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN
19+
// THE SOFTWARE.
20+
21+
using System;
22+
23+
namespace SharpDX.Direct2D1
24+
{
25+
public partial class Device5
26+
{
27+
/// <summary>
28+
/// Initializes a new instance of the <see cref="Device5"/> class.
29+
/// </summary>
30+
/// <param name="factory"><para>The <see cref="Factory4"/> object used when creating the <see cref="SharpDX.Direct2D1.Device5"/>. </para></param>
31+
/// <param name="device"><para>The <see cref="SharpDX.DXGI.Device"/> object used when creating the <see cref="SharpDX.Direct2D1.Device5"/>. </para></param>
32+
/// <remarks>
33+
/// Each call to CreateDevice returns a unique <see cref="SharpDX.Direct2D1.Device5"/> object.The <see cref="SharpDX.DXGI.Device"/> object is obtained by calling QueryInterface on an ID3D10Device or an ID3D11Device.
34+
/// </remarks>
35+
/// <unmanaged>HRESULT ID2D1Factory3::CreateDevice([In] IDXGIDevice* dxgiDevice,[Out] ID2D1Device2** d2dDevice2)</unmanaged>
36+
public Device5(Factory6 factory, SharpDX.DXGI.Device device)
37+
: base(IntPtr.Zero)
38+
{
39+
factory.CreateDevice(device, this);
40+
}
41+
}
42+
}
Lines changed: 42 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,42 @@
1+
// Copyright (c) 2010-2014 SharpDX - Alexandre Mutel
2+
//
3+
// Permission is hereby granted, free of charge, to any person obtaining a copy
4+
// of this software and associated documentation files (the "Software"), to deal
5+
// in the Software without restriction, including without limitation the rights
6+
// to use, copy, modify, merge, publish, distribute, sublicense, and/or sell
7+
// copies of the Software, and to permit persons to whom the Software is
8+
// furnished to do so, subject to the following conditions:
9+
//
10+
// The above copyright notice and this permission notice shall be included in
11+
// all copies or substantial portions of the Software.
12+
//
13+
// THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
14+
// IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
15+
// FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
16+
// AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
17+
// LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,
18+
// OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN
19+
// THE SOFTWARE.
20+
21+
using System;
22+
23+
namespace SharpDX.Direct2D1
24+
{
25+
public partial class DeviceContext4
26+
{
27+
/// <summary>
28+
/// Initializes a new instance of the <see cref="DeviceContext4"/> class using an existing <see cref="Device4"/>.
29+
/// </summary>
30+
/// <param name="device">The device.</param>
31+
/// <param name="options">The options to be applied to the created device context.</param>
32+
/// <remarks>
33+
/// The new device context will not have a selected target bitmap. The caller must create and select a bitmap as the target surface of the context.
34+
/// </remarks>
35+
/// <unmanaged>HRESULT ID2D1Device4::CreateDeviceContext([In] D2D1_DEVICE_CONTEXT_OPTIONS options,[Out] ID2D1DeviceContext4** DeviceContext4)</unmanaged>
36+
public DeviceContext4(Device4 device, DeviceContextOptions options)
37+
: base(IntPtr.Zero)
38+
{
39+
device.CreateDeviceContext(options, this);
40+
}
41+
}
42+
}
Lines changed: 42 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,42 @@
1+
// Copyright (c) 2010-2014 SharpDX - Alexandre Mutel
2+
//
3+
// Permission is hereby granted, free of charge, to any person obtaining a copy
4+
// of this software and associated documentation files (the "Software"), to deal
5+
// in the Software without restriction, including without limitation the rights
6+
// to use, copy, modify, merge, publish, distribute, sublicense, and/or sell
7+
// copies of the Software, and to permit persons to whom the Software is
8+
// furnished to do so, subject to the following conditions:
9+
//
10+
// The above copyright notice and this permission notice shall be included in
11+
// all copies or substantial portions of the Software.
12+
//
13+
// THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
14+
// IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
15+
// FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
16+
// AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
17+
// LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,
18+
// OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN
19+
// THE SOFTWARE.
20+
21+
using System;
22+
23+
namespace SharpDX.Direct2D1
24+
{
25+
public partial class DeviceContext5
26+
{
27+
/// <summary>
28+
/// Initializes a new instance of the <see cref="DeviceContext5"/> class using an existing <see cref="Device5"/>.
29+
/// </summary>
30+
/// <param name="device">The device.</param>
31+
/// <param name="options">The options to be applied to the created device context.</param>
32+
/// <remarks>
33+
/// The new device context will not have a selected target bitmap. The caller must create and select a bitmap as the target surface of the context.
34+
/// </remarks>
35+
/// <unmanaged>HRESULT ID2D1Device5::CreateDeviceContext([In] D2D1_DEVICE_CONTEXT_OPTIONS options,[Out] ID2D1DeviceContext5** DeviceContext5)</unmanaged>
36+
public DeviceContext5(Device5 device, DeviceContextOptions options)
37+
: base(IntPtr.Zero)
38+
{
39+
device.CreateDeviceContext(options, this);
40+
}
41+
}
42+
}

Source/SharpDX.Direct2D1/Mapping-direct2d1.xml

Lines changed: 9 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -303,7 +303,7 @@
303303
<map method="ID2D1Factory::GetDesktopDpi" visibility="internal" />
304304
<map method="ID2D(\d+)Factory\d?::Create.*" visibility="internal" />
305305

306-
<map param="ID2D1Factory[1234]::CreateDevice::d2dDevice[1234]?" attribute="out fast"/>
306+
<map param="ID2D1Factory[123456]::CreateDevice::d2dDevice[12345]?" attribute="out fast"/>
307307
<map param="ID2D1Factory1::CreateStrokeStyle::strokeStyle" attribute="out fast"/>
308308
<map param="ID2D1Factory1::CreatePathGeometry::pathGeometry" attribute="out fast"/>
309309
<map param="ID2D1Factory1::CreateDrawingStateBlock::drawingStateBlock" attribute="out fast"/>
@@ -325,8 +325,8 @@
325325
<map param="ID2D(\d+)Factory::CreateDCRenderTarget::dcRenderTarget" attribute="out fast"/>
326326
<map param="ID2D(\d+)Factory::CreateWicBitmapRenderTarget::renderTarget" attribute="out fast"/>
327327

328-
<map method="ID2D\dDevice[123]?::Create.*" visibility="internal"/>
329-
<map param="ID2D\dDevice[123]?::CreateDeviceContext::deviceContext[123]?" attribute="out fast"/>
328+
<map method="ID2D\dDevice[12345]?::Create.*" visibility="internal"/>
329+
<map param="ID2D\dDevice[12345]?::CreateDeviceContext::deviceContext[12345]?" attribute="out fast"/>
330330
<map param="ID2D\dDevice::CreatePrintControl::printControl" attribute="out fast"/>
331331

332332
<map method="ID2D\dDeviceContext[123]?::Create.*" visibility="internal"/>
@@ -490,7 +490,12 @@
490490
<map interface="ID2D1DrawTransform" callback-visibility="public" callback="true" callback-dual="true" />
491491
<map interface="ID2D1SourceTransform" callback-visibility="public" callback="true" callback-dual="true" />
492492

493-
<!--
493+
<map param="ID2D\dDeviceContext5::CreateColorContextFromDxgiColorSpace::colorContext" attribute="out fast"/>
494+
<map param="ID2D\dDeviceContext5::CreateColorContextFromSimpleColorProfile::colorContext" attribute="out fast"/>
495+
<map param="ID2D\dEffectContext2::CreateColorContextFromDxgiColorSpace::colorContext" attribute="out fast"/>
496+
<map param="ID2D\dEffectContext2::CreateColorContextFromSimpleColorProfile::colorContext" attribute="out fast"/>
497+
498+
<!--
494499
// *****************************************************************
495500
// D2D1 Functions
496501
// *****************************************************************

0 commit comments

Comments
 (0)