summaryrefslogtreecommitdiffstats
path: root/services/surfaceflinger/Layer.cpp
Commit message (Collapse)AuthorAgeFilesLines
* sf: Fix blending mode for legacy BSPArne Coucheron2016-07-201-1/+1
| | | | | | | * After 0c5f3af, glitches when blending is observed on A family devices. Modify ifdef to not include QCOM_BSP_LEGACY. Change-Id: Ibb53df5709abbb0e7132065aec23a14f7accf4b3
* sf: Make sure HWC_BLENDING_NONE is set for opaque layerradhakrishna2016-07-151-0/+4
| | | | | | | | Before configuring the layers to HWC, make sure HWC_BLENDING_NONE is set if the layer is opaque Change-Id: Ie84aa9d93e98a244692a0cffc2de653a9079f8b4 Crs-fixed: 957373
* SurfaceFlinger : Ensure position changes are drawn with correct buffer sizeDanesh M2016-05-121-2/+34
| | | | | | | | If a single transaction has both positional and size changes, ensure we don't draw any frames using the incorrect buffer size using the updated position. Wait for the correct buffer size and then proceed. Change-Id: I8e25f21f17e0936e66bb5053f85f8336c8464c7b
* SF: Fix invalid reduction of transparent region from a layer.radhakrishna2015-12-161-1/+3
| | | | | | | | | | Reduce transparent region from a layer only if the transparent region has valid intersection with the layer. Otherwise, reducing a transparent region lying completely outside of the layer leads to invalid sourcecrop values for the layer. Change-Id: Iee9ba53a8072c21c9ba8a6d58cb14ca30f8600ba CRs-Fixed: 620973
* sf : Fix vertices & texture coordinates computation.Ramakant Singh2015-12-161-7/+53
| | | | | | | | | Compute crop and display frame for GPU composition also in the same way it's done for HWC and compute vertices and texture coordinates for GPU composition. This avoids pixel shifts in output of GPU composition & overlays. Change-Id: I0d31b1e4a81049fff72109d1a210e7cbd945cfe9
* SurfaceFlinger: Add support for MDP3Baldev Sahu2015-12-081-2/+2
| | | | | | | | | | | | This change is porting of below commits related to MDP3 In MDP3 we are using the widevine level3 for secure content display. And this should applicable only for primary display not for screen shot or screen recording - CRs-Fixed: 595469 - Change-Id: I99be2d81287ab746d5c4a2375c3106c59e61a8fc Change-Id: Ie7ac95e1c03eb7ad6f71098ecf09a1e25e69760f
* SurfaceFlinger: Native changes to add blur effectByunghun Jeon2015-11-081-6/+15
| | | | | | | | | | | | | | Native changes to add blur-behind and blur mask effect Change-Id: I54faf82d750e8299de6d261f6a893ab26d08df84 SurfaceFlinger: Adding template for LayerBlur files Change-Id: I444009113b7bdd6c5284863fd1f56358e67d9fe6 SurfaceFlinger: Featurize libuiblur module for OSS build Change-Id: Ifdc176e699434125d17b111c044b8ba954cf717c
* SurfaceFlinger: Add support for MDP3Baldev Sahu2015-10-071-1/+2
| | | | | | | | | | | | | | | | | | | | | | | | | | This change is porting of following commits related to MDP3 1) SurfaceFlinger: Change to support framebuffer flip for 2D blitters - Surfaceflinger does not flip framebuffers when there are no layers marked for HWC_FRAMEBUFFER - This change checks for the HWC_BLIT flag and will request a flip to a new FB_TARGET buffer even if there are no FRAMEBUFFER layers "Change-Id: I1cb44389a05c9ec049d7f0d39c288feccb11a91c" 2) SF: Avoid wormhole clear for BLIT calls - Do not call GPU clear from SF when composition type is BLIT as it'll be taken care in HAL. "Change-Id: Ia613eb9b824c6484ecc8c8fa4ee883545d8541b8" 3) surfaceflinger: Allow gpu to render widevine level3 - Allow gpu to render widevine level3 but keep blocking screen shots. "Change-Id: I914232a062acbb7b17901dbf2b414973230e59d9" Change-Id: I35eef9eb1597af21c195e07d5fe4c0c73ab3a269
* SurfaceFlinger: Add support for DisplayUtilsRaj Kamal2015-10-061-1/+2
| | | | | | | | Add DisplayUtils class which uses the custom implementations of ExLayer, ExSurfaceFlinger, ExHWComposer, and ExVirtualDisplaySurface classes if needed Change-Id: Ibdd8da5d3d0d602f42b76a15d0994c6aa98bee3f
* SF: Allow present if sideband stream changedDan Stoza2015-07-291-0/+4
| | | | | | | | Allows the sideband layer to be passed all the way to HWC instead of getting blocked by the updated PTS tracking code. Bug: 22291067 Change-Id: Ic2f20a7528e276fff054e86ca35789c26873b348
* SF: Ignore PTS more than one second in the futureDan Stoza2015-07-061-2/+13
| | | | | | | | | | | Some of this logic already existed, but when we optimized SurfaceFlinger to avoid unnecessary wake-ups, we didn't carry the logic over into the new readiness test. shouldPresentNow now returns true if the timestamp is more than a second in the future (since it's likely a bogus timestamp and should be ignored). Bug: 21932760 Change-Id: Ib50970a4eb621588c0b60766c8d8d1a8bddf853b
* libgui: Fix handling of rotated surface damageDan Stoza2015-06-251-8/+1
| | | | | | | | | | | | | | | Incoming surface damage was not aware that the EGL implementation was rotating buffers in response to SurfaceFlinger's transform hint. This didn't affect all cases because the effect was to apply a 90 degree rotation instead of a 270 degree rotation. For full-screen updates, things more or less worked, but in other cases this caused corruption. This fixes that by correctly undoing the effect of rotated buffers on the incoming surface damage, and then passing that damage down untouched to HWC. Bug: 22068334 Change-Id: I226ecfc7a91fe2e16edd2aa6d9149f0d26b529d6
* libgui/SF: Propagate SECURE Layer flag changesDan Stoza2015-06-181-2/+8
| | | | | | | | | This allows changes to the SECURE flag to propagate down to Layers in SurfaceFlinger so that WindowManager can change it on the fly in response to device policy updates. Bug: 20934462 Change-Id: I558f6d22c6273be373f1f480365e42536af18a33
* SF: Don't crop surface damage against viewportDan Stoza2015-06-041-3/+1
| | | | | | | | Apply the display transform to surface damage, but don't intersect it with the viewport. Bug: 21486007 Change-Id: I94e697cea52096a960385d5f3b89609fdcf30a02
* SurfaceFlinger: Handle EGL errors more cleanlyDan Stoza2015-05-141-1/+20
| | | | | | | | | | Adds some more safety checking for cases where we get an error while trying to create the EGLImage. The checking puts the Layer into a failed state after detecting an error, since the shadow queue may no longer be synchronized. Bug: 20957332 Change-Id: I68b4c40eab3e58731b875ed5752f2c7d17f14bcb
* Fix PTS handling for buffer replacementDan Stoza2015-05-121-15/+46
| | | | | | | | | | | This changes the way that SurfaceFlinger's shadow buffer management works such that instead of tracking the size of the shadow queue in the BufferQueue, SF tracks the last frame number it has seen, and passes that into the acquireBuffer call. BufferQueueConsumer then ensures that it never returns a buffer newer than that frame number, even if that means that it must return PRESENT_LATER for an otherwise valid buffer. Change-Id: I3fcb45f683ed660c3f18a8b85ae1f8a962ba6f0e
* SF: Apply pending transactions to new sidebandsDan Stoza2015-05-051-0/+4
| | | | | | | | | | When a Layer's sideband stream is set, apply any pending transactions. Otherwise they would never be applied since sideband streams don't trigger updates by pushing new buffers. Bug: 20125898 Change-Id: I0c7a91cdf84e6205801f4ab64eee0b09e4c0b3e0 (cherry picked from commit 3b04e1383eca6cb1d43ebe23a421c427007690c7)
* SurfaceFlinger: Fix PTS on stale buffersDan Stoza2015-05-011-2/+32
| | | | | | | | | | | | | | | | | | | | | SurfaceFlinger's (Layer's) shadow copy of the BufferQueue queue was getting out of sync for a few reasons. This change fixes these by doing the following: - Adds a check to re-synchronize the shadow copy every time we successfully acquire a buffer by first dropping stale buffers before removing the current buffer. - Avoids trying to perform updates for buffers which have been rejected (for incorrect dimensions) by SurfaceFlinger. - Adds IGraphicBufferConsumer::setShadowQueueSize, which allows the consumer to notify the BufferQueue that it is maintaining a shadow copy of the queue and prevents it from dropping so many buffers during acquireBuffer that it ends up returning a buffer for which the consumer has not yet received an onFrameAvailable call. Bug: 20096136 Change-Id: I78d0738428005fc19b3be85cc8f1db498043612f (cherry picked from commit 2e36f2283f48ab764b496490c73a132acf21df3a)
* SF: Always perform sideband transactionsDan Stoza2015-04-221-1/+5
| | | | | | | | | | | | On normal Layers, we defer applying resize transactions until a buffer of the correct size arrives. This breaks with sideband streams, because buffers are not seen by SurfaceFlinger. This change applies transactions immediately for Layers which have a sideband stream attached to avoid that problem. Bug: 20428254 Change-Id: I379d8aaef460d467cdf8432764b4a504928fb65a (cherry picked from commit c300b8b506536e1bf94ffd8a3b75d46e776923e0)
* SurfaceFlinger: Pass surface damage to HWCDan Stoza2015-04-151-0/+23
| | | | | | | | | Passes the surface damage from the incoming SurfaceFlingerConsumer BufferQueue down to the hardware composer HAL interface, if the HWC version number is 1.5 or greater. Bug: 11239309 Change-Id: Ic4305210593874a8d6deba3319055b2b8c57e926
* DO NOT MERGE SurfaceFlinger: Stop using IGBC::BufferItemDan Stoza2015-03-191-1/+1
| | | | | | | | | | Switches all uses of IGraphicBufferConsumer::BufferItem (and BufferQueue::BufferItem) to the BufferItem in libgui. Depends on frameworks/native I699ed0a6837076867ca756b28d1ffb2238f7a0d9. Cherry pick of I187b3a7d05196b6289596afac8fb9a9d4aebff76 Change-Id: I5bc79fb96b6cba6021af64b20890967aa3b7fcbf
* DO NOT MERGE Add dataSpace to buffer queues; remove old format enums.Eino-Ville Talvala2015-03-191-1/+0
| | | | | | | | | | | | | | | - Wire up new dataSpace parameter through buffer queue stack - Update tests to include the parameter - Switch eglApi to using dataSpace to indicate sRGB gamma/linear difference - Remove RAW_SENSOR in favor of RAW16 - Remove use of sRGB format enums - Add default dataspace to buffer queue core - Add query for default dataspace Cherry pick of I070bd2e7c56506055c419004c29e2e3feac725df Change-Id: I461952389c18051176c6b75e664f20ad369f5760
* am b947f29a: Merge "Add clamp to Layer and update Transform inverse." into ↵Michael Lentine2014-11-251-2/+13
|\ | | | | | | | | | | | | lmp-mr1-dev * commit 'b947f29a6af1622cda16d0b7112595082750dd07': Add clamp to Layer and update Transform inverse.
| * Add clamp to Layer and update Transform inverse.Michael Lentine2014-11-211-2/+13
| | | | | | | | | | | | | | | | | | | | Ensure that the adjusted transparent region is within the display bounds by clamping after the transformation is applied and clean up transform's inverse function. Bug: 18452546 Change-Id: Ia473e483ee8374177bcb84d8192eb1f0e86f022a
* | am 6b9454d1: SurfaceFlinger: Do less work when using PTSDan Stoza2014-11-181-1/+31
|\ \ | |/ | | | | | | * commit '6b9454d1fee0347711af1746642aa7820b1ea04d': SurfaceFlinger: Do less work when using PTS
| * SurfaceFlinger: Do less work when using PTSDan Stoza2014-11-171-1/+31
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | Currently, SurfaceFlinger is very dumb about how it handles buffer updates at less than 60fps. If there is a new frame pending, but its timestamp says not to present it until later SurfaceFlinger will wake up every vsync until it is time to present it. Even worse, if SurfaceFlinger has woken up but nothing has changed, it still goes through the entire composition process. This change (mostly) fixes that inefficiency. SurfaceFlinger will still wake up every refresh period while there is a new frame pending, but if there is no work to do, it will almost immediately go back to sleep. Bug: 18111837 Change-Id: I7825bacd37f40bf26edcc6a5e0f051dce45291fb
* | resolved conflicts for merge of 07dffa18 to lmp-mr1-dev-plus-aospAndreas Gampe2014-11-131-2/+0
|\ \ | |/ |/| | | Change-Id: I42d8bc291f4f48f3098754b076889159c4b20e41
| * Frameworks/native: Wall Werror in surfaceflingerAndreas Gampe2014-11-131-2/+0
| | | | | | | | | | | | Turn on -Wall -Werror in services/surfaceflinger. Fix warnings. Change-Id: Ifef830300d9d4bc657d8f1257c02bfe8c2b4d9c5
* | Add a BufferItem parameter to onFrameAvailableDan Stoza2014-11-071-1/+1
| | | | | | | | | | | | | | | | | | | | Passes the BufferItem for the queued buffer to the onFrameAvailable callback so the consumer can track the BufferQueue's contents. Also adds an onFrameReplaced callback, which is necessary if the consumer wants to do anything more than simple queue length tracking. Bug: 18111837 Change-Id: If9d07229c9b586c668e5f99074e9b63b0468feb0
* | Fixed discrepancy between crop and frame transparencies.Michael Lentine2014-10-031-2/+22
|/ | | | Bug: 17662777 Change-Id: I0d65d9b912a37a60e4c1d2e2e198f7709460917c
* surfaceflinger: recompute visibility after sideband stream changeJesse Hall2014-10-011-0/+4
| | | | | | | | | | | We normally recompute layer visibility when a layer gets its first buffer; before then it's treated as invisible. Sideband layers never get a buffer (as far as SurfaceFlinger knows), so never became visible. Now we also recompute visibility when a layer gets a new sideband stream. Bug: 17752511 Change-Id: I84e150f196eb2eb7bcd2616248e5e3fa73624809
* Fix inverse orientation when original is not applied first.Michael Lentine2014-08-191-2/+11
| | | | Change-Id: I6f1a11950c77c99800acbf08a672bc1b2310b0b5
* Fix camera orientation by swapping horizontal and vertical flips when needed.Michael Lentine2014-08-191-1/+18
| | | | | | Bug: 16637957 Change-Id: I66de597546fdc19e0af9e6150ca20460ab36bf8b
* Incorporate TransformToDisplayInverse into the crop calculation.Michael Lentine2014-08-181-5/+19
| | | | Change-Id: Ia9757b3a43d3b8f99df9fef2ed4d11c43b5abdd2
* Fix HWComposer Surface Crop when surface is rotatedMichael Lentine2014-08-071-5/+5
| | | | | | Bug: 15091149 Change-Id: I97ecd8af9636da9403fafdb3f9b846f95053ebb7
* Turn on support for async cursor update in surfaceflinger.Riley Andrews2014-07-281-2/+27
| | | | | | | If available, surfaceflinger will use the hwc setCursorPositionAsync() api to change the position of supported cursor layers outside of the usual prepare/set loop. Change-Id: Ib3fc5c0c390b3489ddbba202379840a1d2748917
* Add sticky transform to surfaceflinger.Ruben Brunk2014-07-141-7/+20
| | | | | | | | | | Bug: 15116722 - Adds a sticky transform field that can be set from a SurfaceFlinger client Surface. This transform is added to any transform applied to the Surface. Change-Id: Idaa4311dfd027b2d2b8ea5e2c6cba2da5779d753
* Improve SurfaceFlinger PTS estimationAndy McFadden2014-05-021-1/+2
| | | | | | | Get the next refresh time from DispSync instead of guessing based on the current time. Change-Id: I8dc72a3217bfd4e9b4c905034194d1a298cad69a
* Merge "Adding render stats APIs to UiAutomation (framework native)."Svetoslav2014-04-101-4/+8
|\
| * Adding render stats APIs to UiAutomation (framework native).Svetoslav2014-04-101-4/+8
| | | | | | | | | | | | bug:12927198 Change-Id: Ibb1c07f7d89e11281e5c1f27f412a29ac6f9c4ab
* | Merge "Fix sideband stream issues"Wonsik Kim2014-04-101-1/+1
|\ \
| * | Fix sideband stream issuesWonsik Kim2014-04-071-1/+1
| |/ | | | | | | | | | | | | | | - Notify a listener when sideband stream is set - Mark a layer as visible when sideband stream is set, even though no buffer is queued. Change-Id: I9652bf530f2b5ce331533ec1bb3b10a815ca191c
* | BufferQueue: Remove Bn version of create*Dan Stoza2014-04-071-2/+2
|/ | | | | | | It turns out that there's no reason to have both I* and Bn* versions of the createBufferQueue method, so I removed the Bn* version. Change-Id: I66aeb09e10458ae540ddf1f38d2d0154ea8f315b
* Remove deprecated BufferQueue constructorDan Stoza2014-03-181-5/+8
| | | | | Bug: 13415624 Change-Id: I9fe15e45daa7351f1db34ee75bfee6f19cb347d3
* Add sideband streams to BufferQueue and related classesJesse Hall2014-03-111-5/+23
| | | | | | | | | | | | Sideband streams are essentially a device-specific buffer queue that bypasses the BufferQueue system. They can be used for situations with hard real-time requirements like high-quality TV and video playback with A/V sync. A handle to the stream is provided by the source HAL, and attached to a BufferQueue. The sink HAL can read buffers via the stream handle rather than acquiring individual buffers from the BufferQueue. Change-Id: Ib3f262eddfc520f4bbe3d9b91753ed7dd09d3a9b
* Allow disabling layer rotation during screenshotsDan Stoza2014-02-141-15/+24
| | | | | | | | Add the ability to ignore layers' transformation matrices during screenshot capture, which will allow the window manager to capture unrotated images for recents during the device rotation animation. Bug: 11805195 Change-Id: I854d87bc84ca06ef9a054a454af1c080ee66fbb8
* Allow "opaque" flag to be updatedAndy McFadden2014-01-291-11/+11
| | | | | | | | | Moves the "opaque layer" from Layer to Layer::State. This allows it to be updated as part of a transaction. Bug 12387406 Change-Id: I0a114ce6adf77cd12fb08f96e0691b76c475768d
* fix camera API 2.0 orientationMathias Agopian2013-09-171-2/+44
| | | | | | | | | we add a flag to ANativeWindow::setBufferTransform that means "apply the inverse rotation of the display this buffer is displayed onto to". Bug: 10804238 Change-Id: Id2447676271950463e8dbcef1b95935c5c3f32b2
* color blindness enhancementMathias Agopian2013-09-041-14/+10
| | | | | | | | | | | | | | | | | | | | | | | | | This is an attempt at improving the experience of users with color vision impairement. At this time this feature can only be enabled for debugging: adb shell service call SurfaceFlinger 1014 i32 PARAM with PARAM: 0 : disabled 1 : protanomaly/protanopia simulation 2 : deuteranomaly/deuteranopia simulation 3 : tritanopia/tritanomaly simulation 11, 12, 13: same as above w/ attempted correction/enhancement The enhancement algorithm tries to spread the "error" such that tones that would otherwise appear similar can be distinguished. Bug: 9465644 Change-Id: I860f7eed0cb81f54ef9cf24ad78155b6395ade48
* minor clean-up of the GLESRendererMathias Agopian2013-08-281-1/+3
| | | | Change-Id: I978dea25b7687fbbbb283f09c24e115d9bad49a2