Пример #1
0
        public void Prepare(PrerollContext context, Layer layer, SKMatrix ctm)
        {
            RasterCacheKey <Layer> cache_key = new RasterCacheKey <Layer>(layer, ctm);
            Entry entry = layer_cache_.First(x => x == cache_key).id(); // I used Linq, that aint going to be good for performance

            entry.access_count    = GlobalMembers.ClampSize(entry.access_count + 1, 0, threshold_);
            entry.used_this_frame = true;
            if (!entry.image.is_valid)
            {
                entry.image = GlobalMembers.Rasterize(context.gr_context, ctm, context.dst_color_space, checkerboard_images_, layer.paint_bounds(), (SKCanvas canvas) =>
                {
                    Layer.PaintContext paintContext = new Layer.PaintContext(canvas, null, context.texture_registry, context.raster_cache, context.checkerboard_offscreen_layers);
                    layer.Paint(paintContext);
                });
            }
        }
Пример #2
0
        public void Prepare(PrerollContext context, Layer layer, SKMatrix ctm)
        {
            RasterCacheKey <Layer> cache_key = new RasterCacheKey <Layer>(layer, ctm);
            Entry entry = layer_cache_.First(x => x == cache_key).id(); // I used Linq, that aint going to be good for performance

            //C++ TO C# CONVERTER TODO TASK: The following line was determined to be a copy assignment (rather than a reference assignment) - this should be verified and a 'CopyFrom' method should be created:
            //ORIGINAL LINE: entry.access_count = ClampSize(entry.access_count + 1, 0, threshold_);
            entry.access_count    = GlobalMembers.ClampSize(entry.access_count + 1, 0, threshold_);
            entry.used_this_frame = true;
            if (!entry.image.is_valid)
            {
                //C++ TO C# CONVERTER TODO TASK: Only lambda expressions having all locals passed by reference can be converted to C#:
                //ORIGINAL LINE: entry.image = Rasterize(context->gr_context, ctm, context->dst_color_space, checkerboard_images_, layer->paint_bounds(), [layer, context](SKCanvas* canvas)
                //C++ TO C# CONVERTER TODO TASK: The following line was determined to be a copy assignment (rather than a reference assignment) - this should be verified and a 'CopyFrom' method should be created:
                entry.image = GlobalMembers.Rasterize(context.gr_context, ctm, context.dst_color_space, checkerboard_images_, layer.paint_bounds(), (SKCanvas canvas) =>
                {
                    Layer.PaintContext paintContext = new Layer.PaintContext(canvas, null, context.texture_registry, context.raster_cache, context.checkerboard_offscreen_layers);
                    layer.Paint(paintContext);
                });
            }
        }