480 Commits

Author SHA1 Message Date
Jack Palevich
d40dfbbbff Fix broken Javadoc link for GLSurfaceView.EGLWindowSurfaceFactory. 2009-09-24 14:10:17 -07:00
Jack Palevich
726d9074cf am d0b58414: Merge change 26891 into eclair
Merge commit 'd0b584148bdcc219136d92e2034e316ae50c8151' into eclair-plus-aosp

* commit 'd0b584148bdcc219136d92e2034e316ae50c8151':
  Make tritex test run with latest OpenGL driver.
2009-09-24 12:27:16 -07:00
Jack Palevich
87a7265ee1 Make tritex test run with latest OpenGL driver.
Use EGLUtils::selectConfigForNativeWindow to select a legitimate
configuration. (Before now we had been selecting an incorrect
configuration, but the older drivers let us get away with it.)

Converted the source to C++ so we can call selectConfigForNativeWindow.
2009-09-24 12:19:05 -07:00
Jack Palevich
c055f173c9 am 1267b0e1: Merge change 26882 into eclair
Merge commit '1267b0e1844ac802de92b203007513573e4886fd' into eclair-plus-aosp

* commit '1267b0e1844ac802de92b203007513573e4886fd':
  Publish minor additions to GLSurfaceView API.
2009-09-24 12:06:29 -07:00
Jack Palevich
82cbaab450 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.
2009-09-24 11:55:04 -07:00
Jack Palevich
b09c63e240 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.
2009-09-23 15:03:46 -07:00
Jack Palevich
a8fecb87c5 Create samples showing how to call OpenGL from JNI libraries. 2009-09-23 14:48:07 -07:00
Jack Palevich
e231743843 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.
2009-09-21 19:31:42 -07:00
Jack Palevich
15e1c6dc7a Allow GLSurfaceView clients to customize EGL Surfaces and Contexts.
This API is hidden for now, will expose once it's been tested more.
2009-09-21 19:19:25 -07:00
Jack Palevich
5ac5b68bf1 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
2009-09-21 16:09:45 -07:00
Jack Palevich
1bd888ba2e 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.
2009-09-21 15:59:17 -07:00
Mathias Agopian
be4d7d2446 am cc7f40a8: Merge change 26060 into eclair
Merge commit 'cc7f40a88d64cbb4e664e231668ae4e2862036c6' into eclair-plus-aosp

* commit 'cc7f40a88d64cbb4e664e231668ae4e2862036c6':
  log an error when loading an existing GL driver fails
2009-09-20 16:15:29 -07:00
Mathias Agopian
40621774ec log an error when loading an existing GL driver fails 2009-09-20 16:07:26 -07:00
Jack Palevich
f44ddb6b45 am cd0aceb7: Merge change 25883 into eclair
Merge commit 'cd0aceb710fc3b62a238992ceef628e359ee1e7d' into eclair-plus-aosp

* commit 'cd0aceb710fc3b62a238992ceef628e359ee1e7d':
  Draw a green triangle using OpenGL 2.0 APIs.
2009-09-18 18:37:38 -07:00
Jack Palevich
953254b2f2 Draw a green triangle using OpenGL 2.0 APIs. 2009-09-18 18:27:37 -07:00
Jack Palevich
6d3179332d am 78059337: Merge change 25523 into eclair
Merge commit '7805933738de33b1961bd03553237a86d90792dd' into eclair-plus-aosp

* commit '7805933738de33b1961bd03553237a86d90792dd':
  Add additional error checking, exit early if errors occur.
2009-09-17 11:06:54 -07:00
Jack Palevich
fc342cbbf7 Add additional error checking, exit early if errors occur. 2009-09-17 10:59:23 -07:00
Jack Palevich
c05a7f6216 am fee6b69a: Merge change 25303 into eclair
Merge commit 'fee6b69a7ce38118423c114abb977fd1b053be3c' into eclair-plus-aosp

* commit 'fee6b69a7ce38118423c114abb977fd1b053be3c':
  Add EGL call error checking.
2009-09-16 11:40:30 -07:00
Jack Palevich
113096d5d0 Add EGL call error checking. 2009-09-16 11:08:43 -07:00
Jack Palevich
b734a268a0 am ebebf9c3: Merge change 24618 into eclair
Merge commit 'ebebf9c36c0112d99cb2e11953febdff8ba5ff23' into eclair-plus-aosp

* commit 'ebebf9c36c0112d99cb2e11953febdff8ba5ff23':
  AGL's glCompressedTexImage2D now checks the imageSize parameter.
2009-09-10 17:51:50 -07:00
Jack Palevich
fb5ea2e579 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
Jason Sams
8fb913661c am e00d660a: Merge change 23584 into eclair
Merge commit 'e00d660aba91a7a682f83b2e0216296b0f3cca64' into eclair-plus-aosp

* commit 'e00d660aba91a7a682f83b2e0216296b0f3cca64':
  Simple app to create a gl2 context and dump the strings.
2009-09-02 19:16:20 -07:00
Jason Sams
b22f5b3bb3 Simple app to create a gl2 context and dump the strings. 2009-09-01 20:41:05 -07:00
Jean-Baptiste Queru
85a2c7f1ca merge from open-source master 2009-09-01 11:46:14 -07:00
Martin Storsjo
c0dea96491 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
4f31af9346 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
0648422f67 Merge change 10840
* changes:
  the vertex index should be "first + i".
2009-08-25 14:37:40 -07:00
Android Code Review
46ba1c964f 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
94263d7923 fix a bug recently introduced where EGL couldn't be initialized again after it had been terminated once 2009-08-24 21:47:13 -07:00
Mathias Agopian
4a34e888ae first step for fixing [2066786] EGL object lifetime management doesn't respect the EGL spec
this change fixes the lifetime mgt of EGLSurface, EGLContext and EGLImageKHR in the EGL wrapper.
EGLDisplay is still somewhat bogus and libagl's EGL is still incorrect.

The idea of the change is that EGL objects are put in a list when created and removed when destroyed.
Before each use, we first verify if the object is in the list and if so a reference is taken and kept
for the scope of the whole EGL API being called, if not, an error is returned.

Upon object destruction, the object is simply marked as "terminated" (this is not protected by a lock
because it doesn't really matter). This flag is only used to deny access to the object by other APIs
while it's still valid (for instance current or being used by another function in another thread).
A reference is also removed and the object can then actually be destroyed when going out of scope.
2009-08-21 19:45:44 -07:00
Mathias Agopian
82fd4fce16 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.
2009-08-20 19:09:34 -07:00
Mathias Agopian
ffbc864329 better error handling in EGL 2009-08-20 00:12:56 -07:00
Mathias Agopian
dcebf6f65a 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
317a6280cc 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.
2009-08-13 18:19:32 -07:00
Mathias Agopian
88e3e6bd04 Better error handling in EGL extensions 2009-08-12 21:18:15 -07:00
Mathias Agopian
5cec4742b3 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
a1e03d4d7f 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
efefd5efb9 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
a1d9388ea7 show that we need to glClear to be fast(er) 2009-08-11 20:50:20 -07:00
Fred Quintana
64e89a8aff 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
0d63f8163d option to use drawtexture at compile time 2009-08-11 20:12:18 -07:00
Mathias Agopian
88caa97f9e fix and extend the filter test a bit 2009-08-11 19:55:31 -07:00
Mathias Agopian
8b76a0ac6f 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
79ad0e6623 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
e6f0f5c8fb workaround a bug in the SGX driver that would prevent eglGetConfig to work properly 2009-08-10 16:48:22 -07:00
Martin Storsjo
1ac3b5ff60 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
f1e5b0d4e5 add support for RGBX_8888 2009-08-07 20:55:14 -07:00
Mathias Agopian
9ca4dd6011 minor code clean-up 2009-08-07 16:38:10 -07:00
Mathias Agopian
a1f6eff297 update most gl tests to use EGLUtils 2009-08-06 16:26:15 -07:00
Mathias Agopian
265d9c076a added two EGL helpers for selecting a config matching a certain pixelformat or native window type 2009-08-06 16:05:39 -07:00