History log of /frameworks/native/services/surfaceflinger/SurfaceFlinger.h
Revision Date Author Comments (<<< Hide modified files) (Show modified files >>>)
6b9454d1fee0347711af1746642aa7820b1ea04d 08-Nov-2014 Dan Stoza <stoza@google.com> SurfaceFlinger: Do less work when using PTS

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
/frameworks/native/services/surfaceflinger/SurfaceFlinger.h
3f121fc650d72d0103cef8e6a651093fb1589e0a 01-Oct-2014 Michael Lentine <mlentine@google.com> When eglMakeCurrent fails we need to fix the egl state.

Bug: 16676660

Change-Id: Ie7bee9c78378b9e9206060444319e6ee35e1ab74
/frameworks/native/services/surfaceflinger/SurfaceFlinger.h
67d8bd66aaf04805cb8f2616ba964141b865e3b9 11-Sep-2014 Lajos Molnar <lajos@google.com> surfaceflinger: add getDisplayStats() method

This is used by media service to schedule video frames at the
proper time, based on precise vsync timings.

Bug: 14659809
Change-Id: I1a90603f3dc09dca9aa4f90a3aa845fab56e0a5e
/frameworks/native/services/surfaceflinger/SurfaceFlinger.h
c3ebe66b49cfba035e1fd0e160a13db38eb81b0e 05-Sep-2014 Riley Andrews <riandrews@google.com> Add rotation to surfaceflingers screen cap.

+ This is needed so that activity manager does not
have to do cpu side rotations when capturing recents
thumbnails.

Change-Id: If998008e675ad01305db8399fd643cf4608b7025
/frameworks/native/services/surfaceflinger/SurfaceFlinger.h
1f6078aef71b1d3f080cd565adbec350c71088dd 27-Jun-2014 Michael Wright <michaelwr@google.com> Have VirtualDisplays send SF resize messages when resizing

Change-Id: I76d15b22099a659450ec875836c9bf2b6584838f
/frameworks/native/services/surfaceflinger/SurfaceFlinger.h
6c9e34a98a63033b80bd1c24c7aa1304f912f10a 14-Jul-2014 Michael Lentine <mlentine@google.com> Modified SurfaceFlinger to implment setActiveConfig and getActiveConfig.

This can be used to change the current display mode of the device.

Change-Id: Icdc3fb58389b861dc77b68102083da6f7a96eccb
Tested: None
(cherry picked from commit 2651fa94635a96d653038fb389a0dd827338f8d3)
/frameworks/native/services/surfaceflinger/SurfaceFlinger.h
03414a1cfe6c1222fd7723949bd622f9cba145aa 01-Jul-2014 Riley Andrews <riandrews@google.com> Turn on support for async cursor update in surfaceflinger.

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
/frameworks/native/services/surfaceflinger/SurfaceFlinger.h
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/services/surfaceflinger/SurfaceFlinger.h
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/services/surfaceflinger/SurfaceFlinger.h
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/services/surfaceflinger/SurfaceFlinger.h
d85084b2b65828442eafaff9b811e9b6c9ca9fad 20-Mar-2014 Svetoslav <svetoslavganov@google.com> Adding render stats APIs to UiAutomation (framework native).

bug:12927198

Change-Id: Ibb1c07f7d89e11281e5c1f27f412a29ac6f9c4ab
/frameworks/native/services/surfaceflinger/SurfaceFlinger.h
b9b088375d33a87b201cdbe18be71802e2607717 13-Mar-2014 Dan Stoza <stoza@google.com> Remove deprecated BufferQueue constructor

Bug: 13415624
Change-Id: I9fe15e45daa7351f1db34ee75bfee6f19cb347d3
/frameworks/native/services/surfaceflinger/SurfaceFlinger.h
29fa9590ad32d918cb32cc88898ec53d28e1ad5a 17-Mar-2014 Wonsik Kim <wonsik@google.com> Revert "Implement video plane layer"

This reverts commit f837c93a1b392dbc4f7099d0c4fb723e32ca438e.

Change-Id: I6a1aa9ad0aca023267dc53d19c950b1535123ca7
/frameworks/native/services/surfaceflinger/SurfaceFlinger.h
f837c93a1b392dbc4f7099d0c4fb723e32ca438e 24-Feb-2014 Wonsik Kim <wonsik@google.com> Implement video plane layer

Binding with video source will follow.

Change-Id: Ic14e9757f5b61f4055cbeda47c1bafae0a621abb
/frameworks/native/services/surfaceflinger/SurfaceFlinger.h
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/services/surfaceflinger/SurfaceFlinger.h
10ca42cbdc75c6a36d0b72dadbe845d990e31e95 03-Jan-2014 Jesse Hall <jessehall@google.com> am 4c37d088: am 6c7dcfa9: am 662d3134: Merge "Move EGLConfig selection to RenderEngine"

* commit '4c37d0886ca06c290e205cad2798406361bbbf53':
Move EGLConfig selection to RenderEngine
05f8c703d4a050669ff8f406be3a9dc2357935f7 24-Dec-2013 Jesse Hall <jessehall@google.com> Move EGLConfig selection to RenderEngine

Bug: 12230666
Change-Id: I8d1111a7e0fd9d9e2525e6a80da8ce46d7dd085d
Signed-off-by: Jesse Hall <jessehall@google.com>
/frameworks/native/services/surfaceflinger/SurfaceFlinger.h
cd65a2c51e2f0d7756274fad0ad2c2fe698d2229 16-Oct-2013 Jamie Gennis <jgennis@google.com> am bbfbe93c: am 0a645cc5: SurfaceFlinger: give SF its own vsync phase

* commit 'bbfbe93c0d2d6c7818e23219d2925f02ddf5bd92':
SurfaceFlinger: give SF its own vsync phase
5727fc08ba39bb53e9191447e1b3144ea244ae0e 16-Oct-2013 Jamie Gennis <jgennis@google.com> am 47c772e8: am d1700756: SurfaceFlinger: Add EventControlThread

* commit '47c772e8ec28eb0a3df9c8edd252f292c7c8e152':
SurfaceFlinger: Add EventControlThread
c6694b4cb4829164cd490869c557103f310fd761 16-Oct-2013 Jesse Hall <jessehall@google.com> resolved conflicts for merge of e94d204a to master

Change-Id: Idb2030dbb25a2e4b972492587558b25a305e68bd
0a645cc5a935e67a8d1effc7679a838160b971d8 15-Oct-2013 Jamie Gennis <jgennis@google.com> SurfaceFlinger: give SF its own vsync phase

This change allows SurfaceFlinger to run at a different vsync phase offset from
that used by external listeners.

Bug: 11175503
Change-Id: I561c53a5659fa6dc1e3e4ae30340f3c1a6adceb4
/frameworks/native/services/surfaceflinger/SurfaceFlinger.h
d1700756ec9520c3fba22f9a14fd064a6e288810 14-Oct-2013 Jamie Gennis <jgennis@google.com> SurfaceFlinger: Add EventControlThread

This change adds a new thread for calling HWComposer's eventControl
asynchronously. The DispSync-based vsync approach ends up enabling and
disabling HWComposer's vsync callbacks at arbitrary times, and some HWComposer
implementations do not have these calls optimized.

Bug: 11175503
Change-Id: I719be82bd200b391c61d40863b991c7b59acdfd6
/frameworks/native/services/surfaceflinger/SurfaceFlinger.h
948fe0ce74c13e1bbff233883c158519fa8fb293 14-Oct-2013 Jesse Hall <jessehall@google.com> Disable hardware vsync when blanking the screen

Bug: 11220224
Change-Id: I99d0a42e1a6bb0aaf89706f6d100e9ef2a5deaa4
/frameworks/native/services/surfaceflinger/SurfaceFlinger.h
b85d2cf0a20e46261db8fee4839840f0ef715c68 09-Oct-2013 Jamie Gennis <jgennis@google.com> resolved conflicts for merge of 790b6d09 to master
faf77cce9d9ec0238d6999b3bd0d40c71ff403c5 31-Jul-2013 Jamie Gennis <jgennis@google.com> SurfaceFlinger: SW-based vsync events

This change adds the DispSync class, which models the hardware vsync event
times to allow vsync event callbacks to be done at an arbitrary phase offset
from the hardware vsync. This can be used to reduce the minimum latency from
Choreographer wake-up to on-screen image presentation.

Bug: 10624956
Change-Id: I8c7a54ceacaa4d709726ed97b0dcae4093a7bdcf
/frameworks/native/services/surfaceflinger/SurfaceFlinger.h
0c6fd94c13402ef56010cc2f122768bf9bf35dd9 02-Oct-2013 Jesse Hall <jessehall@google.com> am 92d7c3ee: am b65f32eb: Fix two EGLConfig selection bugs

* commit '92d7c3ee03109cf2d465a103b828b7d7d3ee9848':
Fix two EGLConfig selection bugs
b65f32ebe2c86869b07ac1c986660dfb2187b7d3 28-Sep-2013 Jesse Hall <jessehall@google.com> Fix two EGLConfig selection bugs

This fixes two bugs introduced by
Change-Id: Ia8cc084c02a0e3de910def024da8a08d02bbd89d

(a) There is no invalid EGLConfig value, in particular zero is valid.
Checking return values of eglGetConfigs and eglChooseConfig is the
only way to determine success.
(b) The "simple" EGLConfig query used as the emulator fallback should
not include EGL_RECORDABLE; the emulator doesn't have it.

Bug: 10935622
Change-Id: Ib798a24e7cf06a679811c46eaa45d39174a715ec
/frameworks/native/services/surfaceflinger/SurfaceFlinger.h
1c479c56da44c8942ab3d858ebcc19e4a6f76786 20-Sep-2013 Mathias Agopian <mathias@google.com> am 754bad45: am d555684c: reinstate black-screenshot debugging code

* commit '754bad4534e9a2de8b4e3ecbe097993c71246f91':
reinstate black-screenshot debugging code
4d5755389d111eb58ba5bdade84a39614dd222ed 20-Sep-2013 Mathias Agopian <mathias@google.com> am f589dd29: am e2a3e872: Merge "Fix GLES context version selection" into klp-dev

* commit 'f589dd2915587994d3dd36eff2191962fe0b71c0':
Fix GLES context version selection
d555684cb36dfb959694db76962e570184f98838 20-Sep-2013 Mathias Agopian <mathias@google.com> reinstate black-screenshot debugging code

turned off by default.

Bug: 10809349
Change-Id: I3e6b8c7860e6b0e122b8f07de4020967cd1f005c
/frameworks/native/services/surfaceflinger/SurfaceFlinger.h
2185f8b420ee1b150f761893a9c47cffff645cde 19-Sep-2013 Mathias Agopian <mathias@google.com> Fix GLES context version selection

Explicitly selects an ES 2.0 config first, then an ES 1.x config,
before attempting the fallback path for the emulator.

Bug: 10820214
Change-Id: Ia8cc084c02a0e3de910def024da8a08d02bbd89d
/frameworks/native/services/surfaceflinger/SurfaceFlinger.h
9c5a3335110769993d3fe997bdf1d594954d4304 13-Sep-2013 Alan Viverette <alanv@google.com> Add API for pushing color transforms to SurfaceFlinger

BUG: 9057596
Change-Id: Iea0953366eac875b7968897a75472c25a137edb5
/frameworks/native/services/surfaceflinger/SurfaceFlinger.h
ff2ed70fa30f04b90dd1a2c06ec2319e157152d7 02-Sep-2013 Mathias Agopian <mathias@google.com> color blindness enhancement

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
/frameworks/native/services/surfaceflinger/SurfaceFlinger.h
4f4f0943489d9113c66ac22b58cfba8c21dfa879 20-Aug-2013 Mathias Agopian <mathias@google.com> SurfaceFlinger now runs in the process's main thread

it used to spawn its own thread and return the main thread
to the binder thread pool -- this was confusing the naming
of things in the kernel.

Bug: 10331839

Change-Id: I2d13a6d73409a38109300fcbe6a04b4c41cb5d00
/frameworks/native/services/surfaceflinger/SurfaceFlinger.h
9e663de4fe1dcc872373ee530c60a375624671c3 16-Aug-2013 Jesse Hall <jessehall@google.com> Use new HWC display type/count constants.

Change-Id: I774d0c68906ac6dc69268f708c30a6b0868b8816
/frameworks/native/services/surfaceflinger/SurfaceFlinger.h
3f84483382be2d528918cc1a6fbc6a7d68e0b181 08-Aug-2013 Mathias Agopian <mathias@google.com> SurfaceFlinger now uses GLES 2.x when available

Bug: 8679321

Change-Id: I2b152d01fb4e2de2ea9fe87f1ddbd6826d7520d7
/frameworks/native/services/surfaceflinger/SurfaceFlinger.h
6c913be9ca95fd6b556d056e165a4ba6dc69795b 08-Aug-2013 Jesse Hall <jessehall@google.com> Add ISurfaceComposer::destroyDisplay

Bug: 10191053
Change-Id: Ia89286f95421344a60ffedaaca5825c4e3cd7f9e
/frameworks/native/services/surfaceflinger/SurfaceFlinger.h
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/services/surfaceflinger/SurfaceFlinger.h
6547ff4327aa320fbc9635668d3fc66db7dd78f6 17-Jul-2013 Jamie Gennis <jgennis@google.com> surfaceflinger: add frame duration logging

Change-Id: Ib414a45e7e191f23a2726cbbbeb606e9ce68a3b5
/frameworks/native/services/surfaceflinger/SurfaceFlinger.h
547e98f33c829eb2e3948a57e491a9106afa1f5e 09-Jul-2013 Mathias Agopian <mathias@google.com> Merge "Refactor SF. Move all GL operations in their own class."
fee2b463c5fbe8fa0132d03634ccc02ea55c1505 03-Jul-2013 Mathias Agopian <mathias@google.com> Debug code for detecting all black pixels screenshots

Bug: 9120292
Change-Id: If60db32524db973bb1f905ba3cb415c2a1cd7e71
/frameworks/native/services/surfaceflinger/SurfaceFlinger.h
875d8e1323536e16dcfc90c9674d7ad32116a69a 08-Jun-2013 Mathias Agopian <mathias@google.com> Refactor SF. Move all GL operations in their own class.

this is the first step to add support for GLES 2.x, this
change breaks the dependency of SF on GLES 1.x by moving
all operation into their own class.

Bug: 8679321

Change-Id: I0d2741eca2cefe67dfd9cf837cac10c4d126928b
/frameworks/native/services/surfaceflinger/SurfaceFlinger.h
29c3f352797d9d2ddf055d8f888e7694ef8b3947 22-May-2013 Jesse Hall <jessehall@google.com> Prevent opaque windows from making framebuffer translucent

To keep the code readable now that we have four different texenv
configurations, this change separates the decisions about what
configuration to use from the GL calls to set up the configuration.

Bug: 8963244
Change-Id: Ia07a306a7809ba8f93493d0160ccbd509e948581
/frameworks/native/services/surfaceflinger/SurfaceFlinger.h
b6df7d0e4c2117ca476662bd52b6745b3d8a305f 09-May-2013 Mathias Agopian <mathias@google.com> make all libsurfaceflinger and libsensorservice symbols's visibility hidden

we only export the main entry-point.
this saves about 150KB.

Change-Id: I55eb2b6705386fdfa43860deb62f9cdd2a0982aa
/frameworks/native/services/surfaceflinger/SurfaceFlinger.h
0aea53ff3f71f9f8df55d1cf58fd586442582643 24-Apr-2013 Mathias Agopian <mathias@google.com> use a Framebuffer Object to render all screenshots

this allows us to render into a buffer with a
pixelformat of our own choice; this is much faster
on all platform.

Bug: 8582615
Change-Id: I61298fc8e43fa6f92044c5123955cb5c7897dab7
/frameworks/native/services/surfaceflinger/SurfaceFlinger.h
74d211ae26a0257c6075a823812e40b55aa1e653 22-Apr-2013 Mathias Agopian <mathias@google.com> clean-up/simplify all dump() APIs

remove the scratch buffer parameter and use
String8::appendFormat() instead.

Change-Id: Ib96c91617c8e7292de87433d15cf6232b7d591b0
/frameworks/native/services/surfaceflinger/SurfaceFlinger.h
180f10de6f504d2ba56ff32ae8ed53c58bb458e9 11-Apr-2013 Mathias Agopian <mathias@google.com> Improve screenshot performance on some devices (DO NOT MERGE)

this affects devices that need a glReadPixels(). We use
a FBO instead of a GlConsumer as an intermediate render target, this
saves 2 calls to eglMakeCurrent().

On Galaxy Nexus this allows us to go from ~135ms to ~35ms for
recent's screenshots.

Bug: 8582615
Change-Id: I6b25291ecc235f1927579bbb2db3c731e985c6e8
/frameworks/native/services/surfaceflinger/SurfaceFlinger.h
02d86567d95b99e1142941ed7ec23a4465822813 25-Mar-2013 Jesse Hall <jessehall@google.com> Clean up HWC state when releasing a DisplayDevice

DisplayDevices can be released when DisplayManager removes them from
the display list, or (for virtual displays) when the surface is set to
NULL. We were only cleaning up HWC resources associated with the
display in the first case.

Bug: 8384764
Change-Id: Id3d226dd7178fbe6d0a2ac4e2660b864ee073de3
/frameworks/native/services/surfaceflinger/SurfaceFlinger.h
48bc05b56df9919fc39c5f2e3ea6535560eec98f 21-Mar-2013 Jesse Hall <jessehall@google.com> Fix dump when virtual display exists

SurfaceFlinger::getLayerSortedByZForHwcDisplay only worked for builtin
displays.

Bug: 8384764
Change-Id: I989275407fb2f06d166a6e70321c3211e27e562e
/frameworks/native/services/surfaceflinger/SurfaceFlinger.h
ed985574148a938bc3af24442eead313cc62521c 22-Mar-2013 Mathias Agopian <mathias@google.com> make sure screenshot are in a format supported by Bitmap.java

Change-Id: I0fb9cc4088f9c1fd27e6c017b0a7c5617adb4660
/frameworks/native/services/surfaceflinger/SurfaceFlinger.h
b4b1730abb7824dc084468c4942f010d94a7e039 21-Mar-2013 Mathias Agopian <mathias@google.com> only use glReadPixels() when needed when taking screenshots

some drivers don't support this yet, so we use a system
property to enable the glReadPixels "workaround" for them:

ro.bq.gpu_to_cpu_unsupported=1

Change-Id: I74d6a3a8f0cee8d5a507b72c760cf247e39195e0
/frameworks/native/services/surfaceflinger/SurfaceFlinger.h
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/services/surfaceflinger/SurfaceFlinger.h
6710604286401d4205c27235a252dd0e5008cc08 15-Mar-2013 Mathias Agopian <mathias@google.com> get rid of purgatory and fix QueuesToWindowComposer query

the purgatory list wasn't needed anymore; in fact it had no effect as
buffer life-time management is now handled by the BufferQueue.

For QueuesToWindowComposer we keep a list of wp<> on the IBinder
for IGraphicBufferProducers we hand over to clients so we can
easily check if an IGraphicBufferProducer is ours. We clean-up the
list when our IGraphicBufferProducer are destroyed.

Bug: 8349142
Change-Id: I1aa06652ade8c72d0004a3f5e6c3d6e8a82fc2ae
/frameworks/native/services/surfaceflinger/SurfaceFlinger.h
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/services/surfaceflinger/SurfaceFlinger.h
13127d8921356dff794250e04208c3ed60b3a3df 06-Mar-2013 Mathias Agopian <mathias@google.com> Get rid of LayerBase.

The functionality of LayerBase and Layer is folded
into Layer. There wasn't a need for this abstraction
anymore.

Change-Id: I66511c08cc3d89009ba4deabf47e26cd4cfeaefb
/frameworks/native/services/surfaceflinger/SurfaceFlinger.h
b79f61d41ef053bee1087ec612896c59f95f9686 06-Mar-2013 Mathias Agopian <mathias@google.com> fold LayerBaseClient into LayerBase

Change-Id: Ic745136522df59c42f0885fd969e75ea55d09f01
/frameworks/native/services/surfaceflinger/SurfaceFlinger.h
089a15298e045598bf15fd2a46284c34dd56384c 05-Mar-2013 Mathias Agopian <mathias@google.com> Remove support for ScreenshotLayer

Change-Id: I5b571a4cf3faa77d2c4aca916fa4bd00a1065bb9
/frameworks/native/services/surfaceflinger/SurfaceFlinger.h
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/services/surfaceflinger/SurfaceFlinger.h
e3c697fb929c856b59fa56a8e05a2a7eba187c3d 15-Feb-2013 Mathias Agopian <mathias@google.com> Refactoring: Rename SurfaceTextureClient to Surface

Change-Id: Ibed34175ae273608393aaa5f0a7df207dc40d709
/frameworks/native/services/surfaceflinger/SurfaceFlinger.h
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/services/surfaceflinger/SurfaceFlinger.h
4b0eba949cc026ffb2c75313042d8a7bcb3fcf86 05-Feb-2013 Jamie Gennis <jgennis@google.com> SurfaceFlinger: add win anim frame time tracking

This change makes the 'dumpsys SurfaceFlinger --latency' command with no extra
args dump the frame timestamp data for the most recent frames that
SurfaceFlinger generated that included window animation transaction changes.

Change-Id: I8bded1ea08a4cddefef0aa955401052bb9107c90
/frameworks/native/services/surfaceflinger/SurfaceFlinger.h
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/services/surfaceflinger/SurfaceFlinger.h
692c723e84e6f2747447d871d468ff50e5c73f19 09-Nov-2012 Jesse Hall <jessehall@google.com> Create builtin display tokens on demand

For hotpluggable builtin displays (currently just HDMI), create the
display device IBinder token when the display is connected and destroy
it when the display is disconnected. Previously we created the tokens
at startup and never changed them. This made it so that when comparing
current and drawing state, we couldn't tell whether a display had been
disconnected and reconnected.

Bug: 7491120
Change-Id: I23b77037dc0f548d549abf580339edd0e3c626e9
/frameworks/native/services/surfaceflinger/SurfaceFlinger.h
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/services/surfaceflinger/SurfaceFlinger.h
db9b41fd157279d1b988a854e0d7c5b43c2fac38 16-Oct-2012 Mathias Agopian <mathias@google.com> fix a corruption in blank/unblank

we were holding a reference (ie: pointer) to a sp<DisplayDevice>
while processing the message. Meanwhile the object itself could
go away and we would end up accessing a dead object.

the root cause of the problem is that we are accessing mDisplays[]
in a few places outside of the main thread.

Bug: 7352770
Change-Id: I89e35dd85fb30e9a6383eca9a0bbc7028363876c
/frameworks/native/services/surfaceflinger/SurfaceFlinger.h
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/services/surfaceflinger/SurfaceFlinger.h
cb55857bbde34a06c19dde3db5064d1717a0173e 05-Oct-2012 Mathias Agopian <mathias@google.com> fix dumpsys Layer name when using multiple displays

Bug: 7288401
Change-Id: I14beeef58fac5270cef3b611e18c163060efe6c3
/frameworks/native/services/surfaceflinger/SurfaceFlinger.h
81cd5d3b94d21253a0be925f4ae58cc7f4afeef7 04-Oct-2012 Mathias Agopian <mathias@google.com> make sure we don't call into the HWC HAL when not needed

when enabling/disabling vsync we now make sure to
not call into the HAL if the state wouldn't change.

Bug: 7274951

Change-Id: Ie24a6d68888a51b577acf9c2a973d85437cbacaf
/frameworks/native/services/surfaceflinger/SurfaceFlinger.h
c01a79d77b829e7de86ef137694e8ad708470ca1 28-Sep-2012 Andy McFadden <fadden@android.com> Pass display arg to blank/unblank

This allows us to blank and unblank displays other than the built-in
display (e.g. HDMI).

Bug: 7240511
Change-Id: I89ea13f9e497be74c3e1231d0c62fb558e93e0f8
/frameworks/native/services/surfaceflinger/SurfaceFlinger.h
722b98f9dfe8f04de8734630198b99a6cd024118 26-Sep-2012 Mathias Agopian <mathias@google.com> add support for EGL_FRAMEBUFFER_TARGET_ANDROID

we now try first with EGL_FRAMEBUFFER_TARGET_ANDROID, and
pick the first config we find. Otherwise, we revert to
the old algorithm.

Bug: 7232584

Change-Id: I8d5c5a4ce48420832c2e2828718a8f53325effb0
/frameworks/native/services/surfaceflinger/SurfaceFlinger.h
4803b74e2a12a508f7bbfde6f6a962fe3299c61c 25-Sep-2012 Andy McFadden <fadden@android.com> Show build config in dumpsys SurfaceFlinger

This adds a line to the "dumpsys SurfaceFlinger" output that shows
build-time configuration values.

Example:
Build configuration: [sf HAS_CONTEXT_PRIORITY] [libui] \
[libgui USE_FENCE_SYNC]

Bug 7206633

Change-Id: Ibe1856b459d34a4be6ee83a4ebfd2807e6cc68a0
/frameworks/native/services/surfaceflinger/SurfaceFlinger.h
148994e5f33ce240ff24ceb5bc0500b7f2001959 20-Sep-2012 Mathias Agopian <mathias@google.com> We now report hotplug events to the framework

Change-Id: I2d6b7787d39e5929485a551e4982498c5053c211
/frameworks/native/services/surfaceflinger/SurfaceFlinger.h
f33e4b6f13bc3ee2d2a4e1abd1ada171c70d3492 21-Sep-2012 Mathias Agopian <mathias@google.com> GraphicBufferAlloc class was declared twice

this was confusing because the one in FramebufferSurface
wasn't in fact being used

Change-Id: Ied45aec20d804cfbe52440f9b2f2852a85c757cf
/frameworks/native/services/surfaceflinger/SurfaceFlinger.h
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/services/surfaceflinger/SurfaceFlinger.h
cde87a3b9d3f8dc15232d927b56ee9e5e520f58d 13-Sep-2012 Mathias Agopian <mathias@google.com> refactor things a bit

- decouple GL and main display initialization
- ensure that each "supported" display has its own FramebufferSurface
- onScreenAcquired/Released now takes a display

Change-Id: If34a05f3dea40f6c79db77f4dde283a2580daac4
/frameworks/native/services/surfaceflinger/SurfaceFlinger.h
ce3a0a541c3dde1330551bd7a048cd9d92335c00 13-Sep-2012 Mathias Agopian <mathias@google.com> don't call hwc with non-empty layer lists for blanked displays

we now make sure to take the blanked state of a display into
account when we build its list of visible layers, this ensures
that we won't call prepare/set with a non-empty list when the
display is blanked.

Possibly fixes 7075380, 7103553, 7130187, 7016215

Bug: 7075380
Change-Id: I9fdd2e73d1b7621eaeca3d4ac2ae60d9fb1b3631
/frameworks/native/services/surfaceflinger/SurfaceFlinger.h
da8d0a5c0cf9d41915d3b106cad4aaec3e767c11 05-Sep-2012 Mathias Agopian <mathias@google.com> implement display viewport and frame

note: viewport clipping is not implemented yet

Change-Id: I7fde7c4de075d409d95c48bb20ba8ee017f6f00a
/frameworks/native/services/surfaceflinger/SurfaceFlinger.h
63f165fd6b86d04be94d4023e845e98560504a96 31-Aug-2012 Keun young Park <keunyoung@google.com> add libsurfaceflinger_ddmconnection for PDK build

- the library is dlopened from libsurfaceflinger
- the library built only when libnativehelper exists

Bug: 7089510
Change-Id: Ib3ea1029d7e8f6e055f4b759d0bf68f5123fa8a1
/frameworks/native/services/surfaceflinger/SurfaceFlinger.h
55801e41e6d7306d75d8134dd69d7d8cbbfbc63c 28-Aug-2012 Mathias Agopian <mathias@google.com> we were not always clearing the screen properly

Change-Id: I269dd866e965aebd9b3c4667095818202982f4a3
/frameworks/native/services/surfaceflinger/SurfaceFlinger.h
3ee454a7bef8bd3d1c9cdd9d17108eb80ebadf2a 28-Aug-2012 Mathias Agopian <mathias@google.com> Eradicate DisplayID.

DisplayDevices are now keyed of the wp<IBinder> the client uses.
DisplayID has now become DisplayType which is just used to identify
physical displays (as opposed to virtual displays such as wifi displays).

Change-Id: I0c5968f2c902dcd699a7e0afacf833ff070c12ea
/frameworks/native/services/surfaceflinger/SurfaceFlinger.h
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/services/surfaceflinger/SurfaceFlinger.h
13a082e160c2d1d8006b93a555a57035213d568b 24-Aug-2012 Andy McFadden <fadden@android.com> Added display initialization method

The primary display device was being configured to "blank" by
default, which prevented the boot animation from appearing
(unless you got lucky with the hardware composer state).

Bug 6975688

Change-Id: I0fa52e9e719c6e997c5725a7baf15d9718461b78
/frameworks/native/services/surfaceflinger/SurfaceFlinger.h
0bceb84773882b796d9dacbaf96167cb15928d78 24-Aug-2012 Jamie Gennis <jgennis@google.com> surfaceflinger: fix display id selection

This change fixes display ID selection so that it never chooses negative
numbers as display IDs.

Change-Id: I5af1acc7b1270b371595e096b18e2a6ad250c7ba
/frameworks/native/services/surfaceflinger/SurfaceFlinger.h
9b6a395e65ff88ab79fe92d6f112c434441ca606 24-Aug-2012 Andy McFadden <fadden@android.com> Revert "Added display initialization method"

Something doesn't seem right (again).

This reverts commit 53ade0853ca003c9e917b5e7d34e1b1338d7b87d.

Change-Id: Id5786997ca9dd2a447363e8ac95213ea37468504
/frameworks/native/services/surfaceflinger/SurfaceFlinger.h
53ade0853ca003c9e917b5e7d34e1b1338d7b87d 24-Aug-2012 Andy McFadden <fadden@android.com> Added display initialization method

The primary display device was being configured to "blank" by
default, which prevented the boot animation from appearing
(unless you got lucky with the hardware composer state).

Bug 6975688

(This reverts an earlier revert.)
/frameworks/native/services/surfaceflinger/SurfaceFlinger.h
f1bf89dd88f3926faaec77b9322b2a580691960d 22-Aug-2012 Ramanan Rajeswaran <ramanan@google.com> Revert "Added display initialization method"

This reverts commit 3f3956236aac97b6aa25fa89f0983d5e9d065fdb

Change-Id: Ia2a15d9a5db88add6019edf9d955cef1f73d432d
/frameworks/native/services/surfaceflinger/SurfaceFlinger.h
3f3956236aac97b6aa25fa89f0983d5e9d065fdb 21-Aug-2012 Andy McFadden <fadden@android.com> Added display initialization method

The primary display device was being configured to "blank" by
default, which prevented the boot animation from appearing
(unless you got lucky with the hardware composer state).

Bug 6975688

Change-Id: Idaa0d0b98ebb331a17d1b16774c6b05bfa1e8728
/frameworks/native/services/surfaceflinger/SurfaceFlinger.h
cd60f99aba9e750700a967db30b74a29145739cf 17-Aug-2012 Mathias Agopian <mathias@google.com> refactor compositing code to avoid multiple eglMakeCurrent() calls

when multiple displays are connected, we ended-up having to
call eglMakeCurrent() twice per display due to a limitation
in EGL. this fixes that.

Change-Id: I11e4584df50f8c24bbecee74e37b28b3ee031d2f
/frameworks/native/services/surfaceflinger/SurfaceFlinger.h
5f20e2d4462da3471f59152b32cd8640fa4a21da 11-Aug-2012 Mathias Agopian <mathias@google.com> reimplement wifi display hack with new external display SF framework

fix a few bugs with external displays

- HWComposer doesn't really handle multiple displays yet
so there is a lot of ugliness there

- We also need to make sure that external displays are not
blanked by default

- due to some EGL limitations surfaces being swapped need
to be current

Change-Id: I82bff05b43bcebd8da863c7c76b4edbc3bc223a9
/frameworks/native/services/surfaceflinger/SurfaceFlinger.h
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/services/surfaceflinger/SurfaceFlinger.h
4297734c1156fd8ede7e9c61b1e439f9e1c18cd9 05-Aug-2012 Mathias Agopian <mathias@google.com> turn DisplayDevice into a reference-counted object

it's safer this way because this object owns an
EGLSurface which cannot be easily reference-counted.

it also gives us the ability to sub-class it, which
we might want to do soon.

Change-Id: I07358bb052dc5a13b4f2196b2c2b6e6e94c4bb4f
/frameworks/native/services/surfaceflinger/SurfaceFlinger.h
888c822c4cb6976aab9256c58bae9e17e3e55c5c 05-Aug-2012 Mathias Agopian <mathias@google.com> remove a dependency of DisplayDevice on the refresh rate

this remove a dependency (not all) on FramebufferSurface

Change-Id: Ie07ce70760cdcedfb41b5b41bea8da45637bf474
/frameworks/native/services/surfaceflinger/SurfaceFlinger.h
92efd84f37ce5a8aae74dc9086f825a67b6894e9 03-Aug-2012 Mathias Agopian <mathias@google.com> screen-off animation won't be handled by SF anymore

Change-Id: Idc41386804ae7d7eb981c36e1bc55c270870c8d0
/frameworks/native/services/surfaceflinger/SurfaceFlinger.h
92a979a92c34b7de609ce2b1662c73bb8a2728b9 03-Aug-2012 Mathias Agopian <mathias@google.com> We now have a real list of displays.

displays can be dynamically added or removed, and the
list is part of the SF's transaction.

Change-Id: I4186ea39f1317c0e7c044f869004017738968fab
/frameworks/native/services/surfaceflinger/SurfaceFlinger.h
0f2f5ff75b7b48ceb64270655ee6b62d09bf4d00 01-Aug-2012 Mathias Agopian <mathias@google.com> rename DisplayHardware to DisplayDevice

Change-Id: I3f7250cd914e0da4f9ec2c9403587bbe12f3cc62
/frameworks/native/services/surfaceflinger/SurfaceFlinger.h
52bbb1ae239c8a4d05543a23fa8c08467d09c3b2 01-Aug-2012 Mathias Agopian <mathias@google.com> getting closer to final main composition loop

Change-Id: Icd63782366ffd11d9ea00c925ae5783ed7440cdb
/frameworks/native/services/surfaceflinger/SurfaceFlinger.h
87baae104a3e4c2059990b01c393476065c558b0 31-Jul-2012 Mathias Agopian <mathias@google.com> get rid of global regions that should be tracked per display

Change-Id: I3b871860cc29f1b2fdcc22b0c577a6eae65d9296
/frameworks/native/services/surfaceflinger/SurfaceFlinger.h
34a09ba1efd706323a15633da5044b352988eb5f 30-Jul-2012 Jesse Hall <jessehall@google.com> Move eglSwapBuffers out of HWComposer

Commit 8630320 moved the eglSwapBuffers fallback (for devices with no
HWC implementation) from DisplayHardware to HWComposer. But HWComposer
only knows about the framebuffer EGL display and surface handles if
there is a HWC, so it was always passing bogus handles.

This change moves the eglSwapBuffers fallback up to SurfaceFlinger,
which has access to the framebuffer EGL handles.

Bug: 6886613
Change-Id: Iad3f5ff7c90ee48d7053999e6a4548d6794b6ebd
/frameworks/native/services/surfaceflinger/SurfaceFlinger.h
c666cae2d5995097ec49a87e375e2afdd92802b7 26-Jul-2012 Mathias Agopian <mathias@google.com> get rid of the shared-memory control block

Change-Id: If814060aca1d2ff2619d4adcd57296983d207f7f
/frameworks/native/services/surfaceflinger/SurfaceFlinger.h
8630320433bd15aca239522e54e711ef6372ab07 25-Jul-2012 Mathias Agopian <mathias@google.com> split HWComposer out of DisplayHardware

we will only ever have a single instance of HWComposer, so
it's now an attribute of SurfaceFlinger, instead of being part
of DisplayHardware.

DisplayHardware now just represents a "display" (it should be renamed).

Change-Id: Iec191e57686868e1df6daa8b880a286c9fefde56
/frameworks/native/services/surfaceflinger/SurfaceFlinger.h
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/services/surfaceflinger/SurfaceFlinger.h
921e6ac4b7610a178285898d191eb0e3afe906c0 24-Jul-2012 Mathias Agopian <mathias@google.com> SurfaceFlinger cleanup

mostly refactored SurfaceFlinger.h, but also removed dead code.
cleaned-up a few includes as well.

Change-Id: Ib15f4ffe567912b61ee98aa076c6a283b72811b5
/frameworks/native/services/surfaceflinger/SurfaceFlinger.h
a49126087b4494f4ef50873f3a3f6727265f6621 12-Jul-2012 Mathias Agopian <mathias@google.com> factor EGL/GL and surface creation out of DisplayHardware

Change-Id: Icd85a6a4caad06f056578008af3e21666fa8b1f4
/frameworks/native/services/surfaceflinger/SurfaceFlinger.h
3b1d2b6b2bbfb5df46b1059ec52360974e6f1428 11-Jul-2012 Mathias Agopian <mathias@google.com> mVisibleLayersSortedByZ is now maintained per display

Change-Id: Idcdb77eba1a3f99b3e4b2150128a82acaffcd2a8
/frameworks/native/services/surfaceflinger/SurfaceFlinger.h
4fec873a98f7b4380720cd1ad006f74c8cdc73da 29-Jun-2012 Mathias Agopian <mathias@google.com> one more step towards multiple display support

- remove dependency on cached state in validateVisibility
- get rid of mVertices and mTransformedBounds
- get rid of validateVisibility
- get rid of unlockPageFlip
- handleTransaction now returns a dirty region
- computevisibileregion now uses window-manager space
/frameworks/native/services/surfaceflinger/SurfaceFlinger.h
1b03149f3533db04e72e088d3fdd09d0087ca594 21-Jun-2012 Mathias Agopian <mathias@google.com> get rid of GraphicPlane

its functionality is now folded into DisplayHardware
there will be more changes in that area.
/frameworks/native/services/surfaceflinger/SurfaceFlinger.h
3094df359d1e6e2ae8ca4e935cc093f563804c96 19-Jun-2012 Mathias Agopian <mathias@google.com> First prototype atttempting to support an external display

both API and implementation will change, this is just a prototype
intended to show feasability.

SurfaceFlinger is passed an ISurfaceTexture through a new
callback, it is in turn used to create an EGLSurface which
surfaceflinger will draw into in addition to the main screen.

Change-Id: Id0bbb0b854bb7bae44d57246a90b65d4567f9a21
/frameworks/native/services/surfaceflinger/SurfaceFlinger.h
aa049f0d19684cf92f2f6510133a33138845dcd3 20-Jun-2012 Mathias Agopian <mathias@google.com> am 8aaf3e47: am a67e418e: Exit boot animation cleanly.

* commit '8aaf3e47a51aa0beebecc8c536504d310d07cda9':
Exit boot animation cleanly.
a67e418e1fda219f6cc0a7e420bcf5cc4f9fe710 20-Jun-2012 Mathias Agopian <mathias@google.com> Exit boot animation cleanly.

The desc.txt file can now mark parts as 'must finish cleanly' by using
'c' as the part line prefix rather than 'p'. If so indicated, if the
bootanimation is asked to quit it will do so only after waiting to
finish that part.

I considered either making init.c service killing smarter or promoting
bootanim to be a bindable service with a requestExit method. However,
these changes are probably too big/risky given our ship date. So
I used a property as a mailbox between SurfaceFlinger and bootanim.

Bug: 6679877
Change-Id: Id7dca22caa50b450fff25ca94f7242d971034f41
/frameworks/native/services/surfaceflinger/SurfaceFlinger.h
db403e8ff0d7727015e1a5009bab20eb7ec205bc 19-Jun-2012 Mathias Agopian <mathias@google.com> split-up Client.h out of SurfaceFlinger.h

Change-Id: I1993bf23e417163749d886283563a93d50b361b4
/frameworks/native/services/surfaceflinger/SurfaceFlinger.h
8e533069e5721e55cb9768e140e16546c3a4a8b6 07-Jun-2012 Colin Cross <ccross@android.com> surfaceflinger: replace early suspend with binder call from PowerManager

SurfaceFlinger will no longer directly synchronize with early suspend.
Instead, PowerManagerService will synchronize with SurfaceFlinger to
ensure that a black frame has been drawn on the display, and then
trigger all early suspend handlers.

Change-Id: I07acdd628440d23fdb69db94319ec5d65d3f4919
/frameworks/native/services/surfaceflinger/SurfaceFlinger.h
b9494d5c9d44e4a59b6d510fea1665de434f3c6b 18-Apr-2012 Mathias Agopian <mathias@google.com> make sure to clear the framebuffer when using overlays

Bug: 6354761, 6353719
Change-Id: I0739de3fee7c54c14b294ffd768b70ee1f541d9e
/frameworks/native/services/surfaceflinger/SurfaceFlinger.h
a2f4e56fec0fb36c4a370eb23d6e9dc57f250b59 16-Apr-2012 Mathias Agopian <mathias@google.com> get rid off preserve backbuffer optimization in SF

this optimization didn't improve performance and in fact
seemed to hurt more than anything else. it also made
things a lot more complex as it introduced edges cases
when switching to/from h/w composer.

Change-Id: Iaafc235e175f5740cd98bff914d706e02ab88bb8
/frameworks/native/services/surfaceflinger/SurfaceFlinger.h
b60314a12f3336b27d73920805ab07cbc498d857 11-Apr-2012 Mathias Agopian <mathias@google.com> rework screen on/off code

Change-Id: I13f71e850592a588bbd4805b1830c503bd4decb4
/frameworks/native/services/surfaceflinger/SurfaceFlinger.h
cb9732a951d20cacb7ebe2dab132b5738226b1b6 04-Apr-2012 Mathias Agopian <mathias@google.com> refactor / simplify EventThread

Change-Id: I3981c6fba93b7b985174b2a7045e24db2c0b4428
/frameworks/native/services/surfaceflinger/SurfaceFlinger.h
90ac799241f077a7b7e6c1875fd933864c8dd2a7 26-Feb-2012 Mathias Agopian <mathias@google.com> fix libgui header location

Change-Id: Iec71706cdd4f29c6904993648ce873e83ef9cafe
/frameworks/native/services/surfaceflinger/SurfaceFlinger.h
99ce5cdeb383216dee95af4d90e47406b0948ea1 01-Feb-2012 Mathias Agopian <mathias@google.com> separate transactions from updates

with this changes, SF transactions are handled as soon as possible
but do not trigger updates. the update is delayed until the next
vsync.

this allows us to work much better without requiring triple-buffering.

Change-Id: I1fa10794d0cf742129f0877698b7b1e1f2ec7401
/frameworks/native/services/surfaceflinger/SurfaceFlinger.h
ad8d13c8858b33e3efef42086875c0b0836d2296 30-Jan-2012 Mathias Agopian <mathias@google.com> remove unneeded code

Change-Id: I07e2fca7274d2e12bf5b4aee0050794bdb97a8b3
/frameworks/native/services/surfaceflinger/SurfaceFlinger.h
25e66fc324bbc004fa8902b2d4699e41bb601104 29-Jan-2012 Mathias Agopian <mathias@google.com> added a few more commands to SF's dumpsys

--latency-clear [name]
clears the latency data for the specified layer or for
all layers if none is specified

--list
prints the list of all layers regardless of their visibility

Change-Id: I7c07ae020f838c173b98ee50f3fb3e93da78acbb
/frameworks/native/services/surfaceflinger/SurfaceFlinger.h
82d7ab6c7e0cf971e515134ccf072682dd1a2cdb 20-Jan-2012 Mathias Agopian <mathias@google.com> improve SurfaceFlinger dumpsys

It is now possible to say:

dumpsys SurfaceFlinger --latency

to print latency information about all windows

dumpsys SurfaceFlinger --latency window-name

to print the latency stats of the specified window

for instance: dumpsys SurfaceFlinger --latency SurfaceView

The data consists of one line containing global stats, followed by
128 lines of tab separated timestamps in nanosecond.

The first line currently contains the refresh period in nanosecond.
Each 128 following line contains 3 timestamps, of respectively
the app draw time, the vsync timestamp just prior the call to set and
the timestamp of the call to set.

Change-Id: Ib6b6da1d7e2e6ba49c282bdbc0b56a7dc203343a
/frameworks/native/services/surfaceflinger/SurfaceFlinger.h
55ef343331f5efbfe3e01bc9993d94faea236048 07-Jan-2012 Mathias Agopian <mathias@google.com> remove dead/usnused code

Change-Id: I6fa2bc6ee01790abd2c1533f043d61a5e5c8d26e
/frameworks/native/services/surfaceflinger/SurfaceFlinger.h
99ed22412db547c59d3da08114d9d5a586442b30 15-Dec-2011 Glenn Kasten <gkasten@google.com> Use the standard CC_LIKELY and CC_UNLIKELY macros

Several source files privately defined macros LIKELY and UNLIKELY in terms
of __builtin_expect. But <cutils/compiler.h> already has CC_LIKELY and
CC_UNLIKELY which are intended for this purpose. So rename the private
uses to use the standard names.

In addition, AudioFlinger was relying on the macro expanding to extra ( ).

Change-Id: I2494e087a0c0cac0ac998335f5e9c8ad02955873
/frameworks/native/services/surfaceflinger/SurfaceFlinger.h
478ae5eb5a0047e1b2988c896cff6363b455ee50 07-Dec-2011 Mathias Agopian <mathias@google.com> Improve the VSYNC api a bit.

- add the ability to set the vsync delivery rate, when the rate is
set to N>1 (ie: receive every N vsync), SF process' is woken up for
all of vsync, but clients only see the every N events.

- add the concept of one-shot vsync events, with a call-back
to request the next one. currently the call-back is a binder IPC.

Change-Id: I09f71df0b0ba0d88ed997645e2e2497d553c9a1b
/frameworks/native/services/surfaceflinger/SurfaceFlinger.h
43bfe7f047668a5b74fefb8cfecbf070f637201b 03-Dec-2011 Jesse Hall <jessehall@google.com> am a91e54fe: am f57c1388: Merge "SurfaceFlinger: fix layer removal race condition" into ics-mr1

* commit 'a91e54fed6a0690d59c97bab9b081b2614880563':
SurfaceFlinger: fix layer removal race condition
2f4b68d21c1a58cbcb1e6929fb241e425a8f7b5d 02-Dec-2011 Jesse Hall <jessehall@google.com> SurfaceFlinger: fix layer removal race condition

Layer::lockPageFlip() and layer::onRemove() could be called on
different threads and race such that lockPageFlip() successfully
called mSurfaceTexture->updateTexImage() but then gets NULL back from
mSurfaceTexture->getCurrentBuffer(), leading to a crash.

This change moves Layer::onRemove() calls to
SurfaceFlinger::commitTransaction() so they happen after the Layer is
done being drawn from and only happen on the main surfaceflinger
thread.

Change-Id: I4b550caadff4cc1878d7c3bca6129193fb0c713e
/frameworks/native/services/surfaceflinger/SurfaceFlinger.h
d0566bc26fcf6ca396118701fa11900b627f2c09 18-Nov-2011 Mathias Agopian <mathias@google.com> Add support for sending VSYNC events to the framework

use gui/DisplayEvent to receive the events. Events are
dispatched through a unix pipe, so the API is compatible
with utils/Looper. see gui/DisplayEvent.h for more info.

Bug: 1475048
Change-Id: Ia720f64d1b950328b47b22c6a86042e481d35f09
/frameworks/native/services/surfaceflinger/SurfaceFlinger.h
439cf8576d3b846c0aa0944d84372259bf075d51 29-Nov-2011 Mathias Agopian <mathias@google.com> Fix build.

Revert "Add support for sending VSYNC events to the framework"

This reverts commit f3918c5bd4bc9f02f74da42995564150ca2dd382.

Change-Id: I998e3e1aa3fa310829ae973b64fe11b01f6f468f
/frameworks/native/services/surfaceflinger/SurfaceFlinger.h
461afeb9fde149f9455acbadf1257d08d33e8eb3 18-Nov-2011 Mathias Agopian <mathias@google.com> Add support for sending VSYNC events to the framework

use gui/DisplayEvent to receive the events. Events are
dispatched through a unix pipe, so the API is compatible
with utils/Looper. see gui/DisplayEvent.h for more info.

Bug: 1475048
Change-Id: If4126023fc9c067e56087ec7d16a8fd542ce1794
/frameworks/native/services/surfaceflinger/SurfaceFlinger.h
4a9ac37fe26644bb5253d15eec08be2edb896642 01-Nov-2011 Mathias Agopian <mathias@google.com> Fix rotation displays frame N-1 briefly while rotating

The ScreenShot layer is now created hidden. The screenshot itself
is aquired during the transaction when the layer is made visible.
This guarantees the screenshot and the layer happen atomically
with respect to screen updates.

Bug: 5534521
Change-Id: Ida23e1f13d5716ec83b78a15712e0646d6cf8729
/frameworks/native/services/surfaceflinger/SurfaceFlinger.h
51726c381e23d148867c760d06306dfa940b4d15 22-Oct-2011 Mathias Agopian <mathias@google.com> am aa938c8d: Merge "mDirtyRegion is single threaded, but could be accessed from a hwc thread" into ics-mr0

* commit 'aa938c8d9c0e71c9b556657cb33794210ce6ebf8':
mDirtyRegion is single threaded, but could be accessed from a hwc thread
0dfb7b73a468698622d6c0423f0d5471a6f5d375 22-Oct-2011 Mathias Agopian <mathias@google.com> mDirtyRegion is single threaded, but could be accessed from a hwc thread

We now have mInvalidateRegion which holds the region to invalidate, it
can be set from any thread as long as mInvalidateLock is held. We use
fine-grained locking here because mInvalidateRegion can be set from anywhere,
in particular frmo HWC callbacks.

Bug: 5466774
Change-Id: Iafca20aa3f5b25a87755e65bde7b769aa8f997bc
/frameworks/native/services/surfaceflinger/SurfaceFlinger.h
818fb243572f8e1f408ba9fc35ef61bbedbd9ce1 19-Oct-2011 Dave Burke <daveburke@google.com> am 70ac412b: Merge "Add a LayerScreenshot" into ics-mr0

* commit '70ac412b2fe7be2507189a9fdfb30c43b36d56ac':
Add a LayerScreenshot
118d0245ee0a3b107055782aa8b555404b6f0280 14-Oct-2011 Mathias Agopian <mathias@google.com> Add a LayerScreenshot

A LayerScreenshot is a special type of layer that contains a screenshot of
the screen acquired when its created. It works just like LayerDim.

Make sure to call compositionComplete() after rendering into a FBO.

Bug: 5446982, 5467587, 5466259
Change-Id: I5d8a1b4c327f9973d950cd4f4c0bca7f62825cd4
/frameworks/native/services/surfaceflinger/SurfaceFlinger.h
cdec8f01aae14ed59fbc57cb2ce97a6602f4b9a1 17-Oct-2011 Mathias Agopian <mathias@google.com> am 840b8a67: Revert "Add a LayerScreenshot"

* commit '840b8a678537519c27ddf2f818494eaa20a135d4':
Revert "Add a LayerScreenshot"
090cb44b945bfe2711344a5331814bd6412ab437 17-Oct-2011 Elliott Hughes <enh@google.com> Merge branch 'master' of ssh://android-git:29418/platform/frameworks/base
e9800c83114988b6f8cc25bb9d508ebb322f9903 17-Oct-2011 Mathias Agopian <mathias@google.com> Revert "Add a LayerScreenshot"

This reverts commit d6809f40cf61203573ec5dbc437f695cd132cc18.
/frameworks/native/services/surfaceflinger/SurfaceFlinger.h
a402c4c9913cfbc6c3da21719c57a93a11f091f0 15-Oct-2011 Jamie Gennis <jgennis@google.com> SurfaceFlinger: Remove display freezing code

This change removes the dead code from SurfaceFlinger that resulted from
disabling support for freezing the display.

Change-Id: I4e5ff00c94b4c7a79af2f65c9850c135210068ed
/frameworks/native/services/surfaceflinger/SurfaceFlinger.h
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/services/surfaceflinger/SurfaceFlinger.h
f171ab6da9cf9793093e50947aacdab8f2b0c9b2 14-Oct-2011 Mathias Agopian <mathias@google.com> Add a LayerScreenshot

A LayerScreenshot is a special type of layer that contains a screenshot of
the screen acquired when its created. It works just like LayerDim.

Bug: 5446982
Change-Id: I7814aff2380e7e146937f2b641907be2a30c76cc
/frameworks/native/services/surfaceflinger/SurfaceFlinger.h
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/services/surfaceflinger/SurfaceFlinger.h
f7cdd053fe1fee093f6b0973ad5723765f98a48d 11-Oct-2011 Mathias Agopian <mathias@google.com> fix an issue where the screen could stay off

this would happen when toggling on/off/on very fast, the screen
could stay black (while the panel is on).

Bug: 5429724
Change-Id: Ic8aa6aff066e6267923c0d47ef65e314e7bb6d41
/frameworks/native/services/surfaceflinger/SurfaceFlinger.h
9575f60722f7a4f54384fe0be6938a8de48dc23a 07-Oct-2011 Jamie Gennis <jgennis@google.com> SurfaceFlinger: screenshots w/ protected buffers

This change modifies SurfaceFlinger's screenshot behavior when a layer
with a protected buffer is visible. The previous behavior was to simply
fail the screenshot. The new behavior is to render the screenshot using
a placeholder texture where the protected buffer would have been.

Change-Id: I5e50cb2f3b31b2ea81cfe291c9b4a42e9ee71874
/frameworks/native/services/surfaceflinger/SurfaceFlinger.h
e2c2f9213f936f98db604dc9c126ff22f725a824 06-Oct-2011 Mathias Agopian <mathias@google.com> Force a repaint when hwc invalidate hook is called

without this prepare() would be called but not set() since the
dirty region is empty.

Change-Id: I038acfbdad4c16015357ccde4d1949391d6f989d
/frameworks/native/services/surfaceflinger/SurfaceFlinger.h
21230c6410bdab13cd2bd274da54b1e4061b6035 21-Sep-2011 Jeff Brown <jeffbrown@google.com> Handle orientation changes more systematically.
Bug: 4981385

Simplify the orientation changing code path in the
WindowManager. Instead of the policy calling setRotation()
when the sensor determined orientation changes, it calls
updateRotation(), which figures everything out. For the most
part, the rotation actually passed to setRotation() was
more or less ignored and just added confusion, particularly
when handling deferred orientation changes.

Ensure that 180 degree rotations are disallowed even when
the application specifies SCREEN_ORIENTATION_SENSOR_*.
These rotations are only enabled when docked upside-down for
some reason or when the application specifies
SCREEN_ORIENTATION_FULL_SENSOR.

Ensure that special modes like HDMI connected, lid switch,
dock and rotation lock all cause the sensor to be ignored
even when the application asks for sensor-based orientation
changes. The sensor is not relevant in these modes because
some external factor (or the user) is determining the
preferred rotation.

Currently, applications can still override the preferred
rotation even when there are special modes in play that
might say otherwise. We could tweak this so that some
special modes trump application choices completely
(resulting in a letter-boxed application, perhaps).
I tested this sort of tweak (not included in the patch)
and it seems to work fine, including transitions between
applications with varying orientation.

Delete dead code related to animFlags.

Handle pausing/resuming orientation changes more precisely.
Ensure that a deferred orientation change is performed when
a drag completes, even if endDragLw() is not called because the
drag was aborted before the drop happened. We pause
the orientation change in register() and resume in unregister()
because those methods appear to always be called as needed.

Change-Id: If0a31de3d057251e581fdee64819f2b19e676e9a
/frameworks/native/services/surfaceflinger/SurfaceFlinger.h
9c6e297271ec9af9d974242d89cfa08cb6ceaa0a 21-Sep-2011 Mathias Agopian <mathias@google.com> fix transition from full overlays to fb

we need to clear the whole framebuffer in that situation because
we can't trust the content of the FB when partial (fb preserving)
updates are used.

Bug: 5318492

Change-Id: I3f0e01b0fb665a34e44d88ad9f0f54a5d990060b
/frameworks/native/services/surfaceflinger/SurfaceFlinger.h
0656a68380d01de4136933901b2c322cf9ab0d7e 21-Sep-2011 Mathias Agopian <mathias@google.com> rename mInvalidRegion to mSwapRegion

Change-Id: I946cbc782c0c84645843ea44c3d8b04a0a2fe658
/frameworks/native/services/surfaceflinger/SurfaceFlinger.h
f9abeb956fb95682d77005ea0dc506a805f52a04 09-Sep-2011 Mathias Agopian <mathias@google.com> Fix another problem with refreshing the screen when switching to/from overlay

the previous fix was incorrect. See comment in setupHardwareComposer for
full explanations.

Change-Id: Ib24a9af000b8f95cf7319f9272d34997064ceb6d
/frameworks/native/services/surfaceflinger/SurfaceFlinger.h
f384cc3008a25ad1b00403aca0cc001547f029c6 09-Sep-2011 Mathias Agopian <mathias@google.com> Fix an issue is SF that caused drawing artifacts when hwc changed mode

we were not redrawing and/or clearing the FB properly when
hwc moved a layer from/to FB to/from OVERLAY.

In these cases we needed to expand the dirty region to include
the layer that changed mode.

Also split composeSurfaces() which was becoming quite large.

Change-Id: Id6fa1acfc4ff694037fddf7efd037a4405732073
/frameworks/native/services/surfaceflinger/SurfaceFlinger.h
a45836466c301d49d8df286b5317dfa99cb83b70 24-Aug-2011 Mathias Agopian <mathias@google.com> Add a debug option to turn the "transformation hint" off

transformation hint is disabled with:

adb shell service call SurfaceFlinger 1009 i32 1

Change-Id: I9aafe6f280f88ce41569ed69a06dc522b10e3a88
/frameworks/native/services/surfaceflinger/SurfaceFlinger.h
53331da007b56e0cb4201728de99c8c29bcfaa9a 23-Aug-2011 Mathias Agopian <mathias@google.com> fix "show screen update" debug option.

Change-Id: I7d8b24124768b5f7d59d3bb0b019e9baaa0dfc4f
NOTE: from now on, this also disable the h/w composer
/frameworks/native/services/surfaceflinger/SurfaceFlinger.h
582270d69db94286a248bd829f1ae6f910d45124 18-Aug-2011 Jamie Gennis <jgennis@google.com> SurfaceTexture: fix queues-to-composer

This change fixes the NATIVE_WINDOW_QUEUES_TO_WINDOW_COMPOSER query of
Surface and SurfaceTextureClient. Surface now uses the inherited
SurfaceTextureClient implementation of this query. SurfaceTextureClient
now queries SurfaceFlinger to determine whether buffers that are queued
to its ISurfaceTexture will be sent to SurfaceFlinger (as opposed to
some other process).

Change-Id: Iff187e72f30d454229f07f896b438198978270a8
/frameworks/native/services/surfaceflinger/SurfaceFlinger.h
8afb7e39a83a3e31170612d562eb08508e328388 16-Aug-2011 Mathias Agopian <mathias@google.com> as a debug option SrufaceFlinger can now connect to DDMS

this is disabled by default. To enable:
setprop debug.sf.ddms 1

this debug option requires to restart SurfaceFlinger

Change-Id: Ic2f8050b29911b55bcd21721648b6978700c277d
/frameworks/native/services/surfaceflinger/SurfaceFlinger.h
47d0812977b7acc4fed6a823203770a57f7a6b78 12-Aug-2011 Mathias Agopian <mathias@google.com> SurfaceFlinger doesn't rely on having a custom RefBase destructor

we just use a message to the main thread to
destroy our GLES state.
/frameworks/native/services/surfaceflinger/SurfaceFlinger.h
7e918860f9d496bf0c4b7e1649216c9209c57850 06-Jul-2011 Mathias Agopian <mathias@google.com> Merge "don't kill surfaceflinger when system process dies"
1f339ff3875afad128a8e16ee6395c5fad295826 02-Jul-2011 Mathias Agopian <mathias@google.com> don't kill surfaceflinger when system process dies

Change-Id: I2d3ed87b590f9ccea3fa4af41d92911de070b315
/frameworks/native/services/surfaceflinger/SurfaceFlinger.h
d9e8c64c3dce1612eb948a5c16ba4ff62202b423 01-Jul-2011 Mathias Agopian <mathias@google.com> return an error code with gralloc buffer allocation failures

Change-Id: I471e5d37ea7a42fc8a0f93446ee3b4229da37807
/frameworks/native/services/surfaceflinger/SurfaceFlinger.h
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/services/surfaceflinger/SurfaceFlinger.h
99b49840d309727678b77403d6cc9f920111623f 28-Jun-2011 Mathias Agopian <mathias@google.com> PermissionCache caches permission checks

This is intended to absorb the cost of the IPC
to the permission controller.
Cached permission checks cost about 3us, while
full blown ones are two orders of magnitude slower.

CAVEAT: PermissionCache can only handle system
permissions safely for now, because the cache is
not purged upon global permission changes.

Change-Id: I8b8a5e71e191e3c01e8f792f253c379190eee62e
/frameworks/native/services/surfaceflinger/SurfaceFlinger.h
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/services/surfaceflinger/SurfaceFlinger.h
ca4d3602c07837d0b2ac6878685a8e327b5f30f0 20-May-2011 Mathias Agopian <mathias@google.com> Fix a race that could cause GL commands to be executed from the wrong thread.

Change-Id: Ia3d407f7bf2f5553f46cfdade70b7b0badb35beb
/frameworks/native/services/surfaceflinger/SurfaceFlinger.h
dea20b1f343012d58ca9eb381684b26a168dc127 04-May-2011 Mathias Agopian <mathias@google.com> Fix a race in SurfaceFlinger that could cause layers to be leaked forever.

The transaction flags were atomically read-and-cleared to determine if
a transaction was needed, in the later case, mStateLock was taken to
keep the current state still during the transaction. This left a small
window open, where a layer could be removed after the transaction flags
were checked but before the transaction was started holding the lock.
In that situation eTraversalNeeded would be set but only seen during the
next transaction cycle; however, because we're handling this transaction
(because of another flag) it will be commited, "loosing" the information
about the layer being removed -- so when the next transaction cycle due
to eTraversalNeeded starts, it won't notice that layers have been removed
and won't populated the ditchedLayers array.

Change-Id: Iedea9e25fee8dd98a0c5bd5ad41a20fcadf75b47
/frameworks/native/services/surfaceflinger/SurfaceFlinger.h
4f113740180b6512b43723c4728f262882dc9b45 04-May-2011 Mathias Agopian <mathias@google.com> Fix a race-condtion in SurfaceFlinger that could lead to a crash.

Client::mLayers could be accessed from different threads.
On one side from Client::attachLayer() which is currently
called from a binder thread; on the other side from
Client::detachLayer() which is always called from the main
thread.

This could lead to a corruption of Client::mLayers.

We fix this issue by adding an internal lock to Client.

Change-Id: Ib1317d7750ed5030e6f577efe34b69fc10198bd3
/frameworks/native/services/surfaceflinger/SurfaceFlinger.h
0ef4e15a6c12778daf464a4953d7e15e651f49ac 20-Apr-2011 Mathias Agopian <mathias@google.com> Get rid of the "pid" parameter from createSurface

Change-Id: I28635e3f803e6abe965d79998e305f54a202465d
/frameworks/native/services/surfaceflinger/SurfaceFlinger.h
4cb18881b55b82a24873ccd8e298bc2d5a9c17e5 09-Apr-2011 Mathias Agopian <mathias@google.com> Fix a GraphicBuffer leak in SurfaceTexture

This leak was intentional, it was there to deal with the fact that
some gralloc implementations don't track buffer handles with
file-descriptors so buffers needed to stay alive until there were
registered, which is not guaranteed by binder transactions.

In this new implementation, we use a small BBinder holding a
reference to the buffer, which with tuck into the parcel. This forces
the reference to stay alive until the parcel is destroyed, which
is guaranteed (by construction) to happen after the buffer is
registered.

this allows the public facing API to not expose the previous hack.

Change-Id: I1dd6cd83679a2b7457ad628169e2851acc027143
/frameworks/native/services/surfaceflinger/SurfaceFlinger.h
1bbafb96101de04c43adb5e3ca2494070d20a46a 12-Mar-2011 Mathias Agopian <mathias@google.com> Fix some const-ness and comments

mDrawingState doesn't need to be accessed by the
mStateLock, because by definition it's only accessed
from the main thread.

Similarily, the list of layers in the drawing state
cannot change (ie: is const).

Change-Id: I2e5da7f4d8caee7af7802b432cd45cc81c7c08b0
/frameworks/native/services/surfaceflinger/SurfaceFlinger.h
134f0422866e8985188ed10dfbdcb8e6c34b87f7 08-Mar-2011 Jamie Gennis <jgennis@google.com> ANativeWindow: add queues-to-window-composer check.

This change adds a new 'method' to the ANativeWindow interface to check
whether buffers queued to the window will be sent directly to the system
window compositor.

Change-Id: I4d4b199e328c110b68b250029aea650f03c8724d
Bug: 3495535
/frameworks/native/services/surfaceflinger/SurfaceFlinger.h
2bd1d95efecffad447afd682ffe605bbf8c79d62 20-Jan-2011 Mathias Agopian <mathias@google.com> clean-up unneeded code

now that we removed the notion of a "inUse" buffer in surfaceflinger
a lot of code can be simplified / removed.

noteworthy, the whole concept of "unlockClient" wrt. "compositionComplete"
is also gone.

Change-Id: I210413d4c8c0998dae05c8620ebfc895d3e6233d
/frameworks/native/services/surfaceflinger/SurfaceFlinger.h
0d3dcc4aab864e4e4086b070c08949d369239f22 15-Jan-2011 Mathias Agopian <mathias@google.com> Merge "partially fix [3306150] HTML5 video with H/W acceleration blackout" into honeycomb
76cd4ddc6ad664257739b3d3713fd9ebdc9a4ad9 15-Jan-2011 Mathias Agopian <mathias@google.com> partially fix [3306150] HTML5 video with H/W acceleration blackout

We used to guarantee that a layer in SurfaceFlinger would never be
destroyed before all references (to its ISurface) on the client
side would be released. At some point, this guarantee got
relaxed to allow to free gralloc resources sooner. This last
change was incorrect, because:
- in implementations with reference-counting the gralloc resources
wouldn't be released anyways, until all the mapping were gone
- in implementations without ref counting, the client side
would most likely crash or do something bad
- it also caused the SharedBufferStack slot to be reallocated
to another surface, which could be problematic if the client
continued to use the surface after the window manager destroyed it.

So, we essentially reinstate the guarantee that layers won't be
destroyed until after all references to their ISurface are
released.

NOTE: This doesn't entirely fix 3306150 because there is another
problem there where the Browser continues to use a surface after it
has been destroyed.

Change-Id: I305c830dd722b30a6d53cbf3a9c714fd3cf7eb06
/frameworks/native/services/surfaceflinger/SurfaceFlinger.h
a49576f06b73893fd957d974382390a47b44589e 14-Jan-2011 Mathias Agopian <mathias@google.com> Merge "fix [3312683] Camera mirroring problem after switching from back to front camera" into honeycomb
ad456f9878ff7c176499e7b992f9ff1cb3e9cdee 14-Jan-2011 Mathias Agopian <mathias@google.com> fix [3312683] Camera mirroring problem after switching from back to front camera

the crop as well as buffer orientation can change at every frame, when that happens
we need to reset the hwc HAL (ie: set the GEOMETRY_CHANGED flag).
currently we achieve this by taking the same code path than an actual geometry change
which is a bit more heavy than necessary.

Change-Id: I751f9ed1eeec0c27db7df2e77d5d17c6bcc17a24
/frameworks/native/services/surfaceflinger/SurfaceFlinger.h
9a78c90cd46b2a3bd637b056873149d3b94384b4 13-Jan-2011 Jamie Gennis <jgennis@google.com> Fix remote GraphicBuffer allocation in SurfaceFlinger.

This change fixes a horrible hack that I did to allow application
processes to create GraphicBuffer objects by making a binder call to
SurfaceFlinger. This change introduces a new binder interface
specifically for doing this, and does it in such a way that
SurfaceFlinger will maintain a reference to the buffers until the app is
done with them.

Change-Id: Icb240397c6c206d7f69124c1497a829f051cb49b
/frameworks/native/services/surfaceflinger/SurfaceFlinger.h
495633406580685dfaa41979bbae47fc5f77fefe 20-Dec-2010 Jamie Gennis <jgennis@google.com> Add the ISurfaceComposer::createGraphicBuffer IPC.

This change adds a new binder method to the ISurfaceComposer interface.
This IPC is intended to allow SurfaceFlinger clients to allocate gralloc
buffers using SurfaceFlinger as a proxy to gralloc.

Change-Id: Ide9fc283aec5da6268ba62cfed0c3319a50b640d
/frameworks/native/services/surfaceflinger/SurfaceFlinger.h
bf2c6a6c8f1df40ac94e28b948754bb9739daaca 11-Dec-2010 Mathias Agopian <mathias@google.com> [3258939] Need snapshot to limit which layers are included

Change-Id: Id7351a0e3f53dde99b291cffba553d89fd4d7ca9
/frameworks/native/services/surfaceflinger/SurfaceFlinger.h
1293a8eb567fd63c072a6970fa9dcf37d076059f 09-Dec-2010 Mathias Agopian <mathias@google.com> More clean-up. Get rid off the "blur" effect in SurfaceFlinger

For multiple reason, this effect is not maintainable and was never
used due to its abysmal performance. it'll be resurected when it can be
implemented efficiently.

Change-Id: Id4222c9b86c629275cdec18873ef07be8723b6d2
/frameworks/native/services/surfaceflinger/SurfaceFlinger.h
a5529c8778c2f407f482fc12165aeb76c0f505c2 08-Dec-2010 Mathias Agopian <mathias@google.com> remove support for PUSH_BUFFER surfaces and overlays

the same functionality is now supported through
the h/w composer HAL, and YUV support in the GPU.

Change-Id: I8146605449954b8e8fd7f78810b7d873c2d8f5bf
/frameworks/native/services/surfaceflinger/SurfaceFlinger.h
fb3051b15e15b0f57196e0f2bc6ba8570f7ffe5e 16-Oct-2010 Mathias Agopian <mathias@google.com> am 7e9a54d4: am d4e03f37: addresses parts of 3096779 and 3097475

Merge commit '7e9a54d460030a871a4f05e61e943c6a694e9ef8'

* commit '7e9a54d460030a871a4f05e61e943c6a694e9ef8':
addresses parts of 3096779 and 3097475
e33a35f02576b482a5ac4891a78f6e72fb4c0dea 15-Oct-2010 Mathias Agopian <mathias@google.com> am 5bfa3a34: am 011b5bcc: Merge "implement part of [3094280] New animation for screen on and screen off add support for screen on animation" into gingerbread

Merge commit '5bfa3a34eaef759c3ec4def76f646eb1c0bf997f'

* commit '5bfa3a34eaef759c3ec4def76f646eb1c0bf997f':
implement part of [3094280] New animation for screen on and screen off
abd671a08a41519a7ab3d438a500efe0ef0bfc1d 14-Oct-2010 Mathias Agopian <mathias@google.com> addresses parts of 3096779 and 3097475

3097475: Animation setting should control the screen on animation
3096779: CRT power-on animation can briefly show the top app instead of lockscreen

There is now a parameter that controls wether the ON and/or OFF animation are
performed. we also always clear the screen to black on power off, to make
sure it won't briefly appear on power on.
HOWEVER, 3096779 is not 100% fixed in the case where we're doing the animation
because there is a race, where SF doesn't wait (b/c it doesn't know) for the
framework to have redrawn the lockscreen.

Change-Id: Ie0f02c9225fcdf24b1e8907e268eb7da2c5b0a03
/frameworks/native/services/surfaceflinger/SurfaceFlinger.h
503d2d4a08370209dc83330bd00997ba9512f46f 14-Oct-2010 Joe Onorato <joeo@google.com> am 9a12a3c8: am ba799098: Merge changes I76513387,I335fb671 into gingerbread

Merge commit '9a12a3c8d4bb20042cf69e07d268e3a04ac71f96'

* commit '9a12a3c8d4bb20042cf69e07d268e3a04ac71f96':
Remove dead code, and make the animation a setting.
turn off the electron beam
9daa5c9b9dd286cbbf5d43f7e45a5e9e4048e855 13-Oct-2010 Mathias Agopian <mathias@google.com> implement part of [3094280] New animation for screen on and screen off
add support for screen on animation

Change-Id: If50cf52ae04b95b42da7d74cf7fa96d5cb54d238
/frameworks/native/services/surfaceflinger/SurfaceFlinger.h
59119e658a12279e8fff508f8773843de2d90917 11-Oct-2010 Mathias Agopian <mathias@google.com> turn off the electron beam

Change-Id: I335fb6719f1d5a3f1c6f37a046fd1c2c4ed2bbc6
/frameworks/native/services/surfaceflinger/SurfaceFlinger.h
df85c455c34a920d22a8e3f7459a1cc615efcd27 29-Sep-2010 Mathias Agopian <mathias@google.com> refactored screenshot code

the core screenshot function now can capture the screen at any lower resolution
performing bilinear filtering.

we also now have some client code to interface with the screenshot service.

it's now possible to request a screenshot at a lower resolution.

Change-Id: I33689bba98507ab928d0898b21596d0d2fe4b953
/frameworks/native/services/surfaceflinger/SurfaceFlinger.h
74c40c0a273dbfd7d10617c4cc1b0c066bfc812e 29-Sep-2010 Mathias Agopian <mathias@google.com> refactored screenshot code

the core screenshot function now can capture the screen at any lower resolution
performing bilinear filtering.

we also now have some client code to interface with the screenshot service.

it's now possible to request a screenshot at a lower resolution.

Change-Id: I5a3b0e431421800e3aad601d9af8f94adffbc71f
/frameworks/native/services/surfaceflinger/SurfaceFlinger.h
a3aefeb1c31618dcc897da22d2d2f741104e3fe3 25-Sep-2010 Mathias Agopian <mathias@google.com> am 495ad4f2: am beabe75a: Merge changes I1f7c4535,I741c68a2 into gingerbread

Merge commit '495ad4f22096aa172d025c16c25497e7dad8f2bd'

* commit '495ad4f22096aa172d025c16c25497e7dad8f2bd':
simple test app for screen capture API
add support for [1974164] Be able to take a screen shot on the device
1b0b30d04304392748a8a4ab5a69e52a19f51b3a 24-Sep-2010 Mathias Agopian <mathias@google.com> add support for [1974164] Be able to take a screen shot on the device

screenshots are taken using ISurfaceComposer::captureScreen() which returns
the size of the screenshot and an IMemoryHeap containing the data.
screenshots have limitations:
- they will always fail if a secure window is up on screen
- require GL_OES_framebuffer_object extension
- in some situation, video planes won't been captured

Change-Id: I741c68a2d2984fb139039301c3349e6780e2cd58
/frameworks/native/services/surfaceflinger/SurfaceFlinger.h
73d3ba9e50be1014aa21ec4bbdc874be394accb4 23-Sep-2010 Mathias Agopian <mathias@google.com> add a way to toggle the h/w composer at runtime

to DISABLE the h/w composer:
adb shell service call SurfaceFlinger 1008 i32 1

to ENABLE the h/w composer:
adb shell service call SurfaceFlinger 1008 i32 0

the state is dumped in "dumpsys SurfaceFlinger"

Change-Id: I23e2242d42c6e3fd5261a83332dd900b189e38ce
/frameworks/native/services/surfaceflinger/SurfaceFlinger.h
000ca8fa9a1a92aa2f132ba41d11ece6d01cdadd 18-Aug-2010 Mathias Agopian <mathias@google.com> revert hwcomposer HAL changes. DO NOT MERGE.

This reverts commit:
94364b91a2894bf037b8beb027132fbb812e1434
f8e705dea48f77f1c2532fdbadd4997dd1851af0
b59beb5ca68d0228f60dda60d85e2d0226b33215
e0d5f5bcf5a8b26f4ad75f549cbf380b2c9faf20
/frameworks/native/services/surfaceflinger/SurfaceFlinger.h
a350ff98692b3a50cad5cc93f9f83221242ca86a 11-Aug-2010 Mathias Agopian <mathias@google.com> call into hwcomposer HAL when present

Change-Id: I70f31c69a9436a43860e78977442863ecba6d27b
/frameworks/native/services/surfaceflinger/SurfaceFlinger.h
f6679fc6f70939643901f29a9a69e40c603e6e5f 11-Aug-2010 Mathias Agopian <mathias@google.com> get rid of our LayerVector implementation

we now use SortedVector<> with a special compare implementation.

Change-Id: I910459cf3b3c8993b55ad0786a8c348369262de5
/frameworks/native/services/surfaceflinger/SurfaceFlinger.h
4da751999358fffa4cefc4c8046dab72045925f6 11-Aug-2010 Mathias Agopian <mathias@google.com> keep a list of visible sorted surfaces

Change-Id: Ib815eeff894f8a3b1e79fbbf8186d5d91bb60285
/frameworks/native/services/surfaceflinger/SurfaceFlinger.h
a1e6bc864fb821c1b470b7aad9b75c441f54eeb4 15-Jul-2010 Mathias Agopian <mathias@google.com> added BinderService<> template to help creating native binder services

Change-Id: Id980899d2647b56479f8a27c89eaa949f9209dfe
/frameworks/native/services/surfaceflinger/SurfaceFlinger.h
81bac09fa6b01dd1495644d9c825c3666762fced 15-Jul-2010 Mathias Agopian <mathias@google.com> move native services under services/

moved surfaceflinger, audioflinger, cameraservice

all native services should now reside in this location.

Change-Id: Iee42b83dd2a94c3bf5107ab0895fe2dfcd5337a8
/frameworks/native/services/surfaceflinger/SurfaceFlinger.h