Skip to content

Commit

Permalink
Support rendering non-tileable effects (#637)
Browse files Browse the repository at this point in the history
This is a fairly unintrusive change to support non-tileable effects. If the effect isn't tileable, we just create a single tile for the whole render bounds.

Related to PR #457
  • Loading branch information
cameronwhite authored Dec 28, 2023
1 parent 81e20b5 commit daf8f77
Showing 1 changed file with 9 additions and 2 deletions.
11 changes: 9 additions & 2 deletions Pinta.Core/Managers/LivePreviewManager.cs
Original file line number Diff line number Diff line change
Expand Up @@ -109,10 +109,17 @@ public void Start (BaseEffect effect)

Started?.Invoke (this, new LivePreviewStartedEventArgs ());

// If the effect isn't tileable, there is a single tile for the entire render bounds.
// Otherwise, render each row in parallel.
int tileWidth = render_bounds.Width;
int tileHeight = 1;
if (!effect.IsTileable)
tileHeight = render_bounds.Height;

var settings = new AsyncEffectRenderer.Settings () {
ThreadCount = PintaCore.System.RenderThreads,
TileWidth = render_bounds.Width,
TileHeight = 1,
TileWidth = tileWidth,
TileHeight = tileHeight,
ThreadPriority = ThreadPriority.BelowNormal
};

Expand Down

0 comments on commit daf8f77

Please sign in to comment.