History log of /frameworks/native/libs/gui/SurfaceControl.cpp
Revision Date Author Comments (<<< Hide modified files) (Show modified files >>>)
4e623e259c3e8677d57f761a3708423fb2e77e2a 16-Jun-2017 Bryce Lee <brycelee@google.com> Add method to explicitly create Surface.

It is sometimes necessary for a SurfaceControl client to request the
associated Surface object be created rather than reuse the cached
value. This changelist adds an additional method that performs the
same creation operations as if the Surface object was created for the
first time.

Bug: 62108743
Test: go/wm-smoke
Change-Id: I2f460f20b2d16ed9ff81cb36842bcd2f8641e03c
/frameworks/native/libs/gui/SurfaceControl.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/SurfaceControl.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/SurfaceControl.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.
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/SurfaceControl.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/SurfaceControl.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/SurfaceControl.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/SurfaceControl.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/SurfaceControl.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/SurfaceControl.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/SurfaceControl.cpp
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/SurfaceControl.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/SurfaceControl.cpp
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/SurfaceControl.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/SurfaceControl.cpp
acbe67888f0bd65d5400400f0115bae6bd6199dc 04-Mar-2016 Pablo Ceballos <pceballos@google.com> Add final crop implementation

Bug 26559810

Change-Id: Idaccd13cd625c92d18665ddecebdbb266ea365f3
/frameworks/native/libs/gui/SurfaceControl.cpp
1b3a9acb77ee12568fa19740d8eeab165a0dcd98 01-Mar-2016 Chong Zhang <chz@google.com> Add SurfaceControl::disconnect() to disconnect currently connected API

bug: 27295820
Change-Id: I6f51338bc15e018ed7899172653599ab6254c8c9
/frameworks/native/libs/gui/SurfaceControl.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/SurfaceControl.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/SurfaceControl.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/SurfaceControl.cpp
017a53851628e967e5e103a467acb602010dffdc 18-Apr-2014 Dan Stoza <stoza@google.com> Merge "libgui: Remove unnecessary casts in SurfaceControl"
3b3ba78c3c586c2b09b11e0f1ab5347ff51a21e0 10-Apr-2014 Dan Stoza <stoza@google.com> libgui: Remove unnecessary casts in SurfaceControl

There are a number of places where we create a local
sp<SurfaceComposerClient>& to something that is already an
sp<SurfaceComposerClient>, which is redundant. This fixes that
by removing the local references.

Bug: 13814149
Change-Id: Ic558cbda651c344e5cac97022c97563928eed29c
/frameworks/native/libs/gui/SurfaceControl.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/SurfaceControl.cpp
6de9653ac876a4cae03d32c1134c56c795b1b11c 20-Sep-2013 Christopher Ferris <cferris@google.com> Merge "Remove unnecessary include."
d142f4b787abae7a5c392ded0dd2741574a0bce2 20-Sep-2013 Christopher Ferris <cferris@google.com> Remove unnecessary include.

All these files are including utils/CallStack.h, but none of the code
uses any CallStack objects.

Change-Id: I38c3a346a3bd0ddbff368d0f7f8b3f3d78fc0432
/frameworks/native/libs/gui/SurfaceControl.cpp
83cafffeac037ab2f9d00f98f8d2f3da8fc9b857 17-Sep-2013 Jesse Hall <jessehall@google.com> Stop using default value for Surface producerControlledByApp parameter

Bug: 10785749
Change-Id: Ifbf9340e5eabe621a69e990ec3e05ac51f8db66a
/frameworks/native/libs/gui/SurfaceControl.cpp
ac006439bb635cd99d8dcbefe95fa680e21519b5 21-Mar-2013 Ramanan Rajeswaran <ramanan@google.com> Merge "Revert "Revert "Change SurfaceControl setPosition to take floats""" into jb-mr2-dev
d6480c020b050c777ec1db2dd9c16fccfc47b47b 21-Mar-2013 Ramanan Rajeswaran <ramanan@google.com> Revert "Revert "Change SurfaceControl setPosition to take floats""

This reverts commit bbb57f3331c7182399ed82e9c4f93a965677dde3

Change-Id: Ib8f039f530d6b8175b5205c6c0008b135d4001a2
/frameworks/native/libs/gui/SurfaceControl.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/SurfaceControl.cpp
bbb57f3331c7182399ed82e9c4f93a965677dde3 01-Mar-2013 Dave Burke <daveburke@google.com> Revert "Change SurfaceControl setPosition to take floats"

Temporary, to fix weekend build, until we get Nvidia code drop.

This reverts commit 9a867a8798fa6ea21f6341db31e38ea64fde6c83

DO NOT MERGE

Change-Id: I7b5dbc4db46ef3d97dc8598057d5487d6971178b
/frameworks/native/libs/gui/SurfaceControl.cpp
9a867a8798fa6ea21f6341db31e38ea64fde6c83 22-Feb-2013 Michael Wright <michaelwr@google.com> Change SurfaceControl setPosition to take floats

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

Change-Id: Ibed34175ae273608393aaa5f0a7df207dc40d709
/frameworks/native/libs/gui/SurfaceControl.cpp