//C++ TO C# CONVERTER WARNING: 'const' methods are not available in C#: //ORIGINAL LINE: void Paint(PaintContext& context) const override public override void Paint(PaintContext context) { TRACE_EVENT0("flutter", "OpacityLayer::Paint"); FML_DCHECK(needs_painting()); SKPaint paint = new SKPaint(); paint.Color = paint.Color.WithAlpha((byte)alpha_); //C++ TO C# CONVERTER TODO TASK: There is no equivalent in C# to 'static_assert': // (...) static_assert(false, "missing name for " "SkAutoCanvasRestore") save(&context.canvas, true); context.canvas.Translate(offset_.X, offset_.Y); #if !SUPPORT_FRACTIONAL_TRANSLATION context.canvas.SetMatrix(RasterCache.GetIntegralTransCTM(context.canvas.TotalMatrix)); #endif if (layers().Count == 1)// && context.raster_cache) { SKMatrix ctm = context.canvas.TotalMatrix; RasterCacheResult child_cache = context.raster_cache.Get(layers()[0], ctm); if (child_cache.is_valid) { child_cache.draw(context.canvas, paint); return; } } Layer.AutoSaveLayer save_layer = Layer.AutoSaveLayer.Create(context, paint_bounds(), paint); PaintChildren(context); }
public override void Paint(PaintContext context) { TRACE_EVENT0("flutter", "OpacityLayer::Paint"); FML_DCHECK(needs_painting()); SKPaint paint = new SKPaint(); paint.Color = paint.Color.WithAlpha((byte)alpha_); context.canvas.Translate(offset_.X, offset_.Y); #if !SUPPORT_FRACTIONAL_TRANSLATION context.canvas.SetMatrix(RasterCache.GetIntegralTransCTM(context.canvas.TotalMatrix)); #endif if (layers().Count == 1 && context.raster_cache != null) { SKMatrix ctm = context.canvas.TotalMatrix; RasterCacheResult child_cache = context.raster_cache.Get(layers()[0], ctm); if (child_cache.is_valid) { child_cache.draw(context.canvas, paint); return; } } Layer.AutoSaveLayer save_layer = Layer.AutoSaveLayer.Create(context, paint_bounds(), paint); PaintChildren(context); }
public override void Paint(PaintContext context) { var color_filter = SKColorFilter.CreateBlendMode(color_, blend_mode_); SKPaint paint = new SKPaint(); paint.ColorFilter = color_filter; Layer.AutoSaveLayer save = Layer.AutoSaveLayer.Create(context, paint_bounds(), paint); PaintChildren(context); }
public override void Paint(PaintContext context) { TRACE_EVENT0("flutter", "BackdropFilterLayer::Paint"); FML_DCHECK(needs_painting()); Layer.AutoSaveLayer save = Layer.AutoSaveLayer.Create(context, paint_bounds(), new SKPaint() { ImageFilter = filter_ }); //, null, filter_, 0); PaintChildren(context); }
//C++ TO C# CONVERTER WARNING: 'const' methods are not available in C#: //ORIGINAL LINE: void Paint(PaintContext& context) const override public override void Paint(PaintContext context) { //TRACE_EVENT0("flutter", "ColorFilterLayer::Paint"); //FML_DCHECK(needs_painting()); var color_filter = SKColorFilter.CreateBlendMode(color_, blend_mode_); SKPaint paint = new SKPaint(); paint.ColorFilter = color_filter; Layer.AutoSaveLayer save = Layer.AutoSaveLayer.Create(context, paint_bounds(), paint); PaintChildren(context); }
//C++ TO C# CONVERTER WARNING: 'const' methods are not available in C#: //ORIGINAL LINE: void Paint(PaintContext& context) const override public override void Paint(PaintContext context) { TRACE_EVENT0("flutter", "ShaderMaskLayer::Paint"); FML_DCHECK(needs_painting()); Layer.AutoSaveLayer save = Layer.AutoSaveLayer.Create(context, paint_bounds(), null); PaintChildren(context); SKPaint paint = new SKPaint(); paint.BlendMode = blend_mode_; paint.Shader = shader_; context.canvas.Translate(mask_rect_.Left, mask_rect_.Top); context.canvas.DrawRect(new SKRect(0, 0, mask_rect_.Width, mask_rect_.Height), paint); }