summaryrefslogtreecommitdiffstats
path: root/services/surfaceflinger/LayerBase.h
Commit message (Collapse)AuthorAgeFilesLines
* Get rid of LayerBase.Mathias Agopian2013-03-051-378/+0
| | | | | | | | The functionality of LayerBase and Layer is folded into Layer. There wasn't a need for this abstraction anymore. Change-Id: I66511c08cc3d89009ba4deabf47e26cd4cfeaefb
* fold LayerBaseClient into LayerBaseMathias Agopian2013-03-051-62/+40
| | | | Change-Id: Ic745136522df59c42f0885fd969e75ea55d09f01
* Remove support for ScreenshotLayerMathias Agopian2013-03-051-2/+1
| | | | Change-Id: I5b571a4cf3faa77d2c4aca916fa4bd00a1065bb9
* refactor the crop region for hwc is calculated/setMathias Agopian2013-02-281-0/+15
| | | | | | | | | - the crop region is now always calculated and set in LayerBase::setGeometry which uses new virtuals to access the "content" crop and transform (which are provided by the Layer subclass) Change-Id: Ib7769bdec0917dd248f926600c14ddf9ea84897a
* get rid of Surface identity and tokenMathias Agopian2013-02-131-5/+0
| | | | | | we use the IBinder instead. Change-Id: I4aa0b58869ba43f19980013620051e5a261b062d
* Add some comments.Andy McFadden2013-01-111-5/+37
| | | | | | Also, minor tweak to SurfaceTextureLayer. Change-Id: If616d5ee4e8226dd0e16c5dbb0e0f80db553110e
* Rename ISurfaceTexture and SurfaceTextureAndy McFadden2012-12-181-2/+2
| | | | | | | | | | The C++ class names don't match what the classes do, so rename ISurfaceTexture to IGraphicBufferProducer, and SurfaceTexture to GLConsumer. Bug 7736700 Change-Id: Ia03e468888025b5cae3c0ee1995434515dbea387
* am a7da0dda: am 98cbec81: am efd614b8: Merge "make transform hint ↵Mathias Agopian2012-11-271-1/+1
|\ | | | | | | | | | | | | multi-display aware" into jb-mr1.1-dev * commit 'a7da0dda39cf1e807eea1304b48d4583e7329b72': make transform hint multi-display aware
| * make transform hint multi-display awareMathias Agopian2012-11-211-1/+1
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | 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
* | Change ConsumerBase's FrameAvailableListener to be a weak pointerIgor Murashkin2012-11-051-1/+1
|/ | | | | | | | This prevents strong reference cycles when the listener implementation also holds a strong pointer to the ConsumerBase Bug: 7425644 Change-Id: I1514b13a32b18d421c902dddebec0765a989c55c
* Stop using transparent region for computing visible regionsJesse Hall2012-09-261-1/+9
| | | | | | | | | | | | | | | | | | | | | | The transparent region hint is computed only from view layout locations, ignoring post-layout translation. If a SurfaceView is layed out with no other views above it, but a view is moved above it post-layout, that view's layout bounds would be subtracted from the window's transparent region instead of its drawing bounds. Prior to this change, the view would not be visible (except where its layout bounds and drawing bounds overlap). With this change, composition uses visible regions computed without regard to the transparent regions. However, if all of a layer's visible region is transparent, it will be removed from the list of layers to composite. This doesn't fix the root problem of incorrect transparent regions, and doesn't prevent bad composition in all cases. But it does avoid it for some existing apps, whiel still allowing the transparent region hint to save power in the important fullscreen-video-in-a-SurfaceView case. Bug: 7179570 Change-Id: I47cf939e12129b167afa344b8b036e8827103ac8
* calculate wether we filter on a per-display basisMathias Agopian2012-09-201-1/+1
| | | | Change-Id: I79d80b432b20b3d02428da19add464ac1e2b9378
* add support hwc 1.1Mathias Agopian2012-09-171-0/+5
| | | | | | Bug: 7124069 Change-Id: I53d705105c4ad8954d3f50ee4f4c8b7ec936b871
* Fix transform hintsAndy McFadden2012-09-161-0/+6
| | | | | | | | | The hints were being set a little too late, so the pre-rotation stuff wasn't quite working. Bug 7054997 Change-Id: Id8d5c626db7a76f768ba762a145b315878ee08e6
* the visible region sent to HWC was garbageMathias Agopian2012-08-311-1/+1
| | | | | | | | | | | | | | | we used to have a visibleRegion object per layer, but now it's per screen; so at somepoint the code got changed to calculate the per-screen visible region on the stack and that's what got passed to HWC. we're now setting the visibleRegionScreen at each frame and freeing at after the HWC set() call. We use the underlaying SharedBuffer so that in most cases we don't have to allocate, free or copy memory around. Bug: 7089478 Change-Id: I24fa556c76613a225d9fe7a6c6b727bb476144d8
* Eradicate DisplayID.Mathias Agopian2012-08-271-4/+2
| | | | | | | | 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-11/+11
| | | | | | | | | | 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
* don't filter when capturing a screenshot unless neededMathias Agopian2012-08-021-4/+4
| | | | | bug: 6919952 Change-Id: Ia6fbe9bc7e533a64cfdd6ef7f0cd6b9f11feb947
* cleanups in preparation of bigger changesMathias Agopian2012-08-021-4/+11
| | | | | | | | | | | - 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-10/+9
| | | | Change-Id: I3f7250cd914e0da4f9ec2c9403587bbe12f3cc62
* split HWComposer out of DisplayHardwareMathias Agopian2012-07-241-0/+1
| | | | | | | | | | we will only ever have a single instance of HWComposer, so it's now an attribute of SurfaceFlinger, instead of being part of DisplayHardware. DisplayHardware now just represents a "display" (it should be renamed). Change-Id: Iec191e57686868e1df6daa8b880a286c9fefde56
* add a layerStack attribute to Layers.Mathias Agopian2012-07-241-1/+3
| | | | | | | this attribute can be set through a regular transaction using SurfaceComposerClient (just like any other attribute, eg: position or size) Change-Id: I701a47c677ea6442ca713728a93335328cd2b172
* SurfaceFlinger cleanupMathias Agopian2012-07-241-2/+2
| | | | | | | mostly refactored SurfaceFlinger.h, but also removed dead code. cleaned-up a few includes as well. Change-Id: Ib15f4ffe567912b61ee98aa076c6a283b72811b5
* factor EGL/GL and surface creation out of DisplayHardwareMathias Agopian2012-07-191-0/+1
| | | | Change-Id: Icd85a6a4caad06f056578008af3e21666fa8b1f4
* one more step towards multiple display supportMathias Agopian2012-07-101-34/+26
| | | | | | | | | - 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-1/+1
| | | | Change-Id: I08e8173f83580de5a4e43a0ba5ea03e5ec6e8782
* get rid of GraphicPlaneMathias Agopian2012-06-281-14/+9
| | | | | 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-4/+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
* improve resize transactionsMathias Agopian2012-05-231-1/+2
| | | | | | | | | | | | use a flag instead of pre-committing the "requested" state to prevent propagation or "requested" to "active", which makes things a lot clearer when reading the code. also avoid going through the "resized" code-path when requested size is equal to "active" size. Bug: 6498869 Change-Id: I24f893ba0ec5ca06aac5b8da9818989ae7ce4005
* Fix "Battery/Status/Clock status bar area flickers when dragging down"Mathias Agopian2012-05-161-3/+9
| | | | | | | | | The crop is now handled like a resize, it's latched only when we receive a new buffer in the case we have a resize in the same transaction. Bug: 6498869 Change-Id: I9f3cbbe08fb19443899461ec441c714748a4fd1a
* minor refactoring in praparation of crop fixMathias Agopian2012-05-161-5/+7
| | | | | Bug: 6498869 Change-Id: I12a6f9a9fdfd2ea1db3fbe5fc8cb443aeaedb328
* SurfaceFlinger: add a crop to the layer stateJamie Gennis2012-05-111-0/+2
| | | | | | | | | 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
* don't attempt to clip layers anymore using glScissorMathias Agopian2012-04-161-1/+1
| | | | | | | | | | | | this seems to hurt performance on some GPU. this change might negatively affect performance on other GPUs though, but probably in less time-sensitive cases. If this becomes a problem it might become necessary to pre-clip the geometry (so that we don't have to use glScissor). This improves the rotation animation quite a bit. Change-Id: I5dbe1286f7ad858ef2c1e1ad9a07ee3f26c0b1f3
* get rid off preserve backbuffer optimization in SFMathias Agopian2012-04-161-9/+3
| | | | | | | | | this optimization didn't improve performance and in fact seemed to hurt more than anything else. it also made things a lot more complex as it introduced edges cases when switching to/from h/w composer. Change-Id: Iaafc235e175f5740cd98bff914d706e02ab88bb8
* fix libgui header locationMathias Agopian2012-02-271-3/+2
| | | | Change-Id: Iec71706cdd4f29c6904993648ce873e83ef9cafe
* separate transactions from updatesMathias Agopian2012-02-011-8/+9
| | | | | | | | | | 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-0/+1
| | | | | | | | | | | | | | | | | | | | | | | | 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-1/+3
| | | | Change-Id: I6d9a466a23285304f0e229a5649815636ab5d6af
* Merge changes Ib302d79e,Ib4ee085fJamie Gennis2011-09-271-1/+1
|\ | | | | | | | | | | * changes: SurfaceFlinger: set layer names on SurfaceTextures SurfaceTexture: add name support
| * SurfaceFlinger: set layer names on SurfaceTexturesJamie Gennis2011-09-221-1/+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
* | SurfaceFlinger: fix the transform hintJamie Gennis2011-09-241-0/+2
| | | | | | | | | | | | | | | | | | This change fixes the transform hint to use only the global display transform rather than incorporating the transient layer-specific transform used during animations. Bug: 5366891 Change-Id: I5408dcd3f4771d010953e8a696a484c835bfe81e
* | improve hwc dumpsysMathias Agopian2011-09-201-0/+2
|/ | | | | | we now log the buffer's format Change-Id: I9d3ad8018e884240a153de3baefb6331cb014d0f
* Fix an issue is SF that caused drawing artifacts when hwc changed modeMathias Agopian2011-09-081-1/+8
| | | | | | | | | | | | we were not redrawing and/or clearing the FB properly when hwc moved a layer from/to FB to/from OVERLAY. In these cases we needed to expand the dirty region to include the layer that changed mode. Also split composeSurfaces() which was becoming quite large. Change-Id: Id6fa1acfc4ff694037fddf7efd037a4405732073
* fix Surface positions are not floatsMathias Agopian2011-08-301-5/+1
| | | | | | | | Added Surface.setPosition(float, float) which allows to set a surface's position in float. Bug: 5239859 Change-Id: I903aef4ad5b5999142202fb8ea30fe216d805711
* give the proper orientation to the h/w composer HALMathias Agopian2011-08-181-0/+1
| | | | | | | | | | | | we were using the "orientation" value instead of the real transform, which may contain arbitrary rotations for instance, and in some case ended up with a final "orientation" that looked valid, but wasn't. this fixes a problem on devices with a h/w composer hal where the rotation animation looked weird. Change-Id: I4be8a2a1bde49c33456fcf5c8d87ab515c216763
* SurfaceTexture: fix queues-to-composerJamie Gennis2011-08-171-0/+1
| | | | | | | | | | | 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
* unify SurfaceTexture and SurfaceMathias Agopian2011-06-131-49/+35
| | | | | | | Add the concept of synchronous dequeueBuffer in SurfaceTexture Implement {Surface|SurfaceTextureClient}::setSwapInterval() Add SurfaceTexture logging fix onFrameAvailable