public void paint(CompositorContext.ScopedFrame frame, bool ignoreRasterCache = false)
        {
            var paintContext = new PaintContext {
                canvas      = frame.canvas(),
                rasterCache = ignoreRasterCache ? null : frame.context().rasterCache(),
                frameTime   = frame.context().frameTime()
            };

            if (this._rootLayer.needsPainting)
            {
                this._rootLayer.paint(paintContext);
            }
        }
Ejemplo n.º 2
0
        public override void paint(PaintContext context)
        {
            var canvas = context.canvas;

            canvas.save();
            canvas.clipRRect(this._clipRRect);

            try {
                this.paintChildren(context);
            }
            finally {
                canvas.restore();
            }
        }
Ejemplo n.º 3
0
        public override void paint(PaintContext context)
        {
            D.assert(this.needsPainting);

            var canvas = context.canvas;

            canvas.save();
            try {
                canvas.concat(this._transform);
                this.paintChildren(context);
            } finally {
                canvas.restore();
            }
        }
Ejemplo n.º 4
0
        public override void paint(PaintContext context)
        {
            D.assert(this.needsPainting);

            var canvas = context.canvas;

            canvas.save();
            canvas.clipRect(this.paintBounds);

            try {
                this.paintChildren(context);
            } finally {
                canvas.restore();
            }
        }
Ejemplo n.º 5
0
        public override void paint(PaintContext context)
        {
            D.assert(this.needsPainting);

            if (this._texture == null)
            {
                return;
            }

            var image = new Image(this._texture, noDispose: true);

            var canvas = context.canvas;

            canvas.drawImageRect(image, this.paintBounds, new Paint());
        }
Ejemplo n.º 6
0
        public override void paint(PaintContext context)
        {
            var canvas = context.canvas;

            var paint = new Paint {
                color = Color.fromARGB(this._alpha, 255, 255, 255)
            };

            canvas.saveLayer(this.paintBounds, paint);
            try {
                this.paintChildren(context);
            }
            finally {
                canvas.restore();
            }
        }
Ejemplo n.º 7
0
        public override void paint(PaintContext context)
        {
            if (this._elevation != 0)
            {
                drawShadow(context.canvas, this._path, this._shadow_color, this._elevation,
                           this._color.alpha != 255, this._device_pixel_ratio);
            }

            this._shadowPaint.color = this._color;
            context.canvas.drawPath(this._path, this._shadowPaint);

            context.canvas.save();
            context.canvas.clipPath(this._path);
            this.paintChildren(context);
            context.canvas.restore();
        }
Ejemplo n.º 8
0
        public override void paint(PaintContext context)
        {
            D.assert(this.needsPainting);

            var canvas = context.canvas;

            canvas.saveLayer(this.paintBounds, new Paint {
                backdrop = this._filter
            });

            try {
                this.paintChildren(context);
            } finally {
                canvas.restore();
            }
        }
Ejemplo n.º 9
0
        public override void paint(PaintContext context)
        {
            if (this._elevation != 0)
            {
                drawShadow(context.canvas, this._path, this._shadow_color, this._elevation,
                           this._color.alpha != 255, this._device_pixel_ratio);
            }

            Paint paint = new Paint {
                color = this._color
            };

            //todo: xingwei.zhu: process according to different clipBehavior, currently use antiAlias as default

            context.canvas.drawPath(this._path, paint);

            context.canvas.save();
            context.canvas.clipPath(this._path);
            this.paintChildren(context);
            context.canvas.restore();
        }
Ejemplo n.º 10
0
        public override void paint(PaintContext context)
        {
            D.assert(this.needsPainting);
            const int padding   = 8;
            const int fpsHeight = 20;

            Canvas canvas = context.canvas;

            canvas.save();

            float x      = this.paintBounds.left + padding;
            float y      = this.paintBounds.top + padding;
            float width  = this.paintBounds.width - padding * 2;
            float height = this.paintBounds.height;

            this._drawFPS(canvas, x, y);

            if ((this._options & (int)PerformanceOverlayOption.drawFrameCost) == 1)
            {
                this._drawFrameCost(canvas, x, y + fpsHeight, width, height - padding - fpsHeight);
            }

            canvas.restore();
        }
Ejemplo n.º 11
0
 public abstract void paint(PaintContext context);