summaryrefslogtreecommitdiff
path: root/src/pkg/exp/draw
AgeCommit message (Collapse)AuthorFilesLines
2011-02-14Imported Upstream version 2011-02-01.1upstream/2011-02-01.1Ondřej Surý1-4/+7
2011-01-17Imported Upstream version 2011.01.12upstream/2011.01.12Ondřej Surý8-504/+334
2010-06-29exp/draw/x11: implement the mapping from keycodes to keysyms.Nigel Tao1-31/+78
R=rsc CC=golang-dev, rog http://codereview.appspot.com/1739042
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 Tao2-1/+15
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 Tao3-35/+2
R=rsc CC=golang-dev http://codereview.appspot.com/1388041
2010-05-27Add Rectangle.Eq and Point.In.Roger Peppe1-0/+14
Fix Rectangle.Clip. It could return a non-canonical rectangle if its arguments did not overlap. e.g. Rect(0, 0, 10, 10).Clip(Rect(0, 20, 10, 30)) -> Rect(0, 20, 10, 10) R=rsc, r CC=golang-dev, golang-dev http://codereview.appspot.com/1290041 Committer: Rob Pike <r@golang.org>
2010-05-24Optimize exp/draw/x11 flusher inner loop.Nigel Tao1-6/+6
On my laptop, time to prepare and write 800x600 pixels over the socket falls from 125-ish ms to 80-ish ms. Thanks to Roger Peppe for the suggestion. R=r CC=golang-dev http://codereview.appspot.com/1228044
2010-05-24Fix typo in exp/draw/x11.Nigel Tao1-1/+1
R=rsc CC=golang-dev http://codereview.appspot.com/1282041
2010-05-24Make draw/x11 treat $DISPLAY the same way x-go-bindings does.Nigel Tao2-44/+97
This ought to make draw/x11 work on a Mac. R=rsc CC=golang-dev http://codereview.appspot.com/1265042
2010-05-21go/printer, gofmt: fix printing of labels,Robert Griesemer1-1/+2
apply gofmt to src, misc Fixes issue 752. R=rsc CC=golang-dev http://codereview.appspot.com/1240044 Committer: Robert Griesemer <gri@golang.org>
2010-05-20Fix Rectangle.Canon()Roger Peppe1-2/+2
R=rsc, r, gri CC=golang-dev http://codereview.appspot.com/1239043 Committer: Robert Griesemer <gri@golang.org>
2010-05-20Fast-ish path for drawing onto an image.RGBA destination.Nigel Tao2-13/+121
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-05-06Make exp/draw/x11 respect $XAUTHORITY.Nigel Tao1-13/+17
R=rsc, cw, nigeltao_golang CC=golang-dev http://codereview.appspot.com/1134041
2010-02-17Add Src and Over draw operators.Nigel Tao2-54/+86
R=r, rsc CC=golang-dev http://codereview.appspot.com/207096
2010-02-11exp/draw test.Nigel Tao1-0/+89
R=rsc CC=golang-dev http://codereview.appspot.com/203062
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 Griesemer6-313/+313
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-29crypto/md4, exp/draw/x11: fix makefile to build when GOROOT has whitespacesSergio Luis O. B. Correia1-2/+2
this is the exact same thing issue #115 is about. fix makefiles to use relative path to work in the case we have whitespaces as part of GOROOT. R=rsc http://codereview.appspot.com/162055 Committer: Russ Cox <rsc@golang.org>
2009-11-25Initial exp/draw/x11 implementation.Nigel Tao3-0/+629
This provides an experimental X11 backend for the exp/draw interface. It does not aim to provide a complete implementation of the X11 client protocol. This works for me (Ubuntu Hardy 8.04, GOARCH=386). Your mileage my vary. R=r, rsc, r1 CC=golang-dev http://codereview.appspot.com/156109
2009-11-23go: makes it build for the case $GOROOT has whitespacesSergio Luis O. B. Correia1-2/+2
the bash scripts and makefiles for building go didn't take into account the fact $GOROOT / $GOBIN could both be directories containing whitespaces, and was not possible to build it in such a situation. this commit adjusts the various makefiles/scripts to make it aware of that possibility, and now it builds successfully when using a path with whitespaces as well. Fixes issue 115. R=rsc, dsymonds1 http://codereview.appspot.com/157067 Committer: Russ Cox <rsc@golang.org>
2009-11-12exp/draw: correct Makefile.Adam Langley1-1/+1
Thanks to Allister Macleod Fixes issue 112. R=rsc CC=golang-dev http://codereview.appspot.com/152102
2009-11-09 - replaced gofmt expression formatting algorithm withRobert Griesemer2-24/+24
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 Griesemer3-33/+33
R=rsc, r http://go/go-review/1025029
2009-11-06- fine-tuning of one-line func heuristic (nodes.go)Robert Griesemer2-51/+17
- enabled for function declarations (not just function literals) - applied gofmt -w $GOROOT/src (look for instance at src/pkg/debug/elf/elf.go) R=r, rsc CC=go-dev http://go/go-review/1026006
2009-11-05gofmt-ify drawRobert Griesemer4-81/+79
R=rsc http://go/go-review/1017055
2009-10-14move draw to expRuss Cox5-0/+471
R=r DELTA=942 (471 added, 471 deleted, 0 changed) OCL=35733 CL=35740