summaryrefslogtreecommitdiff
path: root/opengl/java/android
AgeCommit message (Collapse)Author
2012-03-19Remove EGL context limit for Adreno GPUs.Jack Palevich
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
2012-03-15Ignore EGL_BAD_CURRENT_SURFACE errors from eglSwapBuffersJack Palevich
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
2012-03-09Expose a function to set OpenGL Trace level.Siva Velusamy
This patch adds a function setGlDebugLevel() to libEGL, and exposes it to the Java layer at android.opengl.GLUtils.enableTracing(). Change-Id: Ia5abb130bc32fcfe3ab25b0a0a5283a54c54f357
2012-02-17Remove unused private APIsRomain Guy
Change-Id: Ib22005c7ed9923120089a1f1c806bca55bb90967
2011-11-21am ea54d0dc: am 723218b4: Merge "Hide ManagedEGLContext until we are sure ↵Romain Guy
this is the correct API." into ics-mr1 * commit 'ea54d0dc0dfeef5560fea04667804413d522025f': Hide ManagedEGLContext until we are sure this is the correct API.
2011-11-21am c26e4d18: am 8cd39e3a: Merge "Notify views when EGL resources are about ↵Romain Guy
to be destroyed Bug #5639899" into ics-mr1 * commit 'c26e4d18a20ab0b3e769fb3e547994f1c27d6713': Notify views when EGL resources are about to be destroyed Bug #5639899
2011-11-21Hide ManagedEGLContext until we are sure this is the correct API.Romain Guy
Change-Id: If54942d342ca8ea348e10231b2aed3e5d3bd701b
2011-11-21Notify views when EGL resources are about to be destroyedRomain Guy
Bug #5639899 Change-Id: I7c5d8bebf02294426f5b3ab1358a31c38a4fd064
2011-11-18am 0272e600: am a37a78e2: Merge "GLES: add image external enums" into ics-mr1Jamie Gennis
* commit '0272e60060162d2c32aec02d9cd1414dbbe14782': GLES: add image external enums
2011-11-17Merge "GLES: add image external enums" into ics-mr1Jamie Gennis
2011-11-17Merge "Fix potential GLThread / GLSurfaceView memory leak."Jack Palevich
2011-11-17am 9aa6bd1c: am 717a25dc: Add new ManagedEGLContext class to help apps ↵Dianne Hackborn
participate in memory trimming. * commit '9aa6bd1c34fe3583fe31f283a6415e84fec12567': Add new ManagedEGLContext class to help apps participate in memory trimming.
2011-11-16Add new ManagedEGLContext class to help apps participate in memory trimming.Dianne Hackborn
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
2011-11-15Fix potential GLThread / GLSurfaceView memory leak.Jack Palevich
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
2011-11-15GLES: add image external enumsJamie Gennis
This change adds Java definitions for the enums of the GL_OES_EGL_image_external OpenGL ES extension. Bug: 3482193 Change-Id: Ib50326f8be9b9cc9021753855c3846ddcdc5eaa2
2011-11-11am cb0db030: Merge branch \'ics-mr1-plus-aosp\' of ↵Akwasi Boateng
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.
2011-11-10Terminate EGL when an app goes in the backgroundRomain Guy
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
2011-11-07Merge "Properly passing an unused variable through."Alex Sakhartchouk
2011-11-03Properly passing an unused variable through.Alex Sakhartchouk
Change-Id: Ie49b5855bfca4e202ed41b6167a899832e99d728
2011-10-31am 74b2b954: am 09848bc8: Merge "docs: add developer guide cross references, ↵Joe Fernandez
Project ACRE, round 3" into ics-mr0 * commit '74b2b9547329a0b05e0bd5701057696007b854bb': docs: add developer guide cross references, Project ACRE, round 3
2011-10-29am 09848bc8: Merge "docs: add developer guide cross references, Project ↵Joe Fernandez
ACRE, round 3" into ics-mr0 * commit '09848bc89de999416e2de82a7693b2deec6bf802': docs: add developer guide cross references, Project ACRE, round 3
2011-10-28Destroy and recreate the EGL surface when the surface size changes.Jack Palevich
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
2011-10-28docs: add developer guide cross references, Project ACRE, round 3Joe Fernandez
Change-Id: I6125315ecdf0f78dd947c514a9944729d723e95d
2011-10-14Work around race condition when shutting down a surface flinger surface.Jack Palevich
Works around b/4588890 Change-Id: Ie0cf1f212686aec93cda85bf112f4b7ab4197256
2011-09-20Avoid allocating temporary memory for Matrix operations.Jack Palevich
Also fix a bug where Matrix.invertM was not returning false when the matrix could not be inverted. Change-Id: I68b172032093d9f257e88c802de936633bb4912c
2011-08-24Add OpenGL backend to ImageWallpaperRomain Guy
Bug #5204874 Currently disabled. Change-Id: I5e7b35dce2981b0691f107e39c6394b260466543
2011-08-01fix an issue where the screen could be stale after a surface size changeMathias Agopian
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
2011-07-12fix typo in a commentMathias Agopian
Change-Id: If913611a65e8b578021e9f9a9546f05e0ce6ef44
2011-04-21Fix typo in Matrix.mPerspective.Jack Palevich
(Introduced by a copy-and-paste mistake when factoring out a common expression. D'Oh!) Change-Id: I5e97dde2d2f4564fc74ba69bfa4a2f9db44c8873
2011-04-21Add utility method Matrix.perspectiveMJack Palevich
Change-Id: Ic9d5e5d967bbc08acc524c5092ce61a1cdbfd360
2011-04-11Kill the global references in the OpenGL wrappers.Elliott Hughes
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
2011-02-07Extend recycled bitmap check to all GLUtils APIs.Jack Palevich
Change-Id: I9ea0022b167af2153190b6642aa303232e257379
2011-02-02Throw an exception when trying to upload a recycled bitmap.Jack Palevich
Previously we would upload garbage. Change-Id: Id785792a16f9d24685687f4e6b64ec893ccad225
2011-01-27Add GL11ExtensionPack support to GLDebugWrapperJack Palevich
Allows calling GL11ExtensionPack APIs in a GL context that has been wrapped for debugging. Change-Id: Ib0695b51a92f5dcce32db8b0dc7ee948e5059e7f
2011-01-18Unhide GLSurfaceView.get/setPreserveEGLContextOnPauseJack Palevich
Change-Id: I882b8fa7888e2baae41c81b75af7fc1f639d38d6
2011-01-14Add support for preserving EGL contexts when pausing / resuming.Jack Palevich
Hidden for now. Change-Id: I350576c11960a1aa232da7aebc5c6ec60ff796b5
2010-12-07These files had an older header.Dan Bornstein
This patch replaces the file headers with the approved Android header text. Change-Id: I63cbd21e9112dab404158fb65f74bc6ca5b07eac
2010-10-27Preserve the render mode when recreating the render thread.Jack Palevich
Change-Id: I67a12a9598d3ef099bef8727411891614b1bc3f7
2010-10-26Allow a GLSurfaceView to be reattached to a window.Jack Palevich
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
2010-10-25Do not exit the GLSurfaceView thread when detached from a window.Jack Palevich
Allows a GLSurfaceView to be removed from a window and later reattached to a window. Change-Id: I2b44f35d0c95404b13912782df8877953609a5d0
2010-08-25reserve android.opengl.GLWallpaperService name for future useMathias Agopian
Change-Id: I7a217593a1ca39214dda26ddb3af3ddc30a8a95a
2010-07-13Fix deadlock when switching between two GLSurfaceViewsJack Palevich
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
2010-06-22Add OpenGL ES 2.0 VBO versions glDrawElements and glVertexAttribPointer.Jack Palevich
Change-Id: Id0069535e97fe96eef74e4d0c1d19b010061fe3b
2010-05-24fix [2677468] some 3rd party GL ES apps get a 32-bits surface by default and ↵Mathias Agopian
fail force all SurfaceView to 565 Change-Id: I8ebfa1239d8e4fa097c2e544677fb92fa20b39bd
2010-04-19Quietly handle EGL_BAD_NATIVE_WINDOW errorsJack Palevich
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.
2010-03-27Turn off logging.Jack Palevich
2010-03-25GLSurfaceView pause and resume now synchronizeJack Palevich
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.
2010-03-25Turn off thread logging (too many messages.)Jack Palevich
Leave some other logging on for the monkey test.
2010-03-25Add logging of GLSurfaceView pause/resume calls.Jack Palevich
Turn on GLSurfaceView logging, so we can get better information in the monkey tests. Change-Id: Ifec0101f8a00ab09037dc9f7a1496fa1a374cc08
2010-03-24Improve our EGL management when pausing / resuming.Jack Palevich
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.