summaryrefslogtreecommitdiff
path: root/src/pkg/exp/draw/draw.go
AgeCommit message (Collapse)AuthorFilesLines
2011-01-17Imported Upstream version 2011.01.12upstream/2011.01.12Ondřej Surý1-91/+116
2010-06-14exp/draw: small draw.drawGlyphOver optimization.Nigel Tao1-10/+11
Make dpix variable names consistent. R=rsc CC=golang-dev http://codereview.appspot.com/1563041
2010-06-04Fixes issue 836.Nigel Tao1-1/+1
R=gri CC=golang-dev http://codereview.appspot.com/1548042
2010-06-03draw.Draw fast paths for the Over operator.Nigel Tao1-34/+93
Time (us) to draw a 200x200 src onto an image.RGBA dst with the Over operator. Each case was measured three separate times, and the sorted times are reported. Fill case (where src is an image.ColorImage): Before: 7438, 7511, 7526 After: 3073, 3087, 3102 Copy case (where src is an image.RGBA): Before: 9506, 9510, 9563 After: 5262, 5300, 5344 R=rsc CC=golang-dev http://codereview.appspot.com/1532041
2010-05-28Make image.Color.RGBA return 16 bit color instead of 32 bit color.Nigel Tao1-21/+1
R=rsc CC=golang-dev http://codereview.appspot.com/1388041
2010-05-20Fast-ish path for drawing onto an image.RGBA destination.Nigel Tao1-10/+64
Time to draw.Draw a 200x200 image fell from 18.4ms (and 1 malloc) to 5.6ms (and 0 mallocs). It's still relatively slow since it assumes nothing about the src or mask images, but it does remove the malloc. There are existing faster, more specialized paths for copies, fills and image glyph masks. Also added a "compare to a slow but obviously correct implementation" check to draw_test.go. R=rsc, r CC=golang-dev http://codereview.appspot.com/1223044
2010-05-11drawGlyphOver optimization.Nigel Tao1-4/+5
Timings (as for change 1122043) go from 49ms to 48ms ish. It's mostly lost in the noise, but it probably doesn't hurt. R=r CC=golang-dev http://codereview.appspot.com/1179041
2010-05-10exp/draw fast path for glyph images.Nigel Tao1-1/+43
To draw.Draw a 32x32 image.Alpha 10000 times, Before: 633ms with 10000 mallocs After: 49ms with 0 mallocs These times are just blitting an image.Alpha, and do not include rasterizing a glyph's vector contours to an image.Alpha. The "generic" test case in draw_test.go tests this fast path. R=rsc CC=golang-dev http://codereview.appspot.com/1122043
2010-02-17Add Src and Over draw operators.Nigel Tao1-42/+58
R=r, rsc CC=golang-dev http://codereview.appspot.com/207096
2010-02-06draw.Draw fast paths for a nil mask (and RGBA dst).Nigel Tao1-0/+50
Averaged times (in microseconds) for drawing an 800x600 rectangle are listed below. The summary is: around a 100x improvement. draw.Draw call times were typically linear in the number of pixels touched (i.e. drawing an 800x600 rectangle took 100x as much time as drawing an 80x60 rectangle). Before this change, there was only the general-but-slow code path. When drawing any src with a 50%-opaque mask: 237300 us When drawing any src with a nil mask: 50100 us After this change, the 50%-opaque mask case is unchanged. For an *image.RGBA dst and nil mask and... ...a uniform color (i.e. an image.ColorImage) src: 282 us ...another *image.RGBA src: 615 us. For the curious, an intermediate implementation detected the special cases but used simple nested for loops instead of the built-in copy function. The respective times (compared to 282 and 615 for the final implementation, or 50100 for the original) were 3110 and 3573. Times were measured with 8g/8l on my laptop. I haven't tried gccgo or other architectures. R=r, rsc CC=golang-dev http://codereview.appspot.com/201048
2010-02-04In draw.Draw, separate the source-point and mask-point.Nigel Tao1-30/+40
This lets you draw text (i.e. with mask = a font image) with sources that aren't uniform colors. R=r, rsc CC=golang-dev http://codereview.appspot.com/193067
2010-01-15Fix s/Width/Height/ typo in draw.go.Nigel Tao1-2/+2
Fixes issue 531. R=r CC=golang-dev http://codereview.appspot.com/189078
2009-12-15 1) Change default gofmt default settings forRobert Griesemer1-48/+48
parsing and printing to new syntax. Use -oldparser to parse the old syntax, use -oldprinter to print the old syntax. 2) Change default gofmt formatting settings to use tabs for indentation only and to use spaces for alignment. This will make the code alignment insensitive to an editor's tabwidth. Use -spaces=false to use tabs for alignment. 3) Manually changed src/exp/parser/parser_test.go so that it doesn't try to parse the parser's source files using the old syntax (they have new syntax now). 4) gofmt -w src misc test/bench 2nd set of files. R=rsc CC=golang-dev http://codereview.appspot.com/179067
2009-11-09 - replaced gofmt expression formatting algorithm withRobert Griesemer1-13/+13
rsc's algorithm - applied gofmt -w misc src - partial CL (remaining files in other CLs) R=rsc, r http://go/go-review/1026036
2009-11-09remove semis after statements in one-statement statement listsRobert Griesemer1-7/+7
R=rsc, r http://go/go-review/1025029
2009-11-05gofmt-ify drawRobert Griesemer1-14/+14
R=rsc http://go/go-review/1017055
2009-10-14move draw to expRuss Cox1-0/+125
R=r DELTA=942 (471 added, 471 deleted, 0 changed) OCL=35733 CL=35740