Пример #1
0
        public override void preroll(PrerollContext context, Matrix3 matrix)
        {
            Rect childPaintBounds = Rect.zero;

            this.prerollChildren(context, matrix, ref childPaintBounds);
            this.paintBounds = childPaintBounds;
        }
Пример #2
0
        public override void preroll(PrerollContext context, Matrix3 matrix)
        {
            var childMatrix = Matrix3.concat(matrix, this._transform);

            var previousCullRect = context.cullRect;

            Matrix3 inverseTransform = Matrix3.I();

            if (this._transform.invert(inverseTransform))
            {
                context.cullRect = inverseTransform.mapRect(context.cullRect);
            }
            else
            {
                context.cullRect = Rect.largest;
            }

            Rect childPaintBounds = Rect.zero;

            this.prerollChildren(context, childMatrix, ref childPaintBounds);

            childPaintBounds = this._transform.mapRect(childPaintBounds);
            this.paintBounds = childPaintBounds;

            context.cullRect = previousCullRect;
        }
Пример #3
0
 protected void prerollChildren(PrerollContext context, Matrix3 childMatrix, ref Rect childPaintBounds)
 {
     foreach (var layer in this._layers)
     {
         layer.preroll(context, childMatrix);
         childPaintBounds = childPaintBounds.expandToInclude(layer.paintBounds);
     }
 }
Пример #4
0
        public void preroll(CompositorContext.ScopedFrame frame, bool ignoreRasterCache = false)
        {
            var prerollContext = new PrerollContext {
                rasterCache      = ignoreRasterCache ? null : frame.context().rasterCache(),
                devicePixelRatio = frame.canvas().getDevicePixelRatio()
            };

            this._rootLayer.preroll(prerollContext, Matrix3.I());
        }
Пример #5
0
        public void preroll(CompositorContext.ScopedFrame frame, bool ignoreRasterCache = false)
        {
            var prerollContext = new PrerollContext {
                rasterCache      = ignoreRasterCache ? null : frame.context().rasterCache(),
                devicePixelRatio = frame.canvas().getDevicePixelRatio(),
                cullRect         = Rect.largest,
            };

            this._rootLayer.preroll(prerollContext, _identityMatrix);
        }
Пример #6
0
        public override void preroll(PrerollContext context, Matrix3 matrix)
        {
            var childMatrix = Matrix3.concat(this._tranform, matrix);

            Rect childPaintBounds = Rect.zero;

            this.prerollChildren(context, childMatrix, ref childPaintBounds);

            childPaintBounds = this._tranform.mapRect(childPaintBounds);
            this.paintBounds = childPaintBounds;
        }
Пример #7
0
        public override void preroll(PrerollContext context, Matrix3 matrix)
        {
            var childPaintBounds = Rect.zero;

            this.prerollChildren(context, matrix, ref childPaintBounds);
            childPaintBounds = childPaintBounds.intersect(this._clipRRect.outerRect);

            if (!childPaintBounds.isEmpty)
            {
                this.paintBounds = childPaintBounds;
            }
        }
Пример #8
0
        public override void preroll(PrerollContext context, Matrix3 matrix)
        {
            var childMatrix = new Matrix3(matrix);

            childMatrix.preTranslate(this._offset.dx, this._offset.dy); // TOOD: pre or post? https://github.com/flutter/engine/pull/7945

            base.preroll(context, childMatrix);

            var bounds = this.paintBounds.shift(this._offset);

            this.paintBounds = bounds;
        }
Пример #9
0
        protected void prerollChildren(PrerollContext context, Matrix3 childMatrix, ref Rect childPaintBounds)
        {
            foreach (var layer in this._layers)
            {
                layer.preroll(context, childMatrix);

                if (childPaintBounds == null || childPaintBounds.isEmpty)
                {
                    childPaintBounds = layer.paintBounds;
                }
                else
                {
                    childPaintBounds = childPaintBounds.expandToInclude(layer.paintBounds);
                }
            }
        }
Пример #10
0
        public override void preroll(PrerollContext context, Matrix3 matrix)
        {
            Rect child_paint_bounds = Rect.zero;

            this.prerollChildren(context, matrix, ref child_paint_bounds);

            if (this._elevation == 0)
            {
                this.paintBounds = this._path.getBounds();
            }
            else
            {
                Rect bounds = this._path.getBounds();
                Rect outset = bounds.outset(20.0f, 20.0f);
                this.paintBounds = outset;
            }
        }
Пример #11
0
        public override void preroll(PrerollContext context, Matrix3 matrix)
        {
            Rect child_paint_bounds = Rect.zero;

            this.prerollChildren(context, matrix, ref child_paint_bounds);

            if (this._elevation == 0)
            {
                this.paintBounds = this._path.getBounds();
            }
            else
            {
                Rect bounds = this._path.getBounds();
                //todo xingwei.zhu: outter set shadow
                //bounds.outset(20.0f, 20.0f);
                this.paintBounds = bounds;
            }
        }
Пример #12
0
        public override void preroll(PrerollContext context, Matrix3 matrix)
        {
            var previousCullRect = context.cullRect;

            context.cullRect = context.cullRect.intersect(this._clipRect);

            if (!context.cullRect.isEmpty)
            {
                var childPaintBounds = Rect.zero;
                this.prerollChildren(context, matrix, ref childPaintBounds);
                childPaintBounds = childPaintBounds.intersect(this._clipRect);

                if (!childPaintBounds.isEmpty)
                {
                    this.paintBounds = childPaintBounds;
                }
            }

            context.cullRect = previousCullRect;
        }
Пример #13
0
        public override void preroll(PrerollContext context, Matrix3 matrix)
        {
            if (context.rasterCache != null)
            {
                Matrix3 ctm = new Matrix3(matrix);
                ctm.postTranslate((float)this._offset.dx, (float)this._offset.dy);
                ctm[2] = ctm[2].alignToPixel(context.devicePixelRatio);
                ctm[5] = ctm[5].alignToPixel(context.devicePixelRatio);

                this._rasterCacheResult = context.rasterCache.getPrerolledImage(
                    this._picture, ctm, context.devicePixelRatio, this._isComplex, this._willChange);
            }
            else
            {
                this._rasterCacheResult = null;
            }

            var bounds = this._picture.paintBounds.shift(this._offset);

            this.paintBounds = bounds;
        }
Пример #14
0
        public override void preroll(PrerollContext context, Matrix3 matrix)
        {
            if (context.rasterCache != null)
            {
                Matrix3 ctm = new Matrix3(matrix);
                ctm.preTranslate(this._offset.dx, this._offset.dy); // TOOD: pre or post? https://github.com/flutter/engine/pull/7945
                ctm[2] = ctm[2].alignToPixel(context.devicePixelRatio);
                ctm[5] = ctm[5].alignToPixel(context.devicePixelRatio);

                this._rasterCacheResult = context.rasterCache.getPrerolledImage(
                    this._picture, ctm, context.devicePixelRatio, context.antiAliasing, this._isComplex, this._willChange);
            }
            else
            {
                this._rasterCacheResult = null;
            }

            var bounds = this._picture.paintBounds.shift(this._offset);

            this.paintBounds = bounds;
        }
Пример #15
0
 public virtual void preroll(PrerollContext context, Matrix3 matrix)
 {
 }
Пример #16
0
 public override void preroll(PrerollContext context, Matrix3 matrix)
 {
     this.paintBounds = Rect.fromLTWH(
         this._offset.dx, this._offset.dy, this._size.width, this._size.height);
 }