Browse Source

Merge branch 'master' into linux-framebuffer

pull/939/head
Nikita Tsukanov 10 years ago
committed by GitHub
parent
commit
c179060ab2
  1. 8
      appveyor.yml
  2. 12
      src/Avalonia.Visuals/Media/ImageBrush.cs
  3. 8
      src/Avalonia.Visuals/Media/LinearGradientBrush.cs
  4. 8
      src/Avalonia.Visuals/Media/RadialGradientBrush.cs
  5. 8
      src/Avalonia.Visuals/Media/VisualBrush.cs

8
appveyor.yml

@ -1,4 +1,4 @@
os: Visual Studio 2017 RC os: Visual Studio 2017
platform: platform:
- Any CPU - Any CPU
configuration: configuration:
@ -11,10 +11,10 @@ environment:
secure: OtVfyN3ErqQrDTnWH2HDfJDlCiu/i4/X4wFmK3ZXXP7HmCiXYPSbTjMPwwdOxRaK secure: OtVfyN3ErqQrDTnWH2HDfJDlCiu/i4/X4wFmK3ZXXP7HmCiXYPSbTjMPwwdOxRaK
MYGET_API_URL: https://www.myget.org/F/avalonia-ci/api/v2/package MYGET_API_URL: https://www.myget.org/F/avalonia-ci/api/v2/package
install: install:
- if not exist dotnet-1.0.1.exe appveyor DownloadFile https://go.microsoft.com/fwlink/?linkid=843448 -FileName "dotnet-1.0.1.exe"
- if not exist gtk-sharp-2.12.26.msi appveyor DownloadFile http://download.xamarin.com/GTKforWindows/Windows/gtk-sharp-2.12.26.msi - if not exist gtk-sharp-2.12.26.msi appveyor DownloadFile http://download.xamarin.com/GTKforWindows/Windows/gtk-sharp-2.12.26.msi
- msiexec /i gtk-sharp-2.12.26.msi /qn /norestart - if not exist dotnet-1.0.1.exe appveyor DownloadFile https://go.microsoft.com/fwlink/?linkid=843448 -FileName "dotnet-1.0.1.exe"
- cmd: call dotnet-1.0.1.exe /quiet - ps: Start-Process -FilePath "msiexec" -ArgumentList "/i gtk-sharp-2.12.26.msi /quiet /qn /norestart" -Wait
- ps: Start-Process -FilePath "dotnet-1.0.1.exe" -ArgumentList "/quiet" -Wait
- cmd: set PATH=%programfiles(x86)%\GtkSharp\2.12\bin\;%PATH% - cmd: set PATH=%programfiles(x86)%\GtkSharp\2.12\bin\;%PATH%
before_build: before_build:
- git submodule update --init - git submodule update --init

12
src/Avalonia.Visuals/Media/ImageBrush.cs

@ -8,7 +8,7 @@ namespace Avalonia.Media
/// <summary> /// <summary>
/// Paints an area with an <see cref="IBitmap"/>. /// Paints an area with an <see cref="IBitmap"/>.
/// </summary> /// </summary>
public class ImageBrush : TileBrush, IImageBrush public class ImageBrush : TileBrush, IImageBrush, IMutableBrush
{ {
/// <summary> /// <summary>
/// Defines the <see cref="Visual"/> property. /// Defines the <see cref="Visual"/> property.
@ -17,14 +17,14 @@ namespace Avalonia.Media
AvaloniaProperty.Register<ImageBrush, IBitmap>("Source"); AvaloniaProperty.Register<ImageBrush, IBitmap>("Source");
/// <summary> /// <summary>
/// Initializes a new instance of the <see cref="VisualBrush"/> class. /// Initializes a new instance of the <see cref="ImageBrush"/> class.
/// </summary> /// </summary>
public ImageBrush() public ImageBrush()
{ {
} }
/// <summary> /// <summary>
/// Initializes a new instance of the <see cref="VisualBrush"/> class. /// Initializes a new instance of the <see cref="ImageBrush"/> class.
/// </summary> /// </summary>
/// <param name="source">The image to draw.</param> /// <param name="source">The image to draw.</param>
public ImageBrush(IBitmap source) public ImageBrush(IBitmap source)
@ -40,5 +40,11 @@ namespace Avalonia.Media
get { return GetValue(SourceProperty); } get { return GetValue(SourceProperty); }
set { SetValue(SourceProperty, value); } set { SetValue(SourceProperty, value); }
} }
/// <inheritdoc/>
IBrush IMutableBrush.ToImmutable()
{
return new Immutable.ImmutableImageBrush(this);
}
} }
} }

8
src/Avalonia.Visuals/Media/LinearGradientBrush.cs

@ -6,7 +6,7 @@ namespace Avalonia.Media
/// <summary> /// <summary>
/// A brush that draws with a linear gradient. /// A brush that draws with a linear gradient.
/// </summary> /// </summary>
public sealed class LinearGradientBrush : GradientBrush, ILinearGradientBrush public sealed class LinearGradientBrush : GradientBrush, ILinearGradientBrush, IMutableBrush
{ {
/// <summary> /// <summary>
/// Defines the <see cref="StartPoint"/> property. /// Defines the <see cref="StartPoint"/> property.
@ -41,5 +41,11 @@ namespace Avalonia.Media
get { return GetValue(EndPointProperty); } get { return GetValue(EndPointProperty); }
set { SetValue(EndPointProperty, value); } set { SetValue(EndPointProperty, value); }
} }
/// <inheritdoc/>
IBrush IMutableBrush.ToImmutable()
{
return new Immutable.ImmutableLinearGradientBrush(this);
}
} }
} }

8
src/Avalonia.Visuals/Media/RadialGradientBrush.cs

@ -7,7 +7,7 @@ namespace Avalonia.Media
/// Paints an area with a radial gradient. A focal point defines the beginning of the gradient, /// Paints an area with a radial gradient. A focal point defines the beginning of the gradient,
/// and a circle defines the end point of the gradient. /// and a circle defines the end point of the gradient.
/// </summary> /// </summary>
public sealed class RadialGradientBrush : GradientBrush, IRadialGradientBrush public sealed class RadialGradientBrush : GradientBrush, IRadialGradientBrush, IMutableBrush
{ {
/// <summary> /// <summary>
/// Defines the <see cref="Center"/> property. /// Defines the <see cref="Center"/> property.
@ -61,5 +61,11 @@ namespace Avalonia.Media
get { return GetValue(RadiusProperty); } get { return GetValue(RadiusProperty); }
set { SetValue(RadiusProperty, value); } set { SetValue(RadiusProperty, value); }
} }
/// <inheritdoc/>
IBrush IMutableBrush.ToImmutable()
{
return new Immutable.ImmutableRadialGradientBrush(this);
}
} }
} }

8
src/Avalonia.Visuals/Media/VisualBrush.cs

@ -8,7 +8,7 @@ namespace Avalonia.Media
/// <summary> /// <summary>
/// Paints an area with an <see cref="IVisual"/>. /// Paints an area with an <see cref="IVisual"/>.
/// </summary> /// </summary>
public class VisualBrush : TileBrush, IVisualBrush public class VisualBrush : TileBrush, IVisualBrush, IMutableBrush
{ {
/// <summary> /// <summary>
/// Defines the <see cref="Visual"/> property. /// Defines the <see cref="Visual"/> property.
@ -40,5 +40,11 @@ namespace Avalonia.Media
get { return GetValue(VisualProperty); } get { return GetValue(VisualProperty); }
set { SetValue(VisualProperty, value); } set { SetValue(VisualProperty, value); }
} }
/// <inheritdoc/>
IBrush IMutableBrush.ToImmutable()
{
return new Immutable.ImmutableVisualBrush(this);
}
} }
} }

Loading…
Cancel
Save