History log of /frameworks/native/libs/gui/SurfaceComposerClient.cpp
Revision Date Author Comments (<<< Hide modified files) (Show modified files >>>)
2713c30843816d3511b39b85a2c268a2b7682047 29-Mar-2018 Dan Stoza <stoza@google.com> Early wake-up for transitions (1/2)

On some devices it's very likely that we fall into GL comp during
app transitions. However, SF offsets are chosen in a way such that
the time to finish a frame is just too tight to be completely jank
free when hitting GL composition in SurfaceFlinger. Thus, we
introduce the concept of a separate early offset, and wakeup
SurfaceFlinger at that time if we think that hitting GL comp is
likely, or we already hit GL comp in the last frame.

Test: Open app, check vsync offsets in systrace
Test: Open many dialogs/apps to fall into GPU comp.
Bug: 75985430
Change-Id: Ie17e30c4575359fa11bb8912f68dcafe3e569ddb
Merged-In: Ie17e30c4575359fa11bb8912f68dcafe3e569ddb
/frameworks/native/libs/gui/SurfaceComposerClient.cpp
fd997e0969100418b4df8b8d97d21d497afa76c3 29-Mar-2018 Peiyong Lin <lpy@google.com> Add proper namespace to GraphicTypes.

Renamed GraphicsTypes.h to GraphicTypes.h and added proper namespace to avoid
naming conflict.

BUG: 77156734
Test: Build and flash
Change-Id: Ibd9f454b5b72d5f8c6d94a3869a60a1bf821f106
Merged-In: Ibd9f454b5b72d5f8c6d94a3869a60a1bf821f106
/frameworks/native/libs/gui/SurfaceComposerClient.cpp
c5b2cd2eab6711ef25797eb28539257b95ac4e36 28-Mar-2018 TreeHugger Robot <treehugger-gerrit@google.com> Merge "SurfaceComposerClient: Ensure createSurface returns error codes." into pi-dev
740eaf09b41c0e47c492ae34dc84ccef3ad54bf5 27-Mar-2018 Robert Carr <racarr@google.com> SurfaceComposerClient: Ensure createSurface returns error codes.

If SurfaceComposerClient::mStatus is not equal to NO_ERROR (for example
because we have attempted to construct a rooted-connection to a destroyed
surface, and initialization has failed) then it is possible for createSurface
to return NO_ERROR while failing to assign a value to outSurface. This
violates the expectations of the JNI layer which expects that NO_ERROR will
result in a valid surface.

Bug: 76231383
Test: Surface_test.cpp (libgui_test)
Change-Id: Ie68aafad01674c43e13af09bc144cc673b84ac1b
/frameworks/native/libs/gui/SurfaceComposerClient.cpp
ccd348460ca25890a8fb709e82e6f780e3ce878e 14-Mar-2018 rongliu <rongliu@google.com> Pass correct window type and app id to hw composer.

1. Set -1 as default value for window type and app id.
2. When send layer information to hal, layers inherit type and app id from parent node when
parent node has valid type/appId.
3. Add window type and app id to SurfaceFlinger dumpsys.

Bug: 74622357
Test: Manual test. Several things verified:
1. Android settings layer, status bar layer, nav bar layer have valid window type and appId
when start android settings.
2. Layers without buffer have window type -1 and app id -1.
3. When send layers to hal, Chrome SurfaceView layer inherit type and app id from
its parent (MainActivity layer).

Change-Id: I8d6ad274ca18b61d1bbf6b28f7def5160b55b1e7
Merged-In: I8d6ad274ca18b61d1bbf6b28f7def5160b55b1e7
/frameworks/native/libs/gui/SurfaceComposerClient.cpp
a912b6ec28f758d061c907cee2a4b817690336d7 21-Mar-2018 TreeHugger Robot <treehugger-gerrit@google.com> Merge "Propagate error codes from createSurface" into pi-dev
a52f0295622a42849f5ef81c44589b816b2ccacb 15-Mar-2018 Peiyong Lin <lpy@google.com> [Native] Replace android_color_mode usage with ColorMode.

To ease the pain when we add color mode v1.1, we replace all current
android_color_mode usage in framework native with ColorMode directly from HAL.

BUG: 73824924
Test: Build & flash
Change-Id: I4436fc225c7807506825c7148bc794cb99f278dc
/frameworks/native/libs/gui/SurfaceComposerClient.cpp
3b382ed2e8a6a79698fb8e65913946bba109d836 14-Mar-2018 Robert Carr <racarr@google.com> Propagate error codes from createSurface

Without an error code it's impossible to distinguish OOM
from missing parent, causing the WM to start killing applications
in the case of a missing parent.

Bug: 73664284
Test: Manual.
Change-Id: Ida6a30b41d1e856dfa9dceb80a432a30353d2764
/frameworks/native/libs/gui/SurfaceComposerClient.cpp
578038fc49f83c4c8c4accdce49df404ecd6ad02 09-Mar-2018 Robert Carr <racarr@google.com> SurfaceFlinger: Add childLayersOnly variant of capture layers.

Currently captureLayers is being used to capture children of abstract
buffer-less layers, for example we capture the node representing
a Task. Because of animations, etc, the node may have been scaled
when we want to take the screenshot, so we solved this problem with
an inverse transform in LayerRenderArea. However we have parallel problems
for crop, visibility, etc...It seems what we really want from captureLayers
is the ability to capture all child layers while ignoring the parent imposed
state as if in a parallel hierarchy. I initially considered implementing a parallel
hierarchy with layer clones but it seemed much less risky for P to instead
reparent the existing hierarchy to a parallel abstract parent on the server side.

Bug: 72760590
Test: Existing tests pass. Quickstep works with new implementation. New transaction tests.
Change-Id: Ifd2b2f9ed45351d8ed0d7f09be1cd9806ec4abe8
/frameworks/native/libs/gui/SurfaceComposerClient.cpp
8e3fe5d6a78d92e0bcbd90ca98cf7b3f9de7512d 22-Feb-2018 chaviw <chaviw@google.com> Store SurfaceControl reference when creating transactions

The SurfaceControl needs to be stored when adding a new transaction.
This ensures the ref count is incremented so the SC isn't removed before
the transaction is applied.

Change-Id: I27a060e4c221c5dfa565ceb3a916574105fd1175
Fixes: 73448047
Test: DereferenceSurfaceControlTest
/frameworks/native/libs/gui/SurfaceComposerClient.cpp
763ef57459aa9f10f3587581b119fe8d4ece3cd3 23-Feb-2018 chaviw <chaviw@google.com> Rename getLayerState and getDisplayState functions.

Both getLayerStateLocked and getDisplayStateLocked are named incorrectly
since they do not require a lock to be held when called. Rename to avoid
confusion.

Test: Builds and runs
Change-Id: Ia0a98fc4c1994ecc131c783fea478e3e7075044d
/frameworks/native/libs/gui/SurfaceComposerClient.cpp
ca27f2500cff74ae1e08b3ae06f18e9b3414ffb7 07-Feb-2018 chaviw <chaviw@google.com> Allow destroySurface to get called in transaction.

Previously, destroy was always initiated immediatley and could not be
synchronized with a client transaction. This change allows
destroySurface to be called in the same transaction as other client
state updates.

Test: Unit tests pass
Test: Call from Java fixes bugs.
Change-Id: I841359530538961a0187216cc455cc388c0ede77
Fixes: 72953020
Fixes: 71499373
/frameworks/native/libs/gui/SurfaceComposerClient.cpp
0b26710528eb69f3883f295f3e6146e6466fd082 29-Jan-2018 Jorim Jaggi <jjaggi@google.com> Fix issue with Surface loss

Some remote animations didn't use all surfaces, meaning that these
became unreachable objects in the object tree, meaning that they
we're finalized during the animation, causing the leash to be
destroyed in SurfaceFlinger, causing to suffering because the
AWT surface got released, meaning that we can never allocate the
main windows Surface anymore.

Fix this by not releasing surfaces that you don't own.

Test: go/wm-smoke
Test: Notification launch animation over app
Change-Id: Ia99b4e814bfb286ae1d3639c525fc8f6c42c0e0f
Fixes: No bug yet, but expect to have a chaselist bug soon!
/frameworks/native/libs/gui/SurfaceComposerClient.cpp
1eaa10357344343b91d242a7ea774cc23beeab74 05-Dec-2017 Jorim Jaggi <jjaggi@google.com> Merge "Make SurfaceControl parcelable (2/2)"
f3cf4bcfa2c558f03e178f7044d3cb12fa0e73ed 30-Nov-2017 Jorim Jaggi <jjaggi@google.com> Make SurfaceControl parcelable (2/2)

Bug: 69145041
Test: Send SurfaceControl over binder
Change-Id: I47aa4a4bb39fab3ed4d1d30d4e472de7cbc5ca38
/frameworks/native/libs/gui/SurfaceComposerClient.cpp
40482ff650751819d4104c10a30974838168438c 30-Nov-2017 Chavi Weingarten <chaviw@google.com> Revert "Revert "Use GraphicBuffer instead of GBP for screenshots.""

This reverts commit 707b8f3507fa4a3915844c7a4730e67f94eee2f7.

Reason for revert: Ready to test out changes with SystemUI update

Change-Id: I9fd0cb7ad9cc68d2366fc5ec4ab087fbe4c21f3b
/frameworks/native/libs/gui/SurfaceComposerClient.cpp
707b8f3507fa4a3915844c7a4730e67f94eee2f7 29-Nov-2017 Chavi Weingarten <chaviw@google.com> Revert "Use GraphicBuffer instead of GBP for screenshots."

This reverts commit a252d895816b3aa6c3bc2b2083113694ead6963d.

Reason for revert: SystemUI and some other places need to be updated as well. Will resubmit with the other necessary changes

Change-Id: I2dfb7b439c866f31ffa584e450d3208c75afecaa
Bug: 69898957
/frameworks/native/libs/gui/SurfaceComposerClient.cpp
a252d895816b3aa6c3bc2b2083113694ead6963d 21-Nov-2017 chaviw <chaviw@google.com> Use GraphicBuffer instead of GBP for screenshots.

Migrate screenshot code to render the layers into a
GraphicBuffer instead of creating a GraphicBufferProducer. This cleans
up the code and makes rendering a screen capture simpler and clearer.

Test: Screencaptures for Recents, manual screenshots, and "adb shell
screencap"
Test: Transaction_test

Change-Id: Ifb463c0e98cfaa3f96ad27837b1a2e2921e253d1
/frameworks/native/libs/gui/SurfaceComposerClient.cpp
7206d49b2963ce2e926a5f25fe94aca9c06471e6 11-Nov-2017 chaviw <chaviw@google.com> Add additional parameters for the captureLayer functions.

1. Added new captureLayers function that will return a GraphicBuffer
instead of storing into a Surface.
2. Added crop to captureLayers function.
3. Added frameScale to allow captures to scale.
4. Removed rotation parameter from captureLayers since it will always be
in the correct orientation.

Test: Transaction_test ScreenCaptureTest.CaptureCrop, .CaptureSize

Change-Id: Ib16d8575cf0c103126b9427ad32e2d28d568ea61
/frameworks/native/libs/gui/SurfaceComposerClient.cpp
2c5f6d2257075c8b5ced78b07ed8b2c2323f0df2 26-Sep-2017 Robert Carr <racarr@google.com> SurfaceFlinger: Implement merging of transaction objects.

Useful for WindowManager to collect multiple transactions
from independent units.

Test: Transaction_test.cpp
Change-Id: I52e89b038e3b375493169991e41cb75b67550264
/frameworks/native/libs/gui/SurfaceComposerClient.cpp
a76b271f0e14325fa0ebb98e1cac0a15adfea1cb 20-Sep-2017 chaviw <chaviw@google.com> Add captureLayers function to capture a layer and its children.

The captureLayers function gets a root layer as its argument.
It will capture the content for that layer and its descendants. The
capture will set the root layer's transform back to (0, 0).

Test: Transaction_test ScreenCaptureTest
Change-Id: I84fb66a65cd91434cddc99506b1924cf9f950935
/frameworks/native/libs/gui/SurfaceComposerClient.cpp
4cdc58f6840d15b4952149d2b345ec1f97d505bc 23-Aug-2017 Robert Carr <racarr@google.com> SurfaceFlinger Transactions as distinct objects.

Essentially a process global singleton for transactions is not so useful once
we make surface control public API as process isn't something an app developer
is really thinking about. It's also nice that we get to delete two of the plumbing layers.

Test: Boots
Change-Id: I8864bd7e2f5865e3c0a425cf82f9928211911774
/frameworks/native/libs/gui/SurfaceComposerClient.cpp
13fdc49516d17f41e64e62e73c313b0928bf13cc 27-Jun-2017 chaviw <chaviw@google.com> Added native functionality to create a color layer.

Added a new layer that can draw a specified color and specified
alpha. This will replace creating a dim layer and allow any colors,
not just black, to be set for this layer.

Test: Added tests to Transaction_test.cpp to test with a color
and a color layer with alpha.

Change-Id: I00a38d1bbc01093026f088c3347454281bdc2b8c
/frameworks/native/libs/gui/SurfaceComposerClient.cpp
f1961f713de2b3f54c8ce7653964b969e1a02bc8 19-Sep-2017 chaviw <chaviw@google.com> Re-parent invoked on child instead of on parent.

The function to re-parent an individual child is now invoked on
the child instead of the parent. This ensures the child ends up with
the last parent set if multiple reparent requests are made in the same
transaction.
This also allows adding a parent to a layer that didn't have one
previously.

Test: Transaction_test -> Reparent, ReparentToNoParent,
ReparentFromNoParent

Change-Id: Idab429eb2dca5a4ae1b020a5a7629d719dd4d995
/frameworks/native/libs/gui/SurfaceComposerClient.cpp
0617894190ea0c3ee50889bee1d4df0f369b0761 27-Jul-2017 chaviw <chaviw@google.com> Add a re-parent function to re-parent a specific child.

This is similar to reparentChildren, but the reparentChild will
only re-parent a specific child to the new parent and not all
children.

Test: Added test in Transaction_test for reparentChild.

Change-Id: I4275e0d5f1d5601b489956753c78a56d1a5d4c1c
/frameworks/native/libs/gui/SurfaceComposerClient.cpp
88d37ddac876c75dd5d2e39d33787dbcbf833641 27-May-2017 Romain Guy <romainguy@google.com> Various fixes for wide color gamut rendering

This CL addresses multiple issues:
- A logic issue where the wide gamut color mode was not set at the right time
- The presence of scRGB surfaces was not detected
- The sRGB to Display P3 matrix was transposed
- The color matrix was applied in gamma space instead of linear space*
- The GPU code path was doing a division by w for each pixel when a
color transform is set, which shouldn't be necessary (the code now
checks that the matrix has the expected form)
- Incorrect comment
- Dead code in Description.cpp (mDirtyUniforms was never used)
- Screenshots were taken using the last render engine configuration,
the configuration is now properly set every time

* This can in theory cause a discrepancy when we switch to/from hardware
composer mode. I was not able to create a visible discrepancy in practice
using Night Light, color blindness compensation modes and color inversion.
More importantly, how/where the hardware composer applies the color
transform is not specified: it could be gamma or linear space, before or
after the hardware color LUT. We'll address this in a future CL if needed.
In addition, this code assumes that fp16 surfaces are encoded in non-linear
space (scRGB-nl instead of scRGB) but we do not have EGL/Vulkan extensions
to specify this behavior. We need to address this as well

This CL also fixes potential divides by 0 in the GPU code path.

Bug: 29940137
Test: CtsUiRenderingTestsCases, CtsGraphicsTestCases

Change-Id: I9ae15850f8b9d48c39ebc2724ca3da202be9b008
/frameworks/native/libs/gui/SurfaceComposerClient.cpp
db66e627ad8904491e384c64f82fc77a939b9705 11-Apr-2017 Robert Carr <racarr@google.com> SurfaceFlinger: Add parent-less relative layering.

This is a temporary functionality for the intermediate state where not
all child-surface like things in WM land are ported to use Child
Surfaces. In particular, we have ported SurfaceView to use child
surfaces and relative Z ordering. However the TV frameworks provide a
View framework component which overlays views over the SurfaceView but
below the main application window. Since we have not ported View
framework surfaces to use child layers, there is nothing the WM or
View Framework can do about this situation. Luckily the WM API's to
have requested this are @hide but we have the one media framework
component using it. In order to solve this issue we provide a method
to set Z ordering relative to another window without inheriting
its coordinate space as a child window would. This way the WM can
recognize these TYPE_APPLICATION_MEDIA_OVERLAY windows and Z-order
them at -1 with respect to the parents (and the SurfaceView can be at
-2).

Test: Included in transaction tests. Also manual test of bug repro steps with accomp frameworks/base CL
Bug: 36693738
Change-Id: I921852d3d34f67f79ec745b9703f9e679867e7a1
/frameworks/native/libs/gui/SurfaceComposerClient.cpp
cae605cd5668f8107e340ad8a672c7f034147401 29-Mar-2017 Robert Carr <racarr@google.com> Fix seamless rotation with SurfaceView WM bypass.

First a brief review on seamless rotation. In seamless rotation
the WM will do the following atomically:

1. Update the display transform.
2. Set window transforms to make the surfaces at their old size appear
at the correct location in the new coordinate space.
3. Set a flag to undo the transforms when the surfaces resize.

However, windows with NATIVE_WINDOW_TRANSFORM_DISPLAY needed to be special cased.
The flag will perform step 2 in terms of buffer mapping, but not in terms of bounds
computation. So to compensate the WM would apply the transform to the bounds,
set these bounds, and then skip applying the transform matrix (as the buffer is
transformed by the flag).

Now that the WM can't see the Camera view, it can't implement this special logic
and the Camera view inherits the parent transform. We compensate for this in
SurfaceFlinger by omitting parent rotation transform components for
Surfaces with NATIVE_WINDOW_TRANSFORM_INVERSE_DISPLAY. To some extent this
breaks arbitrary rotation for surfaces with NATIVE_WINDOW_TRANSFORM_INVERSE_DISPLAY
but this is essentially ok:

1. We lived with that bug until N-MR1
2. We fixed it in N-MR1 because the camera was falling back to ROTATE
a lot which shouldn't be happening anymore, following introduction
of specifying rotation animation in manifest.

Test: Rotate camera, disable HWC, rotate camera some more. Switch to front camera, repeat.
Bug: 36230754
Bug: 36727915
Change-Id: Ied390c9cb3968fcce32a84ee7947f699746fdc81
/frameworks/native/libs/gui/SurfaceComposerClient.cpp
77c073bdbe1b24a332056e1194a6162b7717a848 01-Mar-2017 Rob Carr <racarr@google.com> Merge changes from topic 'surfaceview-without-wm'

* changes:
Add detachChildren transaction.
Add deferTransaction variant taking GraphicBufferProducer.
f3edb8989a27b272ffa9273c5735e9dc891380ec 01-Mar-2017 Rob Carr <racarr@google.com> Merge "SurfaceControl: Correct setMatrix parameter naming."
6961b6bc1f6f172745deee98e7dcb34a3668e4e6 01-Mar-2017 Mathias Agopian <mathias@google.com> Remove unneeded references to IMemory

Test: compiled & run
Bug: cleanup
Change-Id: Ifef6695275f244a420df574b3bc49adb99c93fbf
/frameworks/native/libs/gui/SurfaceComposerClient.cpp
9524cb3b37a91b5741790c77ff24fd825b02bca7 13-Feb-2017 Robert Carr <racarr@google.com> Add detachChildren transaction.

Add SurfaceControl#detachChildren for use by the WindowManager.
This method is used in cases where the WM would previously preserve
windows the client tried to destroy. For example, when becoming invisible
(in the activity lifecycle sense, not in the SurfaceFlinger sense)
an app will destroy its child surfaces. Previously the WM would keep child
windows alive until the animation finishes to prevent glitches. The new
scheme for this is the WM will detach the children at this point,
at which point the parent layer becomes the owner of the children and the WM
can control the lifecycle as it wishes. I also included a test for reparentChildren
as I realized I had forgotten that.

Test: New test in Transaction_test.cpp
Change-Id: I79c22b2ccccceb9bdcc37b70c491bdf33dcf83d2
/frameworks/native/libs/gui/SurfaceComposerClient.cpp
0d48072f6047140119ff194c1194ce402fca2c0b 11-Jan-2017 Robert Carr <racarr@google.com> Add deferTransaction variant taking GraphicBufferProducer.

For SurfaceView using child layers, the client framework
will not have access to the Handle* for the parent surface,
but still needs a way to defer transactions to it's frames.

Test: Tested with corresponding SurfaceView modifications and existing tests.
Change-Id: I6f01c360e85a95ff0ab08db406741221152e5d5c
/frameworks/native/libs/gui/SurfaceComposerClient.cpp
cb6e1e385edd44fbc68718e792b7180b1015d438 22-Feb-2017 Robert Carr <racarr@google.com> SurfaceControl: Correct setMatrix parameter naming.

The first parameter dsdx controls the X scaling. The last parameter
is called dtdy but controls the Y scaling. Clearly this was meant to be
named dsdy. You can verify this with a quick look at Transaction_test.

Test: Tried various stuff, phone still works.
Change-Id: Ie9e898443350ffdcf227888a8d85efdbe1b6b033
/frameworks/native/libs/gui/SurfaceComposerClient.cpp
479c60c85c40fd3536b0c88036e838dc1a4c56a0 27-Jan-2017 Albert Chaulk <achaulk@google.com> Refactor how layer metadata for use by VR is propagated
from WindowManager based on feedback in frameworks/base.

Since windowType and ownerUid are immutable, they are sent
on creation instead of separate IPC.

Bug: 30984984
Test: built locally

Change-Id: I380b3cdcf6aec471fc23f1e27846ab80492e8add
/frameworks/native/libs/gui/SurfaceComposerClient.cpp
1db73f66624e7d151710483dd58e03eed672f064 21-Dec-2016 Robert Carr <racarr@google.com> SurfaceFlinger: Add support for non-privileged clients.

Allow clients without privilege to create child layers through scoped
connections. We enable this in preparation for allowing SurfaceView
to bypass the WindowManager. We include support for reparenting of
all of a layer's children for the WindowManager to use in cases where
one surface is replacing another (while keeping its children around).

Test: Tested with corresponding SurfaceView modifications.
Change-Id: I9920e6730d719113522a68788e63fb59f70d3406
/frameworks/native/libs/gui/SurfaceComposerClient.cpp
1f0a16a5d7cd00ba7fda82e7d315afa1fd1303b9 25-Oct-2016 Robert Carr <racarr@google.com> SurfaceFlinger and libgui: Support for child layers.

Add support for parenting Layers in a tree. Layers
follow scene-graph style rules, that is to say:
1. A child is cropped to the final bounds of the parent.
2. A child inherits the parent's transform (including position)
3. A child's Z ordering is relative to the parent and bounded between
the parents siblings.
4. A childs lifetime is bounded by it's parents lifetime.

Test: New tests in Transaction_test plus manual testing with later branches.
Change-Id: I96f8ad863665b9a70b6f845561344c297b7e6eff
/frameworks/native/libs/gui/SurfaceComposerClient.cpp
ae0608381b2b4699218febd6d45ad9d307544d55 28-Nov-2016 Robert Carr <racarr@google.com> SurfaceFlinger and libgui: Switch Z-order to signed type.

In preparation for SurfaceFlinger child layers. In that model
children's Z order will be relative to their parent. We need
negative Z values to represent children stacking below their
parent (e.g. SurfaceView). Java side already uses signed types
strangely enough.

Test: Basically a refactoring. SurfaceFlinger still works.
Change-Id: Ifcece69f6f9d917cbf5238a59f8e5de1e8ba6a25
/frameworks/native/libs/gui/SurfaceComposerClient.cpp
6cf6af0299f7e48bc5bcdcd6a6c0f5a8725e9411 22-Nov-2016 Albert Chaulk <achaulk@google.com> VR: Add API to plumb surface type and owner through to SurfaceFlinger

This is a cherry-pick of
https://googleplex-android-review.git.corp.google.com/c/1648886/

Test: None
Bug: None
Change-Id: I338c84c2576ab85fa4f6d8e759c9e7ce912cdd61
/frameworks/native/libs/gui/SurfaceComposerClient.cpp
673134ed213458e8d92920a9819f7b714947e211 10-Jan-2017 Robert Carr <racarr@google.com> Add ScreenshotClient functionality for returning GraphicBuffer.

WM and SysUI are interested in screenshotting to GraphicBuffer, for
zero copy initialization of Starting Windows and usage in SysUI. Both
codepaths are co-existing in the WM now, so existing screenshot APIs
are not cleaned up, though perhaps they could be soon.

Test: Manual in combination with other branches.
Bug: 31339431
Change-Id: I11151f44eddbba53559befebf5ee2bde1dee9b40
/frameworks/native/libs/gui/SurfaceComposerClient.cpp
d7de179ac5e759efd7d6574d04d24fc3825cffec 01-Sep-2016 Pablo Ceballos <pceballos@google.com> libgui: Add null pointer check in setDisplaySurface am: eddbef88cf am: 8663a03444
am: 739c90cb7b

Change-Id: I587f5160c6abb9e4e4c98657658ff63a91ac1a40
739c90cb7b3a0756d01c3c729476970f72d7e917 01-Sep-2016 Pablo Ceballos <pceballos@google.com> libgui: Add null pointer check in setDisplaySurface am: eddbef88cf
am: 8663a03444

Change-Id: I9ddce6a3f72111aad068bbd13f3618589cbd87fd
eddbef88cf78deb9b08a6cad2c9cb67e4ddcea0d 01-Sep-2016 Pablo Ceballos <pceballos@google.com> libgui: Add null pointer check in setDisplaySurface

Bug 31236602

Change-Id: I78d4e28e40db93f7e7e304355b370af0fa790b9d
/frameworks/native/libs/gui/SurfaceComposerClient.cpp
ec8ab15da8bb39fb55e16b216f9bf26e0c3030c9 31-Aug-2016 Pablo Ceballos <pceballos@google.com> Fail setDisplaySurface if can't enable async am: 1aad24c0c4 am: ad685f0f9f
am: 881a8a9cd7

Change-Id: I97891b6c0c7be3462d0033fcb33630d20a9d127e
881a8a9cd76df805806492131894fb3c8874a68c 29-Aug-2016 Pablo Ceballos <pceballos@google.com> Fail setDisplaySurface if can't enable async am: 1aad24c0c4
am: ad685f0f9f

Change-Id: Ia025b013bfc8199cfae3f2463a00df0b81329994
1aad24c0c47598b0cce5ea2cadd5c2a5f3c5196d 04-Aug-2016 Pablo Ceballos <pceballos@google.com> Fail setDisplaySurface if can't enable async

Bug 30106031

Change-Id: I1c2d048b59e9805e72542c387fbcdb002496a13f
/frameworks/native/libs/gui/SurfaceComposerClient.cpp
c1ba5c4649554e744844b07cfe402b42fbe12ff3 08-Jun-2016 Sahil Dhanju <sahildhanju@google.com> Multithreaded Surface Replayer that replays traces

Change-Id: Id8d17f74e00d4796e1ea266bdaf9e8dd0af6475b
/frameworks/native/libs/gui/SurfaceComposerClient.cpp
19cd2f88b6914e2f4c43a9595532e81a697304fe 20-Jul-2016 Michael Wright <michaelwr@google.com> Merge \"Color transforms are now color modes.\" into nyc-mr1-dev
am: f42ca4da5b

Change-Id: I2b5f704695dbbf84baf56b21369c3c80cc2142e1
28f24d0ab481bd9c6fd5618414fee694e837c5c6 12-Jul-2016 Michael Wright <michaelwr@google.com> Color transforms are now color modes.

Rename color transforms to color modes for all interfaces exposed to
surfaceflinger clients. Also split it out to be a separate
configuration value from display modes.

Bug: 29044347

Change-Id: I87e937f7c954a50c946e8e2c606797caa416c5d8
/frameworks/native/libs/gui/SurfaceComposerClient.cpp
d99daf4fe6e32f3d15482141abf79ef81327fdf4 22-Jun-2016 Robert Carr <racarr@google.com> Merge changes from topic \'seamless-rotation\' into nyc-mr1-dev
am: 4bfbe1f7ef

Change-Id: I05be2795f7b09b92f79627f991c01d7e32840121
367c5684f4d417e5176bec12d67f4e2e42738fe0 20-Jun-2016 Robert Carr <racarr@google.com> SurfaceControl: Add getTransformToDisplayInverse

For seamless rotation, the window manager needs
access to this flag, as it will apply the inverse
display transform itself to all other windows.

Bug: 28823590
Change-Id: Ifeee1078a9cb4cd01c8052570c137c6228b2f13d
/frameworks/native/libs/gui/SurfaceComposerClient.cpp
99e27f0bc236e38d88ff4f9912ede514a729b8eb 17-Jun-2016 Robert Carr <racarr@google.com> Change setPositionAppliesWithResize to apply to all geometry.

To support seamless rotation, change setPositionAppliesWithResize
to also include the crop. As the transformation matrix is already
frozen during resize, this enables the window manager to set the
total geometry state before and after resize in a race free fashion.

Bug: 28823590
Change-Id: I3f8f0e162b7ef4e9403c1220c7e4191b3ef30526
/frameworks/native/libs/gui/SurfaceComposerClient.cpp
f7b6b5d956f96458567eae519a926a6f51b077c0 07-Jun-2016 Robert Carr <racarr@google.com> Merge "SurfaceFlinger: Add mode to apply position with resize." into nyc-dev am: c3da482bb8
am: 3fee6ca1d9

* commit '3fee6ca1d93c1d4b822d2dcd36c61f9722dd88b9':
SurfaceFlinger: Add mode to apply position with resize.

Change-Id: I91f64e194199f1277a9b4e76c68faddcc7ef6660
82364e3cea0bf88fa8147766433329b3dd5148b8 15-May-2016 Robert Carr <racarr@google.com> SurfaceFlinger: Add mode to apply position with resize.

For some cases, like scaled windows with shadows,
we need to be able to apply the position concurrent with
window resize. This is because the scaling of the shadows causes
the top left coordinate of the non shadow surface content
to change before and after the resize.

Bug: 28899837
Change-Id: I522eacfbbcd79707dc1e5ab71901a263b3004ba9
/frameworks/native/libs/gui/SurfaceComposerClient.cpp
68a593e7fa07c947fef2c5de53c42e14ed630a8a 28-Apr-2016 Chih-Hung Hsieh <chh@google.com> resolve merge conflicts of 168dc86 to nyc-dev-plus-aosp

Change-Id: I1554cec6ea880a87921f723bc96972cb8e1d3c5c
e2347b7953f70232541bdc1b392230d6231aaeb9 26-Apr-2016 Chih-Hung Hsieh <chh@google.com> Fix google-explicit-constructor warnings.

Bug: 28341362
Change-Id: I0ce850de85e0de6a5472dd142f738856142db9ec
/frameworks/native/libs/gui/SurfaceComposerClient.cpp
c3574f7b0141c69fdca25ccafb80ff334462f9a3 24-Mar-2016 Robert Carr <racarr@google.com> Add setOverrideScalingMode to SurfaceControl

Provide an interface for the window manager to override
the client specified scaling mode. This makes it possible
for the window manager to force windows to be scaleable
for animations, etc, even when a resize is pending.

Bug: 27891386
Change-Id: Ic4aae9917bd6869ee0dbb425979b4e21c68342a3
/frameworks/native/libs/gui/SurfaceComposerClient.cpp
092123cf5abe88c82deb89bb0188e1cc8d8338be 13-Apr-2016 Jorim Jaggi <jjaggi@google.com> Revert "Death to synchronous transactions (1/2)"

This reverts commit c6a607aa7ab96f6b1bac487cffd1899e1f1cdcf5.

It causes issues when resizing: default buffer size on the consumer side
only gets set when the transaction actually executes. But because
consumer is not blocked on SF over WM anymore, it gets the default
buffer size before the surface is resized, and thus uses wrong bounds
for the buffer to be drawn, and never submits another one.

This needs a more involved fix.

Bug: 28122036
Bug: 28128613
Change-Id: I0e738f99e43fc9ea25426e9e6e607e01413d3bb7
/frameworks/native/libs/gui/SurfaceComposerClient.cpp
c6a607aa7ab96f6b1bac487cffd1899e1f1cdcf5 08-Apr-2016 Jorim Jaggi <jjaggi@google.com> Death to synchronous transactions (1/2)

Bug: 28068298
Change-Id: I0a9a212a4b19793cf2830193152c53c03b651970
/frameworks/native/libs/gui/SurfaceComposerClient.cpp
c4f471e75a8ec64ec34e3f2944a5a756215d0bec 24-Mar-2016 Dan Stoza <stoza@google.com> Plumb HDR capabilities up to SurfaceComposerClient

Plumbs HDR capabilities up from HWC2 through SurfaceFlinger and
ISurfaceComposer to SurfaceComposerClient.

Bug: 25684127
Change-Id: I0f07043ff42bfc7a159f785fee3e84936dc3c280
/frameworks/native/libs/gui/SurfaceComposerClient.cpp
acbe67888f0bd65d5400400f0115bae6bd6199dc 04-Mar-2016 Pablo Ceballos <pceballos@google.com> Add final crop implementation

Bug 26559810

Change-Id: Idaccd13cd625c92d18665ddecebdbb266ea365f3
/frameworks/native/libs/gui/SurfaceComposerClient.cpp
7dde599bf1a0dbef7390d91c2689d506371cdbd7 22-May-2015 Dan Stoza <stoza@google.com> Support SurfaceView synchronization.

Add API for fetching the next frame number to be produced by
a given buffer producer. Add an API to SurfaceComposer to
defer execution of the current transaction until a given frame number.
Together these may be used to synchronize app drawing and surface
control updates.

Change-Id: I8e0f4993332ac0199c768c88581a453fefbaff1d
/frameworks/native/libs/gui/SurfaceComposerClient.cpp
53390e1e8c33ebee5bb8100e846f5263ba05ff73 04-Aug-2015 Pablo Ceballos <pceballos@google.com> libgui/SF: Fix some code warnings

A couple of fixes to satisfy the Eclipse static code analysis tool.
- Initialize all members in constructors
- Remove unused forward declarations
- Add parentheses when combining logical and bitwise operators
- Fix a case statement with no break (it was intentional)

Change-Id: Icecb8cc98c6f58b97ab33fffb621f0edc33a7d3c
/frameworks/native/libs/gui/SurfaceComposerClient.cpp
231160866738f6ed2175701f300fed1a8e8e02b0 18-Jun-2015 Dan Stoza <stoza@google.com> libgui/SF: Propagate SECURE Layer flag changes

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
/frameworks/native/libs/gui/SurfaceComposerClient.cpp
d723bd7669b4fc88dc282d8bf8ba5ecb2849d22f 18-Nov-2014 Dan Stoza <stoza@google.com> libgui: Enable -Weverything and -Werror

Enables -Weverything and -Werror, with just a few exceptions for
warnings we can't (or shouldn't need to) work around.

Change-Id: I034abec27bf4020d84af60d7acc1939c59986dd6
/frameworks/native/libs/gui/SurfaceComposerClient.cpp
2ea926bda2fa30f3ba8d0ed2d2395a8ada952e6e 14-Nov-2014 Marco Nelissen <marcone@google.com> Replace IInterface::asBinder() with a static

so we can do NULL checks again, and update calls to IInterface::asBinder()
to use the new static version.

Change-Id: Ia7b10eb38ca55b72278bfd33d3bf647f338b4e6a
/frameworks/native/libs/gui/SurfaceComposerClient.cpp
f10c46ef855b6410b20ebd8b1351d4d78d8eca8e 11-Nov-2014 Dan Stoza <stoza@google.com> Enable clang for libui/libgui/surfaceflinger

Enables clang and C++11 for libui/libgui/surfaceflinger, and
eliminates all compile-time warnings.

Change-Id: Ie237fdb5ae44f2bfcddaa884f9c65ec3f08ae50f
/frameworks/native/libs/gui/SurfaceComposerClient.cpp
d15ef27f9b13727fa7358e3c09572f66bb1e0668 05-Sep-2014 Riley Andrews <riandrews@google.com> Update ScreenshotClient to take advantage of rotation in surfaceflinger's screencap api

Change-Id: I836649d9d5cd5958ce34e47f26f4a36d2d05d24c
/frameworks/native/libs/gui/SurfaceComposerClient.cpp
1f6078aef71b1d3f080cd565adbec350c71088dd 27-Jun-2014 Michael Wright <michaelwr@google.com> Have VirtualDisplays send SF resize messages when resizing

Change-Id: I76d15b22099a659450ec875836c9bf2b6584838f
/frameworks/native/libs/gui/SurfaceComposerClient.cpp
2c9b11f0291210c9b9513a1a0cce6afebd361b3b 25-May-2014 Prashant Malani <pmalani@google.com> surfaceflinger: Replace blank/unblank with setPowerMode

We replace the blank/unblank calls in surfaceFlinger with a more generic
setPowerMode() routine.

Some displays support different power modes (for example, with reduced
color palettes). Depending on the use case we should be able to toggle
these modes, so as to achieve incremental power savings.

Initially, three power modes will be supported:
- HWC_POWER_MODE_OFF
- HWC_POWER_MODE_DOZE
- HWC_POWER_MODE_NORMAL

HWC_POWER_MODE_OFF will correspond to blanking the display, while
HWC_POWER_MODE_NORMAL will correspond to unblanking. HWC_POWER_MODE_DOZE
will put the display into a low power setting, if it is supported in
hardware.

If such a low power mode is not supported, it should be treated as a
call to set the mode to HWC_POWER_MODE_NORMAL.

As a consequence of adding the mPowerMode field, the mScreenAcquired is
no longer required, and thus references to it are removed and replaced
equivalent references to mPowerMode.

We also add the glue code to connect the services invocation of setting
a power mode and the HAL implementation in HWComposer.

Bug: 13472578
Change-Id: I431595ecf16d2f2c94259272db3dd42f29636204
Signed-off-by: Prashant Malani <pmalani@google.com>
/frameworks/native/libs/gui/SurfaceComposerClient.cpp
c18790018be5d7ea7061ccbc81f3044e74adc823 23-May-2014 Dan Stoza <stoza@google.com> SurfaceFlinger: Add sourceCrop to screenshot

Adds a sourceCrop Rect parameter to screenshot commands, which allows
clients to capture only a portion of the screen instead of the whole
screen.

Bug: 15137922
Change-Id: I629447573cd34ffb96334cde7ba02490b9ea06d8
/frameworks/native/libs/gui/SurfaceComposerClient.cpp
7f7da32569f8e0b3d383a40b95f8ac1d55afd801 03-May-2014 Dan Stoza <stoza@google.com> Enable changing display configuration

This allows querying and switching display device configurations
through the ISurfaceComposer/SurfaceComposerClient interface.

Bug: 14320401
Change-Id: I8c22165698950e5da32204c1c4da92122f91a715
/frameworks/native/libs/gui/SurfaceComposerClient.cpp
d85084b2b65828442eafaff9b811e9b6c9ca9fad 20-Mar-2014 Svetoslav <svetoslavganov@google.com> Adding render stats APIs to UiAutomation (framework native).

bug:12927198

Change-Id: Ibb1c07f7d89e11281e5c1f27f412a29ac6f9c4ab
/frameworks/native/libs/gui/SurfaceComposerClient.cpp
6d5a7bb970dd5cfd5a51fe2de7f10b9fc75732b2 13-Mar-2014 Dan Stoza <stoza@google.com> Remove deprecated BufferQueue constructor

Bug: 13415624
Change-Id: I52f58a4d22296d9fc3cdbd4ad53eb10a785db3ce
/frameworks/native/libs/gui/SurfaceComposerClient.cpp
c701401f8cec2e5309f8b57e2b97baced5093274 15-Feb-2014 Dan Stoza <stoza@google.com> Allow disabling layer rotation during screenshots

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
/frameworks/native/libs/gui/SurfaceComposerClient.cpp
4125a4ffaf374ca9c0773f256998557d3325343e 30-Jan-2014 Andy McFadden <fadden@android.com> Allow "opaque" flag to be updated

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
/frameworks/native/libs/gui/SurfaceComposerClient.cpp
6c913be9ca95fd6b556d056e165a4ba6dc69795b 08-Aug-2013 Jesse Hall <jessehall@google.com> Add ISurfaceComposer::destroyDisplay

Bug: 10191053
Change-Id: Ia89286f95421344a60ffedaaca5825c4e3cd7f9e
/frameworks/native/libs/gui/SurfaceComposerClient.cpp
3ca76f416bc8665a97636ca8a2d0128b9da9d92c 07-Aug-2013 Mathias Agopian <mathias@google.com> remove support for glReadPixels screenshot path

this was only needed on some chipset we're not
supporting in KLP.

Change-Id: I2e8fc07f135030bd61d2e241a8e426f1a4316425
/frameworks/native/libs/gui/SurfaceComposerClient.cpp
db89edc94bd2a78226b407f9f7261e202e7fa325 02-Aug-2013 Mathias Agopian <mathias@google.com> All consumers now take an IGraphicBufferConsumer instead of a BufferQueue

this means they only have access to the consumer end of
the interface. we had a lot of code that assumed consumers
where holding a BufferQueue (i.e.: both ends), so most of
this change is untangling in fix that

Bug: 9265647
Change-Id: Ic2e2596ee14c7535f51bf26d9a897a0fc036d22c
/frameworks/native/libs/gui/SurfaceComposerClient.cpp
ba93b3f8e403636b614a4a379f9421bc70dca84f 02-Aug-2013 Mathias Agopian <mathias@google.com> log an error when dequeueBuffer gets a NULL Fence

Bug: 9858745
Change-Id: If35d6a7d770bf0a42d55bc55880a9ddb721fcfd0
/frameworks/native/libs/gui/SurfaceComposerClient.cpp
8f938a53385a3c6d1c6aa24b3f38437bb2cc47ae 13-Jul-2013 Mathias Agopian <mathias@google.com> always pass the BufferQueue explicitely to consumers

Change-Id: I883b0a7b19d8e722f9ab714ba6f49e658b02ca86
/frameworks/native/libs/gui/SurfaceComposerClient.cpp
8000d0694bc34bc17d869da546d8ff8790ae7be4 27-Mar-2013 Mathias Agopian <mathias@google.com> make sure to unlock the screenshot's buffer on destruction

this fixes a memory leak on various devices

Bug: 8475134
Change-Id: I25924674c803a0cb22371a95c60664c36acb0340
/frameworks/native/libs/gui/SurfaceComposerClient.cpp
abe815dd6978b718c04f6e22e1a893d2b51d11a1 20-Mar-2013 Mathias Agopian <mathias@google.com> rework how we take screenshots for a CPU consumer

We're not using IMemoryHeap as a transport anymore,
instead we're providing a CpuConsumer and use the
IGraphicBufferProducer version of the screenshot API.

However, some GPU drivers don't support properly
a GPU to CPU path, to work around this, we use a
temporary BufferQueue on the server side for the
GL rendering, and we use glReadPixels into the
CpuConsumer (we're now using a CPU to CPU path
which is always supported).

Currently this "wrapping" is always performed,
but it can be bypassed on devices that support
the GPU to CPU path.

This also addresses a DoS attack vector on
SurfaceFlinger, where an application could
consume all of SF's filedescriptors by creating
a lot of screenshots in a row.

Bug: 8390553

Change-Id: I9e81514c2a7711b9bb393f74305be7d2abe08f1c
/frameworks/native/libs/gui/SurfaceComposerClient.cpp
4d9b822e2c18142e55fe2611aa6cd7dc7d4a62c6 13-Mar-2013 Mathias Agopian <mathias@google.com> get rid of ISurface

ISurface was only used to get the IGraphicBufferProducer from
a Layer. It's now replaced by a BBinder subclass / IBinder and
is only used as a handle to the surface, to both refer to it
and manage its life-time.

Also cleaned-up a bit the ISurfaceComposer interface and
"create layer" code path.

Change-Id: I68d0e02d57b862cffb31d5168c3bc10cea0906eb
/frameworks/native/libs/gui/SurfaceComposerClient.cpp
2a9fc493dfdba67108e4335bb1fe931bc1e2a025 01-Mar-2013 Mathias Agopian <mathias@google.com> rework screenshot API and implementation

- SurfaceFlinger now supports to take a screenshot
directly into an IGraphicBufferProducer

- reimplement the IMemoryHeap screenshot on top
of the above

- reimplement LayerScreenshot such that its
BufferQueue is directly used as the destination
of the screenshot. LayerScreenshot is now a thin
wrapper around Layer

Bug: 6940974

Change-Id: I69a2096b44b91acbb99eba16f83a9c78d94e0d10
/frameworks/native/libs/gui/SurfaceComposerClient.cpp
e3c697fb929c856b59fa56a8e05a2a7eba187c3d 15-Feb-2013 Mathias Agopian <mathias@google.com> Refactoring: Rename SurfaceTextureClient to Surface

Change-Id: Ibed34175ae273608393aaa5f0a7df207dc40d709
/frameworks/native/libs/gui/SurfaceComposerClient.cpp
ac9fa427d4a86745e60a5f7fd8e3ea340c4db907 12-Feb-2013 Mathias Agopian <mathias@google.com> get rid of Surface identity and token

we use the IBinder instead.

Change-Id: I4aa0b58869ba43f19980013620051e5a261b062d
/frameworks/native/libs/gui/SurfaceComposerClient.cpp
2adaf04fab35cf47c824d74d901b54094e01ccd3 18-Dec-2012 Andy McFadden <fadden@android.com> Rename ISurfaceTexture and SurfaceTexture

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
/frameworks/native/libs/gui/SurfaceComposerClient.cpp
f3f7db6346323ca3ec4ec449a2622adddc6306b4 31-Aug-2012 Jeff Brown <jeffbrown@google.com> Allow global transactions to nest.

This change fixes a number of small glitches that can occur when
multiple components in the same process are updating surfaces.
One would expect that updates to disjoint sets of surfaces would
not collide but this is not the case. The first component to
close the global transaction causes all pending updates to
be applied, including those that another component might not
have finished setting up if it also had an open transaction
at the same time.

Change-Id: I99345958581abbe0e1e325a5bcba37e8941a313a
/frameworks/native/libs/gui/SurfaceComposerClient.cpp
dd3cb84cfbe8068790c6233b5829fae9c4a0ee93 20-Oct-2012 Jamie Gennis <jgennis@google.com> SurfaceFlinger: add support for secure displays

This change adds support for displays that are not allowed to display surfaces
with the eSecure flag set. All non-virtual displays are considered secure,
while virtual displays have their secure-ness specified at creation time.

Bug: 7368436
Change-Id: I81ad535d2d1e5a7ff78269017e85b111f0098500
/frameworks/native/libs/gui/SurfaceComposerClient.cpp
2d5e230292c27d59f4c096bc742a0a19abf811c1 16-Oct-2012 Jamie Gennis <jgennis@google.com> SurfaceFlinger: add animation transactions

This change adds a transaction flag for WindowManager to indicate that a
transaction is being used to animate windows around the screen. SurfaceFlinger
will not allow more than one of these transactions to be outstanding at a time
to prevent the animation "frames" from being dropped.

Bug: 7353840
Change-Id: I6488a6e0e1ed13d27356d2203c9dc766dc6b1759
/frameworks/native/libs/gui/SurfaceComposerClient.cpp
2a09bb321930e1f782599ec902bca1db58b9af77 09-Oct-2012 Jeff Brown <jeffbrown@google.com> Add blankDisplay/unblankDisplay to SurfaceComposerClient.

Bug: 7309812
Change-Id: Ia401d642094a46c62f0d26c65da1d11341e203a1
/frameworks/native/libs/gui/SurfaceComposerClient.cpp
38b657265ccc5ae45bd7860a68b0d9373b47a2f3 28-Sep-2012 Iliyan Malchev <malchev@google.com> Revert "Compatibility work around for bad graphics driver dependency."

This reverts commit a50b51c03aca449920fc8581a738032a7bce7150

Change-Id: Ibdcd776a7f241dbb2475403ea04f939249774c41
/frameworks/native/libs/gui/SurfaceComposerClient.cpp
8dfa92fef9759a881e96ee58d59875d35023aab9 18-Sep-2012 Andy McFadden <fadden@android.com> Plumb display name into SurfaceFlinger

The Surface createDisplay() call takes a display name for debugging.
This change carries it through SurfaceFlinger and displays it in
the "dumpsys SurfaceFlinger" output.

Bug 7058158

Change-Id: I79f3474a8656ff1beb7b478e0dbf2c5de666118a
/frameworks/native/libs/gui/SurfaceComposerClient.cpp
6652b3edcb7ef5402c05db12f477ceb23c27d6ec 07-Sep-2012 Andy McFadden <fadden@android.com> Watch for SurfaceFlinger death

The ComposerService object wasn't watching for SurfaceFlinger
restarts, which doesn't usually matter because the app framework
restarts when SurfaceFlinger dies. However, mediaserver continues
to run, which means its ComposerService object was trying to use
a dead handle, and playback of DRM movies was failing.

This adds a DeathRecipient listener and some logic to re-establish
the SurfaceFlinger connection.

Bug 6645813

Change-Id: I07581b881d3835601aa57d5358c8259d93bc4515
/frameworks/native/libs/gui/SurfaceComposerClient.cpp
00e8c7a88a5b9c4104a71013a713acd3e4d3b77b 05-Sep-2012 Mathias Agopian <mathias@google.com> display projection API now has a single function instead of 3

Change-Id: I9bf46d372b77d547486d4bbe6f1953ec8c65e98f
/frameworks/native/libs/gui/SurfaceComposerClient.cpp
94f261556cc5f4aa628cd5b71bf923b583f6e3c3 30-Aug-2012 Wink Saville <wink@google.com> Revert "A vendor ril depends on a native screen shot code."

This reverts commit 9b5782baf0a8a2d7afc7129453beb5df7abe7650.

A new ril for toro, hack no longer needed.
/frameworks/native/libs/gui/SurfaceComposerClient.cpp
9b5782baf0a8a2d7afc7129453beb5df7abe7650 29-Aug-2012 Wink Saville <wink@google.com> A vendor ril depends on a native screen shot code.

Add a temporary shim until the vendor fixes the ril.

Bug: 7073467
Change-Id: Ia95a58bd90677c03406c988d1c29ae785f8662f2
/frameworks/native/libs/gui/SurfaceComposerClient.cpp
a50b51c03aca449920fc8581a738032a7bce7150 28-Aug-2012 Jeff Brown <jeffbrown@google.com> Compatibility work around for bad graphics driver dependency.

This is a compatibility shim for one product whose drivers
are depending on SurfaceComposerClient::getDisplayInfo(
int, DisplayInfo*) when it really shouldn't.

Revert this patch when the problem has been resolved.

Bug: 7065398
Change-Id: I6542691b81fd1b1e1d79500a62e82d40a3d51db7
/frameworks/native/libs/gui/SurfaceComposerClient.cpp
380223bf1b340e7503177254a60d5982f95ab793 27-Aug-2012 Jeff Brown <jeffbrown@google.com> Remove unused "layer" argument from show().

Change-Id: I8944a9f4a27c330b11e5e837c69b88c8f84145ba
/frameworks/native/libs/gui/SurfaceComposerClient.cpp
9d4e3d2f42e93e2d12bacabe97d307d30c3c20dd 25-Aug-2012 Jeff Brown <jeffbrown@google.com> Banish DisplayID from the SurfaceFlinger API.

Use only display tokens in the API to refer to new displays.

Don't require the caller to specify the display when creating
a surface (since in general a surface could be shown on
any display).

This is intended to be a minimum change just to update the API.
Note that SurfaceFlinger still uses DisplayID in a few places
internally that might cause some features not to work properly
when there are multiple displays (LayerScreenshot, for example).

Change-Id: I3d91eec2da406eefd97bcd53655d403ad865a7e6
/frameworks/native/libs/gui/SurfaceComposerClient.cpp
818b46058aa3006e1d3c178abd36d4f10823f5d9 17-Aug-2012 Mathias Agopian <mathias@google.com> display states can't share the dirty flags

Change-Id: Ifade9f2f1a0df9a36aede77a6cf5eee4be534f98
/frameworks/native/libs/gui/SurfaceComposerClient.cpp
e57f292595bec48f65c8088b00ff6beea01217e9 10-Aug-2012 Mathias Agopian <mathias@google.com> make multi-display more real

- displays are represented by a binder on the client side
- c++ clients can now create and modify displays

Change-Id: I203ea5b4beae0819d742ec5171c27568f4e8354b
/frameworks/native/libs/gui/SurfaceComposerClient.cpp
3165cc21cfea781988407b19bd83292b19f05f55 09-Aug-2012 Mathias Agopian <mathias@google.com> libgui includes refactoring

Change-Id: I1d24ec17f5003ec2abab5f7472daaff4cc4cc2d3
/frameworks/native/libs/gui/SurfaceComposerClient.cpp
c666cae2d5995097ec49a87e375e2afdd92802b7 26-Jul-2012 Mathias Agopian <mathias@google.com> get rid of the shared-memory control block

Change-Id: If814060aca1d2ff2619d4adcd57296983d207f7f
/frameworks/native/libs/gui/SurfaceComposerClient.cpp
8785578391eacd4192333d7b0ce3afedd7d163e6 25-Jul-2012 Mathias Agopian <mathias@google.com> add a layerStack attribute to Layers.

this attribute can be set through a regular transaction using
SurfaceComposerClient (just like any other attribute, eg: position or size)

Change-Id: I701a47c677ea6442ca713728a93335328cd2b172
/frameworks/native/libs/gui/SurfaceComposerClient.cpp
8b33f032327f8de0dcc0e6d0d43ed80f834b51f6 25-Jul-2012 Mathias Agopian <mathias@google.com> update SF binder protocol to support setting display attributes

no change of functionality -- the old behavior is implemented
on top of this new protocol.
this new protocol will allow, eventually, to pass informations
about displays and layer stacks.

Change-Id: Ic6c2295e61ec8ecbc8ce01ab7664e35d928202fc
/frameworks/native/libs/gui/SurfaceComposerClient.cpp
6501e9944df131b3b7e293007084735dfa217f24 17-Jul-2012 Jeff Brown <jeffbrown@google.com> Remove freeze(), unfreeze() and setFreezeTint().

This is all dead code.

Change-Id: I646673aac793a6ec45021c370a2450f0ea4fbcce
/frameworks/native/libs/gui/SurfaceComposerClient.cpp
f9176a93a5c9061fe001c91bca50dd0a58d54f10 16-Jul-2012 Jeff Brown <jeffbrown@google.com> Remove freezeDisplay(), which is no-op.

Change-Id: I2b70249a1545636fd6d98b58057b22f9529cad21
/frameworks/native/libs/gui/SurfaceComposerClient.cpp
f15a83f5814219c167f87cb8aaea622fc8493499 11-May-2012 Jamie Gennis <jgennis@google.com> SurfaceFlinger: add a crop to the layer state

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
/frameworks/native/libs/gui/SurfaceComposerClient.cpp
90ac799241f077a7b7e6c1875fd933864c8dd2a7 26-Feb-2012 Mathias Agopian <mathias@google.com> fix libgui header location

Change-Id: Iec71706cdd4f29c6904993648ce873e83ef9cafe
/frameworks/native/libs/gui/SurfaceComposerClient.cpp
41f673c9b3aac0d96e41c928845c39186d565212 18-Nov-2011 Mathias Agopian <mathias@google.com> split ComposerService out of SurfaceComposerClient.h

Change-Id: I1eb691f7ca263d5895d871ab675bb5826e0323c6
/frameworks/native/libs/gui/SurfaceComposerClient.cpp
28378392fd5aa3e0a392c9eb64634055678c3987 13-Oct-2011 Jamie Gennis <jgennis@google.com> SurfaceFlinger: make sync transactions explicit

This change enables a layer or orientation update transaction sent to
SurfaceFlinger to explicitly request a synchronous transaction.

Change-Id: I97cbba610c13679849f66114b216fa6dbf12f2a9
/frameworks/native/libs/gui/SurfaceComposerClient.cpp
b8d69a55f1c187a35ac41e69de63251f5501b6f4 11-Oct-2011 Jamie Gennis <jgennis@google.com> SurfaceFlinger: update orientation via transactions

This change merges the ISurfaceComposer::setOrientation functionality
into ISurfaceComposer::setTransactionState. It enables the window
manager to atomically update both the display orientation and the
position and size of the windows in a single transaction with
SurfaceFlinger.

Bug: 5439574
Change-Id: I18a8ccc564d7d760ef8afb2d015ccdb7a7963900
/frameworks/native/libs/gui/SurfaceComposerClient.cpp
41b6aabf356d8a505da37b1d046bc9010028fe8b 31-Aug-2011 Mathias Agopian <mathias@google.com> fix Surface positions are not floats

Added Surface.setPosition(float, float) which allows to set a surface's
position in float.

Bug: 5239859
Change-Id: I903aef4ad5b5999142202fb8ea30fe216d805711
/frameworks/native/libs/gui/SurfaceComposerClient.cpp
c10d9d90b2088a3304076e0dc4bf05cdbb5d45ab 21-Jul-2011 Mathias Agopian <mathias@google.com> clean-up. get rid ofunused code and members in Surface[Control].cpp

Change-Id: Ia7790ae28af2c2ac99eae01c2c5044ace4a490a4
/frameworks/native/libs/gui/SurfaceComposerClient.cpp
698c0873cf2e07bdc7fd1e72169aee2a19fa40d7 29-Jun-2011 Mathias Agopian <mathias@google.com> SF transactions are now O(1) wrt IPC instead of O(N).

Change-Id: I57669852cbf6aabae244ea86940a08a5a27ffc43
/frameworks/native/libs/gui/SurfaceComposerClient.cpp
a67932fe6864ac346e7f78b86df11cf6c5344137 20-Apr-2011 Mathias Agopian <mathias@google.com> unify SurfaceTexture and Surface

Add the concept of synchronous dequeueBuffer in SurfaceTexture
Implement {Surface|SurfaceTextureClient}::setSwapInterval()
Add SurfaceTexture logging
fix onFrameAvailable
/frameworks/native/libs/gui/SurfaceComposerClient.cpp
0ef4e15a6c12778daf464a4953d7e15e651f49ac 20-Apr-2011 Mathias Agopian <mathias@google.com> Get rid of the "pid" parameter from createSurface

Change-Id: I28635e3f803e6abe965d79998e305f54a202465d
/frameworks/native/libs/gui/SurfaceComposerClient.cpp
d87f162026454f5a3e6437ed0c9ef51651a6b939 26-Mar-2011 Mathias Agopian <mathias@google.com> merge libsurfaceflinger_client into libgui

this is the first step in unifying surfacetexture and surface.
for this reason the header files were not moved, as most of them
will eventually go away.

NOTE: currently we keep libsurfaceflinger_client.so as an empty
library to workaround prebuilt binaries wrongly linking against
it.

Change-Id: I130f0de2428e8579033dc41394d093f4e1431a00
/frameworks/native/libs/gui/SurfaceComposerClient.cpp