Commit Graph

19 Commits

Author SHA1 Message Date
Seebs 918031892a smaller imdraw optimizations
For polyline, don't compute each normal twice; when we're going through a line,
the "next" normal for segment N is always the "previous" normal for segment
N+1, and we can compute fewer of them.
2017-06-09 10:37:47 -05:00
Seebs 9a7ab1c6b0 use point pool
For internal operations (anything using getAndClearPoints), there's a
pretty good chance that the operation will repeatedly invoke something
like fillPolygon(), meaning that it needs to push "a few" points
and then invoke something that uses those points.

So, we add a slice for containing spare slices of points, and on the
way out of each such function, shove the current imd.points (as used
inside that function) onto a stack, and set imd.points to [0:0] of
the thing it was called with.

Performance goes from 11-13fps to 17-18fps on my test case.
2017-06-09 10:37:47 -05:00
faiface ecdd8462bb replace complex128 Vec with a struct 2017-05-21 19:25:06 +02:00
faiface 1d928485d6 change IMDraw properties to fields 2017-05-18 23:50:45 +02:00
faiface 29785fb937 IMDraw: change default point color to (1, 1, 1, 1) (was (0, 0, 0, 0)) 2017-05-06 22:57:55 +02:00
faiface a403cfe50b remove commented code 2017-04-21 16:43:56 +02:00
faiface c485793a83 fix drawing non-closed lines in IMDraw 2017-04-21 01:17:29 +02:00
faiface 97158ba502 simplify code in IMDraw 2017-04-16 00:59:07 +02:00
faiface 01ff4230da add IMDraw.Rectangle 2017-04-16 00:01:43 +02:00
faiface cf666b5866 immediate-like-mode -> immediate-mode-like 2017-04-13 17:44:28 +02:00
faiface f325092c02 add imdraw package doc comment 2017-04-13 17:41:38 +02:00
faiface 3276c4e4a1 clarify IMDraw.Draw doc 2017-04-12 16:03:36 +02:00
faiface a555999120 adopt RGB and Alpha 2017-04-10 17:25:56 +02:00
faiface 32ae09e1e5 replace NRGBA to RGBA because Porter-Duff (!!!) 2017-04-09 22:00:26 +02:00
faiface 379b4df667 adopt new ToNRGBA function 2017-03-23 23:07:49 +01:00
faiface fb8424cd32 add support for one point lines in imdraw 2017-03-23 19:38:53 +01:00
faiface 4619398b9e fix 0 vector len + fix imdraw polyline 2017-03-23 19:15:06 +01:00
faiface 0585b0af8c improve imdraw doc 2017-03-22 18:53:25 +01:00
faiface 5e698c63f0 move IMDraw to separate package 2017-03-21 11:33:11 +01:00