Browse Source

XML comments for newly added members

pull/20790/head
timunie 3 weeks ago
parent
commit
0edef9aee6
  1. 11
      src/Avalonia.Base/Media/DrawingContext.cs
  2. 8
      src/Avalonia.Base/Media/DrawingGroup.cs
  3. 2
      src/Avalonia.Base/Media/PlatformDrawingContext.cs
  4. 12
      src/Avalonia.Base/Rendering/Composition/Drawing/Nodes/RenderDataNodes.cs
  5. 2
      src/Avalonia.Base/Rendering/Composition/Drawing/RenderDataDrawingContext.cs

11
src/Avalonia.Base/Media/DrawingContext.cs

@ -451,9 +451,14 @@ namespace Avalonia.Media
}
protected abstract void PushTextOptionsCore(TextOptions textOptions);
protected abstract void PushTransformCore(Matrix matrix);
/// <summary>
/// Pushes an effect.
/// </summary>
/// <param name="effect">The effect.</param>
/// <param name="bounds">The bounds of the effect.</param>
protected abstract void PushEffectCore(IEffect effect, Rect bounds);
protected abstract void PopClipCore();
@ -463,6 +468,10 @@ namespace Avalonia.Media
protected abstract void PopTransformCore();
protected abstract void PopRenderOptionsCore();
protected abstract void PopTextOptionsCore();
/// <summary>
/// Pops an effect.
/// </summary>
protected abstract void PopEffectCore();
private static bool PenIsVisible(IPen? pen)

8
src/Avalonia.Base/Media/DrawingGroup.cs

@ -21,6 +21,9 @@ namespace Avalonia.Media
public static readonly StyledProperty<IBrush?> OpacityMaskProperty =
AvaloniaProperty.Register<DrawingGroup, IBrush?>(nameof(OpacityMask));
/// <summary>
/// Defines the <see cref="Effect"/> property.
/// </summary>
public static readonly StyledProperty<IEffect?> EffectProperty =
AvaloniaProperty.Register<DrawingGroup, IEffect?>(nameof(Effect));
@ -56,6 +59,9 @@ namespace Avalonia.Media
set => SetValue(OpacityMaskProperty, value);
}
/// <summary>
/// Gets or sets the effect to apply to the drawing group.
/// </summary>
public IEffect? Effect
{
get => GetValue(EffectProperty);
@ -346,6 +352,7 @@ namespace Avalonia.Media
drawingGroup.TextOptions = textOptions;
}
/// <inheritdoc />
protected override void PushEffectCore(IEffect effect, Rect bounds)
{
// Instantiate a new drawing group and set it as the _currentDrawingGroup
@ -369,6 +376,7 @@ namespace Avalonia.Media
protected override void PopTextOptionsCore() => Pop();
/// <inheritdoc />
protected override void PopEffectCore() => Pop();
/// <summary>

2
src/Avalonia.Base/Media/PlatformDrawingContext.cs

@ -88,6 +88,7 @@ internal sealed class PlatformDrawingContext : DrawingContext
protected override void PushTextOptionsCore(TextOptions textOptions) => _impl.PushTextOptions(textOptions);
/// <inheritdoc />
protected override void PushEffectCore(IEffect effect, Rect bounds)
{
if (_impl is IDrawingContextImplWithEffects effectImpl)
@ -112,6 +113,7 @@ internal sealed class PlatformDrawingContext : DrawingContext
protected override void PopTextOptionsCore() => _impl.PopTextOptions();
/// <inheritdoc />
protected override void PopEffectCore()
{
if (_impl is IDrawingContextImplWithEffects effectImpl)

12
src/Avalonia.Base/Rendering/Composition/Drawing/Nodes/RenderDataNodes.cs

@ -249,17 +249,29 @@ class RenderDataTextOptionsNode : RenderDataPushNode
}
}
/// <summary>
/// A render data node that pushes an effect.
/// </summary>
class RenderDataEffectNode : RenderDataPushNode
{
/// <summary>
/// Gets or sets the effect to push.
/// </summary>
public IEffect? Effect { get; set; }
/// <summary>
/// Gets or sets the bounds of the effect.
/// </summary>
public Rect BoundsRect { get; set; }
/// <inheritdoc />
public override void Push(ref RenderDataNodeRenderContext context)
{
if (Effect != null && context.Context is IDrawingContextImplWithEffects effectImpl)
effectImpl.PushEffect(BoundsRect, Effect);
}
/// <inheritdoc />
public override void Pop(ref RenderDataNodeRenderContext context)
{
if (Effect != null && context.Context is IDrawingContextImplWithEffects effectImpl)

2
src/Avalonia.Base/Rendering/Composition/Drawing/RenderDataDrawingContext.cs

@ -269,6 +269,7 @@ internal class RenderDataDrawingContext : DrawingContext
TextOptions = textOptions
});
/// <inheritdoc />
protected override void PushEffectCore(IEffect effect, Rect bounds) => Push(new RenderDataEffectNode()
{
Effect = effect,
@ -289,6 +290,7 @@ internal class RenderDataDrawingContext : DrawingContext
protected override void PopTextOptionsCore() => Pop<RenderDataTextOptionsNode>();
/// <inheritdoc />
protected override void PopEffectCore() => Pop<RenderDataEffectNode>();
internal override void DrawBitmap(IRef<IBitmapImpl>? source, double opacity, Rect sourceRect, Rect destRect)

Loading…
Cancel
Save