• Home
  • History
  • Annotate
  • only in /frameworks/base/opengl/java/android/opengl/
History log of /frameworks/base/opengl/java/android/opengl/
Revision Date Author Comments (<<< Hide modified files) (Show modified files >>>)
fd3cee138e24f6fa84db89a936eb7381a8673fe9 18-Apr-2016 John Reck <jreck@google.com> Make surfaceRedrawNeeded forgiving

Fixes: 27071678

It's semi-common for apps to not realize surfaceRedrawNeeded
is a callback they can (and should) be handling, so have it be
more tolerant in lifecycle handling.

Specifically allow a renderer to have not yet been set on
GLSurfaceView, even though it was supposed to have been set already.
Apps are overriding the other lifecycle methods that require this
(created, changed, an destroyed) but not noticing this method.

Change-Id: I6cebca541eeec6e9949bdb55f687b095768a17b2
LSurfaceView.java
86a27f343cd0c1bf5854aca4af6311faef45342f 29-Feb-2016 Pablo Ceballos <pceballos@google.com> Merge "Fix glGetTransformFeedbackVarying JNI" into nyc-dev
68981ff03b2c166800ddc82973a2aa95269a343b 22-Feb-2016 Pablo Ceballos <pceballos@google.com> Add glReadPixels with buffer-offset argument

- For reading into PBOs on GLES3, add an overloaded version of
glReadPixels that takes an offset argument.

Bug 18878609

Change-Id: I744483deab6358a66b0dc5e87be1ae2b96560ac1
LES30.java
59fb43e7bdc607f49b301644e4300485f352b103 30-Jan-2016 Pablo Ceballos <pceballos@google.com> Fix glGetTransformFeedbackVarying JNI

- Deprecate the broken version that takes a byte argument.
- Implement a new version that takes a byte buffer argument.

Bug 19478262

Change-Id: I5ea4f11940e93b5964b66dbf5700b7ff8b80339e
LES30.java
d4393b28978e45f67ace6530338c01ef647fada6 26-Jan-2016 Robert Carr <racarr@google.com> Fix reentrant deadlock in GLSurfaceView.

It is possible for clients to call SurfaceView
methods e.g. setFormat from the GLSurfaceView#Renderer
drawFrame callback. In this case, SurfaceView#updatewindow
will understand that a redraw is required, and will request
it back to GLSurfaceView. Remember, we are still on the GLThread
though (from the drawFrame callback). So these methods
(requestRenderAndWait, windowSizeChanged), need to be reentrant.
Also fix a data race around mWantRenderNotification, which was
accessed out of lock.

Bug: 26770615
Change-Id: Ic66a36c886ae0b085dd456a4220f0d4f270fb016
LSurfaceView.java
2b3bf720bf28584f700ad8ebb5e8e31a0e466f29 08-Jan-2016 Robert Carr <racarr@google.com> Implement surfaceRedrawNeeded for GLSurfaceView

GLSurfaceView was not supporting the surfaceRedrawNeeded protocol
which leads to issues with report draw. Thus far this has mostly
been fine as the main surface will not render
a transparent hole until the SurfaceView has finished drawing. However
in the case of SurfaceView replacement the hole in the parent surface
will be preexisting and we must be able to tell that our new SurfaceView
has actually drawn before removing the replacee. This is part of a
series of fixes to 26070641.

Bug: 26070641
Change-Id: Iecc16647f9979aa057449e8bafa540885881ed64
LSurfaceView.java
38c1a7e732660212687cf375f5e5ed354b91e431 30-Oct-2015 Pablo Ceballos <pceballos@google.com> Add GLES32 class and JNI

Change-Id: I05ff0c14a35f51c2015edbd762dc9e6fe43347b9
LES31.java
LES32.java
dce45fd66b403ab861dad5f27535785d87fa3028 27-Oct-2015 Pablo Ceballos <pceballos@google.com> Merge "Add missing OpenGLES 3.1 bitfield constants."
a4d4e82927ceadc23863e74b7e1160e4497504a7 05-Oct-2015 Pablo Ceballos <pceballos@google.com> Remove GLTrace support

GLTrace is defunct, it does not support newer GL features, breaks
security requirements, and has no supported tooling now that Eclipse
is at end of life.

Bug 22329852

Change-Id: I64c58464f8c2c7ae6125f5d5c7884e3fd34d68ea
LUtils.java
3cdc93c6b48e751eeceb844e682f6d852dabf364 30-Sep-2015 Pablo Ceballos <pceballos@google.com> Add missing OpenGLES 3.1 bitfield constants.

Bug 23892570

Change-Id: I92c7bb9bafb84259bdc42927193e989a6a95d4df
LES31.java
59b429d10678542756c1a9ba7acf900de3d41871 09-Jun-2015 Chris Craik <ccraik@google.com> Add tracing to GLSurfaceView

bug:21195272

Change-Id: I96bce6d6021fc720c73993202ba90997b0fc0e09
LSurfaceView.java
f4faeac3525fe1ce3707ab785a1651aec367589d 05-Mar-2015 John Reck <jreck@google.com> Cleanup Bitmap JNI attempt #2

Original version missed a spot

This reverts commit c02977e3bbfaaedcb1b1d67e1692becc7dddd59b.

Change-Id: I56244ce10d709fcdef42a001fe4c6ba7b6bbb04d
LUtils.java
c02977e3bbfaaedcb1b1d67e1692becc7dddd59b 05-Mar-2015 Chad Jones <chadj@google.com> Revert "Cleanup Bitmap JNI"

This reverts commit b2915245b74b3b5541b123e38403f8e26426b4b7.

Change-Id: Idd7d7f33eec4ea5024c83de6b10d3d1a6ab2b17a
LUtils.java
b2915245b74b3b5541b123e38403f8e26426b4b7 04-Mar-2015 John Reck <jreck@google.com> Cleanup Bitmap JNI

Fix a bunch of places where mNativeBitmap was being
poked at directly, switch them either to the NDK API
or to GraphicsJNI where it made sense

Change-Id: I6b3df3712d6497cba828c2d3012e725cb4ebb64d
LUtils.java
77e4a5250fc6df451999efe508f57968a44b603f 01-Oct-2014 John Reck <jreck@google.com> Re-allow suppressing onDetachedFromWindow

Bug: 17578553

Games seem to be doing this to prevent destruction of their
GL contexts, and they assume it works even if it doesn't. However,
GLSurfaceView is clunky here, so while the app is doing something
questionable we don't really offer a better way. For now revert
back to kitkat behavior.

Change-Id: Icfa9e496279b9cfa47f9bc7f6848d9313caed0d5
LSurfaceView.java
f47a594f5250b1914c36423ee6b371f0b8db09d0 01-Jul-2014 John Reck <jreck@google.com> Fix onTrimMemory for HardwareRenderer

Also fixes detachFunctor possibly drawing after return

Bug: 15189843
Bug: 15990672

Change-Id: I64c48cb674c461a8eeaba407b697e09f72c98ce3
anagedEGLContext.java
61b2dfe224db012ea9492738ac7ab5cb0629e6c0 20-May-2014 Jesse Hall <jessehall@google.com> opengl: Un-hide GLES31 and GLES31Ext classes

Bug: 15028495
Change-Id: Icda236ee12a06ef2eb9902253d272dee2b61f6ef
LES31.java
LES31Ext.java
7ab63acdd0a257272512d0bcf5e06036fa0b9fdf 20-May-2014 Jesse Hall <jessehall@google.com> opengl: Add GLES31 and GLES31Ext classes

Bug: 15028495
Change-Id: Ie967c1938060edb42864dd48efa668ae7bf5cd76
LES31.java
LES31Ext.java
4660c9e064ebaec9ebb260c2853a8dab868ccdc2 21-Apr-2014 Jesse Hall <jessehall@google.com> am 43cea7ea: am 650a8860: am fc3c6a0e: Merge "EGL_OPENGL_ES3_BIT_KHR is set as ES 3 context is requested."

* commit '43cea7eadbcb3930887eadfa3f278e1a666449d0':
EGL_OPENGL_ES3_BIT_KHR is set as ES 3 context is requested.
28a5c593577d6aef03d874b42ec0215c88f62bf4 21-Jan-2014 Jin Zhebin <zhebinx.jin@intel.com> EGL_OPENGL_ES3_BIT_KHR is set as ES 3 context is requested.

OpenGL ES have 3 configuration: 1(EGL10.EGL_RENDERABLE_TYPE),
2(EGL_OPENGL_ES2_BIT), 3(EGL_OPENGL_ES3_BIT_KHR). The driver
should be get the according configuration parameter.
Now 1 is set to driver when Configuration 3 is set from user.
Specification EGL_OPENGL_ES3_BIT_KHR is set to driver when a OpenGL
ES 3 context is requested in setEGLContextClientVersion().

Change-Id: I980d9d8dbe5754295f8329fcf9378962d669fa89
Signed-off-by: Jin Zhebin <zhebinx.jin@intel.com>
Signed-off-by: bdeng3X <bingx.deng@intel.com>
LSurfaceView.java
b14dfe20ef300c47cc5cdfbd844c21f7fd302f0c 06-Mar-2014 John Reck <jreck@google.com> Revert "Revert "Workaround apps not calling super.onDetachedFromWindow()""

This reverts commit bac16fae7e6fceb1e516252ede673844b772e7c3.

Change-Id: I61e997b23fac1aa984129fdc0328426ff8891bdd
LSurfaceView.java
bac16fae7e6fceb1e516252ede673844b772e7c3 06-Mar-2014 Bart Sears <bsears@google.com> Revert "Workaround apps not calling super.onDetachedFromWindow()"

Requested by jreck to fix the build.

This reverts commit 198d20842a537f3df3584ea084e74220e172b086.

Change-Id: I733065cc124b59bf914034f5bac5e2e951a5b604
LSurfaceView.java
198d20842a537f3df3584ea084e74220e172b086 06-Mar-2014 John Reck <jreck@google.com> Workaround apps not calling super.onDetachedFromWindow()

Bug: 13338698
Move the releasing of hardware resources to a new
@hide onDetachedFromWindowInternal

Change-Id: I52b4e6ba4d5b3ce20b89cabffa248d1d780e3e81
LSurfaceView.java
80009c029800fd343012ce55648ef9a21c139527 28-Feb-2014 Narayan Kamath <narayan@google.com> Fix bad link tag in javadoc.

Java7 javadoc tools seem to accept this without complaint
but not all targets use java7 yet.

Change-Id: Ib025d12550f5fd68edce5760747f9225a2be50c6
GLObjectHandle.java
1801b180dac364a25ef12a5af01ce0bb5a74a601 27-Feb-2014 Narayan Kamath <narayan@google.com> API changes for 64 bit platforms.

EGLObjectHandle.<init>(int) and int EGLObjectHandle.getHandle()
have now been deprecated and replaced with variants that take
and return java longs.

bug: 13181704
Change-Id: I67bef5fbf064e85205b8a85e00f91f4ffcf60d19
GLObjectHandle.java
e5f98941bad09f797329aeec090177e1da17220e 27-Feb-2014 Narayan Kamath <narayan@google.com> am 7aec4109: am 7aeb4307: am 2525acf5: am e4dae5f2: Merge "AArch64: Make eglGetDisplay(int) work for EGL_DEFAULT_DISPLAY"

* commit '7aec4109c53371e69bec111c69767810f45c301c':
AArch64: Make eglGetDisplay(int) work for EGL_DEFAULT_DISPLAY
64d38d9f4863f6e9434e6820b924eb958e8a2230 26-Feb-2014 Ashok Bhat <ashok.bhat@arm.com> AArch64: Make eglGetDisplay(int) work for EGL_DEFAULT_DISPLAY

Note that files changed in this patch have been automatically
generated by running frameworks/native/opengl/tools/glgen/gen
script

This will allow eglGetDisplay(int) to work on both 32-bit and
64-bit systems when EGL_DEFAULT_DISPLAY is passed as a parameter.

Change-Id: Idf27d6e00d623d331bb2d4d7f85fa450e0db26c9
Signed-off-by: Ashok Bhat <ashok.bhat@arm.com>
GL14.java
a77cf8735432daddb233164f41103a0ff38408bb 25-Feb-2014 John Spurlock <jspurlock@google.com> Merge "Tabs -> spaces in frameworks/base."
8a985d24ce9a38f40ed88fecbdcd0e75e3a68f44 25-Feb-2014 John Spurlock <jspurlock@google.com> Tabs -> spaces in frameworks/base.

Change-Id: I5a84e8e93ac99b5ed0212b37bf66efa5e53864be
LES10.java
LES10Ext.java
LES11.java
LES11Ext.java
LES30.java
58908b02f38b7bcf713664c76c6eaa732d1e8467 25-Feb-2014 Narayan Kamath <narayan@google.com> am d8410d38: am 614b00de: am a88abfb3: am 6ab07fac: Merge "Use long for pointers in opengl/EGL classes"

* commit 'd8410d38cf2eb133dab29aec722dce862584d115':
Use long for pointers in opengl/EGL classes
84bbeb9e0c9c185a22d4882b79e0bc8a598642ab 24-Feb-2014 Ashok Bhat <ashok.bhat@arm.com> Use long for pointers in opengl/EGL classes

Note that files changed in this patch have been automatically
generated by running frameworks/native/opengl/tools/glgen/gen script

This patch updates EGL classes in frameworks/base to support
64-bit platforms. Key changes in the EGL classes include

[x] EGLObjectHandle class - EGLObjectHandle class has two public
methods (constructor and getHandle) that assume handles are
32-bit. They have not been changed. Instead, two new hidden
methods (EGLObjectHandle(long) and getNativeHandle) have been
added.

[x] EG14 class - Two public methods eglGetDisplay and
eglCreatePbufferFromClientBuffer assume that handles are 32-bit.
They have been changed to throw unsupported operation exception
on non 32-bit machines. Two new methods eglGetDisplay(long)
and eglCreatePbufferFromClientBuffer(...long buffer..) have
been added to support 64-bit handles.

Change-Id: I9e0f064e5b33700eb0baa2e1841a21f931f7a765
Signed-off-by: Ashok Bhat <ashok.bhat@arm.com>
GL14.java
GLConfig.java
GLContext.java
GLDisplay.java
GLObjectHandle.java
GLSurface.java
9ba6ecb275d62ad363bda73856c0e75590a73c57 14-Feb-2014 Andy McFadden <fadden@android.com> Hide three malformed GL bindings

They were replaced with correct bindings a while back, but the
broken methods weren't hidden.

Bug 6006380

Change-Id: I3432d37a6bf411bbd2b3ea363749e32fcff28672
LES20.java
a0ab49bb52f44eac97f81117d6864edd6a2e0487 15-Dec-2013 Jesse Hall <jessehall@google.com> Merge "Fix incorrect name in eglSwapBuffers log wrapper"
544604098cce0648b82c9d3fa232cffcb2a902a7 11-Dec-2013 Brian Harris <brianh@nvidia.com> Fix incorrect name in eglSwapBuffers log wrapper

Correctly identify eglSwapBuffers in EGLLogWrapper, which had been
labeled as "eglInitialize".

Change-Id: I67c61e100e2f84400ceebc28712f036e5a055017
GLLogWrapper.java
066bdcfe83e49ad4bfb97670521c1b7e7297ba53 24-Jun-2013 Andy McFadden <fadden@android.com> Merge "Fix wrapper equals()"
a0175536383d77a5dd1908e73085752b1bf5a803 22-Jun-2013 Andy McFadden <fadden@android.com> Fix wrapper equals()

Make it faster and correcter.

Bug 9204146

Change-Id: Ieeb97b72005e831ec6b94fc24ed2c3bc03307c2a
GL14.java
GLConfig.java
GLContext.java
GLDisplay.java
GLExt.java
GLSurface.java
043d13ad4b67b57fa8ba1fa35f48ff5bcc0f0141 21-Jun-2013 Andy McFadden <fadden@android.com> Minor fixes to android.opengl.Matrix

This has a minor API change: deprecation of the nullary constructor.
The class is entirely composed of static methods, and was written
without a constructor, but the compiler dutifully generated a
default implementation and the API tool slurped it up.

The other changes are to the documentation:

- Added warnings about the use of overlapping input and output
on certain methods.
- Fixed a few inaccuracies (e.g. transposeM() returns a transposed
matrix, not an inverted matrix).
- Tidied up the formatting.
- Generally placated the consistency hobgoblins.

Bug 8868762

Change-Id: Ie3f86b98c477d8dc82d9dcaa311959bd4d191359
atrix.java
0c79d808cb66894434e78052c66a0f81e5419176 30-Apr-2013 Jesse Hall <jessehall@google.com> Add android.opengl.EGLExt class for EGL extensions

Add the ES-relevant constants from the EGL_KHR_create_context
extension. These allow apps to check which EGLConfigs (if any) support
ES3 contexts. Otherwise, the app has to create a context with an
EGLConfig and then check whether it is an ES2 or ES3 context.

Also move eglSetPresentationTimeANDROID from EGL14 to EGLExt, since it's an
extension function. It's new in API 18.

Bug: 8678160
Change-Id: I3cba6e59ebb0a3a4c4012aa54a36b940c288bcec
GL14.java
GLExt.java
f48b03296c715b18ffbb7393d5e71ea96eaae028 20-Apr-2013 Jeff Brown <jeffbrown@google.com> Revert all recent GLSurfaceView changes.

Several issues have been identified that will need to be
resolved carefully before we attempt to make similar changes.

1. Some applications make assumptions about the fact that all
Runnables posted with queueEvent() will be executed before
the next draw. Because the Choreographer may post messages
in the past (due at the frame time), these Runnables were
not always running at the expected time.

2. Some applications apparently hijack the GLThread and try
to run their own Looper on it. This obviously won't work
if we are already running one of our own.

We may need to add new rendering modes or target API checks
to provide an opportunity for applications to opt-in to the
changes in the future.

Bug: 8649804
Change-Id: I6289c3392a98cdbfaf28c7f4f7a8040f2138a3b4
LSurfaceView.java
8b60e4514702edd1eb4b6f2bfc027e04a94369c0 19-Apr-2013 Jeff Brown <jeffbrown@google.com> Fix change of behavior in Looper.quit().

It seems some applications rely on Looper.quit() terminating the
loop immediately without processing all messages. Rather than
risk breaking them, make the safer behavior optional.

Also take care to properly drain the message queue before quitting
so that all of the Message instances are recycled. This may
help release storage sooner in case the Looper doesn't get GC'd
promptly and its remaining queue of undelivered messages sticks
around.

Improve docs on runWithScissors.

Bug: 8596303
Change-Id: I8cbeb6f7a5f6b8e618b5109f87a03defc1486b9f
LSurfaceView.java
78bc2033129507f1cf4acb2e3007f89cb2b3f224 18-Apr-2013 Mathias Agopian <mathias@google.com> don't trigger a render when setting the rendermode

also don't cache the rendermode, to mimic the older
behaviour.

Bug: 8656076
Change-Id: Id9383852bed073927db2364f7ac30a1be28b4cd8
LSurfaceView.java
c7bdd50c97d874456d0408599c1a6145186167dd 17-Apr-2013 Jesse Hall <jessehall@google.com> Merge "Unhide android.opengl.GLES30 class and contents" into jb-mr2-dev
811d373444822b1a81cd6fb4f8ef87f6d49559b1 16-Apr-2013 Jesse Hall <jessehall@google.com> Merge "Add android.opengl.GLES30, hidden for now" into jb-mr2-dev
58d80c53c0aa2716b9bb6efa64111e1528cef2f8 11-Apr-2013 Jesse Hall <jessehall@google.com> Unhide android.opengl.GLES30 class and contents

Bug: 8566953
Change-Id: I5273fb3bff642da5ff1eecb5899e8051402b19ca
LES20.java
LES30.java
d830e74ff4bc9aa015f746e54f6922bf5221f1ba 29-Mar-2013 Jesse Hall <jessehall@google.com> Add android.opengl.GLES30, hidden for now

Bug: 8566953
Change-Id: Ia5a01d5e857b4fce12a451e2dcab0359758ad648
LES20.java
LES30.java
ab814a647222ff6a6b682f0ff8159d1253cc0713 10-Apr-2013 Mathias Agopian <mathias@google.com> Don't draw synchronously in onResume()

this could cause a dead-lock if the applicaltion's draw
implementation blocks until something happenson the main
ui thread.

note: we're still doing this synchronous draw in onWindowResize() because
that's what the previous implementation did. Technically, it has the
same problem.

Bug: 8586305
Change-Id: I782568289cc9419346aeea73775d86faa28b3058
LSurfaceView.java
57d019e222abc0de3f8876e682617d42872230c6 04-Apr-2013 Mathias Agopian <mathias@google.com> rework GLSurfaceView so it can use the choreographer

GLSurfaceView will now automatically use the Choreographer to
schedule render updates on VSYNC. This happens only in
RENDERMODE_CONTINUOUSLY.

GLSurfaceView was rewriten to use a Looper and a HandlerThread
instead of a custom thread.

The basic mode of operation is unchanged, however the implementation
is largely different.

Removed support for older GPUs which had a limited number of contexts.

Bug: 8485730

Change-Id: I7b270f7ad7bb1259e858429054b1c8c9cc159dc6
LSurfaceView.java
ea62b95e7c562e8d0052441d8a0d7de6d919320f 19-Mar-2013 Jack Palevich <jackpal@google.com> Fix createSurface / eglCreateWindowSurface race.

Previously we could have returned from createSurface on the main thread
before calling eglCreateWindowSurface on the GLThread. That could lead
to a problem because the surface could be destroyed before
eglCreateWindowSurface got a chance to run.

Bug: 8328715
Change-Id: I273149f7d4b165abbe218a91ff54083f3f498cb0
LSurfaceView.java
34f17dd1f615c6285f4f344eb700923e2432e48e 06-Mar-2013 Andy McFadden <fadden@android.com> Publish new MediaCodec API

Un-hide two new methods in MediaCodec, one new constant, and a new
EGL extension.

Bug 7991062
Bug 8191230

Change-Id: I028669132d9ffda1e4b34a561bab3997bbd7dae5
GL14.java
0c361e9d3c93b3890fbae82b2f937bb4b3a42f70 02-Mar-2013 Andy McFadden <fadden@android.com> Add eglPresentationTimeANDROID

Added EGL extension to set a timestamp on a surface.

Bug 8191230

Change-Id: Ie73bd7d1217348c9c64b8c68da38d671d48355f7
GL14.java
15284dee8efe6b4d1441ab040962077614b5061a 23-Feb-2013 Mathias Agopian <mathias@google.com> regenerate GLES java bindings

- added most missing validation checks
- glGet* validation reimplement from khronos documentation

Bug: 7402895

Change-Id: I92a805bb1aba1600d3372dc2db22eab08c975d7f
LES10.java
LES20.java
89be00bcda2b5965757e83bdf70a650b64373045 23-Feb-2013 Mathias Agopian <mathias@google.com> regenerate egl/gles stubs from glgen

those are minor cosmetic changes.

Change-Id: I84ee5383577f0ca33ed7cc32d03e53c1475f068d
LES20.java
0c1761bd37815c3776608a19c8e11d862b3e910c 15-Dec-2012 Siva Velusamy <vsiva@google.com> DdmServer: add controls for OpenGL tracing

Add a new JDWP packet to allow control of OpenGL tracing.

Change-Id: Ic89e2f6299238a612df2f914581049f2cbba088c
LUtils.java
29e0bd2f5a80fdfe0e5b482a1df86363afcecbfa 19-Sep-2012 Mathias Agopian <mathias@google.com> GLSurfaceView defaults to 888 instead of 565

Change-Id: Ie00fe578136365031e4bb878a04b68dc40e24b9e
LSurfaceView.java
1296c63bf14af034a90d5579ff301d1a2b70e34a 08-Aug-2012 Jeff Brown <jeffbrown@google.com> Enable use of Surface as a native window in EGL14 wrapper.

Change-Id: Ia3546fd02f9b60d4505fbc0602522b95e3e5b6be
GL14.java
42e1e0d482d774cf18a55773e434f02edb9e4462 30-Jul-2012 Romain Guy <romainguy@google.com> Improve gradients

Avoid using textures for common gradients (two stops from 0.0 to 1.0)

Change-Id: Iff55d21b126c8cfc4cfb701669f2339c8f6b131a
atrix.java
0a088f5d4681fd2da6f610de157bf905df787bf7 30-Jul-2012 Romain Guy <romainguy@google.com> Fix android.opengl.Matrix frustum's generation

External bug report: http://code.google.com/p/android/issues/detail?id=35646

Change-Id: I845783c05da46855f0c1d824c9a367f0e4673b85
atrix.java
dd06946252be852aa53eb6142a119b0fccc83cd1 20-Jul-2012 Thomas Tafertshofer <tafertth@google.com> updated gles20 bindings, fixes broken methods

this adds correct versions of the broken GLES20 methods
glGetShaderSource, glGetActiveAttrib and glGetActiveUniform.
the old functions are still there and need to be @hide later.

Bug: 6006380
Change-Id: I8127a77c4b89aa8a9a54bea88774077535e2139d
LES20.java
9b18b515909354d7b48c8ebc33ec38e2c6bbdf37 13-Jul-2012 Thomas Tafertshofer <tafertth@google.com> EGL 1.4 API without @hide

Change-Id: If03d23082b011aaba41594712601495dcbd70f6a
GL14.java
GLConfig.java
GLContext.java
GLDisplay.java
GLObjectHandle.java
GLSurface.java
6b1e838fc16d397359f82c3a4f5700f1ed7dd910 03-Jul-2012 Thomas Tafertshofer <tafertth@google.com> EGL 1.4 bindings generated by glgen

Change-Id: I1c3da57101f4ea089a12f1796f25b72d6852141e
GL14.java
GLConfig.java
GLContext.java
GLDisplay.java
GLObjectHandle.java
GLSurface.java
cee059dc764a57860da6b1574952089680b5ddc6 16-Apr-2012 Jack Palevich <jackpal@google.com> Improve GLSurfaceView Pausing.

When pausing we want to do three separate things, in order:

+ release the EGL surface
+ optionally release the EGL context
+ optionally terminate Egl

Previously we would only do these things if we had an EGL surface. But
it is possible that we don't have an EGL Surface, but still have an EGL
context. And in that situation we still want to release the EGL context.

Now we check the preconditions for the three cases separately.

Bug: 6338235
Change-Id: I804683b3d5c136cc98ea3f5051067eea18152ddf
LSurfaceView.java
7dee7a38baafcbdd26ff116eeec862ec661dedec 10-Apr-2012 Jack Palevich <jackpal@google.com> Notify monitor waiters when changing mSurfaceIsBad value.

Otherwise the waiters might not wake up, leading to ANRs.

Bug: 6307843
Change-Id: I0646b4e8368f80dbff46342f75709992796973fd
LSurfaceView.java
7d73df83f9a28950f404e957eb2e4ea1e8525c55 30-Mar-2012 Jack Palevich <jackpal@google.com> Try to survive a failure return from eglMakeCurrent.

Assume a failure in eglMakeCurrent occurs because the SurfaceView
surface has been destroyed.

See b/6257956 for an example of this failure happening during rotation
stress testing.

Change-Id: I4618703b5291aba3a3f0c6bd83c3435a67b97d33
LSurfaceView.java
db6c78b5bdf264abe8f6de97f67ca5e90fb6a05a 29-Mar-2012 Jack Palevich <jackpal@google.com> Make GLSurfaceView handle eglSwapBuffers errors more robustly.

A careful reading of the EGL spec, as well as experience with many
different EGL drivers, has shown that it is error prone to attempt to
discriminate between different error conditions.

We now treat any error besides EGL_CONTEXT_LOST as an indication that the
EGL context is in a bad state, most likely due to the window manager
having removed the underlying surface flinger surface.

In addition, we changed the way we deal with this kind of error:
Previously we would ignore the error and keep rendering. But if the
EGL context and surface has become invalid, it would be better to
stop drawing. We now stop drawing until the surface view surface is
recreated.

See b/6032663 for an example of this problem affecting the GMM app,
but note that GMM is using their own version of GLSurfaceView, so this
change won't help them directly. They'll have to make a similar change
to their version of GLSurfaceView.

Change-Id: Iffe3e1e3a3c7a91d03140fd34391eadeaecf777e
Signed-off-by: Jack Palevich <jackpal@google.com>
LSurfaceView.java
f7f4c20605badb95f99e3f1f609458a9e4fe0c1a 22-Mar-2012 Jack Palevich <jackpal@google.com> Merge "Remove EGL context limit for Adreno GPUs."
8b854cd74bd29b6bb0b4c681490a3a97b1739289 19-Mar-2012 Jack Palevich <jackpal@google.com> Remove EGL context limit for Adreno GPUs.

This change allows Adreno GPUs to have multiple EGL contexts. We had
to limit this in earlier versions of Android due to limitations in
the Adreno GPU driver (only 8 EGL contexts allowed system wide.)
That brand of GPU has improved its EGL drivers to support multiple
EGL contexts in more recent versions of their drivers used on more
recent versions of Android.

Bug: 6142005
Change-Id: Id3030466be9a3d9fbe728f1785378c1f05da98fe
LSurfaceView.java
48a59c3d852867f13da4138ed2de94044febb99e 15-Mar-2012 Jack Palevich <jackpal@google.com> Ignore EGL_BAD_CURRENT_SURFACE errors from eglSwapBuffers

Certain EGL device drivers are generating this error, so we need to
survive it. (It's not clear from the EGL spec whether this is a
legitimate error code, but since it's being generated we need to
handle it.)

Remove logging of expected errors from elSwapBuffers. We expect these
errors to happen, and are handeling them by ignoring them.
No need to clutter the logs.

Bug: 6083241

Change-Id: If17dcfbb68d3009b92cf95a448728ccb47023b51
LSurfaceView.java
64d10a1da0a702ffeb086ad9c4a632f2712f1dad 09-Mar-2012 Siva Velusamy <vsiva@google.com> Expose a function to set OpenGL Trace level.

This patch adds a function setGlDebugLevel() to libEGL, and
exposes it to the Java layer at android.opengl.GLUtils.enableTracing().

Change-Id: Ia5abb130bc32fcfe3ab25b0a0a5283a54c54f357
LUtils.java
97eda365fcf7209b56e0a52e01f7fb3352e4fa63 17-Feb-2012 Romain Guy <romainguy@google.com> Remove unused private APIs

Change-Id: Ib22005c7ed9923120089a1f1c806bca55bb90967
roup.java
aterial.java
bject3D.java
exture.java
0219af277e5e1ae483c9690cffce33f185b02246 22-Nov-2011 Romain Guy <romainguy@google.com> am ea54d0dc: am 723218b4: Merge "Hide ManagedEGLContext until we are sure this is the correct API." into ics-mr1

* commit 'ea54d0dc0dfeef5560fea04667804413d522025f':
Hide ManagedEGLContext until we are sure this is the correct API.
3526b00a53a2582a51ff8b98ac1400a48f351107 22-Nov-2011 Romain Guy <romainguy@google.com> am c26e4d18: am 8cd39e3a: Merge "Notify views when EGL resources are about to be destroyed Bug #5639899" into ics-mr1

* commit 'c26e4d18a20ab0b3e769fb3e547994f1c27d6713':
Notify views when EGL resources are about to be destroyed Bug #5639899
dccf73a50cb2a219182e141bac1d9da82fdaf4d7 22-Nov-2011 Romain Guy <romainguy@google.com> Hide ManagedEGLContext until we are sure this is the correct API.

Change-Id: If54942d342ca8ea348e10231b2aed3e5d3bd701b
anagedEGLContext.java
31f2c2e94656530fbf6282803e62edb47e9a894d 21-Nov-2011 Romain Guy <romainguy@google.com> Notify views when EGL resources are about to be destroyed
Bug #5639899

Change-Id: I7c5d8bebf02294426f5b3ab1358a31c38a4fd064
anagedEGLContext.java
fa1a6eb584dde49d424fa53a995a6d0dbd45155c 18-Nov-2011 Jamie Gennis <jgennis@google.com> am 0272e600: am a37a78e2: Merge "GLES: add image external enums" into ics-mr1

* commit '0272e60060162d2c32aec02d9cd1414dbbe14782':
GLES: add image external enums
a37a78e2efe54892a744adfc6330c2d2179dee21 18-Nov-2011 Jamie Gennis <jgennis@google.com> Merge "GLES: add image external enums" into ics-mr1
22da9a8beb4af362fbe9a108234d40b341c8d9fb 17-Nov-2011 Jack Palevich <jackpal@google.com> Merge "Fix potential GLThread / GLSurfaceView memory leak."
77c5f4def49357a89abd9849b0bab950179d71f4 17-Nov-2011 Dianne Hackborn <hackbod@google.com> am 9aa6bd1c: am 717a25dc: Add new ManagedEGLContext class to help apps participate in memory trimming.

* commit '9aa6bd1c34fe3583fe31f283a6415e84fec12567':
Add new ManagedEGLContext class to help apps participate in memory trimming.
717a25dc2a411edb548859cd6870363346c71b01 16-Nov-2011 Dianne Hackborn <hackbod@google.com> Add new ManagedEGLContext class to help apps participate in memory trimming.

This class provides an API for an application to know when it is time to
destroy its EGL context when memory is being trimmed. By having this in
the framework, we can still detect whether it will be useful to destroy
any EGL contexts (because we know if doing so will destroy all of them).

Change-Id: I1eac8d640052778052926b875c7928008f752182
anagedEGLContext.java
80b3cd6bc608c5929096e3407de2b157be925d3e 15-Nov-2011 Jack Palevich <jackpal@google.com> Fix potential GLThread / GLSurfaceView memory leak.

Until now a leak was possible under the following scenario:

Create a GLSurfaceView
Register a renderer (this automatically starts a GLThread).
Discard the GLSurfaceView without installing it in the view system.

This scenario can occur when a device is rotated rapidly from
orientation A to orientation B to orientation C. In that scenario,
orientation B's GLSurfaceView might be discarded without ever being
attached to a window.

If this issue had been identified before GLSurfaceView had clients, one
possible fix would have been to delay the construction of the GLThread
until the GLSurfaceView was attached to a window. Unfortunately, it's
too late, and so making that change would lead to observable changes in
behavior, possibly breaking some clients.

Instead, fixed by making GLThread and EGLHelper static classes that hold
onto a weak reference to the GLSurfaceView. This allows the GLSurfaceView
to be garbage collected when it is no longer used, even if the GLThread
is active. GLSurfaceView's finalize method will manually stop the GLThread
if it is still running when the GLSurfaceView exits.

Part of this change was to remove the Renderer reference from GLThread,
because Renderer is a user-supplied class that could contain a reference
chain that points back to the GLSurfaceView.

Fixes b/5606613 "GLSurfaceView that's never added to a window will
leak threads and views, can leak activities"

Change-Id: Iafdc329eb6e9e40062358e7c119f5547ffe23d5e
LSurfaceView.java
9726b1b54b45f9a165a12bc4738f22c5070a6657 15-Nov-2011 Jamie Gennis <jgennis@google.com> GLES: add image external enums

This change adds Java definitions for the enums of the
GL_OES_EGL_image_external OpenGL ES extension.

Bug: 3482193
Change-Id: Ib50326f8be9b9cc9021753855c3846ddcdc5eaa2
LES11Ext.java
1333742bedc9b462024302f302e3a7f27053df66 11-Nov-2011 Akwasi Boateng <akwasi.boateng@ti.com> am cb0db030: Merge branch \'ics-mr1-plus-aosp\' of ssh://android-git:29418/platform/frameworks/base into ics-mr1-plus-aosp

* commit 'cb0db0306b5849a35d3d99eea1b34ce019c6f0d8':
Make the overridden ImageView#setVisibility remotable
Clamp non-monotonic stats instead of dropping.
DO NOT MERGE. Fix leak in LayoutTransition
Fix lastVisible/global rects
Fix Wimax-less build.
Fix leak in LayoutTransition
Deferring wallpaper update to improve workspace scrolling (issue 5506959)
Terminate EGL when an app goes in the background
boot animation is dithered and scaled
Fix NdefRecord byte-stream constructor.
PopupWindow dismiss() can get into a recursive loop.
Fold WiMAX state into the mobile RSSI.
Remove dedicated wimax icon to fix RSSI layout.
8ff6b9ebeeb24a6161ec6098e6bfdf8790ee5695 10-Nov-2011 Romain Guy <romainguy@google.com> Terminate EGL when an app goes in the background

This does not happen on high end gfx devices. This happens
only if only one EGL context is initialized in the current
process.

Change-Id: Ibd1737efdf84eef8a84108b05795440d1ae9964e
GLLogWrapper.java
9829cceca11a0fc92ab1318ce32b4d4dae8d347d 07-Nov-2011 Alex Sakhartchouk <alexst@google.com> Merge "Properly passing an unused variable through."
fc5e224e8dcc878606e47ba3d834be0a79498ac6 04-Nov-2011 Alex Sakhartchouk <alexst@google.com> Properly passing an unused variable through.

Change-Id: Ie49b5855bfca4e202ed41b6167a899832e99d728
TC1Util.java
eba186448ff048f8fc1ba596c9779e8069a93128 31-Oct-2011 Joe Fernandez <joefernandez@google.com> am 74b2b954: am 09848bc8: Merge "docs: add developer guide cross references, Project ACRE, round 3" into ics-mr0

* commit '74b2b9547329a0b05e0bd5701057696007b854bb':
docs: add developer guide cross references, Project ACRE, round 3
74b2b9547329a0b05e0bd5701057696007b854bb 29-Oct-2011 Joe Fernandez <joefernandez@google.com> am 09848bc8: Merge "docs: add developer guide cross references, Project ACRE, round 3" into ics-mr0

* commit '09848bc89de999416e2de82a7693b2deec6bf802':
docs: add developer guide cross references, Project ACRE, round 3
b50e2afd6782e9b877f52844bec106c12ff9a9ef 28-Oct-2011 Jack Palevich <jackpal@google.com> Destroy and recreate the EGL surface when the surface size changes.

Details:
+ Split EGLHelper.createSurface into two methods.
+ Add a separate flag for specifying when to create the GlInterface.
+ destroy and recreate the EGL surface when the surface size changes
+ Remove no-longer-needed work-around for b/2263168.

This fixes b/2263168

Change-Id: I0d2596527e3c8dabacdd8a8e427531eaefe7d266
LSurfaceView.java
61fd1e8d8c3ccf2d6b7d4af1c19e8f0988d5a1ec 26-Oct-2011 Joe Fernandez <joefernandez@google.com> docs: add developer guide cross references, Project ACRE, round 3

Change-Id: I6125315ecdf0f78dd947c514a9944729d723e95d
LSurfaceView.java
ackage.html
a35c120d8fafa7dded606a25bc100b13f48ab9e3 14-Oct-2011 Jack Palevich <jackpal@google.com> Work around race condition when shutting down a surface flinger surface.

Works around b/4588890

Change-Id: Ie0cf1f212686aec93cda85bf112f4b7ab4197256
LSurfaceView.java
cc5471c35327c1511075f5df0d45a2d57610fecb 21-Sep-2011 Jack Palevich <jackpal@google.com> Avoid allocating temporary memory for Matrix operations.

Also fix a bug where Matrix.invertM was not returning false when the
matrix could not be inverted.

Change-Id: I68b172032093d9f257e88c802de936633bb4912c
atrix.java
407ec78b828173257b0c5dae221649a4ccd8b058 25-Aug-2011 Romain Guy <romainguy@google.com> Add OpenGL backend to ImageWallpaper
Bug #5204874

Currently disabled.

Change-Id: I5e7b35dce2981b0691f107e39c6394b260466543
LUtils.java
3ab88557947d708cc36d60ce6566509ceff944e4 02-Aug-2011 Mathias Agopian <mathias@google.com> fix an issue where the screen could be stale after a surface size change

some GLES drivers dequeue buffers before a frame is started
(which is allowed), which can cause a that frame to be rendered
into a buffer of the wrong size. Such buffer will be ignored
by the compositor. If the application draws only once after a
size change, the screen might stay in this stale state.

this can be avoided by telling the GL driver to purge all its
pending buffers, which is done by making the surface not current
and then current again.

this solution is specific to android, but acceptable because
handled solely in the framework.

Bug: 2263168
Change-Id: I3d3c9a019979a9186e329d3160fa54adac78d3f7
LSurfaceView.java
43dd61e08a726fbc3695b1cbfdef6bdd4ddd34be 12-Jul-2011 Mathias Agopian <mathias@google.com> fix typo in a comment

Change-Id: If913611a65e8b578021e9f9a9546f05e0ce6ef44
LSurfaceView.java
7c80244afb9098c75b127c2d785bb6e5b03d68c5 22-Apr-2011 Jack Palevich <jackpal@google.com> Fix typo in Matrix.mPerspective.

(Introduced by a copy-and-paste mistake when factoring out a common
expression. D'Oh!)

Change-Id: I5e97dde2d2f4564fc74ba69bfa4a2f9db44c8873
atrix.java
d793299e875a97dc73e04e3beb2a2865563dccdb 21-Apr-2011 Jack Palevich <jackpal@google.com> Add utility method Matrix.perspectiveM

Change-Id: Ic9d5e5d967bbc08acc524c5092ce61a1cdbfd360
atrix.java
24ce5fb2cc09d0a14406e7b935f8648c5720d27e 09-Apr-2011 Elliott Hughes <enh@google.com> Kill the global references in the OpenGL wrappers.

Just use jniThrowException instead. Note that it would be trivial to throw
seemingly more appropriate exceptions (NullPointerException and
OutOfMemoryException in particular), but I'm only attempting to preserve
existing behavior here.

I also found shadowing bugs in some of the special-case functions, which
would previously always have leaked memory.

This also moves an accidental change to a generated file (ActivityThread ->
AppGlobals) into the generator, so it won't be overwritten in future.

Change-Id: Iab570310b568cb406c60dd0e2b8211f8a36ae590
LES10.java
LES10Ext.java
LES11.java
LES11Ext.java
LES20.java
70a1875635cf988b9962fbe2325ea73fd346858c 07-Feb-2011 Jack Palevich <jackpal@google.com> Extend recycled bitmap check to all GLUtils APIs.

Change-Id: I9ea0022b167af2153190b6642aa303232e257379
LUtils.java
5f89f510f327228d4ba2261aff7e8faa7d3715aa 03-Feb-2011 Jack Palevich <jackpal@google.com> Throw an exception when trying to upload a recycled bitmap.

Previously we would upload garbage.

Change-Id: Id785792a16f9d24685687f4e6b64ec893ccad225
LUtils.java
29406daf21c2dfa4d893b421d39137eb47fb3aa6 27-Jan-2011 Jack Palevich <jackpal@google.com> Add GL11ExtensionPack support to GLDebugWrapper

Allows calling GL11ExtensionPack APIs in a GL context that has been
wrapped for debugging.

Change-Id: Ib0695b51a92f5dcce32db8b0dc7ee948e5059e7f
LErrorWrapper.java
LLogWrapper.java
LWrapperBase.java
75f2bc04df11c67d7074186432278f182381b9f2 19-Jan-2011 Jack Palevich <jackpal@google.com> Unhide GLSurfaceView.get/setPreserveEGLContextOnPause

Change-Id: I882b8fa7888e2baae41c81b75af7fc1f639d38d6
LSurfaceView.java
8432b3f98a22d5cdfcc0183d134770597e44d412 14-Jan-2011 Jack Palevich <jackpal@google.com> Add support for preserving EGL contexts when pausing / resuming.

Hidden for now.

Change-Id: I350576c11960a1aa232da7aebc5c6ec60ff796b5
LSurfaceView.java
c086ca1fa7cebc3e9a51abd4be4688346225c2e4 08-Dec-2010 Dan Bornstein <danfuzz@android.com> These files had an older header.

This patch replaces the file headers with the approved Android
header text.

Change-Id: I63cbd21e9112dab404158fb65f74bc6ca5b07eac
TC1.java
TC1Util.java
LES10.java
LES10Ext.java
LES11.java
LES11Ext.java
LES20.java
1396afb73047c402db5af98e8f6b442ecbfa98d4 27-Oct-2010 Jack Palevich <jackpal@google.com> Preserve the render mode when recreating the render thread.

Change-Id: I67a12a9598d3ef099bef8727411891614b1bc3f7
LSurfaceView.java
2ff6a824619ac6849ba9f36d97590acf74f62518 27-Oct-2010 Jack Palevich <jackpal@google.com> Allow a GLSurfaceView to be reattached to a window.

This approach is more backwards-compatible than the previous attempt.

The onDetachedFromWindow case is unchanged from the "classic"
GLSurfaceView behavior, except that we don't throw a NPE if the
renderer has never been set.

Change-Id: Ia8103a73366ddb13be44f16b789c929e75ddc792
LSurfaceView.java
fc5508bc994174bc4d1b1d028cfa25eb70ea8203 26-Oct-2010 Jack Palevich <jackpal@google.com> Do not exit the GLSurfaceView thread when detached from a window.

Allows a GLSurfaceView to be removed from a window and later reattached
to a window.

Change-Id: I2b44f35d0c95404b13912782df8877953609a5d0
LSurfaceView.java
f45b674d48ff91972e4b8ffbbe3c4bd16d231bdc 26-Aug-2010 Mathias Agopian <mathias@google.com> reserve android.opengl.GLWallpaperService name for future use

Change-Id: I7a217593a1ca39214dda26ddb3af3ddc30a8a95a
LWallpaperService.java
1b4ecc63c4eceb7c125d4e749fd5f747d99d6ec6 14-Jul-2010 Jack Palevich <jackpal@google.com> Fix deadlock when switching between two GLSurfaceViews

Some devices only support a single active EGL context.

On those devices, when a second activity that uses a GLSurfaceView
is started in the same process, the second activity can potentially
hang in GLSurfaceView.onWindowResize waiting for its GLSurfaceView
render thread to draw a frame. The second activity's render thread
is waiting to acquire an EGL context, but the first activity's render
thread doesn't know it should release the EGL context.

The fix is to detect the potential hang, and ask the first activity's
render thread to release the EGL context.

Change-Id: Ibb342c68772297744c973bcf5010581cd132db67
LSurfaceView.java
224107a421e2611b15d1ec736df54bca9ee3e78d 22-Jun-2010 Jack Palevich <jackpal@google.com> Add OpenGL ES 2.0 VBO versions glDrawElements and glVertexAttribPointer.

Change-Id: Id0069535e97fe96eef74e4d0c1d19b010061fe3b
LES10.java
LES20.java
d6ddcb7f00a7af95b452233d965b922632f78f21 25-May-2010 Mathias Agopian <mathias@google.com> fix [2677468] some 3rd party GL ES apps get a 32-bits surface by default and fail

force all SurfaceView to 565

Change-Id: I8ebfa1239d8e4fa097c2e544677fb92fa20b39bd
LSurfaceView.java
0e4aa37872810e46775374596e0beb11f7123727 19-Apr-2010 Jack Palevich <jackpal@google.com> Quietly handle EGL_BAD_NATIVE_WINDOW errors

We believe these errors happen when the window
manager has told surface flinger to close the
native window.

If this error happens while we are creating the
EGL surface we exit the render loop (and
therefore exit the render thread.)

If the error happens while swapping the surface
we ignore it.

In either situation, we expect that the
application is about to be shut down by the
window manager, so it should not be necessary
to try and recover from the error.
LSurfaceView.java
4a65900cd69b79e6e47d275575eaeb5bb2487f9f 27-Mar-2010 Jack Palevich <jackpal@google.com> Turn off logging.
LSurfaceView.java
451a224c46c297bd6b25e3570b45f5053b4788be 26-Mar-2010 Jack Palevich <jackpal@google.com> GLSurfaceView pause and resume now synchronize
with the GLThread.

We used to just set the mPaused state and return,
now we wait until the rendering thread signals
that it has noticed the change in pause state.

This makes Pause/Resume more consistent with
other UI-thread-to-GLThread event communication.

This change was made in the hope of fixing some
race conditions observed in monkey testing.
LSurfaceView.java
57c6a46bd0c84c4b349d49f8df12f30a8cfcdaa2 25-Mar-2010 Jack Palevich <jackpal@google.com> Turn off thread logging (too many messages.)

Leave some other logging on for the monkey test.
LSurfaceView.java
e6c9448eb3228887c49f6ba9c4be2345443286e9 25-Mar-2010 Jack Palevich <jackpal@google.com> Add logging of GLSurfaceView pause/resume calls.

Turn on GLSurfaceView logging, so we can get better
information in the monkey tests.

Change-Id: Ifec0101f8a00ab09037dc9f7a1496fa1a374cc08
LSurfaceView.java
b1768998f14e03bd69cf049783d6cbeccf6d5839 24-Mar-2010 Jack Palevich <jackpal@google.com> Improve our EGL management when pausing / resuming.

We now release the EGL context when pausing. This
is required to reduce the chance of running out of
contexts on devices which support a limited number
of active EGL contexts.

Someday we may implement a global EGL context
manager that will allow us to let EGL contexts
persist until another activity needs an EGL
context. But for now, without such a manager,
we take the conservative approach.

Separately, we now terminate EGL when
pausing on Sapphire. This is a requirement of the
Sapphire OpenGL driver.
LSurfaceView.java
07353a1e8598b1e2993b8b6763f630379ae6e8bb 23-Mar-2010 Jack Palevich <jackpal@google.com> GLSurfaceView: Log egl failures

Decode the EGL error code when throwing exceptions.
LSurfaceView.java
04b17ab7b4a17a28f541f746c3d55046c5b87596 15-Mar-2010 Jack Palevich <jackpal@google.com> Improve eglSwapBuffers error handling.

We now distinguish EGL_CONTEXT_LOST errors from
other kinds of errors. We return "true" if
the swap completes successfully, "false" if
the swap fails due to EGL_CONTEXT_LOST, and
throw a RuntimeException if the swap fails due
to any other cause.

If eglSwapBuffers succeeds, we now avoid calling
eglGetError at all, which means we avoid clearing
any EGL errors that might already have been
pending before eglSwapBuffers is called.
LSurfaceView.java
15a4d2ffd04dc6c70f2cd17dae12ac6bc14c69ab 12-Mar-2010 Kenny Root <kroot@google.com> Add correct copyright headers to multiple files

Format for the list of changes shows the origin commit reference followed
by the file name.

33931-p9 awt/org/apache/harmony/awt/gl/font/AndroidGlyphVector.java
33931-p9 awt/org/apache/harmony/awt/gl/image/PngDecoderJava.java
133776-p9 core/java/android/app/IntentService.java
127013-p9 core/java/android/appwidget/AppWidgetHost.java
27863-p9 core/java/android/bluetooth/BluetoothAudioGateway.java
60765-p9 core/java/android/content/SyncResult.java
43920-p9 core/java/android/content/pm/ActivityInfo.java
43920-p9 core/java/android/content/pm/ApplicationInfo.java
43920-p9 core/java/android/content/pm/InstrumentationInfo.java
43920-p9 core/java/android/content/pm/PackageInfo.java
44103-p9 core/java/android/content/pm/PackageItemInfo.java
68960-p9 core/java/android/content/pm/PackageStats.java
43920-p9 core/java/android/content/pm/ResolveInfo.java
43920-p9 core/java/android/content/pm/ServiceInfo.java
60641-p9 core/java/android/content/res/Configuration.java
60734-p9 core/java/android/content/res/TypedArray.java
137672-p9 core/java/android/inputmethodservice/ExtractButton.java
123112-p9 core/java/android/inputmethodservice/ExtractEditText.java
119291-p9 core/java/android/inputmethodservice/IInputMethodSessionWrapper.java
112946-p9 core/java/android/inputmethodservice/IInputMethodWrapper.java
115078-p9 core/java/android/os/BatteryStats.java
124790-p9 core/java/android/text/style/UpdateAppearance.java
45083-p9 core/java/android/view/RawInputEvent.java
101491-p9 core/java/android/view/inputmethod/EditorInfo.java
114701-p9 core/java/android/view/inputmethod/ExtractedText.java
123112-p9 core/java/android/view/inputmethod/ExtractedTextRequest.java
119291-p9 core/java/com/android/internal/os/HandlerCaller.java
129279-p9 core/java/com/android/internal/os/PkgUsageStats.java
114701-p9 core/java/com/android/internal/view/IInputConnectionWrapper.java
114701-p9 core/java/com/android/internal/view/InputConnectionWrapper.java
84364-p9 opengl/java/android/opengl/EGLLogWrapper.java
11355-p9 opengl/tools/glgen/src/CFunc.java
11355-p9 opengl/tools/glgen/src/CType.java
11355-p9 opengl/tools/glgen/src/CodeEmitter.java
11355-p9 opengl/tools/glgen/src/GenerateGL.java
11355-p9 opengl/tools/glgen/src/JFunc.java
11355-p9 opengl/tools/glgen/src/JType.java
11355-p9 opengl/tools/glgen/src/JniCodeEmitter.java
11355-p9 opengl/tools/glgen/src/ParameterChecker.java
57236-p9 services/java/com/android/server/status/AnimatedImageView.java
66754-p9 services/java/com/android/server/status/CloseDragHandle.java
57188-p9 services/java/com/android/server/status/DateView.java
46928-p9 services/java/com/android/server/status/ExpandedView.java
70590-p9 services/java/com/android/server/status/FixedSizeDrawable.java
45968-p9 services/java/com/android/server/status/IconData.java
57470-p9 services/java/com/android/server/status/IconMerger.java
82719-p9 services/java/com/android/server/status/LatestItemView.java
45968-p9 services/java/com/android/server/status/NotificationData.java
66754-p9 services/java/com/android/server/status/NotificationLinearLayout.java
57458-p9 services/java/com/android/server/status/NotificationViewList.java
45968-p9 services/java/com/android/server/status/StatusBarException.java
45968-p9 services/java/com/android/server/status/StatusBarIcon.java
46130-p9 services/java/com/android/server/status/StatusBarNotification.java
45968-p9 services/java/com/android/server/status/StatusBarView.java
46199-p9 services/java/com/android/server/status/Ticker.java
62286-p9 services/java/com/android/server/status/TickerView.java
57188-p9 services/java/com/android/server/status/TrackingView.java
86041-p9 telephony/java/android/telephony/PhoneStateListener.java
87020-p9 telephony/java/com/android/internal/telephony/TelephonyIntents.java
136269-p9 telephony/java/com/android/internal/telephony/gsm/SpnOverride.java
34409-p9 tests/FrameworkTest/src/com/android/frameworktest/FrameworkTestApplication.java
55717-p9 tests/FrameworkTest/src/com/android/frameworktest/performance/InvalidateCycle.java
128994-p9 tests/ImfTest/src/com/android/imftest/samples/AutoCompleteTextViewActivityLandscape.java
128994-p9 tests/ImfTest/src/com/android/imftest/samples/AutoCompleteTextViewActivityPortrait.java
129372-p9 tests/ImfTest/src/com/android/imftest/samples/BigEditTextActivityNonScrollablePanScan.java
129372-p9 tests/ImfTest/src/com/android/imftest/samples/BigEditTextActivityNonScrollableResize.java
129372-p9 tests/ImfTest/src/com/android/imftest/samples/BigEditTextActivityScrollablePanScan.java
129372-p9 tests/ImfTest/src/com/android/imftest/samples/BigEditTextActivityScrollableResize.java
128994-p9 tests/ImfTest/src/com/android/imftest/samples/BottomEditTextActivityPanScan.java
128994-p9 tests/ImfTest/src/com/android/imftest/samples/BottomEditTextActivityResize.java
127341-p9 tests/ImfTest/src/com/android/imftest/samples/ButtonActivity.java
129347-p9 tests/ImfTest/src/com/android/imftest/samples/DialogActivity.java
129372-p9 tests/ImfTest/src/com/android/imftest/samples/EditTextActivityDialog.java
128994-p9 tests/ImfTest/src/com/android/imftest/samples/ManyEditTextActivityNoScrollPanScan.java
128994-p9 tests/ImfTest/src/com/android/imftest/samples/ManyEditTextActivityScrollPanScan.java
128994-p9 tests/ImfTest/src/com/android/imftest/samples/ManyEditTextActivityScrollResize.java
128994-p9 tests/ImfTest/src/com/android/imftest/samples/OneEditTextActivityNotSelected.java
128994-p9 tests/ImfTest/src/com/android/imftest/samples/OneEditTextActivitySelected.java
25959-p9 tests/framework-tests/src/android/test/FrameworkTests.java
46162-p9 tests/framework-tests/src/com/android/internal/http/multipart/MultipartTest.java
77101-p9 tools/layoutlib/bridge/tests/com/android/layoutlib/bridge/NinePatchTest.java
9788976b1465ce982b5ae7c741345edd0ecd9322 core/java/android/accounts/AuthenticatorDescription.java
53332883543868fb83e111a07306368b7772b340 core/java/android/app/UiModeManager.java
93e7e22ec91dbc641d10ca6d70423e1357a95bba core/java/android/app/FullBackupAgent.java
328c0e7986aa6bb7752ec6de3da9c999920bb55f core/java/android/content/CursorEntityIterator.java
307da1a46b4c9b711bafe8fbaaa6b98e8868c18e core/java/android/content/SyncQueue.java
307da1a46b4c9b711bafe8fbaaa6b98e8868c18e core/java/android/content/SyncOperation.java
eb034652c2037a47ebfd99779e8383bb8bb528af core/java/android/content/pm/LabeledIntent.java
49237345d83e62fdb9eb8d50b13ad086636a04fa core/java/android/content/pm/FeatureInfo.java
a2b6c3775ed6b8924232d6a01bae4a19740a15f8 core/java/android/content/pm/PackageInfoLite.java
3ecd5f437580e49d80beecd29489d5fb1f7a7db0 core/java/android/content/pm/RegisteredServicesCacheListener.java
5ebbb4a6b3e16f711735ae0615b9a9ea64faad38 core/java/android/content/pm/XmlSerializerAndParser.java
c4516a7b62de525e3d6d5e76851bdfaf12c11f05 core/java/android/database/sqlite/SQLiteTransactionListener.java
9bbc21a773cbdfbef2876a75c32bda5839647751 core/java/com/android/internal/backup/LocalTransport.java
21f1bd17b2dfe361acbb28453b3f3b1a110932fa core/java/com/android/internal/content/PackageMonitor.java
4c62fc0e1e5ea9c69a12a7d1cf8b3ec8b2d114a3 core/java/com/android/internal/view/BaseSurfaceHolder.java
4c62fc0e1e5ea9c69a12a7d1cf8b3ec8b2d114a3 core/java/com/android/internal/view/BaseIWindow.java
e540833fdff4d58e37c9ba859388e24e2945ed45 core/java/com/android/internal/os/SamplingProfilerIntegration.java
192ab903887bbb8e7c7b6da5c581573850e30f46 core/tests/coretests/src/android/widget/expandablelistview/PositionTesterContextMenuListener.java
1619367ab823150fa8856d419abe02ceb75886f1 media/tests/MediaFrameworkTest/src/com/android/mediaframeworktest/MediaProfileReader.java
27f8002e591b5c579f75b2580183b5d1c4219cd4 opengl/tools/glgen/stubs/gles11/glGetString.java
560814f6b11abe83ff0c4ed18cac015c276b3181 opengl/tools/glgen/stubs/gles11/glGetProgramInfoLog.java
560814f6b11abe83ff0c4ed18cac015c276b3181 opengl/tools/glgen/stubs/gles11/glGetShaderInfoLog.java
560814f6b11abe83ff0c4ed18cac015c276b3181 opengl/tools/glgen/stubs/gles11/glShaderSource.java
1c4907ee77392afb768c2f088e0dedbe4239f6fb opengl/tools/glgen/src/GenerateGLES.java
1c4907ee77392afb768c2f088e0dedbe4239f6fb opengl/tools/glgen/src/Jsr239CodeEmitter.java
1c4907ee77392afb768c2f088e0dedbe4239f6fb opengl/tools/glgen/src/GLESCodeEmitter.java
69e21f5f6e0d04539cd92848ea009dd615d88c2c opengl/tests/gldual/src/com/android/gldual/TriangleRenderer.java
c028be4f3b8c7476b46859f66c3f33d528adf181 packages/DefaultContainerService/src/com/android/defcontainer/DefaultContainerService.java
7c6efa13f129dbae5319f0981a430d4662f43354 tests/BrowserPowerTest/src/com/android/browserpowertest/PowerMeasurement.java
7c6efa13f129dbae5319f0981a430d4662f43354 tests/BrowserPowerTest/src/com/android/browserpowertest/PowerTestActivity.java
7c6efa13f129dbae5319f0981a430d4662f43354 tests/BrowserPowerTest/src/com/android/browserpowertest/PowerTestRunner.java
df8a3f31d871db25e952972c2eb346a71186e9e3 tests/BrowserTestPlugin/src/com/android/testplugin/TestPlugin.java
cfaef699e1dfb3a75d5b51f3b15816f13670fd51 tests/permission/src/com/android/framework/permission/tests/ActivityManagerPermissionTests.java
cfaef699e1dfb3a75d5b51f3b15816f13670fd51 tests/permission/src/com/android/framework/permission/tests/ServiceManagerPermissionTests.java
cfaef699e1dfb3a75d5b51f3b15816f13670fd51 tests/permission/src/com/android/framework/permission/tests/WindowManagerPermissionTests.java

Copyright header moved to top in following file:

core/tests/coretests/src/android/widget/ListViewTest.java

Change-Id: I3c3198be5a0ba36e18679ed834170432bf0b8418
GLLogWrapper.java
83835359e51ddb8be37cea9bf4bb32f9390d82b7 05-Mar-2010 Jack Palevich <jackpal@google.com> Clarify the default algorithm used to choose an EGLConfig.

Explicitly default to an RGB_565 android.view.Surface.
LSurfaceView.java
4a2221ec4a929976be570ad096252c8dea326e19 06-Mar-2010 Jack Palevich <jackpal@google.com> Fix inverted release-EGLContext-on-pause logic.

This works around a bug in the
"Q3Dimension MSM7500" driver. That driver only
supports a single active EGLContext, so we must
release and restore the EGLContext when pausing
and unpausing.

Unfortunately the test for deciding whether to
release the context was inverted. We were
releasing the context on every device besides
the MSM7500 devices, which was a performance
drain, and we were not releasing the context on
the MSM7500, which meant the underlying driver
bug was not worked around.

Now we release the EGL context when pausing only
on the devices that have the bug.
LSurfaceView.java
840e958847f31f835dbf17ce539c9f8317251cc9 18-Jan-2010 Jack Palevich <jackpal@google.com> Decouple the EGL context lifetime from the EGL surface lifetime.

The EGL context is now preserved when possible. Previously we would
destroy it whenever the EGL surface was destroyed. Preserving the
EGL context preserves loaded textures and VBO resources.
LSurfaceView.java
8af9649d44745adba8be4db4e96af053ba32f2c5 31-Dec-2009 Jack Palevich <jackpal@google.com> Fix javadoc typos.
TC1.java
TC1Util.java
a6276fdd4253c3a7150ab675678c750473ab6c45 28-Dec-2009 Jack Palevich <jackpal@google.com> A library for encoding and decoding ETC1 textures.

The ETC1 compressed texture format is commonly
supported by OpenGL ES 2.0-capable devices.
TC1.java
TC1Util.java
66a4a6e45f59f72f24d710221c27db1bd233e154 21-Dec-2009 Jack Palevich <jackpal@google.com> Fix merge conflict markers that accidentally got checked in.

(They were in a comment, so it wasn't detected by the compiler.)
LSurfaceView.java
21799450ec751fd3c41c7e66e69fefb094b3050b 21-Dec-2009 Jack Palevich <jackpal@google.com> Fix bug 2325244 screen turns black for a brief period of time

The problem was a black first frame when creating a surface, or a
garbage frame when the surface was resized.

The cause was lack of synchronization between the render thread and the
UI thread. The UI thread would typically return before the render thread
had a chance to draw its first frame.

The fix was to make the UI thread wait until at least one frame had been
rendered by the rendering thread.

The waiting is done in the surfaceChanged method because we know
that surfaceChanged will be called in both the surface created
and surface changed cases.
LSurfaceView.java
bcf848e096b600ee36430849ade76826c3062196 10-Dec-2009 Jack Palevich <jackpal@google.com> am 74befcc7: am 981ccfbb: Implement Matrix Palette extension.

Merge commit '74befcc7fd721ca34f60bf75e18ce6faaab37aef'

* commit '74befcc7fd721ca34f60bf75e18ce6faaab37aef':
Implement Matrix Palette extension.
4c2fc8cb2571061371a34e736f157686ba57a779 10-Dec-2009 Jack Palevich <jackpal@google.com> resolved conflicts for merge of fac57636 to master
981ccfbbfd737e2bdf0cedec0089975f91fd4e0a 08-Dec-2009 Jack Palevich <jackpal@google.com> Implement Matrix Palette extension.

Adds support for formerly-unimplemented methods:

glCurrentPaletteMatrixOES
glLoadPaletteFromModelViewMatrixOES
glMatrixIndexPointerOES
glWeightPointerOES

The bulk of the changes are related to implementing the two PointerOES
methods, which are implemented pretty much the same way as the existing
Pointer methods were implemented.

This change also changes the way glPointSizePointerOES is implemented,
making it act like all the other Pointer methods. (Previously it was
not handling non-direct-buffer arguments correctly.)

Fixes bug 2308625 "Support matrix palette skinning
in JSR239 and related APIs"

Also updated GLLogWraper to fix two bugs in GLLogWrapper that were
discovered while testing matrix palette skinning support:

a) Handle trying to print the contents of null-but-enabled buffers.
(It's not legal to draw with null-but-enabled buffers, and
in fact some OpenGL drivers will crash if you try to render in this
state, but there's no reason the GLLogWrapper should crash while trying
to debug this situation.

b) Don't read off the end of a vertex buffer with non-zero position when
printing the entire contents of the vertex buffer. Now we only print from
the current position to the end of the buffer.
LES11.java
LES11Ext.java
LES20.java
LLogWrapper.java
aa396b9610f339cf280159144fbea47506f060e7 27-Nov-2009 Jack Palevich <jackpal@google.com> Unhide the Android OpenGL ES 2.0 API

Add a Matrix.setLookAtM method for computing a look-at viewing transform.

Change GLU.lookAt to use Matrix.setLook.
LES20.java
LSurfaceView.java
LU.java
atrix.java
0dce2dd26699e4dbfba8b8c5ea01f7fd03369e02 19-Nov-2009 Jack Palevich <jackpal@google.com> Extend GLSurfaceView to make it easy to create an OpenGL ES 2.0 context

Provide a new method, GLSurfaceView.setEGLContextClientVersion. Clients
call this method to define which level of OpenGL ES support they want.

This method only affects the default behavior of GLSurfaceView. If clients
have supplied their own EGLContextFactory or EGLConfigChooser then they
are on their own if they want to create an OpenGL ES 2.0 context.

This API is currently hidden.

Update the gl2_java test to use this new API.

Update the gl2_java test's AndroidManifest.xml file to indicate that
it requires OpenGL ES 2.0.
LSurfaceView.java
3608891b83af9fbd1af9b9a411f2a90e52353ff8 19-Nov-2009 Jack Palevich <jackpal@google.com> Add a Java API for OpenGL ES 2.0.

Currently this API is hidden.

Add a test program.
LES20.java
5c47265a704cb0cc081b79e191442f99014726b0 09-Dec-2009 Android (Google) Code Review <android-gerrit@google.com> Merge change Ibe6eac82

* changes:
Implement Matrix Palette extension.
be6eac828f5af8b608c3fa6749330f1dcd6b6206 08-Dec-2009 Jack Palevich <jackpal@google.com> Implement Matrix Palette extension.

Adds support for formerly-unimplemented methods:

glCurrentPaletteMatrixOES
glLoadPaletteFromModelViewMatrixOES
glMatrixIndexPointerOES
glWeightPointerOES

The bulk of the changes are related to implementing the two PointerOES
methods, which are implemented pretty much the same way as the existing
Pointer methods were implemented.

This change also changes the way glPointSizePointerOES is implemented,
making it act like all the other Pointer methods. (Previously it was
not handling non-direct-buffer arguments correctly.)

Fixes bug 2308625 "Support matrix palette skinning
in JSR239 and related APIs"

Also updated GLLogWraper to fix two bugs in GLLogWrapper that were
discovered while testing matrix palette skinning support:

a) Handle trying to print the contents of null-but-enabled buffers.
(It's not legal to draw with null-but-enabled buffers, and
in fact some OpenGL drivers will crash if you try to render in this
state, but there's no reason the GLLogWrapper should crash while trying
to debug this situation.

b) Don't read off the end of a vertex buffer with non-zero position when
printing the entire contents of the vertex buffer. Now we only print from
the current position to the end of the buffer.
LES11.java
LES11Ext.java
LES20.java
LLogWrapper.java
c373edbf1c7066668b8bf5fe90edd3fedd94c78b 07-Dec-2009 Jack Palevich <jackpal@google.com> am 9196034b: am 30d90523: Merge changes Id682ab72,I9bb4dbae into eclair-mr2

Merge commit '9196034b84c48844799a2904ef3ce31f18ee748e'

* commit '9196034b84c48844799a2904ef3ce31f18ee748e':
Improve error message thrown when eglCreateContext fails.
Improve error reporting by always returning the public
9bb4dbae91df0971038e955ef49c5d9a64d4a428 04-Dec-2009 Jack Palevich <jackpal@google.com> Improve error message thrown when eglCreateContext fails.
LSurfaceView.java
51438c18f5af96c16ac33a85b3ebaacf200b7b5e 29-Jul-2009 Li Wenhao <gliwenhao@gmail.com> the vertex index should be "first + i".
LLogWrapper.java
355c20cb9276148fd9b7074c5199aedeb497406e 27-Nov-2009 Jack Palevich <jackpal@google.com> Unhide the Android OpenGL ES 2.0 API

Add a Matrix.setLookAtM method for computing a look-at viewing transform.

Change GLU.lookAt to use Matrix.setLook.
LES20.java
LSurfaceView.java
LU.java
atrix.java
6a9a87da47bcfb032d0585f41d77abb6300ea63c 25-Nov-2009 Jack Palevich <jackpal@google.com> am 85a9498a: am 9c0b39c4: am ca00dee2: Merge change I5aa3adcf into eclair

Merge commit '85a9498a2f33d62a4313a3561b5468456974696e'

* commit '85a9498a2f33d62a4313a3561b5468456974696e':
Improve the exception message text by including eglGetError().
85a9498a2f33d62a4313a3561b5468456974696e 25-Nov-2009 Jack Palevich <jackpal@google.com> am 9c0b39c4: am ca00dee2: Merge change I5aa3adcf into eclair

Merge commit '9c0b39c47efade5ee2303a8f8ffbd9cf87c2c841' into eclair-mr2-plus-aosp

* commit '9c0b39c47efade5ee2303a8f8ffbd9cf87c2c841':
Improve the exception message text by including eglGetError().
9c0b39c47efade5ee2303a8f8ffbd9cf87c2c841 25-Nov-2009 Jack Palevich <jackpal@google.com> am ca00dee2: Merge change I5aa3adcf into eclair

Merge commit 'ca00dee21425882619aef4ecbe3e0d08de0544e5' into eclair-mr2

* commit 'ca00dee21425882619aef4ecbe3e0d08de0544e5':
Improve the exception message text by including eglGetError().
5aa3adcf304ec3767b3c22128acb23240d8d0bab 25-Nov-2009 Jack Palevich <jackpal@google.com> Improve the exception message text by including eglGetError().

Should help us track down the cause of bug 2285187
LSurfaceView.java
6ae4da75422bbb31c3e0a09f616cdaee1d465946 19-Nov-2009 Jack Palevich <jackpal@google.com> Extend GLSurfaceView to make it easy to create an OpenGL ES 2.0 context

Provide a new method, GLSurfaceView.setEGLContextClientVersion. Clients
call this method to define which level of OpenGL ES support they want.

This method only affects the default behavior of GLSurfaceView. If clients
have supplied their own EGLContextFactory or EGLConfigChooser then they
are on their own if they want to create an OpenGL ES 2.0 context.

This API is currently hidden.

Update the gl2_java test to use this new API.

Update the gl2_java test's AndroidManifest.xml file to indicate that
it requires OpenGL ES 2.0.
LSurfaceView.java
560814f6b11abe83ff0c4ed18cac015c276b3181 19-Nov-2009 Jack Palevich <jackpal@google.com> Add a Java API for OpenGL ES 2.0.

Currently this API is hidden.

Add a test program.
LES20.java
85d3f59ca0fcce0d405d9a024c1e5ff7352803a2 17-Nov-2009 Jack Palevich <jackpal@google.com> am 8d0e1472: am a822f02b: resolved conflicts for merge of dc49acb0 to eclair-mr2

Merge commit '8d0e14723312a9f8286ba95cc559ee000eab1b82'

* commit '8d0e14723312a9f8286ba95cc559ee000eab1b82':
More GLSurfaceView cleanup.
8d0e14723312a9f8286ba95cc559ee000eab1b82 17-Nov-2009 Jack Palevich <jackpal@google.com> am a822f02b: resolved conflicts for merge of dc49acb0 to eclair-mr2

Merge commit 'a822f02bb9c7f5bf2e3fa3cb63effc391be158c5' into eclair-mr2-plus-aosp

* commit 'a822f02bb9c7f5bf2e3fa3cb63effc391be158c5':
More GLSurfaceView cleanup.
a822f02bb9c7f5bf2e3fa3cb63effc391be158c5 17-Nov-2009 Jack Palevich <jackpal@google.com> resolved conflicts for merge of dc49acb0 to eclair-mr2
a08d46d8aaabb53eef4d5dc47272565d50f23c19 16-Nov-2009 Jack Palevich <jackpal@google.com> More GLSurfaceView cleanup.

+ The mDone flag is now a pair of flags: mShouldExit and mExited. The
problem with mDone was that it meant "had been asked to exit", but was
being used by some observers as "had exited". Using two variables means
that observers can observe either "had been asked to exit" or "had exited",
as they prefer.

+ Simplyify where we check for mShouldExit. We now check for it at the
top of our innermost guardedRun while loop.

+ requestExitAndWait now waits for mExited to be set to true to know
that a thread has exited, rather than using join(). This means we can use
wait() for the check, which releases the sGLThreadManager
monitor, avoiding a potential deadlock.

+ move the event queue into the sGLThreadManager monitor. This avoids
having to acquire two locks in order to enque/deque events, which also
avoids the potential for lock ordering deadlocks.

+ Simplify the event dequeueing code. We now deque one event each time
through the main GLSurfaceView loop. Events still have priority over
rendering, so there isn't any semantic change, it just cleans up the code.

+ Avoid trying to acquire an egl Surface if we're paused.

+ To simplify reasoning about the code, call sGLThreadManager.notifyAll()
in every case where we modify one of the variables that's protected by
the sGLThreadManager monitor. It would be slightly more efficient to only
notify when we change variables that could cause a thread to wait(), but
then we would have to redo our analysis every time we change any code.

+ Clean up the logic for creating the EGL surface and then calling the
renderer's onSurfaceCreated / onSurfaceChanged methods.

+ Implement work-around for bug 2263168 "Need to draw twice after
screen rotation..."
LSurfaceView.java
cbce240a0d64f4e3ae52aadf233c708a759a7ecb 11-Nov-2009 Jack Palevich <jackpal@google.com> am 99cf71b0: am 83536cee: Merge change I1179efbb into eclair-mr2

Merge commit '99cf71b0856e00c1ae9631db91702349cceb9bf8'

* commit '99cf71b0856e00c1ae9631db91702349cceb9bf8':
Fix multi-lock ordering issues in GLSurfaceView
99cf71b0856e00c1ae9631db91702349cceb9bf8 11-Nov-2009 Jack Palevich <jackpal@google.com> am 83536cee: Merge change I1179efbb into eclair-mr2

Merge commit '83536cee2b2b5445c5ba0b22531c23890b82da41' into eclair-mr2-plus-aosp

* commit '83536cee2b2b5445c5ba0b22531c23890b82da41':
Fix multi-lock ordering issues in GLSurfaceView
1179efbb3b8856eb8160e2dd67a300a5d64e8e98 11-Nov-2009 Jack Palevich <jackpal@google.com> resolved conflicts for merge of ba56915a to eclair-mr2
67dcd6c2392caf3ff98f35a3d1ec550d229c167b 10-Nov-2009 Jack Palevich <jackpal@google.com> Fix multi-lock ordering issues in GLSurfaceView

There were potential deadlocks between the per-GLThread monitors and the
GLThreadManager monitor.

To avoid these deadlocks we now use a single monitor for
both the GLThreadManager state and the per-GLThread state.

Converted GLThreadManager's semaphore into the equivalent
synchronized-wait-notifyAll code. This enables us to wait for
either mDone, or user events, or the EGL surface with a single "wait()".

Simplified the logic used to acquire and release the EGL surface. The
EGL surface is now only requested while the surfaceFlinger surface
is acquired.

Removed the "egl surface stealing" policy we had recently inserted.
It's not needed now that we reliably quit when requested.

Pulled user event processing outside of the GLThreadManager monitor
so that we don't call any potentially-long-running code while
inside the monitor.

This should help with bug 2228262.
LSurfaceView.java
2806a6b5ffd1003e217deebb6a9c3d3c6d9d4087 10-Nov-2009 Jack Palevich <jackpal@google.com> am 73ae27f0: am 8da3ac92: resolved conflicts for merge of 3f857b78 to eclair-mr2

Merge commit '73ae27f0c56fa705dcfb86d784a95b86f10e48ad'

* commit '73ae27f0c56fa705dcfb86d784a95b86f10e48ad':
Allow a GLThread to release and reacquire the EGL Surface as needed.
73ae27f0c56fa705dcfb86d784a95b86f10e48ad 10-Nov-2009 Jack Palevich <jackpal@google.com> am 8da3ac92: resolved conflicts for merge of 3f857b78 to eclair-mr2

Merge commit '8da3ac92a6a6247ef06de4d4b684f8635d8fc003' into eclair-mr2-plus-aosp

* commit '8da3ac92a6a6247ef06de4d4b684f8635d8fc003':
Allow a GLThread to release and reacquire the EGL Surface as needed.
8da3ac92a6a6247ef06de4d4b684f8635d8fc003 10-Nov-2009 Jack Palevich <jackpal@google.com> resolved conflicts for merge of 3f857b78 to eclair-mr2
32d416518473f3bf5323d660e5910ca5633ffed6 08-Nov-2009 Jack Palevich <jackpal@google.com> Allow a GLThread to release and reacquire the EGL Surface as needed.

We currently only allow one GLThread to have an active EGL Surface at a
time.(This may be lifted in the future, when EGL and GL are reentrant.)

Prior to this change we would enforce this rule by having older GLThreads
quit when a new GLThread started. That had the drawback of leaving the
older GLSurfaceViews in a zombie state -- their GLThreads would be
gone.

We now enforce this rule by just releasing and reacquiring the EGL surface
context as needed.

Specific changes to the code:

created private helper methods - startEgl and stopEgl to help manage
starting and stopping EGL.

Move the calls to sGLThreadManager start and end from the outermost run
method into the startEgl / stopEgl methods.

Reworked the wait loop to handle starting and stopping EGL as needed.

needToWait() gets simpler -- just looks at current status.

sGLThreadManager.shouldQuit was replaced by shouldHaveEgl.


This is another step in fixing bug 2228262.
LSurfaceView.java
6518c2bab4e336a08e703018accdf7d5e6a6a1ad 07-Nov-2009 Jack Palevich <jackpal@google.com> am e54f267f: am a3a351e5: resolved conflicts for merge of 4e3fadd0 to eclair-mr2

Merge commit 'e54f267f06e86f9c1248742fc56967355721a4e7'

* commit 'e54f267f06e86f9c1248742fc56967355721a4e7':
Fix stupid bug in GLThreadManager implementation.
e54f267f06e86f9c1248742fc56967355721a4e7 07-Nov-2009 Jack Palevich <jackpal@google.com> am a3a351e5: resolved conflicts for merge of 4e3fadd0 to eclair-mr2

Merge commit 'a3a351e5d164d0c8b461ae7af86edc0227654a76' into eclair-mr2-plus-aosp

* commit 'a3a351e5d164d0c8b461ae7af86edc0227654a76':
Fix stupid bug in GLThreadManager implementation.
a3a351e5d164d0c8b461ae7af86edc0227654a76 07-Nov-2009 Jack Palevich <jackpal@google.com> resolved conflicts for merge of 4e3fadd0 to eclair-mr2
a44249500f6c1c7a75b5c420fa2e81c2aa317a10 07-Nov-2009 Jack Palevich <jackpal@google.com> Fix stupid bug in GLThreadManager implementation.

The code intended to copy the old value of a field, before the
field was updated. However, what the code was actually doing was
copying the new value of the field, after the field was updated.

The fix was to move the copy to before the update.

This is work towards fixing bug 2228262
LSurfaceView.java
3f7b5a13ca6fdd31c934850ed802a74714e7b2cc 06-Nov-2009 Jack Palevich <jackpal@google.com> am a9e47546: am 79447b20: resolved conflicts for merge of 84872738 to eclair-mr2

Merge commit 'a9e47546a5132b30a2ed1e24d9193d4db09ef323'

* commit 'a9e47546a5132b30a2ed1e24d9193d4db09ef323':
Improve GLSurfaceView to avoid deadlocks and race conditions.
a9e47546a5132b30a2ed1e24d9193d4db09ef323 06-Nov-2009 Jack Palevich <jackpal@google.com> am 79447b20: resolved conflicts for merge of 84872738 to eclair-mr2

Merge commit '79447b2087c8c820d742185dda7305101f9656f0' into eclair-mr2-plus-aosp

* commit '79447b2087c8c820d742185dda7305101f9656f0':
Improve GLSurfaceView to avoid deadlocks and race conditions.
79447b2087c8c820d742185dda7305101f9656f0 06-Nov-2009 Jack Palevich <jackpal@google.com> resolved conflicts for merge of 84872738 to eclair-mr2
8b2c9c9ecb08d25244fa97fb42c2c315ae3cf03d 06-Nov-2009 Jack Palevich <jackpal@google.com> Improve GLSurfaceView to avoid deadlocks and race conditions.

This is work towards fixing bug 2228262

Specific issues fixed by this change:

+ GLThread names now include the thread id, making it easier to tell one
GLThread from another.

+ A private final static boolean LOG_THREADS can be set to true at compile
time to print out thread-related trace information, helpful for debugging
GLSurfaceView behavior. This static defaults to "false".

+ Changed calls to "notify" to "notifyAll" to make the code more
robust in case more than two threads are blocked on the same monitor.

+ Add a GLThreadManager to help manage the transition to
a new GLThread. Currently only one GLThread can be active in an address
space. When the second thread starts up, the GLThreadManager helps the old
GLThread to shut down,

+ Make sure we stop waiting for dead GLThreads. This is done by adding
checks for a variable mDone being true to our monitor wait loops. And
we use a "finally" clause at the end of GLThread.run() method to set mDone
and notifyAll any wait loops.
LSurfaceView.java
86a19b3d2c873113d6da49257cf720f90d1c2498 14-Oct-2009 Jack Palevich <jackpal@google.com> am 70d12dda: am 3743559d: Merge change I28023911 into eclair-mr2

Merge commit '70d12dda7c1e36850e1ed95d719bc1d6dadb6fef'

* commit '70d12dda7c1e36850e1ed95d719bc1d6dadb6fef':
Add additional error checking of EGL function calls.
70d12dda7c1e36850e1ed95d719bc1d6dadb6fef 14-Oct-2009 Jack Palevich <jackpal@google.com> am 3743559d: Merge change I28023911 into eclair-mr2

Merge commit '3743559db03645ef7d319c0344238c335a315b65' into eclair-mr2-plus-aosp

* commit '3743559db03645ef7d319c0344238c335a315b65':
Add additional error checking of EGL function calls.
28023911a4b572f0ca640e7a3e3f9a0dd6f535e9 14-Oct-2009 Jack Palevich <jackpal@google.com> Add additional error checking of EGL function calls.
LSurfaceView.java
ef79172c5501ea0110c24c24871d3b62be8997ed 14-Oct-2009 Jack Palevich <jackpal@google.com> am 98a51b86: am 3b7a1e6d: Merge change Ic52ba78c into eclair-mr2

Merge commit '98a51b86869e9cf2a1624f8540c4c126962a3a85'

* commit '98a51b86869e9cf2a1624f8540c4c126962a3a85':
Allow multiple OpenGL contexts on systems that support them.
98a51b86869e9cf2a1624f8540c4c126962a3a85 14-Oct-2009 Jack Palevich <jackpal@google.com> am 3b7a1e6d: Merge change Ic52ba78c into eclair-mr2

Merge commit '3b7a1e6d70fda4ce834034930847fe2cc75de515' into eclair-mr2-plus-aosp

* commit '3b7a1e6d70fda4ce834034930847fe2cc75de515':
Allow multiple OpenGL contexts on systems that support them.
c52ba78cab001ff68b4823f4769c129b8acfddee 14-Oct-2009 Jack Palevich <jackpal@google.com> Allow multiple OpenGL contexts on systems that support them.

Previously we always restricted the number of OpenGL contexts to 1.
LSurfaceView.java
d70213e70ed4b2648d696a554a0ba7dac4c32757 13-Oct-2009 Jack Palevich <jackpal@google.com> Implement GL11 and GL11Ext methods for GL Log and Error wrappers.

Until now we had been throwing UnsupportedOperationException when
developers tried to use the GL11 or GL11Ext methods. Now we handle
these methods correctly, passing their arguments through to the
wrapped interface's methods.

Fixes bug 2167522 GLUtils debug wrapper doesn't support GL11 features
LErrorWrapper.java
LLogWrapper.java
LWrapperBase.java
a46c138ab37e141f195d449f453dda8bd1df0947 26-Sep-2009 Jack Palevich <jackpal@google.com> am 07e0dce4: Merge change 27202 into eclair

Merge commit '07e0dce441ea056710efd76d7df18b8833de772a' into eclair-plus-aosp

* commit '07e0dce441ea056710efd76d7df18b8833de772a':
Check for failure to create EGL surfaces and contexts.
2e26fc08aa1939c19e939d983bd608cdec050024 26-Sep-2009 Jack Palevich <jackpal@google.com> Check for failure to create EGL surfaces and contexts.
LSurfaceView.java
bf0d9041202eb52b036a8a5854dd6fef55d87919 24-Sep-2009 Jack Palevich <jackpal@google.com> am b87f24a6: Merge change 26908 into eclair

Merge commit 'b87f24a6a88a994256ca97b69904af28824bc9ce' into eclair-plus-aosp

* commit 'b87f24a6a88a994256ca97b69904af28824bc9ce':
Fix broken Javadoc link for GLSurfaceView.EGLWindowSurfaceFactory.
d40dfbbbff81219258ca36b762a89ff503154345 24-Sep-2009 Jack Palevich <jackpal@google.com> Fix broken Javadoc link for GLSurfaceView.EGLWindowSurfaceFactory.
LSurfaceView.java
c055f173c9211b27184c56ce385df5278db4011c 24-Sep-2009 Jack Palevich <jackpal@google.com> am 1267b0e1: Merge change 26882 into eclair

Merge commit '1267b0e1844ac802de92b203007513573e4886fd' into eclair-plus-aosp

* commit '1267b0e1844ac802de92b203007513573e4886fd':
Publish minor additions to GLSurfaceView API.
82cbaab450d3c5d9f3d52c49881212f250d7cd97 24-Sep-2009 Jack Palevich <jackpal@google.com> Publish minor additions to GLSurfaceView API.

Clients can now modify the way that the EGL context and the EGL window
surface are created and destroyed.
LSurfaceView.java
b09c63e24043a6ca03f04709a92f528d233fd8d7 24-Sep-2009 Jack Palevich <jackpal@google.com> am 311ed019: Merge change 26679 into eclair

Merge commit '311ed0191d6423e41b1cf5137a38e53504494818' into eclair-plus-aosp

* commit '311ed0191d6423e41b1cf5137a38e53504494818':
Create samples showing how to call OpenGL from JNI libraries.
a8fecb87c5eaaefc9ca6272e3b59ef88d293dd6d 23-Sep-2009 Jack Palevich <jackpal@google.com> Create samples showing how to call OpenGL from JNI libraries.
LSurfaceView.java
e2317438433d4f2f822fe0c3659e70c89f6a707f 22-Sep-2009 Jack Palevich <jackpal@google.com> am 1167b43c: Merge change 26317 into eclair

Merge commit '1167b43c3d1ca232c9b4e0a75343b6b3cb90f0df' into eclair-plus-aosp

* commit '1167b43c3d1ca232c9b4e0a75343b6b3cb90f0df':
Allow GLSurfaceView clients to customize EGL Surfaces and Contexts.
15e1c6dc7a778590068b1cad55beea2bc6159509 22-Sep-2009 Jack Palevich <jackpal@google.com> Allow GLSurfaceView clients to customize EGL Surfaces and Contexts.

This API is hidden for now, will expose once it's been tested more.
LSurfaceView.java
5ac5b68bf103036843deb2e489d07e46c49c4bbd 22-Sep-2009 Jack Palevich <jackpal@google.com> am 5222a957: Merge change 26270 into eclair

Merge commit '5222a9571ea2538c989608d376ac71eabe0f09d4' into eclair-plus-aosp

* commit '5222a9571ea2538c989608d376ac71eabe0f09d4':
Fix GLSurfaceView to sync surfaceDestroyed with GL rendering thread
1bd888ba2e0976a179258cfa65ef07be31602a0a 22-Sep-2009 Jack Palevich <jackpal@google.com> Fix GLSurfaceView to sync surfaceDestroyed with GL rendering thread

Until now we had a race condition where the GL rendering thread could
continue rendering a frame after we have returned from the
SurfaceHolder.Callback.surfaceDestroyed notification.
LSurfaceView.java
85a2c7f1cad8fd55ed72a8a3dbb2b36632ebbff3 01-Sep-2009 Jean-Baptiste Queru <jbq@google.com> merge from open-source master
0648422f6721953cee30941b6798ded18e0ad2fb 25-Aug-2009 Android Code Review <code-review@android.com> Merge change 10840

* changes:
the vertex index should be "first + i".
82fd4fce16b9bbde25d044acc86ddf7306ebdd10 21-Aug-2009 Mathias Agopian <mathias@google.com> fix a bug in ComponentSizeChooser where it could pick a software EGLConfig instead of a better h/w one.

We now just try to honor the stencil / depth buffer "at least", while doing a "shortest distance" on the colors.
LSurfaceView.java
317a6280cc109e873646e4652be1582d870eedfd 14-Aug-2009 Mathias Agopian <mathias@google.com> Surface::GPU and Surface::HARDWARE are now deprecated; they will be set automatically if needed.

this also ripples into the window manager API by making some constant there deprecated as well.
LSurfaceView.java
219749df3ef8ad8efa4a1d4889403e179c268067 29-Jul-2009 Li Wenhao <gliwenhao@gmail.com> the vertex index should be "first + i".
LLogWrapper.java
7e263332e0c68f67868cb3245bf42f41e847d816 23-Jul-2009 Jack Palevich <jackpal@google.com> Remove recently-added android.opengl.Version API

There's another already-existing way of obtaining this information,
the ConfigurationInfo.reqGlEsVersion field returned from
ActivityManager.getDeviceConfigurationInfo.
ersion.java
1baf11b116d4094ea1f7149bbf1348d6290a637e 22-Jul-2009 Jack Palevich <jackpal@google.com> Add a public API that reports the supported OpenGLES API level.
ersion.java
843ef36f7b96cc19ea7d2996b7c8661b41ec3452 20-May-2009 Jean-Baptiste Queru <jbq@google.com> donut snapshot
LES10.java
LES10Ext.java
LES11.java
LES11Ext.java
LU.java
e20ea783a12f1031482c3aa01938efe39dcbf0a2 08-May-2009 Jack Palevich <jackpal@google.com> Require native-order direct buffers for glXXXPointer APIs.

This was always a documented restriction, but was not enforced by the runtime until now.

Until now, if you passed in some other kind of buffer, it would sometimes work, and
sometimes fail. The failures happened when the Java VM moved the buffer data while
OpenGL was still holding a pointer to it.

Now we throw an exception rather than leaving the system in a potentially bad state.
LES10.java
a379585e6e3ff41db6d71a5cd0a0403931bc525d 24-Apr-2009 Jack Palevich <jackpal@google.com> Enable static Java APIs for OpenGL ES 1.1 extensions.

This is just plumbing. The Java APIs existed already, but there were no C APIs to hook the Java APIs
up to. Now there are C APIs, so we can call them.

Of course, whether or not the C APIs actually work when you call them depend upon the
capabilities of the active OpenGL driver, which must be checked at run time.

Also, while we're here, make the glGetString method static. It was always supposed to be static,
but was accidentally implemented as non-static, because the code was copied from the non-static
OpenGL ES classes.
LES10.java
27f8002e591b5c579f75b2580183b5d1c4219cd4 16-Apr-2009 Jack Palevich <jackpal@google.com> Add an Android-specific static OpenGL ES 1.1 Java API.

This change adds four new public classes that expose a static OpenGL ES 1.1 API:

android.opengl.GLES10
android.opengl.GLES10Ext
android.opengl.GLES11
android.opengl.GLES11Ext

Benefits:

+ The static API is slightly faster (1% to 4%) than the existing Interface based JSR239 API.
+ The static API is similar to the C API, which should make it easier to import C-based
example code.
+ The static API provides a clear path for adding new OpenGL ES 1.1 extensions
and OpenGL ES 2.0 APIs, neither of which currently have a JSR standard.

Example:

import static android.opengl.GLES10.*;

...

glClear(GL_COLOR_BUFFER_BIT | GL_DEPTH_BUFFER_BIT);

Note that it is possible to mix-and-match calls to both the static and JSR239 APIs.
This works because neither API maintains state. They both call through to the same underlying
C OpenGL ES APIs.

Implementation details:

This change enhances the "glgen" "gen" script to generate both the original JSR239 and
new static OpenGL ES APIs. The contents of the generated JSR239 classes remained the same as before,
so there is no need to check in new versions of the generated JSR239 classes.

As part of this work the gen script was updated to be somewhat more robust, and to
work with git instead of perforce. The script prints out commands to git add the generated files,
but leaves it up to the script runner to actually execute those commands.
LES10.java
LES10Ext.java
LES11.java
LES11Ext.java
b1970201ecedde4cee25ded12efd5b09e976a6f1 10-Apr-2009 Jack Palevich <> AI 145526: am: CL 145249 Correct misspelling of constant RENDERMODE_CONTUOUSLY --> RENDERMODE_CONTINUOUSLY
Original author: jackpal
Merged from: //branches/cupcake/...

Automated import of CL 145526
LSurfaceView.java
23cda69aaa82718ad9cd29220b5b11b0de205493 09-Apr-2009 Jack Palevich <> AI 145523: am: CL 145244 Fully document GLSurfaceView and related classes.
Original author: jackpal
Merged from: //branches/cupcake/...

Automated import of CL 145523
LSurfaceView.java
93f411386a570082f25996cb373bc338c6beee7a 09-Apr-2009 Jack Palevich <> AI 145249: Correct misspelling of constant RENDERMODE_CONTUOUSLY --> RENDERMODE_CONTINUOUSLY
BUG=1766678

Automated import of CL 145249
LSurfaceView.java
722a96cbb4236fa8b4d84f7b1e1b64b30e656cd0 09-Apr-2009 Jack Palevich <> AI 145244: Fully document GLSurfaceView and related classes.
BUG=1766685

Automated import of CL 145244
LSurfaceView.java
b8488808899d27ea3d2c9d0091745012e13e3554 25-Mar-2009 Jack Palevich <> Automated import from //branches/donutburger/...@142687,142687
LU.java
c2310f32b0a1373012fd4a2db8cebdb46507b901 25-Mar-2009 Jack Palevich <> Automated import from //branches/donutburger/...@142486,142486
LSurfaceView.java
0577b26b7fc0a0dba4445c7965e05e98d4253211 25-Mar-2009 Jack Palevich <> Automated import from //branches/donutburger/...@141859,141859
LUtils.java
50fd2b9ef212e604e6821f751f40838d27b1f88f 25-Mar-2009 Jack Palevich <> Automated import from //branches/cupcake/...@142485,142485
LSurfaceView.java
c8405b6d02306d4cba4a169a4c24d7791dbaa0b4 25-Mar-2009 Jack Palevich <> Automated import from //branches/cupcake/...@141857,141857
LUtils.java
9066cfe9886ac131c34d59ed0e2d287b0e3c0087 04-Mar-2009 The Android Open Source Project <initial-contribution@android.com> auto import from //depot/cupcake/@135843
GLLogWrapper.java
LDebugHelper.java
LErrorWrapper.java
LException.java
LLogWrapper.java
LSurfaceView.java
LU.java
LUtils.java
LWrapperBase.java
roup.java
aterial.java
atrix.java
bject3D.java
exture.java
isibility.java
ackage.html
d83a98f4ce9cfa908f5c54bbd70f03eec07e7553 04-Mar-2009 The Android Open Source Project <initial-contribution@android.com> auto import from //depot/cupcake/@135843
GLLogWrapper.java
LDebugHelper.java
LErrorWrapper.java
LException.java
LLogWrapper.java
LSurfaceView.java
LU.java
LUtils.java
LWrapperBase.java
roup.java
aterial.java
atrix.java
bject3D.java
exture.java
isibility.java
ackage.html
076357b8567458d4b6dfdcf839ef751634cd2bfb 03-Mar-2009 The Android Open Source Project <initial-contribution@android.com> auto import from //depot/cupcake/@132589
atrix.java
isibility.java
3dec7d563a2f3e1eb967ce2054a00b6620e3558c 03-Mar-2009 The Android Open Source Project <initial-contribution@android.com> auto import from //depot/cupcake/@137055
atrix.java
isibility.java
f013e1afd1e68af5e3b868c26a653bbfb39538f8 18-Dec-2008 The Android Open Source Project <initial-contribution@android.com> Code drop from //branches/cupcake/...@124589
LDebugHelper.java
LSurfaceView.java
LU.java
54b6cfa9a9e5b861a9930af873580d6dc20f773c 21-Oct-2008 The Android Open Source Project <initial-contribution@android.com> Initial Contribution
GLLogWrapper.java
LDebugHelper.java
LErrorWrapper.java
LException.java
LLogWrapper.java
LU.java
LUtils.java
LWrapperBase.java
roup.java
aterial.java
atrix.java
bject3D.java
exture.java
isibility.java
ackage.html