This repository has been archived by the owner on Mar 30, 2019. It is now read-only.
-
Notifications
You must be signed in to change notification settings - Fork 643
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Merge pull request #764 from andrewst/directWriteNext
[Direct2D] Improve Direct2D and DirectWrite
- Loading branch information
Showing
19 changed files
with
3,704 additions
and
13 deletions.
There are no files selected for viewing
480 changes: 471 additions & 9 deletions
480
External/gccxml/share/gccxml-0.9/vc12/overrides/um/d2d1_3.h
Large diffs are not rendered by default.
Oops, something went wrong.
965 changes: 965 additions & 0 deletions
965
External/gccxml/share/gccxml-0.9/vc12/overrides/um/dwrite_2.h
Large diffs are not rendered by default.
Oops, something went wrong.
1,743 changes: 1,743 additions & 0 deletions
1,743
External/gccxml/share/gccxml-0.9/vc12/overrides/um/dwrite_3.h
Large diffs are not rendered by default.
Oops, something went wrong.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,47 @@ | ||
// Copyright (c) 2010-2014 SharpDX - Alexandre Mutel | ||
// | ||
// Permission is hereby granted, free of charge, to any person obtaining a copy | ||
// of this software and associated documentation files (the "Software"), to deal | ||
// in the Software without restriction, including without limitation the rights | ||
// to use, copy, modify, merge, publish, distribute, sublicense, and/or sell | ||
// copies of the Software, and to permit persons to whom the Software is | ||
// furnished to do so, subject to the following conditions: | ||
// | ||
// The above copyright notice and this permission notice shall be included in | ||
// all copies or substantial portions of the Software. | ||
// | ||
// THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR | ||
// IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, | ||
// FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE | ||
// AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER | ||
// LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, | ||
// OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN | ||
// THE SOFTWARE. | ||
|
||
namespace SharpDX.Direct2D1 | ||
{ | ||
public partial interface CommandSink3 | ||
{ | ||
/// <summary> | ||
/// <p>Renders part or all of the given sprite batch to the device context using the specified drawing options.</p> | ||
/// </summary> | ||
/// <param name="spriteBatch"><dd> <p>The sprite batch to draw.</p> </dd></param> | ||
/// <param name="startIndex"><dd> <p>The index of the first sprite in the sprite batch to draw.</p> </dd></param> | ||
/// <param name="spriteCount"><dd> <p>The number of sprites to draw.</p> </dd></param> | ||
/// <param name="bitmap"><dd> <p>The bitmap from which the sprites are to be sourced. Each sprite?s source rectangle refers to a portion of this bitmap.</p> </dd></param> | ||
/// <param name="interpolationMode"><dd> <p>The interpolation mode to use when drawing this sprite batch. This determines how Direct2D interpolates pixels within the drawn sprites if scaling is performed.</p> </dd></param> | ||
/// <param name="spriteOptions"><dd> <p>The additional drawing options, if any, to be used for this sprite batch.</p> </dd></param> | ||
/// <returns><p>If this method succeeds, it returns <strong><see cref="SharpDX.Result.Ok"/></strong>. Otherwise, it returns an <strong><see cref="SharpDX.Result"/></strong> error code.</p></returns> | ||
/// <include file='.\..\Documentation\CodeComments.xml' path="/comments/comment[@id='ID2D1CommandSink3::DrawSpriteBatch']/*"/> | ||
/// <msdn-id>mt619823</msdn-id> | ||
/// <unmanaged>HRESULT ID2D1CommandSink3::DrawSpriteBatch([In] ID2D1SpriteBatch* spriteBatch,[In] unsigned int startIndex,[In] unsigned int spriteCount,[In] ID2D1Bitmap* bitmap,[In] D2D1_BITMAP_INTERPOLATION_MODE interpolationMode,[In] D2D1_SPRITE_OPTIONS spriteOptions)</unmanaged> | ||
/// <unmanaged-short>ID2D1CommandSink3::DrawSpriteBatch</unmanaged-short> | ||
void DrawSpriteBatch(SharpDX.Direct2D1.SpriteBatch spriteBatch, | ||
int startIndex, | ||
int spriteCount, | ||
SharpDX.Direct2D1.Bitmap bitmap, | ||
SharpDX.Direct2D1.BitmapInterpolationMode interpolationMode, | ||
SharpDX.Direct2D1.SpriteOptions spriteOptions); | ||
|
||
} | ||
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,49 @@ | ||
// Copyright (c) 2010-2014 SharpDX - Alexandre Mutel | ||
// | ||
// Permission is hereby granted, free of charge, to any person obtaining a copy | ||
// of this software and associated documentation files (the "Software"), to deal | ||
// in the Software without restriction, including without limitation the rights | ||
// to use, copy, modify, merge, publish, distribute, sublicense, and/or sell | ||
// copies of the Software, and to permit persons to whom the Software is | ||
// furnished to do so, subject to the following conditions: | ||
// | ||
// The above copyright notice and this permission notice shall be included in | ||
// all copies or substantial portions of the Software. | ||
// | ||
// THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR | ||
// IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, | ||
// FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE | ||
// AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER | ||
// LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, | ||
// OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN | ||
// THE SOFTWARE. | ||
|
||
namespace SharpDX.Direct2D1 | ||
{ | ||
internal partial class CommandSink3Native | ||
{ | ||
/// <summary> | ||
/// <p>Renders part or all of the given sprite batch to the device context using the specified drawing options.</p> | ||
/// </summary> | ||
/// <param name="spriteBatch"><dd> <p>The sprite batch to draw.</p> </dd></param> | ||
/// <param name="startIndex"><dd> <p>The index of the first sprite in the sprite batch to draw.</p> </dd></param> | ||
/// <param name="spriteCount"><dd> <p>The number of sprites to draw.</p> </dd></param> | ||
/// <param name="bitmap"><dd> <p>The bitmap from which the sprites are to be sourced. Each sprite?s source rectangle refers to a portion of this bitmap.</p> </dd></param> | ||
/// <param name="interpolationMode"><dd> <p>The interpolation mode to use when drawing this sprite batch. This determines how Direct2D interpolates pixels within the drawn sprites if scaling is performed.</p> </dd></param> | ||
/// <param name="spriteOptions"><dd> <p>The additional drawing options, if any, to be used for this sprite batch.</p> </dd></param> | ||
/// <returns><p>If this method succeeds, it returns <strong><see cref="SharpDX.Result.Ok"/></strong>. Otherwise, it returns an <strong><see cref="SharpDX.Result"/></strong> error code.</p></returns> | ||
/// <include file='.\..\Documentation\CodeComments.xml' path="/comments/comment[@id='ID2D1CommandSink3::DrawSpriteBatch']/*"/> | ||
/// <msdn-id>mt619823</msdn-id> | ||
/// <unmanaged>HRESULT ID2D1CommandSink3::DrawSpriteBatch([In] ID2D1SpriteBatch* spriteBatch,[In] unsigned int startIndex,[In] unsigned int spriteCount,[In] ID2D1Bitmap* bitmap,[In] D2D1_BITMAP_INTERPOLATION_MODE interpolationMode,[In] D2D1_SPRITE_OPTIONS spriteOptions)</unmanaged> | ||
/// <unmanaged-short>ID2D1CommandSink3::DrawSpriteBatch</unmanaged-short> | ||
public void DrawSpriteBatch(SpriteBatch spriteBatch, | ||
int startIndex, | ||
int spriteCount, | ||
Bitmap bitmap, | ||
BitmapInterpolationMode interpolationMode, | ||
SpriteOptions spriteOptions) | ||
{ | ||
DrawSpriteBatch_(spriteBatch, startIndex, spriteCount, bitmap, interpolationMode, spriteOptions); | ||
} | ||
} | ||
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,42 @@ | ||
// Copyright (c) 2010-2014 SharpDX - Alexandre Mutel | ||
// | ||
// Permission is hereby granted, free of charge, to any person obtaining a copy | ||
// of this software and associated documentation files (the "Software"), to deal | ||
// in the Software without restriction, including without limitation the rights | ||
// to use, copy, modify, merge, publish, distribute, sublicense, and/or sell | ||
// copies of the Software, and to permit persons to whom the Software is | ||
// furnished to do so, subject to the following conditions: | ||
// | ||
// The above copyright notice and this permission notice shall be included in | ||
// all copies or substantial portions of the Software. | ||
// | ||
// THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR | ||
// IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, | ||
// FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE | ||
// AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER | ||
// LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, | ||
// OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN | ||
// THE SOFTWARE. | ||
|
||
using System; | ||
|
||
namespace SharpDX.Direct2D1 | ||
{ | ||
public partial class Device3 | ||
{ | ||
/// <summary> | ||
/// Initializes a new instance of the <see cref="Device3"/> class. | ||
/// </summary> | ||
/// <param name="factory"><para>The <see cref="Factory4"/> object used when creating the <see cref="SharpDX.Direct2D1.Device3"/>. </para></param> | ||
/// <param name="device"><para>The <see cref="SharpDX.DXGI.Device"/> object used when creating the <see cref="SharpDX.Direct2D1.Device3"/>. </para></param> | ||
/// <remarks> | ||
/// 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. | ||
/// </remarks> | ||
/// <unmanaged>HRESULT ID2D1Factory3::CreateDevice([In] IDXGIDevice* dxgiDevice,[Out] ID2D1Device2** d2dDevice2)</unmanaged> | ||
public Device3(Factory4 factory, SharpDX.DXGI.Device3 device) | ||
: base(IntPtr.Zero) | ||
{ | ||
factory.CreateDevice(device, this); | ||
} | ||
} | ||
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,42 @@ | ||
// Copyright (c) 2010-2014 SharpDX - Alexandre Mutel | ||
// | ||
// Permission is hereby granted, free of charge, to any person obtaining a copy | ||
// of this software and associated documentation files (the "Software"), to deal | ||
// in the Software without restriction, including without limitation the rights | ||
// to use, copy, modify, merge, publish, distribute, sublicense, and/or sell | ||
// copies of the Software, and to permit persons to whom the Software is | ||
// furnished to do so, subject to the following conditions: | ||
// | ||
// The above copyright notice and this permission notice shall be included in | ||
// all copies or substantial portions of the Software. | ||
// | ||
// THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR | ||
// IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, | ||
// FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE | ||
// AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER | ||
// LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, | ||
// OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN | ||
// THE SOFTWARE. | ||
|
||
using System; | ||
|
||
namespace SharpDX.Direct2D1 | ||
{ | ||
public partial class DeviceContext3 | ||
{ | ||
/// <summary> | ||
/// Initializes a new instance of the <see cref="DeviceContext3"/> class using an existing <see cref="Device3"/>. | ||
/// </summary> | ||
/// <param name="device">The device.</param> | ||
/// <param name="options">The options to be applied to the created device context.</param> | ||
/// <remarks> | ||
/// 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. | ||
/// </remarks> | ||
/// <unmanaged>HRESULT ID2D1Device3::CreateDeviceContext([In] D2D1_DEVICE_CONTEXT_OPTIONS options,[Out] ID2D1DeviceContext3** deviceContext3)</unmanaged> | ||
public DeviceContext3(Device3 device, DeviceContextOptions options) | ||
: base(IntPtr.Zero) | ||
{ | ||
device.CreateDeviceContext(options, this); | ||
} | ||
} | ||
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,36 @@ | ||
// Copyright (c) 2010-2014 SharpDX - Alexandre Mutel | ||
// | ||
// Permission is hereby granted, free of charge, to any person obtaining a copy | ||
// of this software and associated documentation files (the "Software"), to deal | ||
// in the Software without restriction, including without limitation the rights | ||
// to use, copy, modify, merge, publish, distribute, sublicense, and/or sell | ||
// copies of the Software, and to permit persons to whom the Software is | ||
// furnished to do so, subject to the following conditions: | ||
// | ||
// The above copyright notice and this permission notice shall be included in | ||
// all copies or substantial portions of the Software. | ||
// | ||
// THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR | ||
// IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, | ||
// FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE | ||
// AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER | ||
// LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, | ||
// OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN | ||
// THE SOFTWARE. | ||
|
||
using System; | ||
|
||
namespace SharpDX.Direct2D1 | ||
{ | ||
public partial class GradientMesh | ||
{ | ||
/// <summary> | ||
/// Initializes a new instance of the <see cref="GradientMesh"/>. | ||
/// </summary> | ||
public GradientMesh(DeviceContext2 context2, GradientMeshPatch[] atchesRef, int patchesCount) | ||
: this(IntPtr.Zero) | ||
{ | ||
context2.CreateGradientMesh(atchesRef, patchesCount, this); | ||
} | ||
} | ||
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,36 @@ | ||
// Copyright (c) 2010-2014 SharpDX - Alexandre Mutel | ||
// | ||
// Permission is hereby granted, free of charge, to any person obtaining a copy | ||
// of this software and associated documentation files (the "Software"), to deal | ||
// in the Software without restriction, including without limitation the rights | ||
// to use, copy, modify, merge, publish, distribute, sublicense, and/or sell | ||
// copies of the Software, and to permit persons to whom the Software is | ||
// furnished to do so, subject to the following conditions: | ||
// | ||
// The above copyright notice and this permission notice shall be included in | ||
// all copies or substantial portions of the Software. | ||
// | ||
// THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR | ||
// IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, | ||
// FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE | ||
// AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER | ||
// LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, | ||
// OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN | ||
// THE SOFTWARE. | ||
|
||
using System; | ||
|
||
namespace SharpDX.Direct2D1 | ||
{ | ||
public partial class ImageSource | ||
{ | ||
/// <summary> | ||
/// Initializes a new instance of the <see cref="ImageSource"/>. | ||
/// </summary> | ||
public ImageSource(DeviceContext2 context2, DXGI.Surface[] surfaces, int surfaceCount, DXGI.ColorSpaceType colorSpace, ImageSourceFromDxgiOptions options) | ||
: this(IntPtr.Zero) | ||
{ | ||
context2.CreateImageSourceFromDxgi(surfaces, surfaceCount, colorSpace, options, this); | ||
} | ||
} | ||
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,36 @@ | ||
// Copyright (c) 2010-2014 SharpDX - Alexandre Mutel | ||
// | ||
// Permission is hereby granted, free of charge, to any person obtaining a copy | ||
// of this software and associated documentation files (the "Software"), to deal | ||
// in the Software without restriction, including without limitation the rights | ||
// to use, copy, modify, merge, publish, distribute, sublicense, and/or sell | ||
// copies of the Software, and to permit persons to whom the Software is | ||
// furnished to do so, subject to the following conditions: | ||
// | ||
// The above copyright notice and this permission notice shall be included in | ||
// all copies or substantial portions of the Software. | ||
// | ||
// THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR | ||
// IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, | ||
// FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE | ||
// AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER | ||
// LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, | ||
// OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN | ||
// THE SOFTWARE. | ||
|
||
using System; | ||
|
||
namespace SharpDX.Direct2D1 | ||
{ | ||
public partial class ImageSourceFromWic | ||
{ | ||
/// <summary> | ||
/// Initializes a new instance of the <see cref="ImageSourceFromWic"/>. | ||
/// </summary> | ||
public ImageSourceFromWic(DeviceContext2 context2, WIC.BitmapSource wicBitmapSource, ImageSourceLoadingOptions loadingOptions, AlphaMode alphaMode) | ||
: this(IntPtr.Zero) | ||
{ | ||
context2.CreateImageSourceFromWic(wicBitmapSource, loadingOptions, alphaMode, this); | ||
} | ||
} | ||
} |
Oops, something went wrong.