Skip to content

Commit 4f5fb26

Browse files
committed
Merge branch 'pr/n606_andrewst' into master_integration
2 parents 7dbcf7a + ac7fb39 commit 4f5fb26

File tree

4 files changed

+13
-10
lines changed

4 files changed

+13
-10
lines changed

Source/SharpDX.Direct2D1/BitmapProperties1.cs

+3-2
Original file line numberDiff line numberDiff line change
@@ -17,6 +17,8 @@
1717
// LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,
1818
// OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN
1919
// THE SOFTWARE.
20+
using System;
21+
2022
namespace SharpDX.Direct2D1
2123
{
2224
public partial class BitmapProperties1
@@ -91,8 +93,7 @@ public ColorContext ColorContext
9193
set
9294
{
9395
colorContext = value;
94-
if (value != null)
95-
ColorContextPointer = colorContext.NativePointer;
96+
ColorContextPointer = colorContext == null ? IntPtr.Zero : colorContext.NativePointer;
9697
}
9798
}
9899
}

Source/SharpDX.Direct2D1/LayerParameters.cs

+2-2
Original file line numberDiff line numberDiff line change
@@ -34,7 +34,7 @@ public Geometry GeometricMask
3434
{
3535
set
3636
{
37-
GeometricMaskPointer = value.NativePointer;
37+
GeometricMaskPointer = value == null ? IntPtr.Zero : value.NativePointer;
3838
}
3939
}
4040

@@ -49,7 +49,7 @@ public Brush OpacityBrush
4949
{
5050
set
5151
{
52-
OpacityBrushPointer= value.NativePointer;
52+
OpacityBrushPointer = value == null ? IntPtr.Zero : value.NativePointer;
5353
}
5454
}
5555
}

Source/SharpDX.Direct2D1/LayerParameters1.cs

+6-4
Original file line numberDiff line numberDiff line change
@@ -18,6 +18,7 @@
1818
// OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN
1919
// THE SOFTWARE.
2020

21+
using System;
2122
using SharpDX.Mathematics.Interop;
2223

2324
namespace SharpDX.Direct2D1
@@ -38,11 +39,11 @@ public LayerParameters1(RawRectangleF contentBounds, Geometry geometryMask, Anti
3839
: this()
3940
{
4041
ContentBounds = contentBounds;
41-
geometricMask_ = geometryMask.NativePointer;
42+
GeometricMaskPointer = geometryMask.NativePointer;
4243
MaskAntialiasMode = maskAntialiasMode;
4344
MaskTransform = maskTransform;
4445
Opacity = opacity;
45-
opacityBrush_ = opacityBrush.NativePointer;
46+
OpacityBrushPointer = opacityBrush.NativePointer;
4647
LayerOptions = layerOptions;
4748
}
4849

@@ -56,8 +57,9 @@ public LayerParameters1(RawRectangleF contentBounds, Geometry geometryMask, Anti
5657
public Geometry GeometricMask
5758
{
5859
set
60+
5961
{
60-
geometricMask_ = value.NativePointer;
62+
GeometricMaskPointer = value == null ? IntPtr.Zero : value.NativePointer;
6163
}
6264
}
6365

@@ -72,7 +74,7 @@ public Brush OpacityBrush
7274
{
7375
set
7476
{
75-
opacityBrush_ = value.NativePointer;
77+
OpacityBrushPointer = value == null ? IntPtr.Zero : value.NativePointer;
7678
}
7779
}
7880
}

Source/SharpDX.Direct2D1/Mapping-direct2d1.xml

+2-2
Original file line numberDiff line numberDiff line change
@@ -200,8 +200,8 @@
200200
<map struct="D2D1_BITMAP_PROPERTIES1" struct-to-class="true"/>
201201
<map field="D2D1_BITMAP_PROPERTIES1::colorContext" name="ColorContextPointer" visibility="internal"/>
202202

203-
<map field="D2D1_LAYER_PARAMETERS1::geometricMask" visibility="internal" name="geometricMask_"/>
204-
<map field="D2D1_LAYER_PARAMETERS1::opacityBrush" visibility="internal" name="opacityBrush_"/>
203+
<map field="D2D1_LAYER_PARAMETERS1::geometricMask" visibility="internal" name="GeometricMaskPointer"/>
204+
<map field="D2D1_LAYER_PARAMETERS1::opacityBrush" visibility="internal" name="OpacityBrushPointer"/>
205205

206206
<map struct="D2D1_PROPERTY_BINDING" struct-to-class="true" visibility="internal"/>
207207
<map field="D2D1_PROPERTY_BINDING::[gs]etFunction" visibility="internal"/>

0 commit comments

Comments
 (0)