2
0
mirror of synced 2025-02-23 23:08:14 +00:00

162 Commits

Author SHA1 Message Date
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
Than McIntosh
f462b3930c app: support C compiler that defaults to -fno-common
For the Android NDK, between r21 and r22 the NDK compiler switched the
default from "-fcommon" to "-fno-common", which causes duplicate
definitions when building the examples given the current C code. To
fix things, rework the C code to insure that we have a single
definition and an "extern" reference to the objects in question.

Updates golang/go#44121.

Change-Id: If198d5cfd977a7cfd1a37652d3a1916d8c8dbcb7
Reviewed-on: https://go-review.googlesource.com/c/mobile/+/290031
Run-TryBot: Than McIntosh <thanm@google.com>
TryBot-Result: Go Bot <gobot@golang.org>
Reviewed-by: Hyang-Ah Hana Kim <hyangah@gmail.com>
Trust: Than McIntosh <thanm@google.com>
2021-02-08 17:11:26 +00:00
Hajime Hoshi
3c8601c510 app: fix comparison of keys' direction
KeyEvent's getAction returns ACTION_DOWN (0), ACTION_UP (1) or
other values, and not AKEY_STATE_DOWN (1) or AKEY_STATE_UP (0).
This change fixes the wrong comparison.

Fixes golang/go#37374

Change-Id: Ia65ac881e57cc29d4bdde2365e177c2b4499a2d9
Reviewed-on: https://go-review.googlesource.com/c/mobile/+/220538
Run-TryBot: Hajime Hoshi <hajimehoshi@gmail.com>
TryBot-Result: Gobot Gobot <gobot@golang.org>
Reviewed-by: Hyang-Ah Hana Kim <hyangah@gmail.com>
2020-02-22 14:29:34 +00:00
Elias Naur
874a4fb9cd app,exp,gl: fix build
Ignore deprecation warning for OpenGL and replace deprecated enum
names.

Change-Id: Ie07c566f1b28610add074dc4da8ab66399cef94b
Reviewed-on: https://go-review.googlesource.com/c/mobile/+/165578
Run-TryBot: Elias Naur <mail@eliasnaur.com>
Reviewed-by: Brad Fitzpatrick <bradfitz@golang.org>
2019-03-06 14:40:52 +00:00
Elias Naur
6d4b718bf3 app: make GoNativeActivity.getKey static
The input queue runs concurrent with the native activity lifecycle,
and so the getKey helper Java method might be called after the
app has been destroyed. This is particularly likely for "back"
key presses that destroys activities.

Change the getKey method to be static so that it can be called
outside the app lifecycle.

Run `go generate ./cmd/gomobile` to update the compiled dex file that
contains GoNativeActivity.

Fixes golang/go#27652

Change-Id: Id2c863ee07e5447f033e67d6948fbfe746916ffa
Reviewed-on: https://go-review.googlesource.com/135215
Reviewed-by: Hyang-Ah Hana Kim <hyangah@gmail.com>
2018-09-13 17:01:46 +00:00
Maarten Bezemer
fe88d27767 app: fix hang when application is closed
Events are Send() after the pump is being stopped (src is not read any more).
This blocks a critical go routine, resulting in the application not properly being stopped.

By continue reading the src channel during shutting down the pump, the block is removed and the application is able to stop.

Fixes golang/go#20256

Change-Id: I1536e8697cd4a0e504e7359e48acce04088e5760
Reviewed-on: https://go-review.googlesource.com/42811
Reviewed-by: Elias Naur <elias.naur@gmail.com>
2018-08-29 07:49:04 +00:00
Elias Naur
bceb7ef27c app: fix cgo exported function signature
Fixes a build warning:

android.c:102:44: warning: incompatible pointer types assigning to 'void (*)(ANativeActivity *, int)' (aka 'void (*)(struct ANativeActivity *, int)') from 'void (ANativeActivity *, GoInt)' (aka 'void (struct ANativeActivity *, long long)') [-Wincompatible-pointer-types]

Change-Id: Ib70bcf8a8e32bb1885ec809d239199fccb1dc4fa
Reviewed-on: https://go-review.googlesource.com/128235
Reviewed-by: Hyang-Ah Hana Kim <hyangah@gmail.com>
2018-08-08 22:10:59 +00:00
Elias Naur
507816974b app: add RunOnJVM to allow Cgo access to the Android JVM and context
CL 122897 changed the visibility of the global JavaVM, JNIEnv and
android.context.Context variables to be internal to gomobile.
However, users of gomobile build programs used those internal
variables to access Java API through Cgo and JNI without Java code.

Make an exported version of mobileinit.RunOnJVM available. This is
quite possibly not the right API for this, but I don't have the
bandwidth to design a better solution. On the other hand, without
access to Java APIs, gomobile build programs are unfairly forced to
add Java code where before there were no need.

Fixes golang/go#26815

Change-Id: I655fb858ffff03a0d542aa9bf97eefc7a22dd5d0
Reviewed-on: https://go-review.googlesource.com/127758
Reviewed-by: Hyang-Ah Hana Kim <hyangah@gmail.com>
2018-08-06 14:06:43 +00:00
Elias Naur
56e3592fa7 internal/mobileinit,app: declare C symbols static
The changes to internal/mobileinit fixes golang/go#26298; the
changes to the app package are only the easy pickings.

Fixes golang/go#26298

Change-Id: I1ac49c57e417b852cb5ab1bdcb18c73db8c4475a
Reviewed-on: https://go-review.googlesource.com/122897
Reviewed-by: Ian Lance Taylor <iant@golang.org>
2018-07-10 17:43:32 +00:00
Elias Naur
721e99406c internal/mobileinit,bind/java,app: don't treat jobject as a pointer
On Android, the JNI jobject type doesn't always contain a pointer.
Treating a non-pointer as a pointer can crash the runtime. Use
the more appropriate type uintptr instead.

Change-Id: I2b2049918d60226c4d23d6df0b10e68248d54bc2
Reviewed-on: https://go-review.googlesource.com/110256
Reviewed-by: Brad Fitzpatrick <bradfitz@golang.org>
2018-04-30 16:43:58 +00:00
Elias Naur
29776d85b2 app: support importing the package for bind programs
Delay loading of the getRune method ID to the first GoNativeActivity
is created. That way, importing golang.org/x/mobile/app will not
crash, even for gomobile bind programs that don't include (or use)
GoNativeActivity.

Fixes golang/go#24490

Change-Id: I4bf90e067700451f7c026e53165b6614366d7a94
Reviewed-on: https://go-review.googlesource.com/104395
Reviewed-by: Hyang-Ah Hana Kim <hyangah@gmail.com>
2018-04-05 18:30:20 +00:00
Elias Naur
3a7f1138ab app,exp/gl/glutil: add missing build directives
For some reason, the changes to the build tags that was supposed to
go in with CL 102915 didn't make it.

Fixes golang/go#24644

Change-Id: I106b3c71fef1088dd1eea193323c13d81e5985fa
Reviewed-on: https://go-review.googlesource.com/104355
Reviewed-by: Hyang-Ah Hana Kim <hyangah@gmail.com>
2018-04-03 15:03:16 +00:00
Elias Naur
54bca60619 app,cmd/gomobile,exp/gl/glutil: support target architectures for iOS build and bind
While we're here, add 386 to the list of supported architectures
on iOS.

To support gomobile build for amd64 and 386, use the "ios" tag to
distinguish between iOS and macOS builds.

Change-Id: Ie09a432794bd8d9853950115349f8d3b57cf43f5
Reviewed-on: https://go-review.googlesource.com/102915
Reviewed-by: Hyang-Ah Hana Kim <hyangah@gmail.com>
2018-03-28 15:26:55 +00:00
Elias Naur
23253814e8 app: skip failing TestAndroidApp test
Updates golang/go#23835

Change-Id: If4aea8fde3b6b66980573d94f0d2189396f6a50c
Reviewed-on: https://go-review.googlesource.com/93997
Reviewed-by: Hyang-Ah Hana Kim <hyangah@gmail.com>
2018-02-21 20:06:47 +00:00
Daniel Skinner
8ab5dbbea1 event/size: document size pt approximation
Fixes golang/go#13366

Change-Id: I2af5e2492450ab5b5996fa5926460b62ce9d9bf5
Reviewed-on: https://go-review.googlesource.com/24865
Reviewed-by: Nigel Tao <nigeltao@golang.org>
2016-08-04 01:15:58 +00:00
Nigel Tao
3465f91246 app: change default window size to 600x800, on desktop.
The 3:4 aspect ratio is more phone-like than the 1:1 400x400.

Change-Id: Ifbc800b853159ea9eb4f255cb0acad2b34996ce6
Reviewed-on: https://go-review.googlesource.com/24143
Reviewed-by: David Crawshaw <crawshaw@golang.org>
2016-06-16 23:44:42 +00:00
Hyang-Ah Hana Kim
74ee969d3f cmd/gomobile: add support for android/arm64
forked from https://golang.org/cl/20434

- added app/internal/callfn package update.

- changed hashes.go because -for some reason- the generated hashes don't match.

- build_androidapp.go had to be changed to deal with openal package.

Fixes golang/go#10743

Change-Id: Iaa3f55d80c5fd184338d27832dc5c90cb772bd6a
Reviewed-on: https://go-review.googlesource.com/20707
Reviewed-by: David Crawshaw <crawshaw@golang.org>
Reviewed-by: Elias Naur <elias.naur@gmail.com>
2016-03-14 23:00:38 +00:00
Daniel Skinner
39fb9d6163 app: remove incorrect call to AInputQueue_detachLooper
Native activity callback onInputQueueCreated does not attach
a looper to the input queue within android.c. Various examples
of first detaching looper on the web are based around use of
native_app_glue_code which does attach a looper before passing
on to user callback.

Calling detachLooper pre-5.0 results in a crash. I didn't track
down exact source for this but code that likely made it's way
into 5.0 given the time frame can be seen to show a recast of
and iter over size() of a container.

This possibly explains the lack of crashing for 5.0+ instead of
potentially referencing a null pointer pre-5.0.

Fixes golang/go#13741

Change-Id: Ie04de9f34436a95c456a56b34f1ca7e6adc00b09
Reviewed-on: https://go-review.googlesource.com/20145
Reviewed-by: Nigel Tao <nigeltao@golang.org>
2016-03-02 23:58:37 +00:00
Nigel Tao
74f88983e7 app: fix shiny build.
Fixes golang/go#14401.

Change-Id: Id8bbc69e8dcb397094c165e97946d4d2688f34ad
Reviewed-on: https://go-review.googlesource.com/19872
Reviewed-by: David Crawshaw <crawshaw@golang.org>
2016-02-25 00:29:21 +00:00
David Crawshaw
b4e66eeef7 app: remove iOS system draw loop
Much like the recent change for OS X, this puts the Go paint loop in
control of drawing onto the screen.

Change-Id: I37321e4bb58869d4c7cafc51951ea64e540d536b
Reviewed-on: https://go-review.googlesource.com/15611
Reviewed-by: Hyang-Ah Hana Kim <hyangah@gmail.com>
2016-01-11 18:20:11 +00:00
Hyang-Ah Hana Kim
aebde7cd7d app/internal/callfn: allow android/386,amd64
For golang/go#10743

Change-Id: I374fae9d6e0a7926b26647fe462968df3c0e3298
Reviewed-on: https://go-review.googlesource.com/17679
Reviewed-by: David Crawshaw <crawshaw@golang.org>
2016-01-08 08:14:44 +00:00
David Crawshaw
54b4a066d7 gl: add a comment for linux installation
OpenGL ES is not installed by default on linux distributions, which
can lead to a cryptic error. Add a comment after the #include
mentioning what packages contain OpenGL ES on Ubuntu, which is
helpfully printed in the error message. For example:

	$ go build golang.org/x/mobile/example/basic
	# golang.org/x/mobile/gl
	In file included from ../../mobile/gl/work.go:21:0:
	work.h:6:117: fatal error: GLES2/gl2.h: No such file or directory
	 #include <GLES2/gl2.h> // install on Ubuntu with: sudo apt-get install libegl1-mesa-dev libgles2-mesa-dev libx11-dev

Change-Id: Ia7ba583cee4dfdeed408f582b29da90de9a4fab3
Reviewed-on: https://go-review.googlesource.com/18058
Reviewed-by: Hyang-Ah Hana Kim <hyangah@gmail.com>
2016-01-07 20:14:32 +00:00
nobonobo
48c96a5e62 x/mobile/app: panic with palm touch on iOS app
improved a problem that continues to maintain a touch-ID
that must be discarded by 'touchesCanceled' event.

Fixes golang/go#13435

Change-Id: I13635255e5317bba2202bf7a8d2dd957f7824d0a
Reviewed-on: https://go-review.googlesource.com/18180
Reviewed-by: David Crawshaw <crawshaw@golang.org>
2016-01-07 19:21:52 +00:00
Shenghou Ma
0a85ca5e85 x/mobile/app: fix doc typo
Change-Id: I108b8d80eb1fee120e7b710ee7dcdbca7ff158c3
Reviewed-on: https://go-review.googlesource.com/18122
Reviewed-by: Ian Lance Taylor <iant@golang.org>
2015-12-25 00:41:33 +00:00
David Crawshaw
6c7eb6c445 app: add shiny backend
Combined with the outstanding shiny CLs and prebuilt ANGLE dlls in the
right place, this makes it possible to run example/basic on a windows
machine.

Eventually this shiny backend will also replace the app package's
custom darwin_amd64 and linux_x11 backends.

For golang/go#9306

Change-Id: Ia4bf9a85b9d903d79cee36abb470a0ad57f09f36
Reviewed-on: https://go-review.googlesource.com/17777
Reviewed-by: Hyang-Ah Hana Kim <hyangah@gmail.com>
2015-12-15 18:31:03 +00:00
Daniel Skinner
3b97f7024e cmd/gomobile: synthesize minSdkVersion for manifest
Fixes golang/go#13172

Change-Id: I16cab3f74f668ce3522a1a14c979aca5c988347c
Reviewed-on: https://go-review.googlesource.com/16843
Reviewed-by: David Crawshaw <crawshaw@golang.org>
2015-11-13 09:00:34 +00:00
Hyang-Ah Hana Kim
5c6636dcb9 app: fix x11.go broken after cl/15460.
Fixes golang/go#12911

Note: the x11 support seems outdated in general compared to
android, darwin versions.

Change-Id: I2a80215c62b8c3cf87c5eb054184fea10819abc9
Reviewed-on: https://go-review.googlesource.com/15790
Reviewed-by: David Crawshaw <crawshaw@golang.org>
2015-10-12 22:02:50 +00:00
David Crawshaw
7fe809f8e0 event/paint: mark paint events sent by the system
A paint.Event now has an External field. Whenever a paint event is
sent by the x/mobile/app package, it is marked as external so users
with an active paint loop can ignore them.

Implemented on OS X and Android, with examples updated.

Change-Id: Ibee8d65625c8818ff954936be48257ad30daa147
Reviewed-on: https://go-review.googlesource.com/15480
Reviewed-by: Hyang-Ah Hana Kim <hyangah@gmail.com>
2015-10-07 19:41:52 +00:00
David Crawshaw
0d45604e75 app: remove OS X display link timer
The CGL display link is a timer keyed on screen refresh rate. It made
sense to use it when the app package controlled the screen paint
cycle. Now that the paint cycle control has moved to the user, and
given that we have always made the equivalent of Publish block until
vsync, it is just complicating matters. The user can come up with
their own timer, and safely dedicate a goroutine to event handling
that paints as fast as it likes without running over the vsync time.

A version of this for iOS will follow (giving up on the timer provided
by GLKViewController) when I get my iOS setup working again.

(Note there is also a bug in the way drawgl works presently. This CL
doesn't fix the bug, but is a first step in untangling the draw loop
so I can fix it.)

Change-Id: I464d5b15f018527d98b792026fb3899681f24e4b
Reviewed-on: https://go-review.googlesource.com/15470
Reviewed-by: Hyang-Ah Hana Kim <hyangah@gmail.com>
2015-10-07 17:45:10 +00:00
David Crawshaw
8a578fa6ca app: move glctx into app.App
Also move the initialization of glctx to an init function, removing
the data race mentioned in golang/go#12718. (Unfortunately the data
race is not the cause of the bug.)

Change-Id: If5f1fd7755d5645cf25ccc780ee8d138011c8f10
Reviewed-on: https://go-review.googlesource.com/15460
Reviewed-by: Hyang-Ah Hana Kim <hyangah@gmail.com>
2015-10-06 17:24:55 +00:00
Paul Hankin
c846a131a8 testapp: Use methods of gl.Context rather than package-level OpenGL calls.
The package-level OpenGL calls in golang.org/x/mobile/gl were removed.
This change fixes testapp to use their replacement.

This change also moves the location of the test taps to be further away
from the top of the screen. On my phone (running L), a tap at 50,60 is
opens the draggy menu thing that Android has and the running app doesn't
see it (which causes the test to not complete).

Change-Id: I679c9b61919a332f9b4a53e0950ff96f6aefbbbb
Reviewed-on: https://go-review.googlesource.com/15050
Reviewed-by: David Crawshaw <crawshaw@golang.org>
2015-09-27 12:25:12 +00:00
David Crawshaw
59ab51f73f gl: move to context methods
All OpenGL functions are now methods on a Context interface. The
gl.Context matches the one loaded into thread-local storage in C.

For mobile apps, the context is owned by an app.App. For now, it is
provided through the events channel on a lifecycle event. Long-term,
it should probably be available by a method on app.App, but this is
inherently racey with our current use of a channel to deliver events.

Shiny-based programs will have a gl.Context associated with a each
shiny.Window. The expectation is each Window will have different
contexts, allowing them to draw separately.

Change-Id: Ie09986fb74e493129f2ea542a151c95c6fa29812
Reviewed-on: https://go-review.googlesource.com/13431
Reviewed-by: Nigel Tao <nigeltao@golang.org>
2015-09-23 23:46:16 +00:00
Nigel Tao
5291eb5e09 app: fix broken build.
Change-Id: I9c41f81bc287679cce5372f3aaf0b14a406eebd2
Reviewed-on: https://go-review.googlesource.com/14864
Reviewed-by: Nigel Tao <nigeltao@golang.org>
2015-09-23 09:47:24 +00:00
David Crawshaw
9e848912c3 app: turn filtering functions into methods on App
Change-Id: I69a6ac9930303945bd2d69a1995f28021bb3b0b0
Reviewed-on: https://go-review.googlesource.com/14796
Reviewed-by: Nigel Tao <nigeltao@golang.org>
2015-09-23 05:17:31 +00:00
Nigel Tao
afa8a11c1d app: re-use the input queue goroutine.
We now have one such goroutine for the life of the process, not one per
onInputQueueCreated call (e.g. whenever the app re-gains visibility).

Also use ALooper_wake instead of rolling our own os.Pipe.

Change-Id: I4fa045972289144e083033f2e243cac65f35ee46
Reviewed-on: https://go-review.googlesource.com/14670
Reviewed-by: David Crawshaw <crawshaw@golang.org>
2015-09-18 00:19:08 +00:00
David Crawshaw
9b7eb80c57 app: skip android test if no device attached
Change-Id: Ie2c81af6cb380ae22d285d0f274755ec421e8d6a
Reviewed-on: https://go-review.googlesource.com/14653
Reviewed-by: Hyang-Ah Hana Kim <hyangah@gmail.com>
2015-09-17 16:14:44 +00:00
Nigel Tao
ef84e0538a app: remove unused windowCreated channel.
Change-Id: Iabe5a9d346ee54ddc4f39475606d262f581b5c63
Reviewed-on: https://go-review.googlesource.com/14667
Reviewed-by: Nigel Tao <nigeltao@golang.org>
2015-09-17 03:25:18 +00:00
Nigel Tao
4c15c79e19 app: change EndPaint to Publish.
More than a name change, the painting model changes so that the app, not
the library, is responsible for driving painting. If the app is
animating and wants paint events at 60 Hz, it has to ask for that. If
the app is not animating and doesn't need to update its screen, it
shouldn't get any paint events.

Plenty of TODOs, and this CL doesn't get us to a perfect place, but it
is a checkpoint along the way.

The darwin_*.go code changes were minimal. I don't even have a Mac or
iOS device to test that this even builds. Even so, the TODOs about not
sending paint.Events unconditionally are important TODOs. That's the
whole point of switching to this model. I'll leave the actual
implementation to you (crawshaw).

Out of all the example apps, the change to example/network/main.go is
probably the most interesting.

It seems like there ought to be some way to reduce the copy/paste
between all of the example app code, but I'll leave that for future CLs.

Change-Id: I17e11c06174110c68e17f7183b2d8af19b6a170e
Reviewed-on: https://go-review.googlesource.com/14300
Reviewed-by: David Crawshaw <crawshaw@golang.org>
2015-09-17 03:17:09 +00:00
Nigel Tao
11f6745c3d app: process input and other events concurrently, not consecutively.
Previously, we did:

for {
  processEvents() // Process any pending Android input events.
  select {        // Select Go events (channel send/receives).
  etc
  }
}

The problem was that if you were blocked on the select because there
were no incoming Go events, then you weren't reading new input events,
and the UI could block indefinitely.

After this CL, input events are processed in a dedicated goroutine,
where it's fine for

for C.AInputQueue_getEvent(q, &e) >= 0 { etc }

to block, and the main loop deals only with Go channels:

for {
  select {
  etc
  }
}

Change-Id: I8ec27a40e220b1d95a6b6fc14347a59833ccfdc8
Reviewed-on: https://go-review.googlesource.com/14500
Reviewed-by: David Crawshaw <crawshaw@golang.org>
2015-09-17 03:05:17 +00:00
David Crawshaw
eadadb8667 internal/mobileinit: standardize JNIEnv* access
Replace the direct access to JavaVM* and the global android Context
instance with a function responsible for running attached correctly
to the JVM. This saves having to replicate the logic for attaching an
OS thread to the JVM. While here, check for any unhandled Java
exceptions.

This supersedes cl/11812.

Change-Id: Ic9291fe64083d2bd983c4f8e309941b9c47d60c2
Reviewed-on: https://go-review.googlesource.com/14162
Reviewed-by: Nigel Tao <nigeltao@golang.org>
2015-09-14 17:30:52 +00:00
David Crawshaw
9308ad61ea app: android key code mapping to USB HID codes
Change-Id: I1225f51fd06a5f9a9f0fdf09096982df761b5a51
Reviewed-on: https://go-review.googlesource.com/13678
Reviewed-by: Nigel Tao <nigeltao@golang.org>
2015-08-19 14:09:33 +00:00
David Crawshaw
377063dfa4 app: plumbing for physical android key events
This is only the first half of physical key event mapping. The
modifiers and hardware key codes will be in a followup CL. I'm
splitting this out because it covers two other parts of the problem:
first is maintaining a JNIEnv pointer for the main routine, the
second is access to the Android unicode key map. The NDK does not have
a method to give us the key mapping, so we get to it via
GoNativeActivity.

Tested with a USB keyboard. I'll attempt an abd-based unit test later,
but I suspect it will be difficult to set a device ID.

Change-Id: Ie93700d1f2a5d382a9b17cdd668cb4acaa6e4bcc
Reviewed-on: https://go-review.googlesource.com/13649
Reviewed-by: Hyang-Ah Hana Kim <hyangah@gmail.com>
2015-08-18 13:10:55 +00:00
David Crawshaw
0cfb79fc77 app: test painting using a screenshot
Also catches any bugs that cause painting to lock up after
rotation (of which there have been many).

Change-Id: I3783030efd2c342afebf2b861e9e9dc32e96f659
Reviewed-on: https://go-review.googlesource.com/13616
Reviewed-by: Hyang-Ah Hana Kim <hyangah@gmail.com>
2015-08-17 16:26:32 +00:00
David Crawshaw
99aacab40d app: attach main thread to the JNI
Ran into this while working on keyboard events. I'm a little surprised
this hasn't been a problem so far -- my understanding of the NDK
functions for working with a NativeActivity is that the require you
hold a valid JNI context before calling them.

Change-Id: Ifd322ef5e8406df648d1a8f667e5ce08ffef954d
Reviewed-on: https://go-review.googlesource.com/13648
Reviewed-by: Hyang-Ah Hana Kim <hyangah@gmail.com>
2015-08-17 14:38:43 +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
David Crawshaw
ec91477003 app: mention wiki docs in app package docs
Change-Id: I5fc7fe86f47e117e2b09dd16d7a588374b32dd66
Reviewed-on: https://go-review.googlesource.com/13611
Reviewed-by: Hyang-Ah Hana Kim <hyangah@gmail.com>
2015-08-12 16:21:36 +00:00
Nigel Tao
4ee6e2bd6d app: fix s/spaces/tabs/.
Change-Id: I795a82a8549d250fb9ca33134248fb4ff12bd0a0
Reviewed-on: https://go-review.googlesource.com/13491
Reviewed-by: David Crawshaw <crawshaw@golang.org>
2015-08-12 04:16:58 +00:00
David Crawshaw
c2f4676407 app: fix X11 build
Change-Id: Ida7cd57eefac66bcff89720ac5c82015d1d37f00
Reviewed-on: https://go-review.googlesource.com/13540
Reviewed-by: Jeffrey Regan <jregan@google.com>
Reviewed-by: David Crawshaw <crawshaw@golang.org>
2015-08-11 19:16:57 +00:00
David Crawshaw
0f9ce16152 app: plumb through android orientation
While I'm here, make pixelsPerPt local on android and darwin/amd64.
The one place where it's global is darwin/arm, which has another
similar global (screenScale).

Change-Id: I5897e7e5341afca1976fdf0215fb4f6fe2f411be
Reviewed-on: https://go-review.googlesource.com/13446
Reviewed-by: Nigel Tao <nigeltao@golang.org>
2015-08-11 15:19:09 +00:00
David Crawshaw
354679495a app: always send paint event when bumping gen
When the generation number is bumped, the <-endPaint case will drop
any old paints. So if a new paint isn't sent to replace it, the app
locks up.

This is a bug that looks like it crept into cl/12533 just before it
was submitted. (Sorry.) I'm working on tests as part of adding
android orientation support.

Change-Id: I6b62bdc6774e090b67a5577c3eae7355e3937894
Reviewed-on: https://go-review.googlesource.com/13445
Reviewed-by: Nigel Tao <nigeltao@golang.org>
2015-08-11 14:52:42 +00:00