2
0
mirror of synced 2025-02-23 06:48:15 +00:00

100 Commits

Author SHA1 Message Date
Hana Kim
32f2370535 go.mobile/bind: include the bind invocation command in generated files.
This change also updates bind/testdata/*.golden.

LGTM=crawshaw
R=crawshaw
CC=golang-codereviews
https://golang.org/cl/167160043
2014-11-10 13:46:47 -05:00
Andrew Gerrand
9470e0ba58 go.mobile: use golang.org/x/... import paths
LGTM=bradfitz, rsc
R=rsc, bradfitz
CC=golang-codereviews
https://golang.org/cl/162710043
2014-11-10 08:55:57 +11:00
David Crawshaw
385a1a25f7 go.mobile/sprite/portable: accept any image type as a source
Clip source bounds to the minimum of src and mask, for the case
where src is an *image.Uniform.

LGTM=nigeltao
R=nigeltao
CC=golang-codereviews
https://golang.org/cl/167310044
2014-11-06 20:51:36 -05:00
David Crawshaw
f973591b21 go.mobile/sprite/portable: bilinear fast path for *image.Uniform
LGTM=nigeltao
R=golang-codereviews, nigeltao
CC=golang-codereviews
https://golang.org/cl/172060043
2014-11-06 20:50:34 -05:00
Hana Kim
c2dd086961 go.mobile/example/libhello: fix typo.
LGTM=crawshaw
R=crawshaw
CC=golang-codereviews
https://golang.org/cl/172740043
2014-11-05 14:00:48 -05:00
Hana Kim
d53d8c3f80 go.mobile/bind/java: update javatest.go to build.
LGTM=crawshaw
R=crawshaw
CC=golang-codereviews
https://golang.org/cl/171850043
2014-11-05 13:09:06 -05:00
David Crawshaw
df04a5b449 go.mobile/sprite/portable: support masks in affine transform
LGTM=nigeltao
R=nigeltao
CC=golang-codereviews
https://golang.org/cl/166100043
2014-11-04 08:51:09 -05:00
Nigel Tao
3e603f3a38 go.mobile/gl/glutil: enable glimage_test on linux/X11.
LGTM=crawshaw
R=crawshaw
CC=golang-codereviews
https://golang.org/cl/167020043
2014-11-03 10:31:19 +11:00
David Crawshaw
9bbfe1ee47 go.mobile/sprite/portable: fix sub-image zero bound bug in affine
Also, modify the affine test to share the test
image with the glimage test.

LGTM=nigeltao
R=nigeltao
CC=golang-codereviews
https://golang.org/cl/164400043
2014-11-01 07:48:58 -04:00
David Crawshaw
b208e914e7 go.mobile/gl/glutil: take advantage of new degree of freedom in test
LGTM=nigeltao
R=nigeltao
CC=golang-codereviews
https://golang.org/cl/166030043
2014-11-01 07:48:07 -04:00
Nigel Tao
970a0a0162 go.mobile/gl/glutil: let Image.Draw draw non-axis-aligned quads.
LGTM=crawshaw
R=crawshaw
CC=golang-codereviews
https://golang.org/cl/160710043
2014-10-31 14:32:34 +11:00
David Crawshaw
0ac70a3835 go.mobile/gl/glutil, go.mobile/app/debug: create glimage with pixel size
LGTM=nigeltao
R=nigeltao
CC=golang-codereviews
https://golang.org/cl/165940043
2014-10-30 19:43:51 -04:00
David Crawshaw
fd18e8dcec go.mobile/gl/glutil: correct image size and switch to testpattern.png
LGTM=nigeltao
R=nigeltao
CC=golang-codereviews
https://golang.org/cl/167910043
2014-10-30 17:30:38 -04:00
David Crawshaw
897e5be307 go.mobile/gl/glutil: use correct image bounds in translation
I have included the gl.LINEAR bugfix here as it changes the
images substantially.

Based on Nigel's excellent analysis in cl/160710043.

LGTM=nigeltao
R=nigeltao
CC=golang-codereviews
https://golang.org/cl/168820043
2014-10-30 17:26:23 -04:00
Nigel Tao
50e85e8344 go.mobile/testdata: add a test pattern image.
LGTM=adg
R=crawshaw, adg
CC=golang-codereviews
https://golang.org/cl/162450043
2014-10-30 18:22:16 +11:00
David Crawshaw
e406fcc9dd go.mobile/sprite/portable: package docs
LGTM=nigeltao
R=nigeltao
CC=golang-codereviews
https://golang.org/cl/162370044
2014-10-29 09:32:18 -04:00
Nigel Tao
2457abfa93 go.mobile/f32: add a f32.Bytes function.
LGTM=crawshaw
R=crawshaw
CC=golang-codereviews
https://golang.org/cl/166720044
2014-10-29 09:19:38 +11:00
Nigel Tao
34a31a192f go.mobile/geom: consolidate two small files into one.
Also fix a typo in "Pacakge geom".

LGTM=crawshaw
R=crawshaw
CC=golang-codereviews
https://golang.org/cl/159630043
2014-10-29 09:18:41 +11:00
Nigel Tao
f458564116 go.mobile/example/basic: strip the "core" from the shaders'
"# version 100 core", as Ubuntu 14.04's OpenGLES doesn't like it:
"shader compile: 0:1(10): error: illegal text following version number"

LGTM=adg, crawshaw
R=crawshaw, bryanturley, adg
CC=golang-codereviews
https://golang.org/cl/163260043
2014-10-28 12:08:26 +11:00
Nigel Tao
b3557d6b50 go.mobile/app: add comment about X11 library dependencies.
LGTM=adg, crawshaw
R=crawshaw, adg
CC=golang-codereviews
https://golang.org/cl/159530043
2014-10-28 12:07:47 +11:00
Nigel Tao
ee31300452 go.mobile/f32: sin/cos look-up tables.
benchmark        old ns/op     new ns/op     delta
BenchmarkSin     98156         32725         -66.66%

LGTM=crawshaw, minux
R=crawshaw, minux
CC=golang-codereviews
https://golang.org/cl/156590043
2014-10-28 11:19:13 +11:00
Nigel Tao
3aced57cb0 go.mobile/gl/glutil: use a triangle strip instead of two triangles.
It's not a big deal in this case, but we'll probably want to do the same
for the sprite/gl package.

LGTM=crawshaw
R=crawshaw
CC=golang-codereviews
https://golang.org/cl/163990043
2014-10-28 10:55:58 +11:00
David Crawshaw
85b2f78310 go.mobile/app: do not log info android logcat already includes
i.e. all of log.LstdFlags

LGTM=hyangah
R=golang-codereviews, hyangah
CC=golang-codereviews
https://golang.org/cl/138310043
2014-10-23 09:55:09 -04:00
David Crawshaw
479974ec25 go.mobile/app: comments from cl/147910043 and fix darwin mouse drag events
LGTM=nigeltao
R=nigeltao, hyangah
CC=golang-codereviews
https://golang.org/cl/146440043
2014-10-22 20:24:05 -04:00
Nigel Tao
fab1e51609 go.mobile/geom: rename Scale to PixelsPerPt.
LGTM=crawshaw
R=crawshaw
CC=golang-codereviews
https://golang.org/cl/160160043
2014-10-22 13:50:04 +11:00
David Crawshaw
32b64a7e1e go.mobile/app: bigger default window in x11
LGTM=nigeltao
R=nigeltao
CC=golang-codereviews
https://golang.org/cl/155680043
2014-10-21 22:11:11 -04:00
David Crawshaw
10d5c6ef91 go.mobile/sprite/portable: transform bugfixes and documentation
The 1/geom.Scale was simply an incorrect version of m.Inverse.
The texture scaling is to correct the fact that the pixels of
texture images were being conflated with the pxiels on the
screen. There is no inherent width/height implied by the pixel
dimensions of a texture.

LGTM=nigeltao
R=nigeltao
CC=golang-codereviews
https://golang.org/cl/156340044
2014-10-21 08:41:44 -04:00
David Crawshaw
cf4f75ce44 go.mobile/sprite: add AppendChild and RemoveChild from go.net/html
LGTM=nigeltao
R=nigeltao
CC=golang-codereviews
https://golang.org/cl/153680046
2014-10-19 10:49:39 -04:00
Hana Kim
80f7412a0f go.mobile: copy the local version of go.mobile instead of downloading from the net.
The purpose of this Dockerfile is to make it easier to hack on go.mobile.
'go get' is still desirable for preinstall necessary dependencies.

LGTM=crawshaw, adg
R=adg, crawshaw
CC=golang-codereviews
https://golang.org/cl/155480043
2014-10-17 13:07:55 -04:00
Hana Kim
830be8ef4c go.mobile: update Dockerfile to install hg/git/svn/bzr and freetype and go.tools/go packages.
LGTM=crawshaw
R=crawshaw
CC=golang-codereviews
https://golang.org/cl/158970044
2014-10-15 20:11:05 -04:00
David Crawshaw
84a6a4e653 go.mobile/app: fix import path in docs
LGTM=hyangah
R=hyangah
CC=golang-codereviews
https://golang.org/cl/157040043
2014-10-15 11:18:32 -04:00
David Crawshaw
90974e3a0b go.mobile/sprite/portable: support draw.Over, document affine and invert sprite matrix
Still trying to come up with some good tests for this package.

LGTM=nigeltao
R=nigeltao
CC=golang-codereviews
https://golang.org/cl/160880043
2014-10-15 09:44:21 -04:00
David Crawshaw
c579c527c1 go.mobile/f32: add Inverse
LGTM=nigeltao
R=nigeltao
CC=golang-codereviews
https://golang.org/cl/157990043
2014-10-15 09:42:53 -04:00
Nigel Tao
0d93f8d8be go.mobile/app: tabs/spaces clean-up.
LGTM=crawshaw
R=crawshaw
CC=golang-codereviews
https://golang.org/cl/159820043
2014-10-13 21:04:04 +11:00
David Crawshaw
17b03aaff9 go.mobile: a test for glutil.Image
LGTM=nigeltao
R=nigeltao
CC=golang-codereviews
https://golang.org/cl/152420043
2014-10-12 18:01:54 -07:00
David Crawshaw
8a5f40b7b3 go.mobile: move glimage to glutil package and export
Drawing now supports defining both the source and destination
bounds, which is equivalent to clipping and scaling an image.

LGTM=nigeltao
R=nigeltao, crawshaw
CC=adg, golang-codereviews
https://golang.org/cl/144480043
2014-10-12 17:58:22 -07:00
Nigel Tao
c2d8ff3468 go.mobile/app: add an X11 implementation, for non-Android Linux.
LGTM=crawshaw
R=crawshaw
CC=golang-codereviews
https://golang.org/cl/155270043
2014-10-13 09:24:05 +11:00
Nigel Tao
2b51510f07 go.mobile/sprite: use clock.Time instead of sprite.Time.
LGTM=crawshaw
R=crawshaw
CC=golang-codereviews
https://golang.org/cl/156950044
2014-10-13 09:09:32 +11:00
Gautham Thambidorai
7aa683c173 go.mobile/app: Add an entrypoint for non Java libraries to use for initializing a go runtime.
LGTM=crawshaw
R=golang-codereviews, crawshaw
CC=golang-codereviews
https://golang.org/cl/156040044
2014-10-09 14:23:40 -07:00
Nigel Tao
4f42fa989e go.mobile/gl: use column major ordering.
Also rename some files:
types.go      -> types_prod.go
typesdebug.go -> types_debug.go
(new file)       types_common.go

In discussing https://golang.org/cl/144480043/ crawshaw said:

The third argument to glUniformMatrix* is "transpose." According to the
linked documentation, which is usually better:

"If transpose is GL_FALSE, each matrix is assumed to be supplied in
column major order. If transpose is GL_TRUE, each matrix is assumed to
be supplied in row major order."

However, the documentation for OpenGL ES 2 doesn't bother even telling
you, it just says that this parameter must always be set to GL_FALSE. So
it's not supported on most Android devices. (Sadly the older
documentation appears to have been discontinued.)

So yes, GL seems to default to column-major, and the older GLES2 I'm
targeting left the transpose argument in but doesn't support it. Hence
I'm not exposing it through this API.

LGTM=crawshaw
R=crawshaw
CC=golang-codereviews
https://golang.org/cl/148690043
2014-10-09 14:00:00 +11:00
Nigel Tao
6d01e6fdd5 go.mobile/f32: add Scale, Translate and Rotate methods to Affine.
Also make Mat4 methods consistent with Affine's methods.

LGTM=crawshaw
R=crawshaw
CC=golang-codereviews
https://golang.org/cl/156000043
2014-10-09 13:48:17 +11:00
David Crawshaw
07f3aef267 go.mobile/sprite/clock: Time type and Cubic Bezier tween functions
LGTM=nigeltao
R=nigeltao
CC=golang-codereviews
https://golang.org/cl/151120043
2014-10-07 12:19:04 -07:00
David Crawshaw
c7a16f3e6b go.mobile/sprite: use f32.Affine and draw to backing image
LGTM=nigeltao
R=nigeltao
CC=golang-codereviews
https://golang.org/cl/146150043
2014-10-03 14:56:54 +10:00
Nigel Tao
925df10ad0 go.mobile/f32: make matrix multiplication work even if the dst matrix
is the same as an arg matrix.

LGTM=crawshaw
R=crawshaw
CC=golang-codereviews
https://golang.org/cl/152850043
2014-10-03 14:33:15 +10:00
Nigel Tao
d3df5eca0b go.mobile/f32: fix matrix multiply to be m0*m1 not m1*m0.
Also fix String methods' receivers to be T, not *T, so that
var m f32.Mat32
s := fmt.Sprintf("m=%v", m)
works.

LGTM=crawshaw
R=crawshaw
CC=golang-codereviews
https://golang.org/cl/147490043
2014-10-03 12:33:49 +10:00
Nigel Tao
52d35457e3 go.mobile/f32: add an Affine type.
Also fix the f32_test.

LGTM=crawshaw
R=crawshaw
CC=golang-codereviews
https://golang.org/cl/149310043
2014-10-03 09:25:48 +10:00
Nigel Tao
fac63c531f go.mobile/sprite: initial check-in.
Mostly just a design sketch for now.

LGTM=crawshaw
R=crawshaw
CC=golang-codereviews
https://golang.org/cl/150390043
2014-10-02 13:25:02 +10:00
Nigel Tao
4313b67f84 go.mobile/f32: make Mat4.Translate take a pointer, to be consistent
with the other methods.

LGTM=crawshaw
R=crawshaw
CC=golang-codereviews
https://golang.org/cl/147420043
2014-10-02 09:35:09 +10:00
Nigel Tao
75e726bb56 go.mobile/f32: add a Mat3 type.
LGTM=crawshaw
R=crawshaw
CC=golang-codereviews
https://golang.org/cl/150380043
2014-10-01 13:51:19 +10:00
David Crawshaw
5217175bab go.mobile/app: darwin window drawing support for debugging
This lets you run really simple apps in a window on an OS X
machine. It's not an official target, but slightly more
productive than waiting for an apk install when working on
the sprite package.

LGTM=adg
R=golang-codereviews, adg
CC=golang-codereviews
https://golang.org/cl/147910043
2014-09-29 13:22:23 +10:00