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>
Also, fixes the memory allocation bug - misuse of mem_ensure that caused
to allocate 72 bytes of memory to carry 16 bytes of data for instance.
Fixesgolang/go#11842.
Change-Id: I21798be2ec7adfb68cc2897bb46a924f05f3478c
Reviewed-on: https://go-review.googlesource.com/12577
Reviewed-by: David Crawshaw <crawshaw@golang.org>
mem_ensure is to ensure the remaining space in buffer
is large enough to hold extra size bytes. We've been passing
the target capacity instead of the number of extra bytes we
need.
Change-Id: Ic6f6ddb4ad22cbcdbc44eb4a58e6a415ae771fb2
Reviewed-on: https://go-review.googlesource.com/12578
Reviewed-by: David Crawshaw <crawshaw@golang.org>
Finding the revision info from compiled binary (gomobile) built with
'go get' is not currently possible. What we can do instead is to check
if the current mobile repository found from GOPATH builds the same
binary by running 'go install -x -n' and checking if it outputs any
output. If so, this command prints out the revision info of the
repository. Otherwise, prints 'unknown'.
Sample output:
./gomobile version
gomobile version +27329c5 Wed Jul 22 19:29:08 2015 -0400 (android,ios);
androidSDK=/Users/hakim/Library/Android/sdk/platforms/android-22
./gomobile version
gomobile version unknown
Change-Id: Idc26c8a1dd3b43cc47a5c15ce130e2b97a460cec
Reviewed-on: https://go-review.googlesource.com/12455
Reviewed-by: David Crawshaw <crawshaw@golang.org>
The property was only introduced in 10.10, and doesn't offer us
anything more than what the method gives us.
Fixesgolang/go#11827.
Change-Id: I5a9f9b068b9f18acc85a68a37dae11f19df686a1
Reviewed-on: https://go-review.googlesource.com/12552
Reviewed-by: Andrey Petrov <shazow@gmail.com>
Reviewed-by: Hyang-Ah Hana Kim <hyangah@gmail.com>
Currently version 0.2.1
I messed up previous versions and plugins.gradle.org doesn't let me
remove the bad versions.
Change-Id: I9eef512633b461ff5a7fcbe11a3e104efb250d61
Reviewed-on: https://go-review.googlesource.com/12538
Reviewed-by: David Crawshaw <crawshaw@golang.org>
non-varargs call of varargs method with inexact argument type for last
parameter
Change-Id: I7623951c365b8cf899a17ee784c8d4f3b4bdb198
Reviewed-on: https://go-review.googlesource.com/12528
Reviewed-by: David Crawshaw <crawshaw@golang.org>
First cut of events from physical keyboards.
Simple darwin/amd64 implementation.
Change-Id: I6e9d0a253387c841864ca9845ee729ea4f7573c7
Reviewed-on: https://go-review.googlesource.com/11815
Reviewed-by: Nigel Tao <nigeltao@golang.org>
EGL is a poor source of window dimensions. On some fraction of
rotations, it reported the old dimensions. Switch to extracting the
data from ANativeWindow, which appears to be more reliable.
While here, plumb through orientation, and follow the recommendation
in the Android platform docs to block onNativeWindowRedrawNeeded
until the draw is complete.
Fixesgolang/go#11741.
Change-Id: I6b29b6a1e5743c612c9af2a8cce4260c5d7e9ca6
Reviewed-on: https://go-review.googlesource.com/12381
Reviewed-by: Nigel Tao <nigeltao@golang.org>
iOS builds have been broken due to missing main executable. Xcode
doesn't complain and buildling the target .app bundle even if a
referenced objects doesn't exist.
Fixing .app builds and adding a unit test.
Change-Id: Ie9aec6c8c982a96c10bf07344e44bd501fcabd19
Reviewed-on: https://go-review.googlesource.com/12492
Reviewed-by: Hyang-Ah Hana Kim <hyangah@gmail.com>
If the application main package is in
golang.org/x/mobile/example/basic
the generated application will have "Basic" as its name.
Change-Id: Ic59fae6e18c26e406ab352265aa2d6b11619c102
Reviewed-on: https://go-review.googlesource.com/12435
Reviewed-by: David Crawshaw <crawshaw@golang.org>
This change allows the example/network from gomobile to compile
correctly.
Change-Id: Id0f722796e0224ec4a7c06b163a25a4f3a5fbcb3
Reviewed-on: https://go-review.googlesource.com/12471
Reviewed-by: Hyang-Ah Hana Kim <hyangah@gmail.com>
Tested manually, I can bind github.com/hyangah/ivy and include it
in an Xcode project.
Change-Id: I7dfa7828da7288841bc930d3e506ee97bf2ca520
Reviewed-on: https://go-review.googlesource.com/12388
Reviewed-by: Hyang-Ah Hana Kim <hyangah@gmail.com>
Tested:
go test golang.org/x/mobile/bind/java
gomobile bind -target={ios,android} github.com/hyangah/ivy
gobuild build -target={ios,android} golang.org/x/mobile/example/basic
(With various takes on -x and -v.)
Change-Id: I15c8f605490381feb6fefb482110f2a1c210529d
Reviewed-on: https://go-review.googlesource.com/12411
Reviewed-by: Hyang-Ah Hana Kim <hyangah@gmail.com>
Allows the use of -X, and similar flags.
Fixesgolang/go#11645.
Change-Id: I0ca097059f5f70c277c79eb89f2cbb10890db802
Reviewed-on: https://go-review.googlesource.com/12333
Reviewed-by: Hyang-Ah Hana Kim <hyangah@gmail.com>
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>
The go command now has a -pkgdir flag, which specifies a directory
for all install output, including the standard library. Use it to
build the mobile compilers under $GOMOBILE, so that targets like
the iOS simulator (darwin/386) do not conflict with system targets.
The result is we no longer need GOROOT to be writable.
The iOS simulator now works with gomobile bind.
Fixesgolang/go#11342.
Change-Id: I0bc6378e0cb82e3175b2a1efe355e3ce39533649
Reviewed-on: https://go-review.googlesource.com/12303
Reviewed-by: Hyang-Ah Hana Kim <hyangah@gmail.com>
First pass at bind support, simply produces .a/.h files.
In future CLs:
- Take the type defintion from seq.h and place it directly in the
generated header, breaking the user's dependency on seq.h.
Open question for future CLs:
- Should we create a framework directory?
If we bundle assets in the directory, can the asset package
find them automatically?
In 1.6: support multiple archives.
Change-Id: I7c3f655e7653018333e3ce3c89807edfcf62906d
Reviewed-on: https://go-review.googlesource.com/12199
Reviewed-by: Hyang-Ah Hana Kim <hyangah@gmail.com>
This allows gomobile bind to stop copying seq.h to the destination.
Change-Id: I4a23613fe0407500ad483ae9d8f6bb823d82f082
Reviewed-on: https://go-review.googlesource.com/12300
Reviewed-by: David Crawshaw <crawshaw@golang.org>
The gl package is not safe for concurrent use.
Change-Id: Ib0e7908746ea3a6520b2ce2f5d8aa7233ab2642c
Reviewed-on: https://go-review.googlesource.com/12165
Reviewed-by: David Crawshaw <crawshaw@golang.org>
Now that we no longer modify the user's $GOROOT and run make.bash,
the need for isolating the environment is gone. Pass through
whatever users want, overriding only those necesssary for corss
compilation.
While here, remove some dead code.
Fixesgolang/go#11672.
Change-Id: Iaf867913eaa1311519a4d5a7a8169228ebf21346
Reviewed-on: https://go-review.googlesource.com/12128
Reviewed-by: Hyang-Ah Hana Kim <hyangah@gmail.com>
If a frame draw cycle does not end in a blocking GL call,
then the app package may process the <-endDraw before the
final <-gl.WorkAvailable, meaning some GL calls miss the
frame.
So we make sure the final GL call for a frame is blocking.
Fixesgolang/go#11696.
Fixesgolang/go#10688.
Change-Id: I39772a3308c98947b1f0838ad58d1d406a711e7f
Reviewed-on: https://go-review.googlesource.com/12123
Reviewed-by: Nigel Tao <nigeltao@golang.org>
Note that darwin/386 is no longer released by the Android NDK.
Change-Id: Ie9d5105884db45a10716637980e8352c855293a0
Reviewed-on: https://go-review.googlesource.com/12121
Reviewed-by: Hyang-Ah Hana Kim <hyangah@gmail.com>
Subclassing NativeActivity makes two things possible. Firstly, we can
implement an InputConnection to offer good support for IMEs,
necessary for good keyboard support. Secondly, we can use it to
overlay WebViews onto the NativeActivity.
But to sublcass NativeActivity, we need to compile Java. To keep the
toolchain go gettable, this is done with go generate.
While here, check the exception after FindClass. Apparently it can
throw an exception.
Updates golang/go#9361.
Updates golang/go#10247.
Change-Id: I672545997f0c9a7580f06988a273c03404772247
Reviewed-on: https://go-review.googlesource.com/11980
Reviewed-by: Hyang-Ah Hana Kim <hyangah@gmail.com>
The goal here is to remove several inconsistencies between
-target=android and -target=ios support, along with making the flow
of the command follow the path you might expect given a certain set
of flags, and preparing for `gomobile bind` support of ios. In
particular, building non-main packages now works with both targets
and the initialization of global build state is clearer.
The reorg also is designed around an nm trick I thought of
yesterday to do better package import scanning without a slow
all-file scan. This will give better detection of x/mobile/app and
x/mobile/exp/audio/al packages. There's a TODO about it, and I'll do
it in a future CL.
Tested with:
go test golang.org/x/mobile/cmd/gomobile
gomobile init
gomobile bind golang.org/x/mobile/asset
go test golang.org/x/mobile/bind/java
gomobile build -target=ios golang.org/x/mobile/example/basic
gomobile build -target=ios golang.org/x/mobile/gl
gomobile build -target=android golang.org/x/mobile/gl
gomobile build -target=android golang.org/x/mobile/example/basic
(Along with manual testing of basic on an android device.)
That might make a pretty good _test.go.
Change-Id: I41230008c3c15db25a11c33b9eaca4abada9f411
Reviewed-on: https://go-review.googlesource.com/12051
Reviewed-by: Hyang-Ah Hana Kim <hyangah@gmail.com>
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>
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.
Fixesgolang/go#11385.
Change-Id: I662f70e49d12833a545005cf0724cc21f67bea09
Reviewed-on: https://go-review.googlesource.com/12001
Reviewed-by: Nigel Tao <nigeltao@golang.org>
CL 11981 changed the Android logcat prefix from "GoLog" to "GoStdio".
Revert the prefix to "GoLog".
Also remove a global variable left unused by CL 11981.
Change-Id: I500313652cd618d8573640d5165e5069a0ba0ba7
Reviewed-on: https://go-review.googlesource.com/11991
Reviewed-by: David Crawshaw <crawshaw@golang.org>
Android support has advanced to the point where this logging statement
adds very little information.
Change-Id: I3c8c9d60be8c0b52a519f9e44711bd211b5bfe67
Reviewed-on: https://go-review.googlesource.com/11990
Reviewed-by: Hyang-Ah Hana Kim <hyangah@gmail.com>