Commit Graph

529 Commits

Author SHA1 Message Date
Mathias Agopian
0696a57229 better error handling in EGL 2009-08-20 00:12:56 -07:00
Mathias Agopian
923c661a86 fix bug [2021677] egl driver unloaded after eglTerminate() is called
refactored the code so that:
- EGL APIs that can be called before or after eglInitialize() will work by loading the drivers first
- make eglGetDisplay() a lot more efficient
- make sure that EGL drivers are loaded in a thread-safe way
- don't unload the drivers upon calling eglTerminate(), they're now never unloaded, since there is no safe way to do it (some thread could be running)
- updated our EGL version to 1.4
- return better error codes if errors happen during initialization
2009-08-17 18:07:06 -07:00
Mathias Agopian
24e5f52901 Better error handling in EGL extensions 2009-08-12 21:18:15 -07:00
Mathias Agopian
5221271375 second take, hopefully this time it doesn't break one of the builds: "SurfaceFlinger will now allocate buffers based on the usage specified by the clients. This allows to allocate the right kind of buffer automatically, without having the user to specify anything." 2009-08-11 23:32:29 -07:00
Android (Google) Code Review
d2a6788876 Merge change 20893
* changes:
  show that we need to glClear to be fast(er)
2009-08-11 20:51:07 -07:00
Android (Google) Code Review
8717ff585e Merge change 20892
* changes:
  Revert "SurfaceFlinger will now allocate buffers based on the usage specified by the clients. This allows to allocate the right kind of buffer automatically, without having the user to specify anything."
2009-08-11 20:50:32 -07:00
Mathias Agopian
6c06ffc6d0 show that we need to glClear to be fast(er) 2009-08-11 20:50:20 -07:00
Fred Quintana
b2fd4665e6 Revert "SurfaceFlinger will now allocate buffers based on the usage specified by the clients. This allows to allocate the right kind of buffer automatically, without having the user to specify anything."
This reverts commit 8b76a0ac6fbf07254629ed1ea86af014d5abe050.
2009-08-11 20:49:35 -07:00
Mathias Agopian
687bea2359 option to use drawtexture at compile time 2009-08-11 20:12:18 -07:00
Mathias Agopian
cba73d3210 fix and extend the filter test a bit 2009-08-11 19:55:31 -07:00
Mathias Agopian
df37b62c62 SurfaceFlinger will now allocate buffers based on the usage specified by the clients. This allows to allocate the right kind of buffer automatically, without having the user to specify anything.
This change makes SurfaceHolder.setType(GPU) obsolete (it's now ignored).
Added an API to android_native_window_t to allow extending the functionality without ever breaking binary compatibility. This is used to implement the new set_usage() API. This API needs to be called by software renderers because the default is to use usage flags suitable for h/w.
2009-08-11 16:12:56 -07:00
Martin Storsjo
b94878cfb6 Calculate specular lighting correctly
Since the lighting calculations are done in object space, the vector
from the object to the viewer also needs to be transformed to object
space.
2009-08-11 18:01:14 +02:00
Mathias Agopian
1d3bcd6e21 workaround a bug in the SGX driver that would prevent eglGetConfig to work properly 2009-08-10 16:48:22 -07:00
Martin Storsjo
924cba8056 If FLAGS_2D_PROJECTION is set, the MVP matrices need updating when changing the viewport. 2009-08-10 13:03:59 +02:00
Mathias Agopian
dfbec0e282 add support for RGBX_8888 2009-08-07 20:55:14 -07:00
Mathias Agopian
0928e31cc7 minor code clean-up 2009-08-07 16:38:10 -07:00
Mathias Agopian
653870d5e9 update most gl tests to use EGLUtils 2009-08-06 16:26:15 -07:00
Mathias Agopian
6cf50a770d added two EGL helpers for selecting a config matching a certain pixelformat or native window type 2009-08-06 16:05:39 -07:00
Mathias Agopian
1c3561e8d8 added a gl swapinterval test 2009-08-05 17:38:49 -07:00
Mathias Agopian
591018aaf9 opengl tests 2009-08-05 12:22:29 -07:00
Mathias Agopian
d274eae545 log opengl-call-with-no-context only once per thread, instead of for each function call 2009-07-31 16:23:03 -07:00
Mathias Agopian
cf81c84e43 be more robust when errors occur upon EGL surface creation (ie: don't crash) 2009-07-31 14:47:00 -07:00
Mathias Agopian
cb6b904164 fixed some issues with the software renderer when surfaces are made current.
there was several issues:
- when a surface was made non-current, the last frame wasn't shown and the buffer could stay locked
- when a surface was made current the 2nd time, it would not dequeue a new buffer

now, queue/dequeue are done when the surface is made current.

for this to work, a new query() hook had to be added on android_native_window_t, it allows to retrieve some attributes of a window (currently only width and height).
2009-07-30 18:14:56 -07:00
Jean-Baptiste Queru
dee1b302ed merge from donut 2009-07-29 14:57:05 -07:00
Jean-Baptiste Queru
02f54246f5 donut snapshot 2009-07-29 14:25:07 -07:00
Mathias Agopian
574c16f9f8 GLESv2 couldn't be loaded due to wrong path specification 2009-07-29 11:10:29 -07:00
Jean-Baptiste Queru
9261bae1d2 Merge korg/donut into korg/master 2009-07-25 21:15:25 -07:00
Jean-Baptiste Queru
4d3b5c1e36 donut snapshot 2009-07-21 11:16:54 -07:00
Jean-Baptiste Queru
77de619c05 Merge commit 'goog/readonly-korg-master' into merge_korg_master
* commit 'goog/readonly-korg-master':
  Fixed Android issue #400, where the Intent documentation was inaccurate in a number of places, undoubtedly causing untold grief to innumerable masses.
  Bug Fixed for libagl.
2009-07-16 14:54:11 -07:00
Mathias Agopian
f13901eaa9 remove libagl's dependency on gralloc_priv.h 2009-07-15 18:53:32 -07:00
Mathias Agopian
8e5fb52a1d this header file is not needed anymore 2009-07-14 14:50:44 -07:00
Android (Google) Code Review
2521f47c4d am 46e28db8: Merge change 6713 into donut
Merge commit '46e28db8818332e3cda4cc410cc89a1ed7ce4db6'

* commit '46e28db8818332e3cda4cc410cc89a1ed7ce4db6':
  fix for [1969185] valgrind errors in new gl stuff
2009-07-09 17:35:26 -07:00
Mathias Agopian
dacd7a33c4 fix for [1969185] valgrind errors in new gl stuff 2009-07-09 17:33:15 -07:00
Marco Nelissen
fc865658b4 Make opengl loader use an absolute path. 2009-07-07 16:18:18 -07:00
Shin-ichiro KAWASAKI
4cce5bd5cc Bug Fixed for libagl. 2009-07-07 19:14:13 +09:00
Mathias Agopian
295eff2008 fix a bug where gl didn't always fallback to software when copybit failed. minor optimizations to copybit codepath. 2009-06-29 16:36:49 -07:00
Mathias Agopian
240c9fe59e use copybit for eglSwapBuffers() copy-back operations 2009-06-25 15:39:25 -07:00
Android (Google) Code Review
defcf8020d Merge change 5352 into donut
* changes:
  fix [1942438] eglGetCurrentSurface() returns bogus value
2009-06-25 13:22:55 -07:00
Mathias Agopian
8d2e83b9f4 Add eglGetRenderBufferANDROID() extension, which returns the current render buffer as an android_native_buffer_t* 2009-06-25 00:02:44 -07:00
Mathias Agopian
af74213546 fix [1942438] eglGetCurrentSurface() returns bogus value 2009-06-25 00:01:11 -07:00
Mathias Agopian
f51f9c8af3 fix [1942438] eglGetCurrentSurface() returns bogus value 2009-06-24 23:59:16 -07:00
Mathias Agopian
5911aa9510 copybit now uses a native_handle_t* instead of a fd/offset 2009-06-24 20:39:16 -07:00
Mathias Agopian
4c4b387afb merge master in master_gl 2009-06-24 18:31:21 -07:00
Mathias Agopian
e7829b8656 fix a bug where copybit would be rejected in landscape mode 2009-06-23 19:50:41 -07:00
Mathias Agopian
9f8b0c9097 Android now has its own EGL extension block (yay) 0x3140-0x314F. EGL_NATIVE_BUFFER_ANDROID now maps to 0x3140 instead of using the staging range 2009-06-23 14:05:35 -07:00
Android (Google) Code Review
60491bc2bf am 4fb69770: Merge change 5024 into donut
Merge commit '4fb69770e70352c987cc79414db7a03b52296ca7'

* commit '4fb69770e70352c987cc79414db7a03b52296ca7':
  Remove opengl tests from tests build
2009-06-22 22:04:57 -07:00
Android (Google) Code Review
952663ef57 am 5277103d: Merge change 5035 into donut
Merge commit '5277103db9033226814edc8fcba6f4ba4e846678'

* commit '5277103db9033226814edc8fcba6f4ba4e846678':
  add glTexParameteri() and fix glTexParameteriv()
2009-06-22 22:04:12 -07:00
Android (Google) Code Review
610f4dbe21 Merge change 5024 into donut
* changes:
  Remove opengl tests from tests build
2009-06-22 18:30:40 -07:00
Mathias Agopian
b12f99b315 add glTexParameteri() and fix glTexParameteriv() 2009-06-22 18:09:09 -07:00
Sriram Raman
8c1127fbe3 Remove opengl tests from tests build 2009-06-22 17:22:12 -07:00
Mathias Agopian
7272add7a5 we were not fetching the texture coords in the copybit case, so we were using garbage 2009-06-18 19:31:07 -07:00
Mathias Agopian
aa6e88b808 fix/add some comments 2009-06-17 21:58:18 -07:00
Mathias Agopian
6d2cad2c6c s/w OpenGL no detects and handles all any combinations of triangle fans corresponding to a rectangle
this allows fallback to faster copybit code in almost all cases.
2009-06-17 21:18:56 -07:00
Mathias Agopian
cf251b9e3b fix a scissor bug in the GLES-on-top-of copybit code 2009-06-16 18:08:29 -07:00
Mathias Agopian
b6822d7a3e Merge commit 'goog/master' into merge_master 2009-06-16 12:38:55 -07:00
Android (Google) Code Review
168f3c5201 am b4f7592b: Merge change 4299 into donut
Merge commit 'b4f7592b03c8424302c10e61474b0e2d0a71a630'

* commit 'b4f7592b03c8424302c10e61474b0e2d0a71a630':
  Allow pre-Donut apps to use indirect Buffers in GL11 Pointer methods.
  Fix IntentFilter constructor to properly process the action parameter.
2009-06-16 08:37:21 -07:00
Jack Palevich
c96812cb27 Allow pre-Donut apps to use indirect Buffers in GL11 Pointer methods.
Apps targeting Donut and newer will throw an exception.

We use a heuristic to determine whether an app is pre-Donut or not:
We take the address space's __progname, and use that as the application's
package name. For simple applications this is correct.
2009-06-15 21:03:24 -07:00
Mathias Agopian
0a3139a21e fix a bug where copybit only renders in the first buffer when used with s/w GL 2009-06-10 16:15:32 -07:00
Mathias Agopian
7e2a937c4f revive the copybit test. 2009-06-09 21:38:08 -07:00
Mathias Agopian
1a0c4cd5d8 Merge commit 'goog/master' into merge_master 2009-06-05 15:45:39 -07:00
Mathias Agopian
9648c1a2b9 make sure clear the draw and read EGLSurface when eglMakeCurrent() is called for unbinding from the thread 2009-06-03 19:00:53 -07:00
Mathias Agopian
f909cb6c69 remove some spurious debuging LOGD 2009-06-03 18:30:22 -07:00
Mathias Agopian
acdebe352d fix/clean these Android.mk following dbort and joeo's comments 2009-06-03 18:26:58 -07:00
Mathias Agopian
bee8b90e6e am cede1ed3: fix [1610840] Positional light doesn\'t work correctly on emulator
Merge commit 'cede1ed3e1721dc4a697a540388ef0f4b51c60eb'

* commit 'cede1ed3e1721dc4a697a540388ef0f4b51c60eb':
  fix [1610840] Positional light doesn't work correctly on emulator
2009-06-03 15:12:30 -07:00
Android (Google) Code Review
a35197e104 am 5de674e1: Merge change 3013 into donut
Merge commit '5de674e1cbd6e43b6d7954ccacf5cd709b30265d'

* commit '5de674e1cbd6e43b6d7954ccacf5cd709b30265d':
  Adding missing callback onJsConfirm to dismiss any confirmation dialogs
  fix a bug in GL lighting where the specular component could be ommited when vertex material was disabled.
2009-06-03 15:12:28 -07:00
Mathias Agopian
69ca17a124 fix [1610840] Positional light doesn't work correctly on emulator
This bug was introduced when lighting computations was changed from eye-space to object-space.
The light position need to be transformed back to object-space each time the modelview matrix changes which requires us to compute the inverse of the modelview matrix. This computation was done with the assumption that normals where transformed (which was the case when the computation was made in eye-space), however, normals only require the inverse of the upper 3x3 matrix while transforming positions requires the inverse of the whole matrix.
This caused the interesting behavior that lights were more-or-less transformed properly, but not translated at all, which caused improper lighting with directional lights in particular.

There was also another smaller bug affecting directional lights: when vertices are read, only the active component are read, the other ones are ignored, later, the transformation operations are set up to ignore the unset values, howver, in the case of lighting, we use the vertex in object space (that is, before it is transformed), and therefore were using uninitalized values; in particular w.
2009-06-03 15:09:52 -07:00
Android (Google) Code Review
2216b95610 Merge change 3013 into donut
* changes:
  fix a bug in GL lighting where the specular component could be ommited when vertex material was disabled.
2009-06-03 15:07:26 -07:00
Android (Google) Code Review
cddc40a4f3 am 5f784df5: Merge change 3011 into donut
Merge commit '5f784df5680e07f6cbc5d929560dfadc0e22db3b'

* commit '5f784df5680e07f6cbc5d929560dfadc0e22db3b':
  simplify this test
2009-06-02 22:56:05 -07:00
Mathias Agopian
50aba6d31d fix a bug in GL lighting where the specular component could be ommited when vertex material was disabled.
the specular enable flag wasn't computed in that case.
2009-06-02 22:51:09 -07:00
Mathias Agopian
17836acabf simplify this test 2009-06-02 18:35:48 -07:00
Android (Google) Code Review
cb1ae92655 am 7728be03: Merge change 2896 into donut
Merge commit '7728be035f5b3b814ef4455d1742d069dbcffb61'

* commit '7728be035f5b3b814ef4455d1742d069dbcffb61':
  added a test that exhibits some lighting issues in the software renderer. see external bug 1709
2009-06-02 00:36:42 -07:00
Mathias Agopian
4d661eb62c added a test that exhibits some lighting issues in the software renderer. see external bug 1709 2009-06-01 18:59:44 -07:00
Mathias Agopian
de58697644 implement a real loader for EGL drivers
we now look for a config file in /system/lib/egl/egl.cfg that describes the association of a display to a driver.
these drivers are named: /system/lib/egl/lib{[EGL|GLESv1_CM|GLESv2] | GLES}_$TAG.so
2009-05-28 20:31:40 -07:00
Mathias Agopian
b1a39d67be Added most of the support needed for GLES 2.x 2009-05-27 20:38:06 -07:00
Mathias Agopian
a3d66a834f minor modifications to the official GLES 2.x headers
- changed glTexImage2D() declaration so it matches that of GLES 1.x; otherwise we can't include both headers (!!!)
- added parameter names to the declaration of some extensions (this is needed by glapigen and glentrygen)
2009-05-27 20:32:20 -07:00
Mathias Agopian
48efd95015 add GLES 2.x headers 2009-05-27 20:31:18 -07:00
Mathias Agopian
310f8da0c3 merge master to master_gl 2009-05-22 02:16:08 -07:00
Android (Google) Code Review
e6b922ab30 am bb7b7b31: Merge change 2152 into donut
Merge commit 'bb7b7b316a6a15f4df6af3c62a293920c68c7b00'

* commit 'bb7b7b316a6a15f4df6af3c62a293920c68c7b00':
  make sure to fail to software when the h/w renderer cannot be initialized
2009-05-20 22:44:06 -07:00
Mathias Agopian
5c846bd6cf make sure to fail to software when the h/w renderer cannot be initialized 2009-05-20 17:58:36 -07:00
Mathias Agopian
c5b2c0bf80 move libbinder's header files under includes/binder 2009-05-20 12:55:03 -07:00
Mathias Agopian
208059f67e checkpoint: split libutils into libutils + libbinder 2009-05-20 12:55:02 -07:00
Jean-Baptiste Queru
9660d304ae donut snapshot 2009-05-20 11:28:04 -07:00
Mathias Agopian
614ecde4cb libGLESv1_CM.so doesn't need to depend on libutils or libui 2009-05-18 13:42:18 -07:00
Mathias Agopian
d8fb7b586f remove libEGL and libGLESv1_CM dependencies on libutils and libui 2009-05-17 18:50:16 -07:00
Jack Palevich
6eedc8d3b5 Fix bug 1856713 gl Pointer functions should use Buffer position
JSR239 and android.opengl gl Pointer functions (glColorPointer, etc.)
now respect the current setting of the Buffer position.

This fixes a regression introduced when we started requiring the
Buffers passed to the Pointer functions to be direct Buffers.
2009-05-15 18:13:34 -07:00
Mathias Agopian
d717598616 Merge commit 'goog/master' into merge_master
Conflicts:
	opengl/libagl/Android.mk
	opengl/libs/Android.mk
	opengl/libs/egl_impl.h
2009-05-14 22:44:23 -07:00
Mathias Agopian
eccc8cfb2f should help fix the Simulator build. 2009-05-13 00:19:22 -07:00
Mathias Agopian
d373c6348a remove the gl{Vertex|Color|TexCoord|Normal}PointerBounds() "extension" fro eglext.h 2009-05-08 17:18:55 -07:00
Mathias Agopian
94aa09680a should fix the build. 2009-05-08 16:05:23 -07:00
Mathias Agopian
48685c45bb only export the GL entry-points, hide everything else.
Conflicts:

	opengl/libagl/Android.mk
	opengl/libs/Android.mk
	opengl/libs/egl_impl.h
2009-05-08 15:23:38 -07:00
Mathias Agopian
5958661507 Merge commit 'goog/master' into merge_master 2009-05-08 13:13:12 -07:00
Jack Palevich
46d25a371d 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.
2009-05-07 18:28:29 -07:00
Mathias Agopian
e6bf8b32b6 fix EGL extension string names 2009-05-07 15:07:52 -07:00
Mathias Agopian
df3ca30bf6 created an new EGL extension called ANDROID_swap_rectangle
ANDROID_swap_rectangle allows to specify the rectangle affected by eglSwapBuffers(), anything outside of this rectangle is unchanged. in particular EGL_BUFFER_DESTROYED only applies to that rectangle. This extension as well as EGL_BUFFER_PRESERVED allow major optimizations on surfaceflinger, which can redraw only the dirty area during compositing.

However, ANDROID_swap_rectangle allows further optimizations in EGL by reducing the amount of copy-back needed. ANDROID_swap_rectangle is particularily important for software implementations.
2009-05-07 15:07:33 -07:00
Jack Palevich
593f203ba3 Fix automatically generated code for glGet
Remove include of an internal agl header file. We should not depend on any implementation details
of our software renderer, since they may not be correct if another renderer is used.
Fix glGet number-of-elements logic for GL_FOG_COLOR GL_LIGHT_MODEL_AMBIENT,
and GL_COMPRESSED_TEXTURE_FORMATS.
2009-05-07 10:52:18 -07:00
Mathias Agopian
58a79f4745 move android_native_buffer_t declaration into its own private/ui/android_native_priv.h header, since user code should never have access to it. 2009-05-05 18:21:32 -07:00
Mathias Agopian
7189c0054e move opengl/include/EGL/android_natives.h to include/ui/egl/android_natives.h and don't include it from egl.h
the android_native_ types are just forward declared in egl.h
2009-05-05 18:11:11 -07:00
Mathias Agopian
21c59d0070 get rid of android_native_buffer_t::getHandle() and replace it with an handle field
this abstraction was not necessary. things are easier now.
2009-05-05 00:59:23 -07:00
Mathias Agopian
e71212ba53 removed the "bits" attribute from android_native_buffer_t.
"bits" can never be trusted now that we need to call lock() on the handle to get the virtual address of the buffer.
2009-05-05 00:37:46 -07:00
Mathias Agopian
0926f50664 update surfaceflinger, libui and libagl to the new gralloc api
- Currently the lock/unlock path is naive and is done for each drawing operation (glDrawElements and glDrawArrays). this should be improved eventually.
- factor all the lock/unlock code in SurfaceBuffer.
- fixed "showupdate" so it works even when we don't have preserving eglSwapBuffers().
- improved the situation with the dirty-region and fixed a problem that caused GL apps to not update.
- make use of LightRefBase() where needed, instead of duplicating its implementation
- add LightRefBase::getStrongCount()
- renamed EGLNativeWindowSurface.cpp to FramebufferNativeWindow.cpp

- disabled copybits test, since it clashes with the new gralloc api

- Camera/Video will be fixed later when we rework the overlay apis
2009-05-04 14:17:04 -07:00
Mathias Agopian
7be3e5d2d8 Merge commit 'goog/master' into merge_master
Conflicts:
	libs/surfaceflinger/Layer.cpp
	libs/surfaceflinger/SurfaceFlinger.cpp
	opengl/libagl/egl.cpp
	opengl/libs/EGL/egl.cpp
	opengl/libs/GLES_CM/gl.cpp
	opengl/libs/GLES_CM/gl_api.in
	opengl/libs/gl_entries.in
	opengl/libs/tools/glapigen
2009-04-30 14:43:18 -07:00
Mathias Agopian
3d8817935b oops forgot to remove a LOGD when loading an opengl driver 2009-04-24 18:16:44 -07:00
Android (Google) Code Review
4e8bdce13f Merge change 551 into donut
* changes:
  Enable static Java APIs for OpenGL ES 1.1 extensions.
2009-04-24 14:17:01 -07:00
Jack Palevich
3327d6c5ac 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.
2009-04-24 13:07:17 -07:00
Mathias Agopian
1c2be6af86 Make sure to map undefined OES functions to their non-OES counterpart if it exists. 2009-04-23 19:57:10 -07:00
Mathias Agopian
b519abb606 use gl.h to generate the *.in files. we are now supporting the full gl.h and glext.h apis. 2009-04-23 18:05:44 -07:00
Mathias Agopian
53238bddea integrate some OpenGL ES changes back from master_gl in preparation of opening GLES to the NDK. 2009-04-23 13:45:48 -07:00
Mathias Agopian
34dd2d1c2d Merge commit 'goog/master' into merge_master 2009-04-17 13:11:48 -07:00
Jack Palevich
412f38f270 Manually merge 129, 174, and 233 from donut
This adds a static OpenGL ES API.

Here are the three commit messages for the original changes:

Clean up trivial Eclipse warnings and fix whitespace.

Added @Override to overridden methods.
Removed unused imports.
Converted tabs to spaces.
Removed \r characters from end-of-lines.
Add .gitignore file to ignore the .class files that are
generated when the "gen" script is run.

This is the 2nd commit message:

Improve glgen

+ gen script is really a bash script rather than a sh script,
  so declare that to be true. (For example, it uses pushd,
  which is a part of bash, but not a part of sh. Not sure
  how this worked until now. Possibly gen was only run in
  environments where /bin/sh was really bash.

+ Check the results of the java compile of the code generator,
  and abort the script if the compile fails.

+ Turn on the bash shell option that guards against using
  uninitialized variables in the script.

+ Remove the generated class files.

Refactor JniCodeEmitter into two classes: a general-purpose
JniCodeEmitter and a specific Jsr239CodeEmitter. The hope is
to use JniCodeEmitter as a base for emitting static OpenGL ES
bindings.

This is the 3rd commit message:

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.
2009-04-17 10:32:56 -07:00
Jack Palevich
427f585f72 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.
2009-04-16 15:20:55 -07:00
Jack Palevich
ffac1eff58 Improve glgen
+ gen script is really a bash script rather than a sh script,
  so declare that to be true. (For example, it uses pushd,
  which is a part of bash, but not a part of sh. Not sure
  how this worked until now. Possibly gen was only run in
  environments where /bin/sh was really bash.

+ Check the results of the java compile of the code generator,
  and abort the script if the compile fails.

+ Turn on the bash shell option that guards against using
  uninitialized variables in the script.

+ Remove the generated class files.

Refactor JniCodeEmitter into two classes: a general-purpose
JniCodeEmitter and a specific Jsr239CodeEmitter. The hope is
to use JniCodeEmitter as a base for emitting static OpenGL ES
bindings.
2009-04-14 19:00:09 -07:00
Jack Palevich
8f75e091d9 Add clarifying comment.
(Primarily as a test of the master_gl branch.)
2009-04-13 22:03:39 -07:00
Jack Palevich
6cbca50b6a Clean up trivial Eclipse warnings and fix whitespace.
Added @Override to overridden methods.
Removed unused imports.
Converted tabs to spaces.
Removed \r characters from end-of-lines.
Add .gitignore file to ignore the .class files that are
generated when the "gen" script is run.
2009-04-13 16:40:25 -07:00
Mathias Agopian
8b765b7f5e more debugging tools around BufferMapper 2009-04-10 20:34:46 -07:00
Mathias Agopian
076b1cc3a9 Integrate from //sandbox/mathias/donut/...@145728
SurfaceFlinger rework for new EGL driver model support.
2009-04-10 14:24:30 -07:00
Jack Palevich
4ec2152709 AI 144401: am: CL 144282 Tweak this tool to work with the current directory structure.
Also leave the "generated" directory around if it contains files that
  need to be checked in.
  Original author: jackpal

Automated import of CL 144401
2009-04-02 23:05:05 -07:00
Jack Palevich
c893868227 AI 144282: Tweak this tool to work with the current directory structure.
Also leave the "generated" directory around if it contains files that
  need to be checked in.

Automated import of CL 144282
2009-04-02 13:38:26 -07:00
Jack Palevich
749c63dbff Automated import from //branches/master/...@142578,142578 2009-03-25 15:12:17 -07:00
Jack Palevich
87d80228cc Automated import from //branches/donutburger/...@142484,142484 2009-03-24 22:48:26 -07:00
Jack Palevich
df351ba573 Automated import from //branches/cupcake/...@142481,142481 2009-03-24 20:18:08 -07:00
The Android Open Source Project
edbf3b6af7 auto import from //depot/cupcake/@135843 2009-03-03 19:31:44 -08:00
The Android Open Source Project
d5193d9394 auto import from //depot/cupcake/@135843 2009-03-03 18:28:45 -08:00
The Android Open Source Project
43aa2b1cbf auto import from //depot/cupcake/@132589 2009-03-03 14:04:24 -08:00
The Android Open Source Project
0bb03408de auto import from //depot/cupcake/@137055 2009-03-02 22:54:33 -08:00
The Android Open Source Project
d2bd26d326 auto import from //branches/cupcake/...@132276 2009-02-19 10:57:31 -08:00
The Android Open Source Project
a6938bab1f auto import from //branches/cupcake/...@130745 2009-02-10 15:44:00 -08:00
The Android Open Source Project
8a7a67538a auto import from //branches/cupcake/...@126645 2009-01-15 16:12:10 -08:00
The Android Open Source Project
e09fd9e819 Code drop from //branches/cupcake/...@124589 2008-12-17 18:05:43 -08:00
The Android Open Source Project
7c1b96a165 Initial Contribution 2008-10-21 07:00:00 -07:00