Commit Graph

150 Commits

Author SHA1 Message Date
Mathias Agopian
45351bcae5 fix [2341222] AGL version of glDrawTexxOES doesn't handle "Z" value correctly 2010-01-25 11:49:52 -08:00
Gary King
9166f7bfa7 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
Doug Kwan
9054ddfcd7 Add misssing symbol type directives. 2009-12-08 11:22:38 -08:00
Mathias Agopian
69fec4726b 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
f9f36b5ecd 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
Mathias Agopian
f74573486d fix [2069023] STOPSHIP: disable DEBUG_COPYBIT 2009-11-30 12:10:53 -08:00
Mathias Agopian
1850ea3a03 am b439f561: am 13feccf5: Merge change I39f0003e into eclair
Merge commit 'b439f561a6aa3900f1850e71a4aa60618af13f90' into eclair-mr2-plus-aosp

* commit 'b439f561a6aa3900f1850e71a4aa60618af13f90':
  fix [2235414] libagl glDeleteBuffers() crashes
2009-11-19 19:12:01 -08:00
Mathias Agopian
935b3deec9 am 13feccf5: Merge change I39f0003e into eclair
Merge commit '13feccf592d6870b41b3b8a0a31d2abefad0d7ae' into eclair-plus-aosp

* commit '13feccf592d6870b41b3b8a0a31d2abefad0d7ae':
  fix [2235414] libagl glDeleteBuffers() crashes
2009-11-19 19:07:17 -08:00
Mathias Agopian
a750fc0bf8 fix [2235414] libagl glDeleteBuffers() crashes
don't dereference null pointers, would happen if one of the array wasn't bound.
2009-11-19 17:32:05 -08:00
Jean-Baptiste Queru
daeaa536fa merge from eclair 2009-11-15 12:06:23 -08:00
Jean-Baptiste Queru
cc8c35cee5 eclair snapshot 2009-11-13 13:53:39 -08:00
Mathias Agopian
c656e03674 am 66b5d902: am 27407208: Merge change Icf335098 into eclair
Merge commit '66b5d902a29e08237f16be53a84f9c2472df8493' into eclair-mr2-plus-aosp

* commit '66b5d902a29e08237f16be53a84f9c2472df8493':
  fix [2236865] STOPSHIP: bump soft gl and egl minor version number
2009-11-13 09:26:24 -08:00
Mathias Agopian
ffd6583e15 am 27407208: Merge change Icf335098 into eclair
Merge commit '274072089ceff6eacb9ccfb59290a18f43739c87' into eclair-plus-aosp

* commit '274072089ceff6eacb9ccfb59290a18f43739c87':
  fix [2236865] STOPSHIP: bump soft gl and egl minor version number
2009-11-12 19:08:01 -08:00
Mathias Agopian
1eeffc6814 fix [2236865] STOPSHIP: bump soft gl and egl minor version number 2009-11-12 15:19:42 -08:00
Mathias Agopian
51f7605e37 am 0b9d3ba2: am c421fc2a: Merge change Id09376d1 into eclair
Merge commit '0b9d3ba2feab494e7bbd180b51a4311864d08e13' into eclair-mr2-plus-aosp

* commit '0b9d3ba2feab494e7bbd180b51a4311864d08e13':
  fix [2071412] work around mdp 32-bits fade limitation
2009-11-09 19:38:43 -08:00
Mathias Agopian
60625acb24 am c421fc2a: Merge change Id09376d1 into eclair
Merge commit 'c421fc2ada7c1bff104733b840bd640151bebbbb' into eclair-plus-aosp

* commit 'c421fc2ada7c1bff104733b840bd640151bebbbb':
  fix [2071412] work around mdp 32-bits fade limitation
2009-11-09 19:34:26 -08:00
Mathias Agopian
198340395d fix [2071412] work around mdp 32-bits fade limitation
make sure to always specify blits *inside* the source bitmap.
2009-11-09 17:55:59 -08:00
Jean-Baptiste Queru
ff230a51f5 merge from open-source master 2009-11-09 11:00:18 -08:00
Jean-Baptiste Queru
143b2a789c merge from open-source master 2009-11-08 17:03:30 -08:00
Mathias Agopian
8b6b95abae part of fix [2186418] switch passion to 24-bits framebuffer
add support for RGBX_8888 EGLConfigs in the software renderer
(since that's what we're using in the MDP case)
2009-11-04 14:51:18 -08:00
Mathias Agopian
bc4929117d fix [2236832] software OpenGL ES driver doesn't work on sholes
make sure to not pass our fake handles to the real gralloc
2009-11-03 21:08:06 -08:00
Android (Google) Code Review
33e18e4ec7 Merge change I56981989 into eclair
* changes:
  fix [2231527] Compatibility with SpaceJunk game (OpenGL)
2009-11-03 18:04:49 -05:00
Mathias Agopian
b44efdc6ba fix [2231527] Compatibility with SpaceJunk game (OpenGL)
we treated all lights as local lights when transforming their
position back to object space.
2009-11-02 18:33:08 -08:00
Mathias Agopian
6fee064809 fix[2228133] pixelflinger ignores the "vertical stride" leading to artifacts when playing back video
we lost the concept of vertical stride when moving video playback to EGLImage.
Here we bring it back in a somewhat hacky-way that will work only for the
softgl/mdp backend.
2009-11-02 17:48:33 -08:00
Iliyan Malchev
d95c322af3 libagl: silence a LOGD
Signed-off-by: Iliyan Malchev <malchev@google.com>
2009-10-30 18:29:08 -07:00
Mathias Agopian
df2d929405 return proper error code from eglCreateImageKHR 2009-10-29 16:45:41 -07:00
Mathias Agopian
2ad8ec50a5 fix [2071412] work around mdp 32-bits fade limitation
in the case where we fade a 32-bits surface (ie: GL_MODULATE w/ a,a,a,a + blending),
we first make a copy of the background into a RGB buffer, then we blend the 32-bits
surface as usual (without the alpha component), and finally blend the copy of
the background on top with 1-a. This uses a lot of bandwidth, but no CPU time.
2009-10-28 14:49:44 -07:00
Mathias Agopian
54ba51dff2 fix [2143798] Need to figure out how to do video
Use EGLImageKHR instead of copybit directly.
    We now have the basis to use streaming YUV textures (well, in fact
    we already are). When/if we use the GPU instead of the MDP we'll
    need to make sure it supports the appropriate YUV format.

    Also make sure we compile if EGL_ANDROID_image_native_buffer is not supported
2009-10-27 13:13:29 -07:00
Android (Google) Code Review
898300890d Merge change I0953c1d5 into eclair
* changes:
  fix [2153873] EGL-1.4 software implementation misses surface attributes
2009-10-19 18:27:47 -04:00
Mathias Agopian
0985f6a4ea fix [2153873] EGL-1.4 software implementation misses surface attributes 2009-10-19 14:46:27 -07:00
Android (Google) Code Review
e614aeaf32 Merge change Ide4c8cbc into eclair
* changes:
  fix [2151588] glTexSubImage2D() allows pixel format conversion
2009-10-19 17:31:52 -04:00
Mathias Agopian
d13e46158a fix [2151588] glTexSubImage2D() allows pixel format conversion 2009-10-19 14:23:02 -07:00
Mathias Agopian
6dbedd7519 one step towards fixing [2071412] work around mdp 32-bits fade limitation
simplify the GL_MODULATE case and allow blending disabled with RGBA texture
2009-10-16 18:24:12 -07:00
Christoffer Gurell
97640b9320 Fix obvious typo bug in egl.cpp
can (and does sometimes) lead to accessing array with -1 as index
2009-10-12 11:57:27 +02:00
Mathias Agopian
56fa27572a fix [2147737] Pixel Flinger needs to set EGL_RENDERABLE_TYPE to EGL_OPENGL_ES_BIT
Also set max swap interval to 1, which is the only supported value currently.
2009-09-27 20:18:16 -07:00
Mathias Agopian
c5f0155d7f OpenGL ES doesn't allow glColorPointer with a size parameter other than 4 2009-09-24 14:22:29 -07:00
Jack Palevich
cfa316b9e7 AGL's glCompressedTexImage2D now checks the imageSize parameter.
This parameter indicates how many bytes of the image data are valid.

Previously this parameter was ignored.
2009-09-10 17:13:28 -07:00
Martin Storsjo
e03eaa1551 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-25 18:35:54 -07:00
Martin Storsjo
d914215edf If FLAGS_2D_PROJECTION is set, the MVP matrices need updating when changing the viewport. 2009-08-25 18:35:03 -07:00
Android Code Review
7e05c0e886 Merge change 11093
* changes:
  If FLAGS_2D_PROJECTION is set, the MVP matrices need updating when changing the viewport.
2009-08-25 14:37:28 -07:00
Mathias Agopian
0696a57229 better error handling in EGL 2009-08-20 00:12:56 -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
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
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
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
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
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
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
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
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
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
b12f99b315 add glTexParameteri() and fix glTexParameteriv() 2009-06-22 18:09:09 -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
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
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
acdebe352d fix/clean these Android.mk following dbort and joeo's comments 2009-06-03 18:26:58 -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
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
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
Jean-Baptiste Queru
9660d304ae donut snapshot 2009-05-20 11:28:04 -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
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
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
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
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
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
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
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