public PaintBucketToolContentRenderer(IRenderer <ColorBgra> sampleSource, PaintBucketToolChanges changes) : base(sampleSource.Width, sampleSource.Height, true) { Validate.IsNotNull <PaintBucketToolChanges>(changes, "changes"); this.sampleSource = sampleSource; this.changes = changes; this.brush = new PdnLegacyBrush(this.changes.BrushType, this.changes.HatchStyle, this.changes.ForegroundColor, this.changes.BackgroundColor).EnsureFrozen <PdnLegacyBrush>(); this.brushRenderer = this.brush.CreateRenderer(base.Width, base.Height); this.lazyStencil = LazyResult.New <IRenderer <ColorAlpha8> >(() => this.CreateMaskRenderer(), LazyThreadSafetyMode.ExecutionAndPublication, new SingleUseCriticalSection()); }
public PaintBrushToolContentRenderer(int width, int height, PaintBrushToolChanges changes) : base(width, height, changes) { this.brush = new PdnLegacyBrush(base.Changes.BrushType, base.Changes.HatchStyle, base.Changes.ForegroundColor, base.Changes.BackgroundColor).EnsureFrozen <PdnLegacyBrush>(); this.brushRenderer = this.brush.CreateRenderer(base.Width, base.Height); }