summaryrefslogtreecommitdiffstats
path: root/libs/surfaceflinger/LayerBuffer.cpp
Commit message (Collapse)AuthorAgeFilesLines
* Revert "fix [2793164] Spam 2x/second with TOT master in SurfaceFlinger"Andreas Huber2010-06-251-9/+10
| | | | This reverts commit 081bc5c47d8a980e6eafa70ddafcd89981586391.
* fix [2793164] Spam 2x/second with TOT master in SurfaceFlingerMathias Agopian2010-06-241-10/+9
| | | | | | | Make sure to not use GL_TEXTURE_EXTERNAL when it's not supported by the GL. The error was harmless, but annoying. Change-Id: I571a9a9b05d35da51420950a6a6e95629067efd0
* clean-up client management.Mathias Agopian2010-06-041-7/+6
| | | | | | | simplified things a lot, the biggest change is that the concept of "ClientID" is now gone, instead we simply use references. Change-Id: Icbc57f80865884aa5f35ad0d0a0db26f19f9f7ce
* minor clean-up GLclampx -> GLclampfMathias Agopian2010-05-261-3/+3
|
* clean-up dead-codeMathias Agopian2010-05-261-16/+0
|
* Make sure to use filtering while in fixed-size modeMathias Agopian2010-05-261-2/+2
|
* Refactor some code in surfaceflinger in preparation of upcoming changesMathias Agopian2010-05-121-29/+4
| | | | | | | | | | | | the new TextureMagager class now handle texture creation and upload as well as EGL image creation and binding to GraphicBuffers. This is used indirectly by Layer and directly by LayerBuffer the new BufferManager class handles the set of buffers used for a Layer (Surface), it abstracts how many buffer there is as well as the use of EGLimage vs. regular texture ops (glTexImage2D). Change-Id: I2da1ddcf27758e6731400f6cc4e20bef35c0a39a
* more surfaceflinger cleanupsMathias Agopian2010-04-211-2/+0
| | | | | | | get rid of the "fake rtti" code, and use polymorphism instead. also simplify how we log SF's state (using polymorphism) Change-Id: I2bae7c98de4dd207a3e2b00083fa3fde7c467922
* fixes for [2474091] Saw Poor behaviour playing a video.Mathias Agopian2010-03-081-3/+11
| | | | | | | | | | | | | | - fix a bug when hacking video buffers into gralloc buffers where the buffer size was incorrect this was causing the "direct-form-texture" mode to fail - also when the above fails, make sure to revert to the "mdp copy mode" before going to "slow mode" - finally disable completely the "direct-from-texture" mode for now. It cannot work because the allocated buffers can't respect the GPU constraints (alignment and such). We'll have to find a solution for that.
* minor cleanup.Mathias Agopian2010-02-121-17/+10
|
* Add support for direct EGLImageKHR use with pushbuffer APIMathias Agopian2010-02-041-16/+30
| | | | | | | We now always first try to use the EGLImageKHR directly before making a copy with copybit. The copy may be needed when EGLImage doesn't support the requested format, which is currently the case with YUV.
* Add an orientation parameter for overlay, so we can do camera preview in ↵Chih-Chung Chang2010-01-211-7/+12
| | | | portrait mode.
* fix [2324665] texture leak in surfaceflinger when using cameraMathias Agopian2010-01-211-1/+16
|
* fix a texture leak introduced recently.Mathias Agopian2010-01-211-4/+11
| | | | | create the texture name once and for all for a given BufferSource and make sure to recreate it when we're forced to delete the texture.
* fix [2363362] [Sapphire] Corrupted raw picture displayed during snapshotMathias Agopian2010-01-201-0/+10
| | | | | handled all cases where the scale factor of a video is out of bounds of supported scale factors in copybit.
* part of fix for [2363362] [Sapphire] Corrupted raw picture displayed during ↵Mathias Agopian2010-01-201-11/+17
| | | | | | | | | snapshot make sure to fallback properly to software when copybit operation fails. with this change, the preview image will at least be displayed in b&w (since GL doesn't support the yuv format). This would also fix 2363506, but that one is now handled more cleanly.
* fix [2363506] [Sapphire] Video playback brokenMathias Agopian2010-01-201-6/+4
| | | | don't try to use copybit for incompatible buffers
* fix [2315900] Monochrome camera preview screen after launching cameraMathias Agopian2009-12-091-49/+67
| | | | | | | | | | this was introduced by a recent change. when we try to figure out the size of the yuv->rgb temporary buffer, the output resolution has not been computed yet and an invalid buffer size is used. most of the time the allocation fails and the system reverts to "standard" GL will uses onle the Y plane. the allocation of the temporary buffer is moved to onDraw(), the first time it is called, by that time, the window is positioned properly.
* improve video performance to minimize the tearing effect seen in 720p moviesMathias Agopian2009-12-081-9/+15
| | | | | | | | always rescale videos to their target size using copybit during yuv->rgb conversion. this improves performance of the GPU pass and doesn't require linear filtering to be enabled. Also always use 16-bits buffers. the average processing time for 720p dropped from ~50ms to ~30ms
* fix [2291418] Camera preview cannot work in EmulatorMathias Agopian2009-12-021-13/+15
| | | | | | The image buffer used by glTexImage2d() would be uninitialized when no copybit engine can be found. We now always initialize images, since the abscence of copybit is not necessarily fatal.
* fix [2269022] The raw picture displayed post shutter seems to have ↵Mathias Agopian2009-11-191-1/+6
| | | | | | | low-resolution Make sure to always enable linear filtering in LayerBuffer. This change doesn't affect devices using overlays.
* fix [2143798] Need to figure out how to do video on Passion w/ GPUMathias Agopian2009-11-111-8/+66
| | | | | | | | | | This builds on the EGLImage solution. We simply use copybit to convert from the YUV frame into an EGLImage created for that purpose and proceed with the regular EGLImage code. We need to do this because "regular" GL doesn't support YUV textures. We could improve upon this by detecting exacly what the GL supports and bypass this extra step if not required, but we'll do this later if needed.
* fix[2228133] pixelflinger ignores the "vertical stride" leading to artifacts ↵Mathias Agopian2009-11-021-0/+2
| | | | | | | | 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.
* fix[2222341] Soft reset while going back from camcorder settingsMathias Agopian2009-10-301-21/+36
| | | | | | add a way to convert a mapped "pushbuffer" buffer to a gralloc handle which then can be safely used by surfaceflinger, without including gralloc_priv.h
* return proper error code from eglCreateImageKHRMathias Agopian2009-10-291-3/+1
|
* fix [2143798] Need to figure out how to do videoMathias Agopian2009-10-271-121/+22
| | | | | | | | | 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
* fix [2167050] glTexImage2D code path buggy in SurfaceFlingerMathias Agopian2009-10-061-6/+5
| | | | | | | | | | | | | | 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.
* Overlay could not set position or rotation immediately after created, it ↵Benny Wong2009-09-161-0/+1
| | | | | | should be triggered by signalEvent(). Originally from: https://partner.source.android.com/g/#change,1074
* revert to black video background, since we don't need the color-key anylongerMathias Agopian2009-09-151-1/+2
|
* fix [2037525] Fail to start camera after adb sync new CameraMathias Agopian2009-09-091-14/+14
| | | | | | | | | we ended-up locking a Mutex that had been destroyed. This happened because we gave an sp<Source> to the outside world, and were called after LayerBuffer had been destroyed. Instead we now give a wp<LayerBuffer> to the outside and have it do the destruction.
* rename Mutexes to make the code easier to followMathias Agopian2009-09-081-8/+7
|
* fix [2068105] implement queueBuffer/lockBuffer/dequeueBuffer properlyMathias Agopian2009-09-071-10/+11
| | | | | | | | | | | | | | | 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
* Add colorkey to gl clear operationRebecca Schultz Zavin2009-09-021-1/+5
| | | | Signed-off-by: Rebecca Schultz Zavin <rebecca@android.com>
* second take, hopefully this time it doesn't break one of the builds: ↵Mathias Agopian2009-08-111-1/+0
| | | | "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."
* second take, hopefully this time it doesn't break one of the builds: ↵Mathias Agopian2009-08-111-1/+5
| | | | "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-5/+1
| | | | | | 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-1/+5
| | | | | | | 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.
* Add a flag to set whether the overlay has been initialized. Commit needs to ↵Rebecca Schultz Zavin2009-07-221-2/+4
| | | | | | | | | | | be called at least once on each overlay, and it appears that sometimes this doesn't happen because the visibility never changes. With this change the overlay parameter and position will be committed when either the visibility of the window changes, or on the first call to visibility resolved, if it hasn't already been done. Signed-off-by: Rebecca Schultz Zavin <rebecca@android.com>
* Fix hardware overlay so all changes are commited when done.Rebecca Schultz Zavin2009-07-211-0/+6
|
* add support for out-of-range copybit scaling. camera capture is in color againMathias Agopian2009-06-251-52/+55
|
* use copybit for eglSwapBuffers() copy-back operationsMathias Agopian2009-06-251-1/+4
|
* make use of new eglGetRenderBufferANDROID extension to clean-up a bit a few ↵Mathias Agopian2009-06-251-37/+42
| | | | hacks added recently
* copybit now uses a native_handle_t* instead of a fd/offsetMathias Agopian2009-06-241-42/+44
|
* hack copybit back in for video playback on msm7k. we have h/w accelerated ↵Mathias Agopian2009-06-241-3/+121
| | | | video again
* fix a bug causing push-buffer surfaces' identity to be garbage, which ↵Mathias Agopian2009-06-231-0/+1
| | | | resulted in some attributes (size/pos) to fail to be set
* checkpoint. bring back video/cameraMathias Agopian2009-06-231-26/+24
|
* fix a memory corruption where a SF Client could be used after it's been ↵Mathias Agopian2009-06-191-1/+1
| | | | destroyed
* update surfaceflinger, libui and libagl to the new gralloc apiMathias Agopian2009-05-041-19/+19
| | | | | | | | | | | | | | - 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
* get rid of an old hack to work around a bug around glDeleteTextures() in the ↵Mathias Agopian2009-04-241-1/+1
| | | | adreno drivers
* more Surface lifetime managementMathias Agopian2009-04-241-5/+16
| | | | | Surfaces are now destroyed once all references from the clients are gone, but they go through a partial destruction as soon as the window manager requests it. This last part is still buggy. see comments in SurfaceFlinger::destroySurface()