645 Commits

Author SHA1 Message Date
Jack Palevich
4a2221ec4a 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.
2010-03-06 10:39:27 -08:00
Magnus Landqvist
f123ec8f7d Build software AGL library with correct get_tls() macro for ARMv7 based platforms
This prevents crashes on snapdragon processors.
2010-02-19 12:06:59 +01:00
Mathias Agopian
8f2423e8f3 get rid off the YUV formats at the libui layer 2010-02-16 17:33:37 -08:00
Mathias Agopian
2b726af2b8 Merge "fix [2189862] Race condition in eglIntialize and eglDestroy" 2010-02-05 18:37:17 -08:00
Mathias Agopian
6099ab701e fix [2189862] Race condition in eglIntialize and eglDestroy
there is now a lock protext a perticular display. it's held during
initialization and destruction.
2010-02-05 16:17:01 -08:00
Mathias Agopian
42d99d211f Proper EGLImageKHR error handling
Validate EGLImageKHR format and return an error for unsupported ones.
Also make sure to return an error when binding EGL_NO_IMAGE_KHR to a texture
2010-02-04 17:04:53 -08:00
Mathias Agopian
e304bdd5ee fix [2133133] Software OpenGL ES Lighting is buggy (GL Gears washed out bug)
A typo caused GL_AMBIENT_AND_DIFFUSE to only set the the ambient color.

Fix another typo which caused the viewer position to be wrong for
specular highlights.

Switch back to eye-space lighting, since there are still some issues
with some demos (San Angeles in particular).
2010-02-03 12:13:15 -08:00
Jack Palevich
019fe73ddb Fix ETC1 texture decoding.
etc1_decode_image requires the stride argument to be in bytes, but the
surface->stride field is in pixels. Convert by multiplying by pixel size.
2010-02-02 22:50:39 -08:00
Mathias Agopian
d1f73a2fca implement [2396050] Add ETC1 texture support to AGL 2010-02-02 20:19:54 -08:00
Mathias Agopian
9c84720da0 fix [2397853] glCopyTexImage2D crashes emulator
Fixed a typo which would cause a buffer overflow
2010-02-01 13:45:08 -08:00
Mike Playle
81d42591f7 Fix glReadPixels() to verify that both x and y are non-negative. 2010-01-29 09:52:22 +00:00
Jack Palevich
8a4de4be9e Implement the GL11ExtensionPack APIs. 2010-01-28 20:28:32 +08:00
Mathias Agopian
ac00ad1b88 fix [2341222] AGL version of glDrawTexxOES doesn't handle "Z" value correctly 2010-01-25 11:49:52 -08:00
Mathias Agopian
7552dcf936 fix [2303866] eglMakeCurrent doesn't return all error messages described in the spec 2010-01-25 11:30:11 -08:00
Jack Palevich
840e958847 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.
2010-01-18 15:13:12 +08:00
Gary King
01f8c06cbe Use correct TLS codepath in graphics libraries
Duplicate ARCH_ARM_HAVE_TLS_REGISTER BoardConfig to proprocessor
HAVE_ARM_TLS_REGISTER define from Bionic's libc Android.mk to ensure that
OpenGL libraries (libEGL, libGLESv1_CM, libGLESv2, libGLES_android) use the
correct codepath in bionic_tls.h for accessing the TLS address
2010-01-12 17:35:35 -08:00
Jack Palevich
90ce68a99f am 6d0f6c78: Merge "DO NOT MERGE A library for encoding and decoding ETC1 textures." into eclair
Merge commit '6d0f6c78037225ef5648d10e45a513a2e7c612b5' into eclair-plus-aosp

* commit '6d0f6c78037225ef5648d10e45a513a2e7c612b5':
  DO NOT MERGE A library for encoding and decoding ETC1 textures.
2010-01-09 21:54:28 -08:00
Romain Guy
980a938c1c Deprecate fill_parent and introduce match_parent.
Bug: #2361749.
2010-01-08 15:11:38 -08:00
Jack Palevich
994cd7959d DO NOT MERGE A library for encoding and decoding ETC1 textures.
The ETC1 compressed texture format is commonly
supported by OpenGL ES 2.0-capable devices.

This change adds a host-only version of the library. It is used by
the etc1tool.
2010-01-08 16:00:21 +08:00
Jean-Baptiste Queru
432bff01ec Do not use a user tag on apps, as it is ignored.
The build system does not honor user tags on apps,
and setting it is misleading.

This removes the confusion by making the makefiles
behave like they read.

Change-Id: I7c5feba1c7d07f915b97dd098584f29938a4c885
2010-01-06 08:53:44 -08:00
Jack Palevich
8af9649d44 Fix javadoc typos. 2009-12-31 15:29:28 +08:00
Jack Palevich
a6276fdd42 A library for encoding and decoding ETC1 textures.
The ETC1 compressed texture format is commonly
supported by OpenGL ES 2.0-capable devices.
2009-12-31 13:31:04 +08:00
Jack Palevich
1c875584c5 Print OpenGL version and extension information.
Something happened to the line endings, adding
a blank line after most lines of text. I
repaired the damage, but in the process some
blank lines have been added / removed.
2009-12-24 11:09:56 +08:00
Jack Palevich
244cc72fdf am e3449553: Merge change I49c9a3a3 into eclair
Merge commit 'e344955393133ac2f99f06cc6a4fe97fbf76f62e' into eclair-plus-aosp

* commit 'e344955393133ac2f99f06cc6a4fe97fbf76f62e':
  Fix bug 2325244	screen turns black for a brief period of time
2009-12-22 18:31:58 -08:00
Jack Palevich
49c9a3a3d4 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.
2009-12-22 11:45:31 +08:00
Jack Palevich
66a4a6e45f Fix merge conflict markers that accidentally got checked in.
(They were in a comment, so it wasn't detected by the compiler.)
2009-12-21 17:39:58 +08:00
Jack Palevich
21799450ec 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.
2009-12-21 14:47:35 +08:00
Jack Palevich
bcf848e096 am 74befcc7: am 981ccfbb: Implement Matrix Palette extension.
Merge commit '74befcc7fd721ca34f60bf75e18ce6faaab37aef'

* commit '74befcc7fd721ca34f60bf75e18ce6faaab37aef':
  Implement Matrix Palette extension.
2009-12-10 12:16:37 -08:00
Jack Palevich
4c2fc8cb25 resolved conflicts for merge of fac57636 to master 2009-12-10 12:13:54 -08:00
Android (Google) Code Review
2d016eb780 Merge change I5ddc721d
* changes:
  Add misssing symbol type directives.
2009-12-09 16:07:57 -08:00
Jack Palevich
74befcc7fd am 981ccfbb: Implement Matrix Palette extension.
Merge commit '981ccfbbfd737e2bdf0cedec0089975f91fd4e0a' into eclair-mr2-plus-aosp

* commit '981ccfbbfd737e2bdf0cedec0089975f91fd4e0a':
  Implement Matrix Palette extension.
2009-12-09 15:59:08 -08:00
Jack Palevich
fac576360f am aa396b96: Unhide the Android OpenGL ES 2.0 API
Merge commit 'aa396b9610f339cf280159144fbea47506f060e7' into eclair-mr2-plus-aosp

* commit 'aa396b9610f339cf280159144fbea47506f060e7':
  Unhide the Android OpenGL ES 2.0 API
2009-12-09 15:58:56 -08:00
Jack Palevich
44a95cc084 am 0dce2dd2: Extend GLSurfaceView to make it easy to create an OpenGL ES 2.0 context
Merge commit '0dce2dd26699e4dbfba8b8c5ea01f7fd03369e02' into eclair-mr2-plus-aosp

* commit '0dce2dd26699e4dbfba8b8c5ea01f7fd03369e02':
  Extend GLSurfaceView to make it easy to create an OpenGL ES 2.0 context
2009-12-09 15:58:45 -08:00
Jack Palevich
00666295a0 am 3608891b: Add a Java API for OpenGL ES 2.0.
Merge commit '3608891b83af9fbd1af9b9a411f2a90e52353ff8' into eclair-mr2-plus-aosp

* commit '3608891b83af9fbd1af9b9a411f2a90e52353ff8':
  Add a Java API for OpenGL ES 2.0.
2009-12-09 15:58:35 -08:00
Jack Palevich
981ccfbbfd 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.
2009-12-09 16:34:46 +08:00
Jack Palevich
aa396b9610 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.
2009-12-09 16:34:42 +08:00
Jack Palevich
0dce2dd266 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.
2009-12-09 16:34:34 +08:00
Jack Palevich
3608891b83 Add a Java API for OpenGL ES 2.0.
Currently this API is hidden.

Add a test program.
2009-12-09 16:34:33 +08:00
Android (Google) Code Review
5c47265a70 Merge change Ibe6eac82
* changes:
  Implement Matrix Palette extension.
2009-12-08 20:13:44 -08:00
Doug Kwan
89fe245e04 Add misssing symbol type directives. 2009-12-08 11:22:38 -08:00
Jack Palevich
be6eac828f 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.
2009-12-08 15:43:51 +08:00
Jack Palevich
c373edbf1c 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
2009-12-07 14:55:39 -08:00
Jack Palevich
9196034b84 am 30d90523: Merge changes Id682ab72,I9bb4dbae into eclair-mr2
Merge commit '30d905235074f343ebac6002408ab5c2b360ea14' into eclair-mr2-plus-aosp

* commit '30d905235074f343ebac6002408ab5c2b360ea14':
  Improve error message thrown when eglCreateContext fails.
  Improve error reporting by always returning the public
2009-12-04 15:59:10 -08:00
Jack Palevich
9bb4dbae91 Improve error message thrown when eglCreateContext fails. 2009-12-04 17:15:07 +08:00
Jack Palevich
d682ab72c5 Improve error reporting by always returning the public
EGL10.EGL_NO_XXX objects for displays, surfaces, and contexts.

This allows clients to compare the returned object against
the public EGL10.EGL_NO_XXX object using a simple == operation.

This fixes bug 2303947 "Java layer EGL API makes it difficult
to tell when certain methods have failed"
2009-12-04 17:07:31 +08:00
Li Wenhao
51438c18f5 the vertex index should be "first + i". 2009-12-02 21:15:33 -08:00
Mathias Agopian
cdc5651683 am 7671c088: am 77f17095: am 533a2803: Merge change I18ffb549 into eclair
Merge commit '7671c088cd5e6ce938c89939f55ead6629bd6516'

* commit '7671c088cd5e6ce938c89939f55ead6629bd6516':
  fix [2069023] STOPSHIP: disable DEBUG_COPYBIT
2009-12-01 18:51:49 -08:00
Mathias Agopian
7671c088cd am 77f17095: am 533a2803: Merge change I18ffb549 into eclair
Merge commit '77f17095ed17a6ccc7fc1f1b3ddb31c63bbf66a2' into eclair-mr2-plus-aosp

* commit '77f17095ed17a6ccc7fc1f1b3ddb31c63bbf66a2':
  fix [2069023] STOPSHIP: disable DEBUG_COPYBIT
2009-12-01 18:41:42 -08:00
Mathias Agopian
77f17095ed am 533a2803: Merge change I18ffb549 into eclair
Merge commit '533a2803506cc4f196403fdfafd948bd4f8e60d9' into eclair-mr2

* commit '533a2803506cc4f196403fdfafd948bd4f8e60d9':
  fix [2069023] STOPSHIP: disable DEBUG_COPYBIT
2009-12-01 17:13:50 -08:00
Mathias Agopian
8e04833151 am 533a2803: Merge change I18ffb549 into eclair
Merge commit '533a2803506cc4f196403fdfafd948bd4f8e60d9' into eclair-plus-aosp

* commit '533a2803506cc4f196403fdfafd948bd4f8e60d9':
  fix [2069023] STOPSHIP: disable DEBUG_COPYBIT
2009-11-30 12:17:52 -08:00