2
0
mirror of synced 2025-02-22 22:38:18 +00:00

82 Commits

Author SHA1 Message Date
Burcu Dogan
25faf494e1 exp/sensor: use a better prefix in C not to pollute the namespace
Change-Id: Iac80d3ca61812ece64ae5127e4b5d1f8c54ff5b3
Reviewed-on: https://go-review.googlesource.com/13620
Reviewed-by: David Crawshaw <crawshaw@golang.org>
2015-08-13 17:46:42 +00:00
Nigel Tao
f632204bcc event/config: rename to event/size.
Change-Id: I908b5f0818da32b2b040f430ebcc3762eb6f7570
Reviewed-on: https://go-review.googlesource.com/13601
Reviewed-by: David Crawshaw <crawshaw@golang.org>
2015-08-13 13:31:00 +00:00
Burcu Dogan
b5583e233e exp/sensor: reorg package to create space for darwin/arm,arm64 impl
Change-Id: I41e4088a92fff2f411dd82102fc3c421d2679c21
Reviewed-on: https://go-review.googlesource.com/13582
Reviewed-by: David Crawshaw <crawshaw@golang.org>
2015-08-12 22:18:05 +00:00
Nigel Tao
723de9f813 exp/sprite/portable: update for x/image/draw API change.
The API change is http://golang.org/cl/12669

Change-Id: Ia34bb2efae808c45e9c0cfd4d3f510fdad549444
Reviewed-on: https://go-review.googlesource.com/12774
Reviewed-by: David Crawshaw <crawshaw@golang.org>
2015-07-29 01:18:55 +00:00
Nigel Tao
cdc5281044 event/config: specify width and height in both pixels and points.
Change-Id: I494c17b2bad6c920ea20b22046d1d3fbc7b6b1d4
Reviewed-on: https://go-review.googlesource.com/12700
Reviewed-by: David Crawshaw <crawshaw@golang.org>
2015-07-28 01:48:05 +00:00
Meir Fischer
a34303262d exp/audio: fix inability to use mono 8 format
There is no way to distinguish an unknown format from
Mono8 because Mono8 is zero. The current CL fixes this
issue by starting the format constants from iota + 1.

Change-Id: I8c709cdaff3bc46bcc15ab770cfcfd04c186034d
Reviewed-on: https://go-review.googlesource.com/12386
Reviewed-by: Burcu Dogan <jbd@google.com>
2015-07-24 05:53:18 +00:00
Nigel Tao
e5bb9c1e6f exp/gl/glutil: don't embed the *image.RGBA.
Embedding is more trouble than it's worth. For example, the image/draw
package will pick the slow code paths for an embedded *image.RGBA.

Change-Id: I64bd20a80814b838850950c05dd8257e5901aef7
Reviewed-on: https://go-review.googlesource.com/12567
Reviewed-by: David Crawshaw <crawshaw@golang.org>
2015-07-24 05:26:20 +00:00
Nigel Tao
0d322895cb exp/sprite/portable: use golang.org/x/image/draw.
Change-Id: Ib41fd6614e3a5504d0cebe9a84b23a675d0e88fd
Reviewed-on: https://go-review.googlesource.com/12289
Reviewed-by: David Crawshaw <crawshaw@golang.org>
2015-07-17 04:52:29 +00:00
Nigel Tao
84f8e5edcc event: move event.Filter to app.Filter.
Change-Id: I11044a6e01b53e441c05fc1baec36718e783622f
Reviewed-on: https://go-review.googlesource.com/12288
Reviewed-by: David Crawshaw <crawshaw@golang.org>
2015-07-17 01:18:36 +00:00
Hyang-Ah (Hana) Kim
136fa9bbbb bind/java: reenable asset access.
This is done by moving app.Context to internal/mobileinit,
introducing mobileinit.SetCurrentContext and,
making bind/java depend on it.

TODO: check gomobile bind's proguard rule - context lookup
was implemented through reflection on android.app.AppGlobals class.

Change-Id: Ieb6ad503eeef8c2c1c5836a21c667938c5a701a2
Reviewed-on: https://go-review.googlesource.com/12279
Reviewed-by: David Crawshaw <crawshaw@golang.org>
2015-07-16 21:15:37 +00:00
Nigel Tao
e4c6af17e3 event: rename event.Foo to foo.Event.
Fixes golang/go#10444

Change-Id: Ie5a8ab8a09b1b1a4f7037da7cf945d39ab6a98fc
Reviewed-on: https://go-review.googlesource.com/12225
Reviewed-by: David Crawshaw <crawshaw@golang.org>
2015-07-16 01:03:51 +00:00
Meir Fischer
7fb893ba43 mobile/exp/audio: use correct indefinite article prior to PCM
There is currently one usage of "an" prior to "PCM". The indefinite
article usage prior to an acronym is determined by the
pronunciation of that acronym's first letter. If the pronunciation
starts with a consonant, "a" is used. If the pronunciation starts
with a vowel, "an" is used.

Usage
https://en.wikipedia.org/wiki/Pulse-code_modulation

Note that there is currently a correct usage in the same file on a
different line: "a PCM header"

Change-Id: Id7749d20722a5cc9b96ecfe466be66fe3c76ab2b
Reviewed-on: https://go-review.googlesource.com/12083
Reviewed-by: David Crawshaw <crawshaw@golang.org>
2015-07-13 15:00:26 +00:00
Burcu Dogan
adcf40b30c exp/audio/al: avoid creation of multiple contexts
This CL reverts the changes made in golang/go#11299.

Allowing creation of multiple contexts break the case of multiple
third party packages depending on the al bindings. These packages
need to make sure that there is a valid current context or initiate
and make a context current. Packages racing to create and make a
context current is what we would like to avoid.

Therefore, al bindings will support only a single context that is
initiated during OpenDevice.

Fixes golang/go#11385.

Change-Id: I662f70e49d12833a545005cf0724cc21f67bea09
Reviewed-on: https://go-review.googlesource.com/12001
Reviewed-by: Nigel Tao <nigeltao@golang.org>
2015-07-11 16:23:18 +00:00
Nigel Tao
8631054b13 exp/app/debug: fit the FPS counter's aspect ratio to the backing image.
Ever since we moved to a bitmap font instead of using freetype, the backing
image's dimensions are 43x9, not 50x12, and we might as well match. For
example, the output will be exactly 43x9 pixels at 72DPI, or 86x18 pixels at
144DPI, etc.

Change-Id: I99975cc780760b28b73fbf6d55befbe500f1a6e1
Reviewed-on: https://go-review.googlesource.com/11880
Reviewed-by: Hyang-Ah Hana Kim <hyangah@gmail.com>
2015-07-04 02:53:51 +00:00
Nigel Tao
f464c65ce4 exp/gl/glutil: fix test for the foo to exp/foo package rename.
Change-Id: I8709146467d15f59433783759a51a1d0a59cdcfc
Reviewed-on: https://go-review.googlesource.com/11857
Reviewed-by: Hyang-Ah Hana Kim <hyangah@gmail.com>
2015-07-03 01:37:31 +00:00
Nigel Tao
467d8559f2 f32: move to exp/f32.
In the long term, a lot of this package should be removed in favor of the
golang.org/x/image/math/f32 package. The latter is the common location for
matrix types shared across graphics libraries. For example, the
golang.org/x/image/draw package refers to golang.org/x/image/math/f64.

Change-Id: I9d7ccd3cb35912e0d9dc5bd46c919516ea840340
Reviewed-on: https://go-review.googlesource.com/11856
Reviewed-by: Hyang-Ah Hana Kim <hyangah@gmail.com>
2015-07-03 01:37:12 +00:00
Nigel Tao
bd8fa0d7bb gl/glutil: move to exp/gl/glutil.
Change-Id: I310c365300cb3fbf8a1abb630e26661fa7ef4844
Reviewed-on: https://go-review.googlesource.com/11824
Reviewed-by: Hyang-Ah Hana Kim <hyangah@gmail.com>
2015-07-01 11:41:50 +00:00
Nigel Tao
c7c93d6952 app/debug: move to exp/app/debug.
Change-Id: I97f3585ff155e8c5b95c5bb32cfa793980c81a9a
Reviewed-on: https://go-review.googlesource.com/11821
Reviewed-by: Hyang-Ah Hana Kim <hyangah@gmail.com>
2015-06-30 23:41:11 +00:00
Nigel Tao
8de8fcfbf7 app/debug, exp/font: remove the freetype dependency.
Change-Id: Id71acfeb605995d8caf947d996a1375335410e08
Reviewed-on: https://go-review.googlesource.com/11668
Reviewed-by: David Crawshaw <crawshaw@golang.org>
Reviewed-by: Hyang-Ah Hana Kim <hyangah@gmail.com>
2015-06-30 23:03:35 +00:00
Burcu Dogan
383ad68fc0 exp/audio: APIs should not use Context pointer type
This CL is a followup of CL/11315 where it is suggested to remove
Context pointer types from the signatures.

Change-Id: Ice68bfabad0e345f7d93102257a99402be8760b5
Reviewed-on: https://go-review.googlesource.com/11560
Reviewed-by: Nigel Tao <nigeltao@golang.org>
2015-06-30 06:09:10 +00:00
Nigel Tao
d06bbc53e4 exp/audio/al: use the standard log library, if al_init fails.
This means that there's only one adb log prefix that Go app developers
need to watch: GoLog.

Change-Id: I562566b92a7bba19f7c7a9cc71315bea02844db1
Reviewed-on: https://go-review.googlesource.com/11609
Reviewed-by: Burcu Dogan <jbd@google.com>
2015-06-30 06:08:38 +00:00
Nigel Tao
d1d3d8a5a0 exp/audio/al: delete a debugging log message.
This was accidentally introduced in
https://go-review.googlesource.com/#/c/11351/

Change-Id: Icc9bc9ccb97e48d376e0da440b72631e605a0a15
Reviewed-on: https://go-review.googlesource.com/11608
Reviewed-by: Hyang-Ah Hana Kim <hyangah@gmail.com>
2015-06-29 04:33:40 +00:00
Nigel Tao
b6ec031d27 exp/audio/al: call log.Fatalf for a dlsym failure.
Change-Id: I197e101f2b93c2aa9dc69cb697afa68a69142783
Reviewed-on: https://go-review.googlesource.com/11537
Reviewed-by: Burcu Dogan <jbd@google.com>
2015-06-29 01:50:48 +00:00
Nigel Tao
42f0d17876 app: use one thread for both GL and other UI C code.
This change will break Darwin. I have only built and tested this on
desktop linux and Android linux. A follow-up CL will fix Darwin.

Currently, OpenGL gets its own thread, and UI C code (e.g. the Android
event loop, or the X11 event loop) gets its own thread. This relies on
multiple system-provided UI-related C libraries working nicely together,
even when running on different threads. Keeping all the C code on the
one thread seems more sound.

As side-effects:
  - In package app/debug, DrawFPS now takes an explicit Config.
  - In package app, some callbacks now take an explicit Config.
  - In package exp/sprite, Render now takes an explicit Config.
  - In package event, there are new events (Config, Draw, Lifecycle),
    and an event filter mechanism to replace multiple app Callbacks.
  - In package geom, the deprecated Width, Height and PixelsPerPt global
    variables were removed in favor of an event.Config that is
    explicitly passed around (and does not require mutex-locking).
    Converting a geom.Pt to pixels now requires passing a pixelsPerPt.
  - In package gl, the Do, Start and Stop functions are removed, as well
    as the need to call Start in its own goroutine. There is no longer a
    separate GL thread. Instead, package app explicitly performs any GL
    work (gl.DoWork) when some is available (gl.WorkAvailable).
  - In package gl/glutil, Image.Draw now takes an explicit Config.

Callbacks are no longer executed on 'the UI thread'.

Changing the app programming model from callbacks to events (since a
channel of events works with select) will be a follow-up change.

Change-Id: Id9865cd9ee1c45a98c613e9021a63c17226a64b1
Reviewed-on: https://go-review.googlesource.com/11351
Reviewed-by: David Crawshaw <crawshaw@golang.org>
2015-06-26 07:43:17 +00:00
Burcu Dogan
0a8a8b8cb6 exp/audio/al,cmd/gomobile: fix the broken build
Change-Id: Ia2da7d987f253c11a62843f54051c9d18c1612b5
Reviewed-on: https://go-review.googlesource.com/11521
Reviewed-by: Nigel Tao <nigeltao@golang.org>
2015-06-26 07:40:05 +00:00
Burcu Dogan
25dc511cde exp/audio: allow multiple instances of al.Context
Fixes golang/go#11299.

Change-Id: Ie59981a0515abcf015c7b22d05d2cdbb8be35f56
Reviewed-on: https://go-review.googlesource.com/11315
Reviewed-by: Nigel Tao <nigeltao@golang.org>
2015-06-26 06:57:01 +00:00
Nigel Tao
229b9af752 exp/sprite/portable: unbreak test.
The test was broken with the foo -> exp/foo move.

Change-Id: Ie2bdf54f6da0365d2e0332bcacdd2b7a000c950c
Reviewed-on: https://go-review.googlesource.com/11392
Reviewed-by: David Crawshaw <crawshaw@golang.org>
2015-06-24 23:49:55 +00:00
Burcu Dogan
1d641b5393 audio: move to exp/audio
Change-Id: I8640b1a38a292972db6dd00506e38c89470b2c15
Reviewed-on: https://go-review.googlesource.com/11311
Reviewed-by: Nigel Tao <nigeltao@golang.org>
2015-06-21 18:18:56 +00:00
Burcu Dogan
e9faa8965b sensor: move to exp/sensor
Change-Id: I707a1555952355ccdd5e851062c4749dc94544eb
Reviewed-on: https://go-review.googlesource.com/11312
Reviewed-by: Nigel Tao <nigeltao@golang.org>
2015-06-21 07:47:51 +00:00
Nigel Tao
c0c696a96d sprite: move to exp/sprite.
Change-Id: Idfdc0c192d7e6d50e1063b2eb582bbe05294643a
Reviewed-on: https://go-review.googlesource.com/11230
Reviewed-by: David Crawshaw <crawshaw@golang.org>
2015-06-21 03:08:52 +00:00
Nigel Tao
981e383923 font: move to exp/font.
Change-Id: I62d5bcd829cb35e13843586b25829938778c79f5
Reviewed-on: https://go-review.googlesource.com/11133
Reviewed-by: David Crawshaw <crawshaw@golang.org>
2015-06-16 21:35:30 +00:00
Nigel Tao
93e2526d55 exp: add a new directory for experimental packages.
Change-Id: I80ebfa6c7e79c1985262fe1572a927ce60df6946
Reviewed-on: https://go-review.googlesource.com/11118
Reviewed-by: David Crawshaw <crawshaw@golang.org>
2015-06-16 21:06:44 +00:00