Skip to content

Commit 91dd68a

Browse files
committed
renmatrix: Add region tracing sub-phase profiling hooks
1 parent aaa0303 commit 91dd68a

1 file changed

Lines changed: 12 additions & 0 deletions

File tree

src/renmatrix.ps.src

Lines changed: 12 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -371,6 +371,8 @@ begin
371371

372372
(render.tracepaths) //renmatrix.before exec
373373

374+
(render.tracepaths.prep) //renmatrix.before exec
375+
374376
% Pad the bitmap on all sides (string is zero-initialized)
375377
/pixx pixx 2 add def
376378
/pixycomp pixycomp 2 add def
@@ -391,9 +393,13 @@ begin
391393
pop /bwipp.renmatrixBitmapTooLarge (The bitmap exceeds the implementation limits) //raiseerror exec
392394
} if /cache exch def
393395

396+
(render.tracepaths.prep) //renmatrix.after exec
397+
394398
%
395399
% Pre-compute abcd values (printed neighbours) for all cells
396400
%
401+
(render.tracepaths.corners) //renmatrix.before exec
402+
397403
/abcdw pixx 1 sub def
398404
abcdw pixycomp 1 sub mul { string } stopped {
399405
pop /bwipp.renmatrixBitmapTooLarge (The bitmap exceeds the implementation limits) //raiseerror exec
@@ -409,12 +415,16 @@ begin
409415

410416
/abcdget { pixx 1 sub mul add abcdcache exch get } def
411417

418+
(render.tracepaths.corners) //renmatrix.after exec
419+
412420
%
413421
% Construct paths by tracing regions, avoiding duplication by using
414422
% the cache. Each raster line of corner codes is scanned with the
415423
% column kept on the stack; stem corners are rare, so only they
416424
% spill to variables.
417425
%
426+
(render.tracepaths.scan) //renmatrix.before exec
427+
418428
/paths [
419429
0 1 pixycomp 2 sub {
420430
/j exch def
@@ -442,6 +452,8 @@ begin
442452
} for
443453
] def
444454

455+
(render.tracepaths.scan) //renmatrix.after exec
456+
445457
%
446458
% Revert the bitmap size
447459
%

0 commit comments

Comments
 (0)