/// <summary> /// Copy all properties that are marked as inherited from a parent <see cref="BlendingParameters"/> object. /// </summary> /// <param name="parent">The parent <see cref="BlendingParameters"/> from which to copy inherited properties.</param> public void CopyFromParent(BlendingParameters parent) { if (Source == BlendingType.Inherit) { Source = parent.Source; } if (Destination == BlendingType.Inherit) { Destination = parent.Destination; } if (SourceAlpha == BlendingType.Inherit) { SourceAlpha = parent.SourceAlpha; } if (DestinationAlpha == BlendingType.Inherit) { DestinationAlpha = parent.DestinationAlpha; } if (RGBEquation == BlendingEquation.Inherit) { RGBEquation = parent.RGBEquation; } if (AlphaEquation == BlendingEquation.Inherit) { AlphaEquation = parent.AlphaEquation; } }
/// <summary> /// Any properties marked as inherited will have their blending mode changed to the default type. This can occur when a root element is set to inherited. /// </summary> public void ApplyDefaultToInherited() { if (Source == BlendingType.Inherit) { Source = BlendingType.SrcAlpha; } if (Destination == BlendingType.Inherit) { Destination = BlendingType.OneMinusSrcAlpha; } if (SourceAlpha == BlendingType.Inherit) { SourceAlpha = BlendingType.One; } if (DestinationAlpha == BlendingType.Inherit) { DestinationAlpha = BlendingType.One; } if (RGBEquation == BlendingEquation.Inherit) { RGBEquation = BlendingEquation.Add; } if (AlphaEquation == BlendingEquation.Inherit) { AlphaEquation = BlendingEquation.Add; } }
public void TestOpaqueBoxWithNonAddAlphaEquation(BlendingEquation equationMode) { createBox(b => { var blending = BlendingParameters.Inherit; blending.AlphaEquation = equationMode; b.Blending = blending; }); AddAssert("doesn't render interior", () => !blendedBox.CanDrawOpaqueInterior); }
public void TestOpaqueBoxWithNonAddAlphaEquation(BlendingEquation equationMode) { createBox(b => { b.Blending = new BlendingParameters { Mode = BlendingMode.Inherit, AlphaEquation = equationMode, RGBEquation = BlendingEquation.Inherit }; }); AddAssert("doesn't render interior", () => !blendedBox.CanDrawOpaqueInterior); }
private static BlendEquationMode translateEquation(BlendingEquation blendingEquation) { switch (blendingEquation) { default: case BlendingEquation.Inherit: case BlendingEquation.Add: return(BlendEquationMode.FuncAdd); case BlendingEquation.Min: return(BlendEquationMode.Min); case BlendingEquation.Max: return(BlendEquationMode.Max); case BlendingEquation.Subtract: return(BlendEquationMode.FuncSubtract); case BlendingEquation.ReverseSubtract: return(BlendEquationMode.FuncReverseSubtract); } }
public void BlendEquationSeparate(BlendingEquation modeRGB, BlendingEquation modeAlpha) => this.CallMethod <object>(BLEND_EQUATION_SEPARATE, modeRGB, modeAlpha);
public void BlendEquation(BlendingEquation equation) => this.CallMethod <object>(BLEND_EQUATION, equation);