예제 #1
0
        public void Reset()
        {
            Fill               = new Paint(Colour.White);
            Stroke             = new Paint(Colour.Black);
            CompositeOperation = new CompositeOperationState(Blending.CompositeOperation.SourceOver);
            ShapeAntiAlias     = true;
            StrokeWidth        = 1.0f;
            MiterLimit         = 10.0f;
            LineCap            = LineCap.Butt;
            LineJoin           = LineCap.Miter;
            Alpha              = 1.0f;
            Transform          = Matrix3X2 <float> .Identity;

            Scissor = new Scissor(new Vector2D <float>(-1.0f));

            FontSize      = 16.0f;
            LetterSpacing = 0.0f;
            LineHeight    = 1.0f;
            FontBlur      = 0.0f;
            TextAlign     = Align.Left | Align.Baseline;
            FontId        = 0;
        }
예제 #2
0
        public Blend(CompositeOperationState compositeOperation, OpenGLRenderer renderer)
        {
            GLEnum srcRgb   = ConvertBlend(compositeOperation.SrcRgb);
            GLEnum dstRgb   = ConvertBlend(compositeOperation.DstRgb);
            GLEnum srcAlpha = ConvertBlend(compositeOperation.SrcAlpha);
            GLEnum dstAlpha = ConvertBlend(compositeOperation.DstAlpha);

            if (srcRgb == GLEnum.InvalidEnum || dstRgb == GLEnum.InvalidEnum ||
                srcAlpha == GLEnum.InvalidEnum || dstAlpha == GLEnum.InvalidEnum)
            {
                srcRgb   = GLEnum.One;
                dstRgb   = GLEnum.OneMinusSrcAlpha;
                srcAlpha = GLEnum.One;
                dstAlpha = GLEnum.OneMinusDstAlpha;
            }
            _srcRgb   = srcRgb;
            _dstRgb   = dstRgb;
            _srcAlpha = srcAlpha;
            _dstAlpha = dstAlpha;

            _renderer = renderer;
        }
예제 #3
0
 public FillCall(int image, Path[] paths, int triangleOffset, int uniformOffset, CompositeOperationState op, OpenGLRenderer renderer)
     : base(image, paths, triangleOffset, 4, uniformOffset, new Blend(op, renderer), renderer)
 {
 }
예제 #4
0
 public StrokeCall(int image, Path[] paths, int uniformOffset, CompositeOperationState op, OpenGLRenderer renderer)
     : base(image, paths, 0, 0, uniformOffset, new Blend(op, renderer), renderer)
 {
 }
예제 #5
0
 public ConvexFillCall(int image, Path[] paths, ulong uniformOffset, CompositeOperationState op, VulkanRenderer renderer)
     : base(image, paths, 0, 0, uniformOffset, PipelineSettings.ConvexFill(op, renderer.TriangleListFill), default, PipelineSettings.ConvexFillEdgeAA(op), renderer)
 {
 }
예제 #6
0
 public StrokeCall(int image, Path[] paths, ulong uniformOffset, CompositeOperationState compositeOperation, VulkanRenderer renderer)
     : base(image, paths, 0, 0, uniformOffset, PipelineSettings.Stroke(compositeOperation), default, default, renderer)
 {
 }
예제 #7
0
 public FillCall(int image, Path[] paths, uint triangleOffset, ulong uniformOffset, CompositeOperationState compositeOperation, VulkanRenderer renderer)
     : base(image, paths, triangleOffset, 4, uniformOffset, PipelineSettings.Fill(compositeOperation), PipelineSettings.FillStencil(compositeOperation, renderer.TriangleListFill), PipelineSettings.FillEdgeAA(compositeOperation), renderer)
 {
 }