Beispiel #1
0
        private void NestedContextPassTeardown(
            ref UIOperationContext context, ref DecorationSettings settings, IDecorator decorations,
            ref RasterizePassSet passSet, ref ImperativeRenderer contentRenderer, ref UIOperationContext contentContext,
            int previousStackDepth
            )
        {
            // If this is the first stencil pass instead of a nested one, clear the stencil buffer
            if (passSet.StackDepth < 1)
            {
                contentRenderer.Clear(stencil: 0, layer: -9999);
            }
            else
            {
                // Erase any siblings' clip regions
                contentRenderer.DepthStencilState = context.UIContext.GetStencilRestore(previousStackDepth);
                contentRenderer.FillRectangle(new Rectangle(-1, -1, 9999, 9999), Color.Transparent, blendState: RenderStates.DrawNone, layer: -1000);
            }

            contentRenderer.DepthStencilState = context.UIContext.GetStencilWrite(previousStackDepth);

            // FIXME: Separate context?
            contentContext.Pass = RasterizePasses.ContentClip;

            // FIXME
            var temp = settings;

            ApplyClipMargins(ref contentContext, ref temp.Box);

            var crLayer = contentRenderer.Layer;

            contentRenderer.Layer = -999;
            settings.State        = default(ControlStates);
            decorations?.Rasterize(ref contentContext, ref contentRenderer, temp);

            contentRenderer.Layer = crLayer;

            // passSet.NextReferenceStencil = childrenPassSet.NextReferenceStencil;
        }
Beispiel #2
0
 protected virtual void OnRasterize(ref UIOperationContext context, ref ImperativeRenderer renderer, DecorationSettings settings, IDecorator decorations)
 {
     decorations?.Rasterize(ref context, ref renderer, settings);
 }