summaryrefslogtreecommitdiffstats
path: root/libs/surfaceflinger/Layer.cpp
Commit message (Collapse)AuthorAgeFilesLines
* Revert "fix [2793164] Spam 2x/second with TOT master in SurfaceFlinger"Andreas Huber2010-06-251-22/+19
| | | | This reverts commit 081bc5c47d8a980e6eafa70ddafcd89981586391.
* fix [2793164] Spam 2x/second with TOT master in SurfaceFlingerMathias Agopian2010-06-241-19/+22
| | | | | | | 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
* fix [2785833] valgrind error in android::Layer::requestBufferMathias Agopian2010-06-211-0/+1
| | | | | | fix uninitialized variable Change-Id: I99e1b619ae8c88dd9d77b3abf4762f801019047e
* Added support for the GL_TEXTURE_EXTERNAL targetMathias Agopian2010-06-151-1/+1
| | | | | | This will allow us to support YUV surfaces. Change-Id: I2d4da75f1006a5285bdc552695d4caeecccf2183
* allow re-targetting of surfacesMathias Agopian2010-06-081-13/+35
| | | | | | | | | Surfaces can now be parcelized and sent to remote processes. When a surface crosses a process boundary, it looses its connection with the current process and gets attached to the new one. Change-Id: I39c7b055bcd3ea1162ef2718d3d4b866bf7c81c0
* split surface management from surface's buffers managementMathias Agopian2010-06-041-58/+129
| | | | Change-Id: If3c5655d1231f8f0c49ba68f972b1b20c93b3f87
* clean-up client management.Mathias Agopian2010-06-041-20/+45
| | | | | | | simplified things a lot, the biggest change is that the concept of "ClientID" is now gone, instead we simply use references. Change-Id: Icbc57f80865884aa5f35ad0d0a0db26f19f9f7ce
* Make sure to use filtering while in fixed-size modeMathias Agopian2010-05-261-0/+13
|
* added the notion of fixed-size buffersMathias Agopian2010-05-241-43/+70
| | | | | | | | | the new native_window_set_buffers_geometry allows to specify a size and format for all buffers to be dequeued. the buffer will be scalled to the window's size. Change-Id: I2c378b85c88d29cdd827a5f319d5c704d79ba381
* fix the threading issue for setBuffercount()Mathias Agopian2010-05-201-53/+84
| | | | | | | | this change introduces R/W locks in the right places. on the server-side, it guarantees that setBufferCount() is synchronized with "retire" and "resize". on the client-side, it guarantees that setBufferCount() is synchronized with "dequeue", "lockbuffer" and "queue"
* SharedBufferStack now can grow up to 16 buffers.Mathias Agopian2010-05-121-0/+34
| | | | | | there is a new resize() api, which currently only allows growing. Change-Id: Ia37b81b73be466d2491ffed7f3a23cd8e113c6fe
* Refactor some code in surfaceflinger in preparation of upcoming changesMathias Agopian2010-05-121-81/+156
| | | | | | | | | | | | 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
* remove the "memcpy" hackMathias Agopian2010-05-121-97/+7
| | | | | | | | this hack was used for gpus that don't support cached buffers for s/w clients. currently we have no gpu with this issue. this removes quite a bit of complexity. Change-Id: I72564669f124f92805030e61983711f61c76b6d9
* am 56aed6bd: am c69775d6: Merge "fix [2664345] Flash: Bad flicker at the end ↵Mathias Agopian2010-05-101-3/+22
|\ | | | | | | | | | | | | | | | | of a pinch zoom." into froyo Merge commit '56aed6bde0c52658d2cb1207c0cfe8ba0a764c59' into kraken * commit '56aed6bde0c52658d2cb1207c0cfe8ba0a764c59': fix [2664345] Flash: Bad flicker at the end of a pinch zoom.
| * fix [2664345] Flash: Bad flicker at the end of a pinch zoom.Mathias Agopian2010-05-061-3/+22
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | the window manger puts SurfaceViews up before they have been rendered into, because of that surfaceflinger doesn't have anything ready to draw for that surface when an udpate occurs and responds by filling the surface with black. With this fix, we only fill those areas of the framebuffer that would otherwise be undefined (no content at all). in the Flash case, the "flash" window is not drawn at all until it has some content, instead the underlaying browser window is shown. Change-Id: Ifb610f7f8c27b88edf83e09adc4803fc295c15a1
* | more surfaceflinger cleanupsMathias Agopian2010-04-211-6/+33
| | | | | | | | | | | | | | get rid of the "fake rtti" code, and use polymorphism instead. also simplify how we log SF's state (using polymorphism) Change-Id: I2bae7c98de4dd207a3e2b00083fa3fde7c467922
* | better fix for [2420565] Surface.lockCanvas() updates the dirty region too oftenMathias Agopian2010-04-211-3/+9
|/ | | | Change-Id: I83438b40effd21538f1c74396dc665254b9d5ab6
* fix [2594950] Flash: Zooming in on some content crashes the Nexus One and ↵Mathias Agopian2010-04-141-2/+15
| | | | | | | | | | causes it to reboot (runtime restart) We now limit the size of the surface to the maximum size supported by the GPU. On Nexus One this will 2048 -- it could be different on other devices. Surface creation fails if the limit is exceeded. Change-Id: I9ecfc2e9c58c9e283782b61ebfc6b590f71df785
* fix [2515291] Native crash and runtime restart while trying to preview ↵Mathias Agopian2010-03-151-31/+48
| | | | | | | | | captured picture on Sapphire if a buffer couldn't be allocated because of an OOM, SF could, in some case dereference a null pointer. Change-Id: I5321248c38a21e56d5278b6aada2694e64451378
* fixes for [2474091] Saw Poor behaviour playing a video.Mathias Agopian2010-03-081-3/+13
| | | | | | | | | | | | | | - 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.
* get rid off the YUV formats at the libui layerMathias Agopian2010-02-161-9/+9
|
* split libsurfaceflinger_client and libcamera_client out of libuiMathias Agopian2010-02-111-1/+2
|
* fix [2269582] [TOP-10][Passion_1506][APT:Camera]Sometimes camera preview ↵Mathias Agopian2009-12-111-0/+1
| | | | | | | | | | | | | screen is truncated after launching and back to home screen by home key repeatedly When a surface is removed from the screen while it holds a "freeze lock", the release of that lock happens in the destructor as a "safety net". However, it doesn't trigger an update at that point. Make sure that "freeze locks" are released from the transaction at the point a surface is removed from the screen (if it's not on screen, it shouldn't prevent the screen to redraw, and therefore cannot hold a freeze lock). The refresh corresponding to that transaction will pick it up as soon as possible.
* fix [2319255] crash in openGL : from the media recorder stress test.Mathias Agopian2009-12-101-1/+8
| | | | | never call eglCreateImageKHR() with a NULL native buffer, which can happen in OOM conditions.
* fixed [2260070] display stopped updatingMathias Agopian2009-11-301-0/+5
| | | | | always check that the visible region isn't empty after all visible regions are recomputed clear he freeze-lock if it is.
* fix [2143798] Need to figure out how to do videoMathias Agopian2009-10-271-59/+6
| | | | | | | | | 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 [2211532] improves sholes graphics performanceMathias Agopian2009-10-231-63/+142
| | | | | | | Instead of using glTex{Sub}Image2D() to refresh the textures, we're using an EGLImageKHR object backed up by a gralloc buffer. The data is updated using memcpy(). This is faster than glTex{Sub}Image2D() because the texture is not swizzled. It also uses less memory because EGLImageKHW is not limited to power-of-two dimensions.
* fix [2164183] sometimes device just wants to stay asleepMathias Agopian2009-10-071-3/+3
| | | | | | | | | | | When switching rapidily orientation back and forth, surfaces end-up acquiring the freeze-lock when the first orientation change happens, but never release it because by the time the 2nd orientation change comes in, the surface size is back to its original size and doesn't appear to have resized. we now always release the freeze-lock when we receive a buffer of the expected size.
* fix [2170319] gmail bulk operation checkbox latency on passionMathias Agopian2009-10-071-2/+4
| | | | | | | | | | | | | | | This also fixes [2152536] ANR in browser When SF is enqueuing buffers faster than SF dequeues them. The update flag in SF is not counted and under some situations SF will only dequeue the first buffer. The state at this point is not technically corrupted, it's valid, but just delayed by one buffer. In the case of the Browser ANR, because the last enqueued buffer was delayed the resizing of the current buffer couldn't happen. The system would always fall back onto its feet if anything -else- in tried to draw, because the "late" buffer would be picked up then.
* 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 [2168528] enable glTexImage2D code path in SF for software-only buffersMathias Agopian2009-10-061-3/+14
|
* fix [2167050] glTexImage2D code path buggy in SurfaceFlingerMathias Agopian2009-10-061-22/+55
| | | | | | | | | | | | | | 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-8/+0
| | | | | | | | | | | 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 [2152247] Windows sometimes drawn scaled up.Mathias Agopian2009-09-301-4/+34
|
* invalidate the surface when the physical changesMathias Agopian2009-09-301-7/+4
|
* introduce the notion of the requested size in the Layer stateMathias Agopian2009-09-291-8/+8
|
* minor SurfaceFlinger code cleanup and remove unnecessary testsMathias Agopian2009-09-241-2/+0
|
* turn dithering off if it's not neededMathias Agopian2009-09-231-1/+14
|
* fix [2133214] STOPSHIP: revert I4a06bb4f: workaround for [2113743] Sholes: ↵Mathias Agopian2009-09-231-2/+2
| | | | | | | | frozen then runtime restart going to list view Revert "workaround for [2113743] Sholes: frozen then runtime restart going to list view" This reverts commit 4a06bb4f3355b0ef2b76aa883704da9d154c44ae.
* workaround for [2113743] Sholes: frozen then runtime restart going to list viewMathias Agopian2009-09-201-2/+2
|
* fix [2129080] Soft reboot after clicking around and then rubbing the screenMathias Agopian2009-09-171-3/+9
|
* fix [2119400] sholes: artifacting when switching orientationMathias Agopian2009-09-161-13/+13
|
* add support for RGBX_8888 surfaces in SurfaceFlingerMathias Agopian2009-09-141-0/+3
|
* fix [2112575] stuck on DequeueCondition for a surface that doesn't exist anymoreMathias Agopian2009-09-101-10/+44
| | | | this also fixes part of [2111536] Device is soft rebooted after ending the call through voice dialer
* fix [2068105] implement queueBuffer/lockBuffer/dequeueBuffer properlyMathias Agopian2009-09-071-374/+119
| | | | | | | | | | | | | | | 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 a bug that could cause a window to be hidden in some cases.Mathias Agopian2009-08-131-1/+6
| | | | | | | this would happen is the window is made visible but the client didn't render yet into it. This happens often with SurfaceView. Instead of filling the window with solid black, SF would simply ignore it which could lead to more disturbing artifacts. in theory the window manager should not display a window before it has been drawn into, but it does happen occasionnaly.
* Surface::GPU and Surface::HARDWARE are now deprecated; they will be set ↵Mathias Agopian2009-08-131-3/+0
| | | | | | automatically if needed. this also ripples into the window manager API by making some constant there deprecated as well.
* second take, hopefully this time it doesn't break one of the builds: ↵Mathias Agopian2009-08-111-4/+4
| | | | "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-4/+4
| | | | | | 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-4/+4
| | | | | | | 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.