Граф коммитов

18 Коммитов

Автор SHA1 Сообщение Дата
Changkun Ou a0f9ae51e3 cmd/gomobile: allow tests to pass on ios builder
There are several tests are skipped for Android but they may still be
tested on iOS. This will leads to trybot failure.

This CL skips those tests and allow them to pass on iOS.

Furthermore, deprecated C function warning are promoted to errors on
builders, this CL also fixes a deprecated asl_log for iOS in mobileinit.

Change-Id: Ie9da57a20dd75ef3d29b393e30aef01051bab454
Reviewed-on: https://go-review.googlesource.com/c/mobile/+/346391
Reviewed-by: Hajime Hoshi <hajimehoshi@gmail.com>
Reviewed-by: Dmitri Shuralyov <dmitshur@golang.org>
Run-TryBot: Hajime Hoshi <hajimehoshi@gmail.com>
Trust: Dmitri Shuralyov <dmitshur@golang.org>
2021-09-01 15:13:16 +00:00
Russ Cox bdb1ca9a1e all: go fmt ./...
Make all our package sources use Go 1.17 gofmt format
(adding //go:build lines).

Not strictly necessary but will avoid spurious changes
as files are edited.

Part of //go:build change (#41184).
See https://golang.org/design/draft-gobuild

Change-Id: I30822eb504168b037ed3ec0f7759da1f41251f52
Reviewed-on: https://go-review.googlesource.com/c/mobile/+/294374
Trust: Russ Cox <rsc@golang.org>
Run-TryBot: Russ Cox <rsc@golang.org>
TryBot-Result: Go Bot <gobot@golang.org>
Reviewed-by: Robert Griesemer <gri@golang.org>
Reviewed-by: Jason A. Donenfeld <Jason@zx2c4.com>
2021-02-20 03:30:13 +00:00
Elias Naur b8c6dab863 all: skip or fix tests for GOOS=android
Some x/mobile tests are designed to run from a host with a device
or emulator attached. Some fail if they run directly from a device,
which is the case when GOOS=android.

Fix the tests by skipping them or adjusting them to work on GOOS=android.

Remove gomobile environment naïve variable expansion for $HOME; on
Android devices HOME=/ so every path separator is replaced with
$HOME.

Fixes golang/go#30482

Change-Id: I553e708226922f6284163f0b7d7b1011a9502e34
Reviewed-on: https://go-review.googlesource.com/c/164799
Run-TryBot: Elias Naur <mail@eliasnaur.com>
Reviewed-by: Brad Fitzpatrick <bradfitz@golang.org>
2019-03-02 06:36:18 +00:00
David Crawshaw 3abfce6c04 all: windows build tags
For golang/go#9306

Change-Id: Ia8778f5b371371d103c55c12606257ee7ca45fd4
Reviewed-on: https://go-review.googlesource.com/17778
Reviewed-by: Hyang-Ah Hana Kim <hyangah@gmail.com>
2015-12-14 17:43:10 +00:00
Angelo Bulfone 8adb9ed3fb exp/sprite/portable: revert for /x/image/draw api
Fix broken build that was broke by "fix[ing] broken build"

Beaking change: http://golang.org/cl/13970
Reverting to state after http://golang/org/cl/12774

Change-Id: Ibb054467ca374d1f9ccff0ec1874a3e567d0c325
Reviewed-on: https://go-review.googlesource.com/16021
Reviewed-by: Hyang-Ah Hana Kim <hyangah@gmail.com>
2015-11-10 13:59:11 +00:00
David Crawshaw 0064789433 exp/gl/glutil: remove global texture cache
It is now the user's job to track the lifetime of a glutil.Image
relative to a (currently implicit, soon to be explicit) GL context.

This is an attempt to move glutil.Image closer to the model for
buffers and textures in shiny. Long-term, I would like to adopt that
model, and this is a step in that direction. It also makes the
introduction of *gl.Context possible, so this is a pre-req for
cl/13431.

Change-Id: I8e6855211b3e67c97d5831c5c4e443e857c83d50
Reviewed-on: https://go-review.googlesource.com/14795
Reviewed-by: Nigel Tao <nigeltao@golang.org>
2015-09-23 04:24:22 +00:00
Hyang-Ah (Hana) Kim ac03bee8c3 exp/sprite/portable: fix broken build
Change-Id: I4eb6dc6a98366ad978f9fa2367b518ccfffee363
Reviewed-on: https://go-review.googlesource.com/13970
Reviewed-by: David Crawshaw <crawshaw@golang.org>
2015-08-27 17:25:15 +00:00
Hana Kim 49a82fefe3 all: support go get golang.org/x/mobile/... on Windows
Fixes golang/go#12212
Workaround for golang/go#12261 until golang/go#9306 is fixed.

Change-Id: I51c1bcfc92c1553fe2132586a0234b1c1af6aeb1
Reviewed-on: https://go-review.googlesource.com/13745
Reviewed-by: David Crawshaw <crawshaw@golang.org>
2015-08-24 21:09:04 +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
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
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 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
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 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
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
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