summaryrefslogtreecommitdiffstats
path: root/services/surfaceflinger/Layer.h
Commit message (Collapse)AuthorAgeFilesLines
* Forward-port surface dithering from CM10Steven Luo2013-04-061-0/+2
| | | | | | | | | | | This allows the use of 16-bit color displays without excessive color banding; behavior can be controlled by the persist.sys.use_dithering property. Incorporates http://review.cyanogenmod.org/19532 from CM10 as well as code removed in upstream commit 1b03149. Change-Id: I290ca4ed4787dc81ac756d9af92cd6a690865a08
* make transform hint multi-display awareMathias Agopian2012-11-211-2/+2
| | | | | | | | | | | | | | | | | | | if a layer is not mirrored, we now use its display as the source for the transfrom hint calculation instead of always using the default (main) display. this change does two thing: 1) we make updateTransformHint take a DisplayDevice as a parameter instead of hard-coding the main display. 2) each time we do a transaction that could change the hint, we go through all layers and figure out which display should be used for their transform hint. Bug: 7599344 Change-Id: I9b04a95e6c372dd770bacf81d8ef6f8e31b87b83
* add support hwc 1.1Mathias Agopian2012-09-171-0/+1
| | | | | | Bug: 7124069 Change-Id: I53d705105c4ad8954d3f50ee4f4c8b7ec936b871
* Fix transform hintsAndy McFadden2012-09-161-1/+4
| | | | | | | | | The hints were being set a little too late, so the pre-rotation stuff wasn't quite working. Bug 7054997 Change-Id: Id8d5c626db7a76f768ba762a145b315878ee08e6
* Eradicate DisplayID.Mathias Agopian2012-08-271-3/+1
| | | | | | | | DisplayDevices are now keyed of the wp<IBinder> the client uses. DisplayID has now become DisplayType which is just used to identify physical displays (as opposed to virtual displays such as wifi displays). Change-Id: I0c5968f2c902dcd699a7e0afacf833ff070c12ea
* turn DisplayDevice into a reference-counted objectMathias Agopian2012-08-051-5/+5
| | | | | | | | | | it's safer this way because this object owns an EGLSurface which cannot be easily reference-counted. it also gives us the ability to sub-class it, which we might want to do soon. Change-Id: I07358bb052dc5a13b4f2196b2c2b6e6e94c4bb4f
* cleanups in preparation of bigger changesMathias Agopian2012-08-021-6/+8
| | | | | | | | | | | - fix typo drawForSreenshot misspelled - get rid of DisplayDeviceBase - removed unused or unneeded code - always pass a DisplayDevice to Layer methods that are called on a per-display basis (to make it clear that this could be called more than once per composition). Change-Id: Id948b7e09fe5c06db0e42d40d6ed75dd095c7f44
* rename DisplayHardware to DisplayDeviceMathias Agopian2012-08-021-2/+2
| | | | Change-Id: I3f7250cd914e0da4f9ec2c9403587bbe12f3cc62
* one more step towards multiple display supportMathias Agopian2012-07-101-5/+4
| | | | | | | | | - remove dependency on cached state in validateVisibility - get rid of mVertices and mTransformedBounds - get rid of validateVisibility - get rid of unlockPageFlip - handleTransaction now returns a dirty region - computevisibileregion now uses window-manager space
* Only set acquire fences on overlay layersJesse Hall2012-07-021-0/+1
| | | | Change-Id: I08e8173f83580de5a4e43a0ba5ea03e5ec6e8782
* Pass fence to HWC on first use of bufferJesse Hall2012-06-301-0/+1
| | | | | | Also do a CPU-wait on the fence before using it for GL composition. Change-Id: I0f645a42a44803276cae11b904e5a26d65871562
* get rid of GraphicPlaneMathias Agopian2012-06-281-4/+2
| | | | | its functionality is now folded into DisplayHardware there will be more changes in that area.
* Transfer HWC release fences to BufferQueueJesse Hall2012-06-211-1/+1
| | | | | | | | | | | | | | | | | | After a HWC set, each SurfaceFlinger Layer retrieves the release fence HWC returned and gives it to the layer's SurfaceTexture. The SurfaceTexture accumulates the fences into a merged fence until the next updateTexImage, then passes the merged fence to the BufferQueue in releaseBuffer. In a follow-on change, BufferQueue will return the fence along with the buffer slot in dequeueBuffer. For now, dequeueBuffer waits for the fence to signal before returning. The releaseFence default value for BufferQueue::releaseBuffer() is temporary to avoid transient build breaks with a multi-project checkin. It'll disappear in the next change. Change-Id: Iaa9a0d5775235585d9cbf453d3a64623d08013d9
* refactor HWComposer to break dependency with the HAL headersMathias Agopian2012-06-141-2/+2
| | | | | | | | | | | | | HWComposer must abstract the HWC HAL entirely, so that the HAL can continue to evolve (and break binary compatibility) without breaking SurfaceFlinger. The HWC data structure had leaked outside of HWComposer, this is now fixed. We now have an abstract interface that provide all the needed functionality, HWCompose provides concrete implementations of it based on the the HWC version. Change-Id: I40c4676dc986b682ede5520a1c60efe64037b0bb
* SurfaceFlinger: add a crop to the layer stateJamie Gennis2012-05-111-0/+1
| | | | | | | | | This change adds a crop rectangle specified in window coordinates to the layer state. The all window pixels outside this crop rectangle are treated as though they were fully transparent. This change also adds the plumbing necessary for WindowManager to set that crop. Change-Id: I582bc445dc8c97d4c943d4db8d582a6ef5a66081
* SurfaceFlinger: tell SurfaceTex about filteringJamie Gennis2012-05-091-1/+0
| | | | | | | This change makes SurfaceFlinger set the filtering-enable on each layer's SurfaceTexture before querying the texture matrix to use for GLES composition. Change-Id: I40c3defd73ebf96e3cabb3bfdb1fc97f2036753a
* SurfaceTexture: Fully refactored from BufferQueueDaniel Lam2012-03-131-1/+2
| | | | | | SurfaceTexture and BufferQueue are separate objects. Change-Id: I230bc0ae6f78d0f9b2b5df902f40ab443ed5a055
* fix libgui header locationMathias Agopian2012-02-271-2/+4
| | | | Change-Id: Iec71706cdd4f29c6904993648ce873e83ef9cafe
* fix an issue in SF where we could miss some updatesMathias Agopian2012-02-231-1/+1
| | | | Change-Id: I7d350bc05d1596655baddff3deaebaba58c9bcc0
* separate transactions from updatesMathias Agopian2012-02-011-0/+4
| | | | | | | | | | with this changes, SF transactions are handled as soon as possible but do not trigger updates. the update is delayed until the next vsync. this allows us to work much better without requiring triple-buffering. Change-Id: I1fa10794d0cf742129f0877698b7b1e1f2ec7401
* added a few more commands to SF's dumpsysMathias Agopian2012-01-281-0/+1
| | | | | | | | | | | --latency-clear [name] clears the latency data for the specified layer or for all layers if none is specified --list prints the list of all layers regardless of their visibility Change-Id: I7c07ae020f838c173b98ee50f3fb3e93da78acbb
* improve SurfaceFlinger dumpsysMathias Agopian2012-01-241-4/+10
| | | | | | | | | | | | | | | | | | | | | | | | It is now possible to say: dumpsys SurfaceFlinger --latency to print latency information about all windows dumpsys SurfaceFlinger --latency window-name to print the latency stats of the specified window for instance: dumpsys SurfaceFlinger --latency SurfaceView The data consists of one line containing global stats, followed by 128 lines of tab separated timestamps in nanosecond. The first line currently contains the refresh period in nanosecond. Each 128 following line contains 3 timestamps, of respectively the app draw time, the vsync timestamp just prior the call to set and the timestamp of the call to set. Change-Id: Ib6b6da1d7e2e6ba49c282bdbc0b56a7dc203343a
* hack up frame latency measurementJamie Gennis2012-01-241-0/+5
| | | | Change-Id: I6d9a466a23285304f0e229a5649815636ab5d6af
* SurfaceFlinger: Remove display freezing codeJamie Gennis2011-10-141-5/+0
| | | | | | | This change removes the dead code from SurfaceFlinger that resulted from disabling support for freezing the display. Change-Id: I4e5ff00c94b4c7a79af2f65c9850c135210068ed
* SurfaceFlinger: set layer names on SurfaceTexturesJamie Gennis2011-09-221-0/+1
| | | | | | | This change sets the SurfaceTexture name string to match that of the layer to which it belongs. Change-Id: Ib302d79e916a36ab1e54cb9ff477c3b857bd957b
* improve hwc dumpsysMathias Agopian2011-09-201-0/+2
| | | | | | we now log the buffer's format Change-Id: I9d3ad8018e884240a153de3baefb6331cb014d0f
* Add a debug option to turn the "transformation hint" offMathias Agopian2011-08-231-0/+1
| | | | | | | | transformation hint is disabled with: adb shell service call SurfaceFlinger 1009 i32 1 Change-Id: I9aafe6f280f88ce41569ed69a06dc522b10e3a88
* SurfaceTexture: fix queues-to-composerJamie Gennis2011-08-171-0/+3
| | | | | | | | | | | This change fixes the NATIVE_WINDOW_QUEUES_TO_WINDOW_COMPOSER query of Surface and SurfaceTextureClient. Surface now uses the inherited SurfaceTextureClient implementation of this query. SurfaceTextureClient now queries SurfaceFlinger to determine whether buffers that are queued to its ISurfaceTexture will be sent to SurfaceFlinger (as opposed to some other process). Change-Id: Iff187e72f30d454229f07f896b438198978270a8
* SurfaceFlinger doesn't rely on having a custom RefBase destructorMathias Agopian2011-08-111-2/+1
| | | | | we just use a message to the main thread to destroy our GLES state.
* use SurfaceTexture new scaling mode in SFMathias Agopian2011-07-191-3/+1
| | | | | | | SF now obeys SurfaceTexture's scaling mode instead of inferring it from the buffer's size Change-Id: I4d50e9851abedd7e64bfcfc8af9eefb9fb668529
* fix RefBase so it retains binary-compatibility with gingerbreadMathias Agopian2011-06-131-2/+2
| | | | | Bug: 4595257 Change-Id: I0d5e10f497e3f39868bff58f6ded510c38b44b12
* unify SurfaceTexture and SurfaceMathias Agopian2011-06-131-139/+25
| | | | | | | Add the concept of synchronous dequeueBuffer in SurfaceTexture Implement {Surface|SurfaceTextureClient}::setSwapInterval() Add SurfaceTexture logging fix onFrameAvailable
* Fix a race that could cause GL commands to be executed from the wrong thread.Mathias Agopian2011-05-191-1/+1
| | | | Change-Id: Ia3d407f7bf2f5553f46cfdade70b7b0badb35beb
* SurfaceFlinger: Respect the PROTECTED gralloc bit.Jamie Gennis2011-03-101-3/+1
| | | | | | | | | This change makes SurfaceFlinger treat layers for which the active buffer has the GRALLOC_USAGE_PROTECTED bit set as if they have the 'secure' flag set. Change-Id: Ic60b6513a63e4bb92ec6ce9fd12fd39b4ba5f674 Bug: 4081304
* Merge "Correctly handle translucency of device-specific pixel formats"Eric Hassold2011-02-231-1/+2
|\
| * Correctly handle translucency of device-specific pixel formatsEric Hassold2011-02-151-1/+2
| | | | | | | | | | | | | | | | | | Check requested format for device-specific formats, and assume (as documented in libhardware/include/hardware/hardware.h) this is opaque layer so no blending is necessary. Bug: 3215931 Change-Id: Ib4dff8060ac522d201ff1e74807ac340c17d3fa7
* | fix a surface leak in SurfaceFlingerMathias Agopian2011-02-161-1/+0
|/ | | | | | | | | | | | | | | | | | | SF kept a strong reference to ISurface until the window manager removed the surface from the screen. This fell appart when running standalone tests, that is when the window manager wasn't involved. When the window manager is around, it would clean-up surfaces even when an application died. with this change, SF is able to do its own cleanup without relying on the window manager. the change is very simple, we simply don't keep a reference to ISurface and make sure no more than one of them can be created. Change-Id: I61f2d7473bf8d4aa651549a846c34cdbb0d0c85a
* Protected surface APIGlenn Kasten2011-01-281-1/+5
| | | | | | To be used by DRM framework, implemented by display HAL Change-Id: I054a07a94f4d5dbe792f3a597e2e49a100d90eb2
* clean-up unneeded codeMathias Agopian2011-01-201-1/+0
| | | | | | | | | | now that we removed the notion of a "inUse" buffer in surfaceflinger a lot of code can be simplified / removed. noteworthy, the whole concept of "unlockClient" wrt. "compositionComplete" is also gone. Change-Id: I210413d4c8c0998dae05c8620ebfc895d3e6233d
* Fix a problem where hwc and GL composition could show a different bufferMathias Agopian2010-12-141-1/+2
| | | | | | | | | | if a surface's buffers are reallocated, the current active buffer will end-up pointing on one of these until a new buffer is retired. we're now keeping a reference to the actual buffer until we retire a new one. Change-Id: Ib1703947e7a0340694d846e0962576318863b935
* fix [3223749] media server crashes when switching mode from video capture to ↵Mathias Agopian2010-12-141-0/+2
| | | | | | | | | | | | | still image capture there was an issue were in some situation SF would call prepare() on hwc with a NULL handle and never call prepare again. in this situation, we onw set the SKIP flag to make sure that hwc won't process this layer and as soon as we receive our first buffer we trigger a recompute of the visible regions which will end-up calling prepare() again. Change-Id: I6b400b2df79712408b9315a9859290c7fcb1609e
* resolved conflicts for merge of a0f011ff to masterMathias Agopian2010-12-071-0/+1
|\ | | | | | | Change-Id: I4c17021fc269ce66c98cc345353600eda332f980
| * [3171580] Fix two typos related to fixed-size buffersMathias Agopian2010-12-031-0/+1
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | mFixedSize was never set, this bug was introduced during some "cleanup", in practice this could cause some issues when a fixed-size buffer was used and the window was resized. Layer::drawForSreenShot() had a typo that had no effect. mFixedSize was used to determine if filtering was needed, which was a bit too conservative and created a dependency between filtering and "fixed size" states which should exist. Now we enable filtering based on the size of the buffer vs. the size of the layer. Change-Id: I32044e91b0c944c1b137efdceb3f01dfaa78119d
| * refactored screenshot codeMathias Agopian2010-10-041-0/+1
| | | | | | | | | | | | | | | | | | | | | | the core screenshot function now can capture the screen at any lower resolution performing bilinear filtering. we also now have some client code to interface with the screenshot service. it's now possible to request a screenshot at a lower resolution. Change-Id: I33689bba98507ab928d0898b21596d0d2fe4b953
| * revert hwcomposer HAL changes. DO NOT MERGE.Mathias Agopian2010-08-171-2/+0
| | | | | | | | | | | | | | | | This reverts commit: 94364b91a2894bf037b8beb027132fbb812e1434 f8e705dea48f77f1c2532fdbadd4997dd1851af0 b59beb5ca68d0228f60dda60d85e2d0226b33215 e0d5f5bcf5a8b26f4ad75f549cbf380b2c9faf20
* | Implement reducing the buffer count of a Surface.Jamie Gennis2010-11-111-1/+2
| | | | | | | | | | Change-Id: I7f979c60c06d654aa8265002836277434bc1a64f Bug: 3095167
* | refactored screenshot codeMathias Agopian2010-09-291-0/+1
|/ | | | | | | | | | | the core screenshot function now can capture the screen at any lower resolution performing bilinear filtering. we also now have some client code to interface with the screenshot service. it's now possible to request a screenshot at a lower resolution. Change-Id: I5a3b0e431421800e3aad601d9af8f94adffbc71f
* call into hwcomposer HAL when presentMathias Agopian2010-08-111-0/+2
| | | | Change-Id: I70f31c69a9436a43860e78977442863ecba6d27b
* move native services under services/Mathias Agopian2010-07-141-0/+239
moved surfaceflinger, audioflinger, cameraservice all native services should now reside in this location. Change-Id: Iee42b83dd2a94c3bf5107ab0895fe2dfcd5337a8