summaryrefslogtreecommitdiffstats
path: root/services/surfaceflinger/Layer.cpp
Commit message (Collapse)AuthorAgeFilesLines
* 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
* screenshot layers wouldn't work in some casesMathias Agopian2013-08-211-0/+2
| | | | | | | | | | specifically when the display size and the screenshot window size didn't match, the buffer would be rejected. We simply fix this by setting the scalling mode to "SCALE_TO_WINDOW". Bug: 9992306 Change-Id: Ib821767899af330bb70d3cbbfa7d41b02794a075
* Fix a bug where non-cropped layer could be scaled incorrectlyMathias Agopian2013-08-201-1/+7
| | | | | | | | | | If a layer is not cropped but its bounds are outside of the viewport (i.e.: clipped), the crop rectangle passed to hw composer would be invalid because it started invalid in the first place (to indicate "no crop"). Bug: 10410944 Change-Id: I4ae4d49a1adef0be7fa4304ecf84b1a5b7d03fe0
* Encapsulate textures into their own Texture classMathias Agopian2013-08-161-1/+6
| | | | | | | | | | | | the main reason for doing this is so that we can have access to informations about a texture (like its dimension) close to where we generate and use shaders in ES 2.0. Previously, there wasn't any way to get to a texture's size from a RenderEngine implementation. Bug: 8679321 Change-Id: I388b338a70d07e3e8177dde248710ea1e4c82dff
* Merge "Add support for EGL_KHR_gl_colorspace" into klp-devJesse Hall2013-08-151-0/+1
|\
| * Add support for EGL_KHR_gl_colorspaceJesse Hall2013-08-131-0/+1
| | | | | | | | Change-Id: I684d0b8556cd6c84ee4b4d67e1bb95c3b96fccfb
* | don't reallocate the mesh each time we use itMathias Agopian2013-08-131-21/+20
| | | | | | | | | | | | | | | | the Mesh object can be part of each Layer (at least currently). also reworked the Mesh code a bit to make it easier to access the vertex data. Change-Id: I0490851ba898f0aa2e55b62958dcd8bdb535e98b