summaryrefslogtreecommitdiffstats
path: root/libs/ui/Surface.cpp
Commit message (Collapse)AuthorAgeFilesLines
* split libsurfaceflinger_client and libcamera_client out of libuiMathias Agopian2010-02-111-755/+0
|
* return an error when Surface::lock() is called while the surface is already ↵Mathias Agopian2010-01-221-3/+11
| | | | locked.
* fix some aspects of [2258746] native crash in launcher2Mathias Agopian2009-11-131-29/+19
| | | | | | Surface::validate() could sometimes dereference a null pointer before checking it wasn't null. This will prevent the application to crash when given bad parameters or used incorrectly. However, the bug above probably has another cause.
* fix [2170283] SurfaceFlinger crashes on OOM.Mathias Agopian2009-10-071-0/+2
| | | | | | when running out of memory, a null handle is returned but the error code may not be set. In that case we need to return NO_MEMORY instead of NO_ERROR, so that the calling code won't try to dereference the null pointer.
* fix [2152536] ANR in browserMathias Agopian2009-10-061-2/+2
| | | | | | | | | | | | | | | | A window is created and the browser is about to render into it the very first time, at that point it does an IPC to SF to request a new buffer. Meanwhile, the window manager removes that window from the list and the shared memory block it uses is marked as invalid. However, at that point, another window is created and is given the same index (that just go freed), but a different identity and resets the "invalid" bit in the shared block. When we go back to the buffer allocation code, we're stuck because the surface we're allocating for is gone and we don't detect it's invalid because the invalid bit has been reset. It is not sufficient to check for the invalid bit, I should also check that identities match.
* fix [2167050] glTexImage2D code path buggy in SurfaceFlingerMathias Agopian2009-10-061-15/+15
| | | | | | | | | | | | | | When EGLImage extension is not available, SurfaceFlinger will fallback to using glTexImage2D and glTexSubImage2D instead, which requires 50% more memory and an extra copy. However this code path has never been exercised and had some bugs which this patch fix. Mainly the scale factor wasn't computed right when falling back on glDrawElements. We also fallback to this mode of operation if a buffer doesn't have the adequate usage bits for EGLImage usage. This changes only code that is currently not executed. Some refactoring was needed to keep the change clean. This doesn't change anything functionaly.
* Attempt to fix [2152536] ANR in browserMathias Agopian2009-10-021-3/+5
| | | | | | | | | | | The ANR is caused by SurfaceFlinger waiting for buffers of a removed surface to become availlable. When it is removed from the current list, a Surface is marked as NO_INIT, which causes SF to return immediately in the above case. For some reason, the surface here wasn't marked as NO_INIT. This change makes the code more robust by always (irregadless or errors) setting the NO_INIT status in all code paths where a surface is removed from the list. Additionaly added more information in the logs, should this happen again.
* fix [2122448] android_native_window_t::setUsage() only reallocates the first ↵Mathias Agopian2009-09-151-19/+10
| | | | | | | | buffer Take 2. We needed to check that the usage flags are "good enough" as opposed to "the same". This reverts commit 8f17a762fe9e9f31e4e86cb60ff2bfb6b10fdee6.
* Revert "fix [2122448] android_native_window_t::setUsage() only reallocates ↵Mathias Agopian2009-09-151-8/+18
| | | | | | the first buffer" This reverts commit 486aa963b63e20b7910e1004cebb4f0afabbd80f.
* fix [2122448] android_native_window_t::setUsage() only reallocates the first ↵Mathias Agopian2009-09-151-18/+8
| | | | buffer
* fix [2068105] implement queueBuffer/lockBuffer/dequeueBuffer properlyMathias Agopian2009-09-071-230/+144
| | | | | | | | | | | | | | | Rewrote SurfaceFlinger's buffer management from the ground-up. The design now support an arbitrary number of buffers per surface, however the current implementation is limited to four. Currently only 2 buffers are used in practice. The main new feature is to be able to dequeue all buffers at once (very important when there are only two). A client can dequeue all buffers until there are none available, it can lock all buffers except the last one that is used for composition. The client will block then, until a new buffer is enqueued. The current implementation requires that buffers are locked in the same order they are dequeued and enqueued in the same order they are locked. Only one buffer can be locked at a time. eg. Allowed sequence: DQ, DQ, LOCK, Q, LOCK, Q eg. Forbidden sequence: DQ, DQ, LOCK, LOCK, Q, Q
* fix [2070341] [FAST BLOCKER] can't successfully setup erc52Mathias Agopian2009-08-211-2/+12
|
* fix a bug that caused the PixelFormat viewed by Surface to be wrong.Mathias Agopian2009-08-191-1/+2
| | | | | what happened is that the efective pixel format is calculated by SF but Surface nevew had access to it directly. in particular this caused query(FORMAT) to return the requested format instead of the effective format.
* fix [2063336] Surface.lockSurface throws IllegalArgumentException when out ↵Mathias Agopian2009-08-191-31/+59
| | | | of memory
* make sure to update a surface's usage bits when it changes, instead of only ↵Mathias Agopian2009-08-141-23/+52
| | | | | | the first time. also fixed a few locking issues in Surface and commented how each member is protected.
* second take, hopefully this time it doesn't break one of the builds: ↵Mathias Agopian2009-08-111-3/+34
| | | | "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."
* Revert "SurfaceFlinger will now allocate buffers based on the usage ↵Fred Quintana2009-08-111-34/+3
| | | | | | 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.
* SurfaceFlinger will now allocate buffers based on the usage specified by the ↵Mathias Agopian2009-08-111-3/+34
| | | | | | | 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.
* added NATIVE_WINDOW_FORMAT attribute to android_native_window_tMathias Agopian2009-08-061-0/+3
|
* don't crash when SurfaceBuffer::writeToParcel is given a null argumentMathias Agopian2009-08-051-0/+3
|
* be more robust when errors occur upon EGL surface creation (ie: don't crash)Mathias Agopian2009-07-311-6/+8
|
* fixed some issues with the software renderer when surfaces are made current.Mathias Agopian2009-07-301-1/+34
| | | | | | | | | | 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).
* fix [1964315] crash in the surface.cpp while browsingMathias Agopian2009-07-131-16/+33
|
* fix typo defining a singleton attrbutes for an object that is not a ↵Mathias Agopian2009-05-281-2/+0
| | | | singleton -- no side effects, but useless
* merge master to master_glMathias Agopian2009-05-221-2/+2
|\
| * move libbinder's header files under includes/binderMathias Agopian2009-05-201-2/+2
| |
* | Region now has its own implementation instead of relying on SkRegion, which ↵Mathias Agopian2009-05-171-4/+6
| | | | | | | | allows us to break libui's dependency on libcorecg.
* | move opengl/include/EGL/android_natives.h to ↵Mathias Agopian2009-05-051-3/+2
| | | | | | | | | | | | 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
* | get rid of android_native_buffer_t::getHandle() and replace it with an ↵Mathias Agopian2009-05-051-20/+7
| | | | | | | | | | | | handle field this abstraction was not necessary. things are easier now.
* | removed the "bits" attribute from android_native_buffer_t.Mathias Agopian2009-05-051-12/+11
| | | | | | | | "bits" can never be trusted now that we need to call lock() on the handle to get the virtual address of the buffer.
* | update surfaceflinger, libui and libagl to the new gralloc apiMathias Agopian2009-05-041-111/+114
| | | | | | | | | | | | | | | | | | | | | | | | | | | | - 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
* | Squashed commit of the following:Mathias Agopian2009-04-241-2/+1
| | | | | | | | | | | | | | | | | | | | | | | | | | | | commit e5c24638f98162c3b75b4c67a16b510d38e31341 Author: Mathias Agopian <mathias@google.com> Date: Fri Apr 17 14:09:03 2009 -0700 oops forgot this file. commit 282642632d0cb12882eecf42e0fdfb2343275de1 Author: Mathias Agopian <mathias@google.com> Date: Fri Apr 17 14:07:32 2009 -0700 use a helper macro for creating Singleton<>'s static attributes instances.
* | cleanup, remove unused fields. Also make sure that we don't systematically ↵Mathias Agopian2009-04-161-10/+5
| | | | | | | | allocate a Surface in Surface.java if only a SurfaceControl is needed (Common case).
* | more splitting of Surface/SurfaceControl. Surface.java is now implemented in ↵Mathias Agopian2009-04-161-177/+92
| | | | | | | | | | | | terms of Surface and SurfaceControl. The WindowManager side of Surface.java holds a SurfaceControl, while the client-side holds a Surface. When the client is in the system process, Surface.java holds both (which is a problem we'll try to fix later).
* | split Surface.cpp into Surface and SurfaceControlMathias Agopian2009-04-161-58/+255
| | | | | | | | | | | | | | SurfaceControl is used for controling the geometry of the surface (for the WM), while Surface is used to access the buffers (for SF's clients). SurfaceFlingerClient now uses the SurfaceID instead of Surface*. Currently Surface still has the SurfaceControl API and is implemented by calling into SurfaceControl.
* | fix some issues with Surface's lifetime management.Mathias Agopian2009-04-161-39/+45
| | | | | | | | To deal with Java's lack of destructors and delayed garbage collection, we used to duplicate Surface.cpp objects in some case; this caused some issues because Surface is supposed to be reference-counted and unique.
* | fix a rookie mistake causing Singleton<> to be a "multiton". Also improve ↵Mathias Agopian2009-04-151-4/+7
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | the BufferMapper's debugging, but turn it off. Squashed commit of the following: commit 04e9cae7f806bd65f2cfe35c011b47a36773bbe5 Author: Mathias Agopian <mathias@google.com> Date: Wed Apr 15 18:30:30 2009 -0700 fix and improve BufferMapper's tracking of mapped buffers. commit 1a8deaed15811092b2349cc3c40cafb5f722046c Author: Mathias Agopian <mathias@google.com> Date: Wed Apr 15 00:52:02 2009 -0700 fix some bugs with the Singleton<> class. untested. commit ed01cc06ad70cf640ce1258f01189cb1a96fd3a8 Author: Mathias Agopian <mathias@google.com> Date: Tue Apr 14 19:29:25 2009 -0700 some work to debug the Singleton<> template.
* | Integrate from //sandbox/mathias/donut/...@145728Mathias Agopian2009-04-101-54/+386
|/ | | | SurfaceFlinger rework for new EGL driver model support.
* auto import from //depot/cupcake/@135843The Android Open Source Project2009-03-031-0/+256
|
* auto import from //depot/cupcake/@135843The Android Open Source Project2009-03-031-256/+0
|
* Code drop from //branches/cupcake/...@124589The Android Open Source Project2008-12-171-6/+1
|
* Initial ContributionThe Android Open Source Project2008-10-211-0/+261