public void Render(object cpuIndexObj) { int cpuIndex = (int)cpuIndexObj; int start = (this.rois.Length * cpuIndex) / Processor.LogicalCpuCount; int end = (this.rois.Length * (cpuIndex + 1)) / Processor.LogicalCpuCount; renderer.Render(this.surface, this.rois, start, end - start); }
protected override void OnMouseMove(object o, Gtk.MotionNotifyEventArgs args, Cairo.PointD point) { Document doc = PintaCore.Workspace.ActiveDocument; if (tracking) { GradientRenderer gr = CreateGradientRenderer(); if (button == 3) // Right-click { gr.StartColor = PintaCore.Palette.SecondaryColor.ToColorBgra(); gr.EndColor = PintaCore.Palette.PrimaryColor.ToColorBgra(); } else //1 Left-click { gr.StartColor = PintaCore.Palette.PrimaryColor.ToColorBgra(); gr.EndColor = PintaCore.Palette.SecondaryColor.ToColorBgra(); } gr.StartPoint = startpoint; gr.EndPoint = point; gr.AlphaBlending = UseAlphaBlending; gr.BeforeRender(); Gdk.Rectangle selection_bounds = doc.GetSelectedBounds(true); ImageSurface scratch_layer = doc.ToolLayer.Surface; gr.Render(scratch_layer, new Gdk.Rectangle[] { selection_bounds }); using (var g = doc.CreateClippedContext()) { g.SetSource(scratch_layer); g.Paint(); } doc.ToolLayer.Clear(); selection_bounds.Inflate(5, 5); doc.Workspace.Invalidate(selection_bounds); } }