History log of /frameworks/base/core/jni/android_view_Surface.cpp
Revision Date Author Comments (<<< Hide modified files) (Show modified files >>>)
02949f14151f10f906f1fab58e788fadb98baba8 16-Jun-2017 Bryce Lee <brycelee@google.com> Create native Surface object on updateWindow for legacy apps.

There are some apps that use the Surface object itself to indicate
changes. As a result, recycling the existing Surface object for
updates can lead to such apps ignoring events such as size changes.

This changelist restores the original behavior for legacy apps, where
the underlying native Surface object is recreated during updates.

Fixes: 62108743
Test: go/wm-smoke
Test: Open affected application, observe expansion to fullscreen when
nav bar disappears. Rotate to other orientation and observe
expansion to fullscreen.

Change-Id: I874602b6b8686c6ecb05cf7b1a04ec4b700ad3f9
/frameworks/base/core/jni/android_view_Surface.cpp
d28e8283d39e7eb6c714511a0430d4cc836298cb 31-Mar-2017 Jiwen 'Steve' Cai <jwcai@google.com> ANativeWindow_toSurface implementation

This enables the conversion from an ANativeWindow (created by NDK API
such as: AImageReader_create) to a Java Surface, so that developers can
hookup a Java Producer to a native buffer consumer.

This CL also introduces android_view_Surface_createFromSurface helper
function in libandroid_runtime to convert a C++ sp<Surface> to a Java
Surface object.

Bug: 36862948
Test: android.media.cts.NativeImageReaderTest
Change-Id: Ia99adb654da505ac117a8e58153ac800df23a650
/frameworks/base/core/jni/android_view_Surface.cpp
a35e5de13cbeb20459b0946828846a18c356e550 04-Mar-2017 Robert Carr <racarr@google.com> Reenable task snapshots without using RenderThread in SystemServer.

Instead just directly queue the buffer to the Surface.

Test: Make sure recents works.
Change-Id: I9488ae614f117f39f9471f3c368bf98152c4f107
/frameworks/base/core/jni/android_view_Surface.cpp
172873f5e6754cb9c1cdb1c08b3b095770c1e3e3 17-Feb-2017 Romain Guy <romainguy@google.com> Merge "Add RGBA 10:10:10:2 format for surfaces"
8ec21062ded44fe28ea7cd50e24112dc1832b0e5 11-Feb-2017 Romain Guy <romainguy@google.com> Add RGBA 10:10:10:2 format for surfaces

Bug: 2984164
Test: CtsHardwareTestCases
Change-Id: I4a42cb9002d8f1f1362999f2739d06c712157620
/frameworks/base/core/jni/android_view_Surface.cpp
7a1e28de4ae8927a82515973dbbdececa1639b47 09-Feb-2017 Mathias Agopian <mathias@google.com> fallout from view::Surface / Surface split

Test: built and booted device
Bug: treble
Change-Id: I8ec554f5726d597d944967a3924cc997a75453a2
/frameworks/base/core/jni/android_view_Surface.cpp
2de950d5a8b47c7b4648ada1b1260ce4b7342798 25-Jan-2017 John Reck <jreck@google.com> Overhaul RenderNode's DisplayList management

* Move mValid to native
* Have destroyHardwareResources destroy everything
* Remove flaky mParentCount checks in setStaging
* All tree updates have an internal observer to
ensure onRemovedFromTree() is a reliable signal
* onRemovedFromTree() immediately releases resources
to avoid displaylist "leaks"

Test: Unit tests for validity added & pass, manually
verified that b/34072929 doesn't repro

Bug: 34072929

Change-Id: I856534b4ed1b7f009fc4b7cd13209b97fa42a71c
/frameworks/base/core/jni/android_view_Surface.cpp
f7e79d6eb3729b0555d1c88054f80467fc6c5303 16-Dec-2016 Romain Guy <romainguy@google.com> Remove RGBX_FP16 format

Bug: 32984164
Test: compile
Change-Id: I22ffe0991d3c4add68317a0554dcac6a7ac56d12
/frameworks/base/core/jni/android_view_Surface.cpp
9505a6552764461c22ce48f1ac13d025d23e1579 14-Dec-2016 Romain Guy <romainguy@google.com> Add new RGBA_F16 bitmap config

This configuration uses 64 bits per pixel. Heach component is stored as a
half precision float value (16 bits). Half floats can be decoded/encoded
using android.util.Half.

RGBA_F16 bitmaps are used to decode wide-gamut images stored in 16 bit
formats (PNG 16 bit for instance). aapt is currently not aware of PNG
16 bits so such files must be placed in raw/ resource directories.

This first pass provides only partial drawing support with hardware
acceleration. RGBA_F16 bitmaps are stored in linear space and need
to be encoded to gamma space with the appropriate OETF to be rendered
properly on Android's current surfaces. They are however suitable for
linear blending. Full rendering support will be provided in a future
CL (BitmapShaders might be a bit tricky to handle properly during
shader generation).

Bug: 32984164
Test: bit CtsGraphicsTestCases:android.graphics.cts.BitmapRGBAF16Test

Change-Id: I328e6b567441a1b9d152a3e7be944a2cf63193bd
/frameworks/base/core/jni/android_view_Surface.cpp
6c67f1d04591f44bccb476d715a005ad5bbdf840 14-Dec-2016 Mike Reed <reed@google.com> SkClipOp is now an enum class

Change-Id: If423dd013a264162ae0b7674a0eeef34bc2cdaae
/frameworks/base/core/jni/android_view_Surface.cpp
6e49c9f007c879f05b035c40c0ba543c00f9d0d0 02-Dec-2016 Mike Reed <reed@google.com> switch over clip calls to use SkClipOp instead of SkRegion::Op

Change-Id: I67d23c487b5249bc31d96e3b2393f693c0b2bcff
/frameworks/base/core/jni/android_view_Surface.cpp
253f2c213f6ecda63b6872aee77bd30d5ec07c82 29-Sep-2016 Romain Guy <romainguy@google.com> Linear blending, step 1

NOTE: Linear blending is currently disabled in this CL as the
feature is still a work in progress

Android currently performs all blending (any kind of linear math
on colors really) on gamma-encoded colors. Since Android assumes
that the default color space is sRGB, all bitmaps and colors
are encoded with the sRGB Opto-Electronic Conversion Function
(OECF, which can be approximated with a power function). Since
the power curve is not linear, our linear math is incorrect.
The result is that we generate colors that tend to be too dark;
this affects blending but also anti-aliasing, gradients, blurs,
etc.

The solution is to convert gamma-encoded colors back to linear
space before doing any math on them, using the sRGB Electo-Optical
Conversion Function (EOCF). This is achieved in different
ways in different parts of the pipeline:

- Using hardware conversions when sampling from OpenGL textures
or writing into OpenGL frame buffers
- Using software conversion functions, to translate app-supplied
colors to and from sRGB
- Using Skia's color spaces

Any type of processing on colors must roughly ollow these steps:

[sRGB input]->EOCF->[linear data]->[processing]->OECF->[sRGB output]

For the sRGB color space, the conversion functions are defined as
follows:

OECF(linear) :=
linear <= 0.0031308 ? linear * 12.92 : (pow(linear, 1/2.4) * 1.055) - 0.055

EOCF(srgb) :=
srgb <= 0.04045 ? srgb / 12.92 : pow((srgb + 0.055) / 1.055, 2.4)

The EOCF is simply the reciprocal of the OECF.
While it is highly recommended to use the exact sRGB conversion
functions everywhere possible, it is sometimes useful or beneficial
to rely on approximations:

- pow(x,2.2) and pow(x,1/2.2)
- x^2 and sqrt(x)

The latter is particularly useful in fragment shaders (for instance
to apply dithering in sRGB space), especially if the sqrt() can be
replaced with an inversesqrt().

Here is a fairly exhaustive list of modifications implemented
in this CL:

- Set TARGET_ENABLE_LINEAR_BLENDING := false in BoardConfig.mk
to disable linear blending. This is only for GLES 2.0 GPUs
with no hardware sRGB support. This flag is currently assumed
to be false (see note above)
- sRGB writes are disabled when entering a functor (WebView).
This will need to be fixed at some point
- Skia bitmaps are created with the sRGB color space
- Bitmaps using a 565 config are expanded to 888
- Linear blending is disabled when entering a functor
- External textures are not properly sampled (see below)
- Gradients are interpolated in linear space
- Texture-based dithering was replaced with analytical dithering
- Dithering is done in the quantization color space, which is
why we must do EOCF(OECF(color)+dither)
- Text is now gamma corrected differently depending on the luminance
of the source pixel. The asumption is that a bright pixel will be
blended on a dark background and the other way around. The source
alpha is gamma corrected to thicken dark on bright and thin
bright on dark to match the intended design of fonts. This also
matches the behavior of popular design/drawing applications
- Removed the asset atlas. It did not contain anything useful and
could not be sampled in sRGB without a yet-to-be-defined GL
extension
- The last column of color matrices is converted to linear space
because its value are added to linear colors

Missing features:
- Resource qualifier?
- Regeneration of goldeng images for automated tests
- Handle alpha8/grey8 properly
- Disable sRGB write for layers with external textures

Test: Manual testing while work in progress
Bug: 29940137

Change-Id: I6a07b15ab49b554377cd33a36b6d9971a15e9a0b
/frameworks/base/core/jni/android_view_Surface.cpp
603ed538e0fb85546ca0878b26e7c9751f82f3a3 24-Sep-2016 Robert Carr <racarr@google.com> SurfaceView: Force surface disconnection before reuse. am: 387838be95 am: 288ce4fc42
am: cfaae3f795

Change-Id: I2c19bd545719e9eb1589ec4065ba26ae65ca03c1
387838be955a44422509c2c7bc124327e9fe61d7 07-Sep-2016 Robert Carr <racarr@google.com> SurfaceView: Force surface disconnection before reuse.

Prior to N, if a client received the surfaceDestroyed callback
from their SurfaceView they could trust that the surface would not be
reused. Now that is not true in multiple scenarios. If a client fails
to shut down its EGL context then, we could end up in a situation where,
the client will never disconnect. Then when we reuse the same
underlying IGraphicBufferProducer for surfaceCreated next
the app will crash with a double connect error. There is no valid
use of the surface inbetween surfaceDestroyed and surfaceCreated,
so we just force the disconnection after surfaceDestroyed.

Bug: 30236166
Change-Id: I2e3e4b3176492dc0c2d46a59e0b5a781bf9bc356
/frameworks/base/core/jni/android_view_Surface.cpp
768e39335b668e8ef25fef30ab42b2d6d29a4735 09-Jul-2016 Stan Iliev <stani@google.com> Refactor CanvasContext: move OpenGL specific code

Move OpenGL specific code from CanvasContext into a new class
OpenGLPipeline.

Change-Id: I4363053f890701a4235927b59ec588861488ea8f
/frameworks/base/core/jni/android_view_Surface.cpp
ab1080c4d075b008cebdd9a2031ebbd51f9c2729 22-Jun-2016 John Reck <jreck@google.com> Delete unused args

Bug: 21170575
Change-Id: Icc832f70f206342557f44667ad3498405d04db78
/frameworks/base/core/jni/android_view_Surface.cpp
51f2d606dcbfba3cc5b03dfea37c1304b91c232f 06-Apr-2016 John Reck <jreck@google.com> Fix some edge cases

Bug: 27709981

This desperately needs a refactor, but to keep
the current (really needed & nice) behavior of
dispatching after sync finishes would be difficult
to handle cleanly without lots of ripping so... #yolo

Change-Id: I831a06c6ae7412a062720d68ecbe3085190f0258
/frameworks/base/core/jni/android_view_Surface.cpp
7966d446cddf92f814792dca3cfb0dfbbc1bef3e 14-Mar-2016 Eino-Ville Talvala <etalvala@google.com> Adjust graphics dataspace references to new standard

Bug: 27344373
Change-Id: I0ad67868894b01948d40336812d836ee2f3bcfdb
/frameworks/base/core/jni/android_view_Surface.cpp
5d2d7788f1759b0f3d2c057af0b3ea61b0354fee 18-Dec-2015 Eino-Ville Talvala <etalvala@google.com> Camera2: Switch to auto-gen C++ binder interfaces

- Move camera AIDL files to frameworks/av
- Update makefiles to point to new AIDL locations
- Adjust camera2 implementation to match modifications to AIDL needed
for native AIDL auto-generation
- Move Surface.aidl to frameworks/native to allow use in
native AIDL. Use android::view::Surface in Surface JNI to
serialize Surface objects to ensure parceling compatibility.
- Adjust service binder tests to new interface

Bug: 25091611
Change-Id: I85b817374b34a4540fa145328dbe4bbf7f746baf
/frameworks/base/core/jni/android_view_Surface.cpp
cd9a18c7f864901400c6017c892bfd3bc48c3a4b 17-Dec-2015 Robert Carr <racarr@google.com> Set SCALING_MODE_NO_SCALE_CROP for SurfaceView.

When resizing SurfaceView along with a main application window,
we want to be able to update the crop of the SurfaceView without waiting
for a buffer at a new size. If we fail to do so the SurfaceView may
extend beyond the edge of the host surface.

Bug: 26010823
Change-Id: I3bb52f82c02bb729a2494a3a43b9654d9aae9532
/frameworks/base/core/jni/android_view_Surface.cpp
44581ff4db54bbaa30365ed210e67a0369576100 08-Dec-2015 Yin-Chia Yeh <yinchiayeh@google.com> Camera: add RAW_PRIVATE format

Also add necessary plumbing for RAW_PRIVATE to work for ImageReader.

Bug: 25596619
Change-Id: Ic90f3f44264ac46fae1fafbc27ac64b5319f0970
/frameworks/base/core/jni/android_view_Surface.cpp
64e516f5fa56d71bf6b5076e5620c30dc5810ba1 29-Oct-2015 Rob Carr <racarr@google.com> Sync SurfaceView position changes to parent render.

In order to provide pixel perfect movement of SurfaceViews
'within' other views (e.g. scrolling) we need to be able to
synchronize the attached (parent window) painting with the
movement of the SurfaceView (recall, SurfaceViews are positioned
behind their attached windows and the parent must render a
transparent region for the SurfaceView to appear). Provide
a new WindowManager method to reposition an attaching window
(that is to say, a window which has an attached window like
SurfaceView) and defer the transaction until the parent frame.
SurfaceView is hooked up to use this for movement. This is still
'racy' in the hardware accelerated case as the render thread
could be on either side of dequeing the frame we are working on.

Bug: 22802885
Change-Id: I025d2bdcbe15c1c11047cc0dbca2cf2b7d67c632
/frameworks/base/core/jni/android_view_Surface.cpp
f35b989d26bb98900f6c5fa2e586326b30b6e161 31-Jul-2015 Leon Scroggins III <scroggo@google.com> Merge six commits from master-skia to master

Also corrects some code under development behind the HWUI_NEW_OPS flags
to match the updated Skia API.

Include external/skia/include/private
use SrcConstraint for drawBitmapRect
clean up to allow removal of flags for SCALAR_DIV and IMAGEINFO_FIELDS
don't call DEPRECATED getDevice()
update to newer API for drawBitmapRect
asABitmap is deprecated, used isABitmap

previous-Change-Id: I12208855a95948897077b1c1549eb35416cc801e
previous-Change-Id: I5044f0f61315fe48c60d7af5e261a7d0ed574f56
previous-Change-Id: Ic34a3ba77b3f9e091fa7aaba75018a307abacdab
previous-Change-Id: I79f8dd779920565d1204f7fe67b3286b1bbf4e9b
previous-Change-Id: Ic04d1f8274f6a862ea00f8d241363cf31f5ec1ec
previous-Change-Id: I9e4ae257a1976c74302b6a73f17405174ae58cec
previous-Change-Id: I85de3462ad1e4877784df38edc4bcd0acbd24e5e
Change-Id: Ide8e2f669e91a13c32521af3a16efdaa085c81d0
/frameworks/base/core/jni/android_view_Surface.cpp
d8f904f256b82e48e9a85561eb96e15399b0b2d9 28-Oct-2015 Tom Hudson <tomhudson@google.com> Revert "Merge six commits from master-skia to master"

This reverts commit 550780745fa28ae9a87d02331841ca5ce4f9c763.

Change-Id: Ic71eccea454b26261fe6e9a9a7a24eff56396989
/frameworks/base/core/jni/android_view_Surface.cpp
550780745fa28ae9a87d02331841ca5ce4f9c763 31-Jul-2015 Leon Scroggins III <scroggo@google.com> Merge six commits from master-skia to master

Include external/skia/include/private
use SrcConstraint for drawBitmapRect
clean up to allow removal of flags for SCALAR_DIV and IMAGEINFO_FIELDS
don't call DEPRECATED getDevice()
update to newer API for drawBitmapRect
asABitmap is deprecated, used isABitmap

Change-Id: I519f54f97321a7a365ea81a3b78cb03b9bdca021
previous-Change-Id: I12208855a95948897077b1c1549eb35416cc801e
previous-Change-Id: I5044f0f61315fe48c60d7af5e261a7d0ed574f56
previous-Change-Id: Ic34a3ba77b3f9e091fa7aaba75018a307abacdab
previous-Change-Id: I79f8dd779920565d1204f7fe67b3286b1bbf4e9b
previous-Change-Id: Ic04d1f8274f6a862ea00f8d241363cf31f5ec1ec
previous-Change-Id: I9e4ae257a1976c74302b6a73f17405174ae58cec
/frameworks/base/core/jni/android_view_Surface.cpp
7e1d861a9a3f76e1f79eb6806d4aa8bbeb560773 16-Oct-2015 Rob Carr <racarr@google.com> Revert "Sync SurfaceView position changes to parent render."

This reverts commit 6104dc95606b3399356dd011ca6d71fcd954154c.

Change-Id: If9d709bc65e7a817bd2c1b5768c7c33a9317638f
/frameworks/base/core/jni/android_view_Surface.cpp
6104dc95606b3399356dd011ca6d71fcd954154c 28-Sep-2015 Robert Carr <racarr@google.com> Sync SurfaceView position changes to parent render.

In order to provide pixel perfect movement of SurfaceViews
'within' other views (e.g. scrolling) we need to be able to
synchronize the attached (parent window) painting with the
movement of the SurfaceView (recall, SurfaceViews are positioned
behind their attached windows and the parent must render a
transparent region for the SurfaceView to appear). Provide
a new WindowManager method to reposition an attaching window
(that is to say, a window which has an attached window like
SurfaceView) and defer the transaction until the parent frame.
SurfaceView is hooked up to use this for movement. This is still
'racy' in the hardware accelerated case as the render thread
could be on either side of dequeing the frame we are working on.

Change-Id: Ic33915043380ab8cd9eb4920e224b35234ed867d
/frameworks/base/core/jni/android_view_Surface.cpp
434a481b2191562582c79be29f24c2e0b5ca60d0 24-Sep-2015 Elliott Hughes <enh@google.com> am ea1831d2: am b57dd722: resolved conflicts for a884d81e to stage-aosp-master

* commit 'ea1831d211ea0e6b2d161c714bb0786369ef2df5':
constify JNINativeMethod function pointer tables
b57dd722f1dc0663417da37d3a82f8283ad3c982 24-Sep-2015 Elliott Hughes <enh@google.com> resolved conflicts for a884d81e to stage-aosp-master

Change-Id: Ice485967fa96f13786024b6939b826638e906ff0
76f6a86de25e1bf74717e047e55fd44b089673f3 19-Sep-2015 Daniel Micay <danielmicay@gmail.com> constify JNINativeMethod function pointer tables

Change-Id: I4036c924958221cbc644724f8eb01c5de3cd7954
/frameworks/base/core/jni/android_view_Surface.cpp
827029228667507c69c7a430798d7ac88e438c33 08-Aug-2015 Pablo Ceballos <pceballos@google.com> Explicitly construct all Rects

Don't rely on the default constructor.

Bug 18173359

Change-Id: I182c54a49f5eba896ddcb15cec124ecd14f347f9
/frameworks/base/core/jni/android_view_Surface.cpp
1b54fb27ac48495ed0b33868fda5776fb49fe0f3 03-Jun-2015 Chris Craik <ccraik@google.com> Delete MAKE_ENUM_FLAGS

bug:21595702

Settle on namespace-enum for consistency. Also removes k prefix.

Change-Id: Ib89f94cb9263de40b6e4636577dca4860867d0d8
/frameworks/base/core/jni/android_view_Surface.cpp
50210d912925aef14e4ce69be82e4949122a3cd9 15-May-2015 Alan Viverette <alanv@google.com> Adjust light source for window position

Bug: 16523629
Change-Id: I2f3fed1edcac0a3cfd5034aded45e08ececfebaf
/frameworks/base/core/jni/android_view_Surface.cpp
c1b33d665c8caf5760f68c45c6ca0baa649b832a 22-Apr-2015 John Reck <jreck@google.com> GraphicsJNI Canvas cleanup

Change-Id: I72e142986a8bc9f464c1951b6b5187919de3462e
/frameworks/base/core/jni/android_view_Surface.cpp
db663fe83f976107fd8fd9307d871b37d9e47370 20-Apr-2015 Chris Craik <ccraik@google.com> Rename native DisplayListRenderer to DisplayListCanvas

Change-Id: I33e6f8cc85da1e7da7ff7bf18d4ebde64222067a
/frameworks/base/core/jni/android_view_Surface.cpp
9d4efdf2802f06ccf7031610891f75af70ea5538 17-Apr-2015 John Reck <jreck@google.com> Revert "A bunch more cleanups"

This reverts commit c294d128d03bc9a9982b273a82516c04583438cc.

Change-Id: Id1ebb236950f7c36c6d86e1dd95566d3a200748d
/frameworks/base/core/jni/android_view_Surface.cpp
c294d128d03bc9a9982b273a82516c04583438cc 14-Apr-2015 John Reck <jreck@google.com> A bunch more cleanups

Switch a few places to using android::canvas
instead of SkCanvas as well which eliminated
some JNI

Change-Id: I8f98b56442a06362b82b984cd1bd3a92398d8dbc
/frameworks/base/core/jni/android_view_Surface.cpp
2f17431194efc5a13981550b004dd8d5d2a42e5e 20-Mar-2015 Zhijun He <zhijunhe@google.com> ImageFormat: add PRIVATE format

Bug: 19865019
Change-Id: I1a9335fe1733a5b28d9cb20485b509fb216cb52b
/frameworks/base/core/jni/android_view_Surface.cpp
b36016c65f1d1b5846dba0349aab491dbd3a746a 11-Mar-2015 John Reck <jreck@google.com> Cleanups & simplifications

Change-Id: I5ad5e3b8fe55b1528f2e20c63e5abe51d9e40ff1
/frameworks/base/core/jni/android_view_Surface.cpp
805f3c9428f9ebd5080aec48d3d9d77dbf4b41a9 26-Feb-2015 Eino-Ville Talvala <etalvala@google.com> Add DEPTH image formats, support in ImageReader

- Add an explicit mapping between public ImageFormat/
PixelFormat enums and internal HAL format/dataspace.
- Add DEPTH16 and DEPTH_POINT_CLOUD formats
- Wire up mapping layer to ImageReader to support depth
formats

Change-Id: I8197eccef900cc91baddcfcb934ccd4d8c972eff
/frameworks/base/core/jni/android_view_Surface.cpp
ba6adf66d3c44c0aa2fd8a224862ff1901d64300 19-Feb-2015 John Reck <jreck@google.com> Initial attempt at jank-tracking stat collection

Is a bit naive, perhaps overly aggressive, but sorta works

Change-Id: I01a774e00dbe681439c02557d9728ae43c45ce50
/frameworks/base/core/jni/android_view_Surface.cpp
7d13d9db1ef90063cb542ccd6554042a6a3263b7 21-Nov-2014 Andreas Gampe <agampe@google.com> resolved conflicts for merge of 3fc5e3ca to lmp-mr1-dev-plus-aosp

Change-Id: Id8286e5a4381315a6060251a8055b0f1d1a96019
ed6b9dff563c5e22f040ff37e12c0d771e0478ae 21-Nov-2014 Andreas Gampe <agampe@google.com> Frameworks/base: Consistency in core/jni

Make consistent use of core_jni_helpers for registration.

Translate some #ifdefs into const bools.

Change-Id: I37639aa053dd50f003a552cbd8550dddecc811c5
/frameworks/base/core/jni/android_view_Surface.cpp
e726680652ecd235496afeb3207b463e0aa83955 17-Nov-2014 Marco Nelissen <marcone@google.com> am 52e2b6f7: Merge "Update calls to IInterface::asBinder()"

* commit '52e2b6f79d44ff289c97653edea0548352c2f55b':
Update calls to IInterface::asBinder()
97069dd4fd5454ba057ccf2854d7f925c337884c 14-Nov-2014 Marco Nelissen <marcone@google.com> Update calls to IInterface::asBinder()

to use the new static version.

Change-Id: Ia7b10eb38ca55b72278bfd33d3bf647f338b4e6a
/frameworks/base/core/jni/android_view_Surface.cpp
b35c9602cf5c628c621e4fe102a461505f302bfe 14-Nov-2014 John Reck <jreck@google.com> Wire up surface width/height to lockHardwareCanvas

Bug: 18338026
Change-Id: I6c37774ef1312278ae81280561060662fef923fb
/frameworks/base/core/jni/android_view_Surface.cpp
1125d1fa92ab9f3b8315bbfb72e038b62dfd454b 23-Oct-2014 John Reck <jreck@google.com> Add some free zoom to lockHardwareCanvas

Bug: 18099195

Don't use EGL_SWAP_BUFFER_PRESERVED on surfaces that will
never benefit. Also clean up some confusing naming

Change-Id: I674ca64e0464a3282cff79e5ecd350d08f47c014
/frameworks/base/core/jni/android_view_Surface.cpp
bb2d0cc7e1d487f7021b1f9ec0c6740e41b535f2 21-Oct-2014 John Reck <jreck@google.com> Surface:lockHardwareCanvas

Bug: 17440886

Change-Id: I1f2d98c63ec1a2814c2258cf7e0096139263770a
/frameworks/base/core/jni/android_view_Surface.cpp
f74930be6037b858f956093ce1b45bd7b6c1e48a 30-Jun-2014 Dan Stoza <stoza@google.com> Merge "Surface: Add allocateBuffers to avoid render delay"
5795d6408d8bf44ffe2f49a25f9f333069b59a49 20-Jun-2014 Dan Stoza <stoza@google.com> Surface: Add allocateBuffers to avoid render delay

This plumbs up a new call on the native Surface object that allows
the client to request that BufferQueue pre-allocate all of the buffers
that it might need for rendering. This hopefully prevents allocation
delays during dequeuing and reduces jank.

Bug: 11792166
Change-Id: Ibeaa7475492d4ac2bcacb107ef60c6240081d8b7
/frameworks/base/core/jni/android_view_Surface.cpp
b933055cf3f7f8ea89bfd3bc9c37a3891ff7310a 16-Jun-2014 Mike Reed <reed@google.com> stop using (deprecated) SkBitmap::Config

Change-Id: Ic75b5fc6996578e9d95bd3a220439ec1541d7c3b
/frameworks/base/core/jni/android_view_Surface.cpp
5ad3ab8a1639eb7feebca9cba2be634bde9dd362 12-Jun-2014 Andy McFadden <fadden@android.com> Delete a local ref in getSurface

ANativeWindow_fromSurface() provides a native-only call path to
android_view_Surface_getSurface(), so we need to clean up the
local reference.

Bug 14087233

Change-Id: I92aa5aa492c47a0642fdcb28c717ad7f874e1ad9
/frameworks/base/core/jni/android_view_Surface.cpp
5c3d927e17e98e8fd4a9f3c86f7f4def0bcfa816 08-May-2014 Florin Malita <fmalita@google.com> Add a native Canvas wrapper.

Instead of storing a direct SkCanvas reference, Canvas now tracks
an opaque native wrapper class. The native wrapper can be used to
store additional info for emulating deprecated Skia features
(at this point it only stores a canvas).

Some notes:

* all native handle -> SkCanvas conversions are routed through a
handful of native utility methods.
* safeCanvasSwap() refactored as a lower level setNativeBitmp() - which
is what clients need.
* removed unused get_thread_msec() (Canvas.cpp)

Change-Id: I715a5a6f1e1621c1cfc1e510ae4f2ea15cf11114
/frameworks/base/core/jni/android_view_Surface.cpp
c677675e9c465dc1de21ecf2e0421835c7eb55b4 07-May-2014 Florin Malita <fmalita@google.com> Encapsulate Canvas.mNativeCanvas

Currently, the native canvas is accessed/manipulated from several
unrelated classes.

In order to facilitate SaveFlags emulation, this CL encapsulates
the field and refactors its external users.

Two main changes:

* new getNativeCanvas() getter for use in Java-level clients.
* JNI canvas swappers (GraphicsBuffers, Surface, TextureView &
AssetAtlasService) are refactored based on the exising/equivalent
safeCanvasSwap() Canvas method.

Change-Id: I966bd4898f0838fb3699e226d3d3d51e0224ea97
/frameworks/base/core/jni/android_view_Surface.cpp
af608e81d450b962a443a21fb1a6feadeb355fe1 29-Jan-2014 Chong Zhang <chz@google.com> change Surface constructor arg to 64bit

Bug: 12799017
Bug: 12799384
Change-Id: Ic16b4fa5394df38cee0378b6e00d1808b9c8cb94
/frameworks/base/core/jni/android_view_Surface.cpp
36bef0bf30d6bae48cf3837df351075ca4fce654 20-Jan-2014 Ashok Bhat <ashok.bhat@arm.com> AArch64: Make graphics classes 64-bit compatible

This a merger of two commits submitted to AOSP by
the following authors:

ashok.bhat@arm.com, david.butcher@arm.coma
craig.barber@arm.com, kevin.petit@arm.com and
marcus.oakland@arm.com

Due to the very large number of internal conflicts, I
have chosen to cherry-pick this change instead
of letting it merge through AOSP because the merge
conflict resolution would be very hard to review.

Commit messages below:

================================================
AArch64: Make graphics classes 64-bit compatible

Changes in this patch include

[x] Long is used to store native pointers as they can
be 64-bit.

[x] Some minor changes have been done to conform with
standard JNI practice (e.g. use of jint instead of int
in JNI function prototypes)

[x] AssetAtlasManager is not completely 64-bit compatible
yet. Specifically mAtlasMap member has to be converted
to hold native pointer using long. Added a TODO to
AssetAtlasManager.java to indicate the change required.

Signed-off-by: Ashok Bhat <ashok.bhat@arm.com>
Signed-off-by: Craig Barber <craig.barber@arm.com>
Signed-off-by: Kévin PETIT <kevin.petit@arm.com>
Signed-off-by: Marcus Oakland <marcus.oakland@arm.com>

==================================================================

AArch64: Use long for pointers in graphics/Camera

For storing pointers, long is used in
android/graphics/Camera class, as native
pointers can be 64-bit.

In addition, some minor changes have been done
to conform with standard JNI practice (e.g. use of
jint instead of int in JNI function prototypes)

Signed-off-by: Ashok Bhat <ashok.bhat@arm.com>
Signed-off-by: Marcus Oakland <marcus.oakland@arm.com>

===================================================================

Change-Id: Id5793fa0ebc17ee8b1eecf4b3f327977fdccff71
/frameworks/base/core/jni/android_view_Surface.cpp
7023df08f14ec5dee76ac54c03e870f84e297636 27-Jan-2014 Narayan Kamath <narayan@google.com> Revert "AArch64: Make graphics classes 64-bit compatible"

This reverts commit 18b4cbeedef21c1fa666a110a157bab66edff976.

Change-Id: I0c52983a3ab1ace3ff743de546a43eca28e5cb0e
/frameworks/base/core/jni/android_view_Surface.cpp
18b4cbeedef21c1fa666a110a157bab66edff976 20-Jan-2014 Ashok Bhat <ashok.bhat@arm.com> AArch64: Make graphics classes 64-bit compatible

This a merger of two commits submitted to AOSP by
the following authors:

ashok.bhat@arm.com, david.butcher@arm.coma
craig.barber@arm.com, kevin.petit@arm.com and
marcus.oakland@arm.com

Due to the very large number of internal conflicts, I
have chosen to cherry-pick this change instead
of letting it merge through AOSP because the merge
conflict resolution would be very hard to review.

Commit messages below:

================================================
AArch64: Make graphics classes 64-bit compatible

Changes in this patch include

[x] Long is used to store native pointers as they can
be 64-bit.

[x] Some minor changes have been done to conform with
standard JNI practice (e.g. use of jint instead of int
in JNI function prototypes)

[x] AssetAtlasManager is not completely 64-bit compatible
yet. Specifically mAtlasMap member has to be converted
to hold native pointer using long. Added a TODO to
AssetAtlasManager.java to indicate the change required.

Signed-off-by: Ashok Bhat <ashok.bhat@arm.com>
Signed-off-by: Craig Barber <craig.barber@arm.com>
Signed-off-by: Kévin PETIT <kevin.petit@arm.com>
Signed-off-by: Marcus Oakland <marcus.oakland@arm.com>

==================================================================

AArch64: Use long for pointers in graphics/Camera

For storing pointers, long is used in
android/graphics/Camera class, as native
pointers can be 64-bit.

In addition, some minor changes have been done
to conform with standard JNI practice (e.g. use of
jint instead of int in JNI function prototypes)

Signed-off-by: Ashok Bhat <ashok.bhat@arm.com>
Signed-off-by: Marcus Oakland <marcus.oakland@arm.com>

===================================================================

Change-Id: Ib3eab85ed97ea3e3c227617c20f8d213f17d4ba0
/frameworks/base/core/jni/android_view_Surface.cpp
8790be6de3644e332ec6a17c855da89ffc13a9bf 03-Dec-2013 Leon Scroggins III <scroggo@google.com> Remove calls to deprecated SkBitmap::setIsOpaque()

setIsOpaque() has been removed from ToT Skia.

Update setters for mIsPremultiplied and hasAlpha to take the
other into consideration.

Change-Id: I1b36b0b0ce7126031eb7b769b563c17dcd4b306a
/frameworks/base/core/jni/android_view_Surface.cpp
87eac99a21772ae56018cb81db6966557b459554 10-Sep-2013 Ruben Brunk <rubenbrunk@google.com> Remove dependency on JNIHelp header side effects.

Bug: 10680559
Change-Id: I47870d6c48906e0a420c52b7bc5945ffe29c68a2
/frameworks/base/core/jni/android_view_Surface.cpp
ed55c8db1c0d47492423fc54f4b0dd5cd585e593 20-Aug-2013 Andy McFadden <fadden@android.com> Avoid crashing in unlockCanvasAndPost

It's possible to update the native surface pointer while the
surface is locked (via lockCanvas). This leads to a surprise when
the surface is unlocked. Avoid the surprise by tracking the
locked surface separately.

Bug 10289713

Change-Id: I84346c952be859bbd91ceae7df07b91dabe0948e
/frameworks/base/core/jni/android_view_Surface.cpp
52a9a10b6b8c7b7a9f97777541841b94d4fd9754 02-Aug-2013 Mathias Agopian <mathias@google.com> Clearly separate consumer and producer interfaces

Bug: 9265647
Change-Id: Ic68e91788d0a05251e1d2fb9f9d4de403c7099bf
/frameworks/base/core/jni/android_view_Surface.cpp
b251f3d0c619c37cc4e4b8d9f8b95eb377423190 26-Jul-2013 Mathias Agopian <mathias@google.com> get rid of HAL pixelformats 5551 and 4444

Change-Id: I6a6c4c656d80280eb85f90f99f35721ffca285df
/frameworks/base/core/jni/android_view_Surface.cpp
6f7b58917104916ee6afd6f246c251c1d7a2102a 26-Jul-2013 Mathias Agopian <mathias@google.com> get rid of PIXEL_FORMAT_A_8

Change-Id: Ia750811f08ddebdd5818da211fd03d61b75f8e97
/frameworks/base/core/jni/android_view_Surface.cpp
e32632682ca9207bd247ca27012cf670b5c23f54 17-Jul-2013 Mathias Agopian <mathias@google.com> update to new Consumer APIs

Change-Id: I8649f3add40e0aeeeb0396b98e2cb93312e8e990
/frameworks/base/core/jni/android_view_Surface.cpp
b468877f7f4919acc5aeff0f8d168e94bb5fed4a 03-May-2013 Jeff Brown <jeffbrown@google.com> am f87d4ea7: am 17cf4e4d: Merge "Really make Surface thread-safe." into jb-mr2-dev

* commit 'f87d4ea77a6950c3d6d381347f2346c12bee25f4':
Really make Surface thread-safe.
fc0ebd7d379ff63c00ebf78ca252fab5070213da 01-May-2013 Jeff Brown <jeffbrown@google.com> Really make Surface thread-safe.

There were many places where the native object was being
accessed improperly. Also some places where CloseGuard might
not be acquired or released correctly or where the generation
count might not be updated.

Fixed them all.

That said, Surface isn't intended to be used concurrently
so please don't do it. This is only intended to make
hard to find crashes less likely.

Bug: 8328715
Change-Id: I981ef33425823e0fd7ad6b64443f2ec9b0c8335e
/frameworks/base/core/jni/android_view_Surface.cpp
667809ef5d2d1fe3796cdc9bdd09503a70d2ba6c 17-Apr-2013 Mathias Agopian <mathias@google.com> simplify Surface{View} dirty rect handling

Change-Id: Ia4595fc1a8a62ca3f3db0f1e47e7e877d73fbfa0
/frameworks/base/core/jni/android_view_Surface.cpp
7c116b54b743cc3e92ac42abdbbe324d63b50a81 19-Mar-2013 Mathias Agopian <mathias@google.com> make Surface.java internal state thread-safe

it's still incorrect to use Surface from different
threads, however this shouldn't result to native crashes
anymore.

Bug: 8328715
Change-Id: I89ac5cc1218dc5aa0e35f8e6d4737879a442f0c6
/frameworks/base/core/jni/android_view_Surface.cpp
86e1bc730570765355dc8789b5c6de6962a053cc 14-Mar-2013 Mathias Agopian <mathias@google.com> fix CloseGuard usage in Surface

Bug: 8375415
Change-Id: I03e9f318c2ad586f4bd93b280557ada66121d275
/frameworks/base/core/jni/android_view_Surface.cpp
c3b9cd635163ae48a9151fc6e1650388c5d716be 14-Mar-2013 Mathias Agopian <mathias@google.com> Try to keep the same native Surface object when reading a parcel

If the IGraphicBufferProducers are the same, it's really the same
window, so we keep the same native object.

Bug: 8322406
Change-Id: I96d55a90e6656a05d4e32ae22945226c350b5747
/frameworks/base/core/jni/android_view_Surface.cpp
4a05f436989a49e06ec762aac9507ad13fcc5e23 13-Mar-2013 Mathias Agopian <mathias@google.com> remove uses of Surface in favor of IGraphicBufferProducer

Change-Id: I2ec590eed03c76a084ee6b0af362a3ca6476bf9f
/frameworks/base/core/jni/android_view_Surface.cpp
b1d90c8f60f71422196c337f1d078b68867f5710 07-Mar-2013 Mathias Agopian <mathias@google.com> fix JNI use of incStrong/decStrong

Change-Id: Ia11b404dea483dc19bbc30f4d7bcff516655e180
/frameworks/base/core/jni/android_view_Surface.cpp
8b5aa4846939975adacd6ea1d2a57a2493ac0216 01-Mar-2013 Romain Guy <romainguy@google.com> Restore the ability to track native Surface changes
Bug #8230990

ViewRootImpl needs to know when the native Surface objects changes
to recreate the EGL surface. A recent refactoring in Surface broke
the behavior of getGenerationId(). This simply restores the old
behavior (every change increments the generation ID by 1.)

Change-Id: Ife1df1ffb2ee7a373b8ebf2431192702ba10f344
/frameworks/base/core/jni/android_view_Surface.cpp
ffddc9b8045235a493ec506965ae4892601eb23d 26-Feb-2013 Mathias Agopian <mathias@google.com> Fix SurfaceControl.setDisplaySurface() such that it accepts a null Surface

also fix a typo that made us call the wrong Surface ctor

Bug: 8225509
Change-Id: I23f92179b6003d4c3e0febb35166c1caeafa27f5
/frameworks/base/core/jni/android_view_Surface.cpp
51eb127a1735c4b6f5983e455c8a1d15ffdecda1 22-Feb-2013 Mathias Agopian <mathias@google.com> am e4d3b06b: Merge "get rid of uses of getISurfaceTexture"

* commit 'e4d3b06b6ddb055739b8b2aa82ffc7840588253a':
get rid of uses of getISurfaceTexture
f3d3b4d80618d498fb669c8bfdc492ce9ea25691 20-Feb-2013 Mathias Agopian <mathias@google.com> get rid of uses of getISurfaceTexture

Change-Id: Ibb14327a2b7217994adaa91cc977b163a5509e4a
/frameworks/base/core/jni/android_view_Surface.cpp
4078559a1f2afcdf1e158a93c8952acb4c938ac6 16-Feb-2013 Mathias Agopian <mathias@google.com> am 8d1a6af4: Merge "fix typo introduced in SurfaceTextureClient to Surface renaming"

* commit '8d1a6af408d798dec46a8b1230b7327551fb8051':
fix typo introduced in SurfaceTextureClient to Surface renaming
f798a8e8d4f09cb1273964a48d2af1d5635d7d87 16-Feb-2013 Mathias Agopian <mathias@google.com> fix typo introduced in SurfaceTextureClient to Surface renaming

Change-Id: Iaf1ecc9f5b83a029067b278bc15180d68a113587
/frameworks/base/core/jni/android_view_Surface.cpp
76f56dd598045dadae6dee5e8547bd077b980d5c 15-Feb-2013 Mathias Agopian <mathias@google.com> am ceec31b7: Merge changes I5a218ca1,I853a76d9

* commit 'ceec31b7dab6a23e443d5dcbcfac4a23b720cfde':
Refactoring: Rename SurfaceTextureClient to Surface
clean-up following Surface split
52800617946c456e78ed010c82d0ec4358368164 15-Feb-2013 Mathias Agopian <mathias@google.com> Refactoring: Rename SurfaceTextureClient to Surface

Change-Id: I5a218ca11abeeec05e3a4c3cfc581bcc788814ea
/frameworks/base/core/jni/android_view_Surface.cpp
29479ebe1007361222bf6ab4d5e2a27927d4b8e8 14-Feb-2013 Mathias Agopian <mathias@google.com> clean-up following Surface split

Change-Id: I853a76d92d957ee38a36fcdd280d6407ec316987
/frameworks/base/core/jni/android_view_Surface.cpp
88e4b3ff90b86de6e358c717dbd0959e8b1b8267 15-Feb-2013 Kristian Monsen <kristianm@google.com> Final merge fix

Fixing a crash on reboot. After this it builds and cts tests passes
as before. I don't have a device locally so can't see if it
actually works.

Change-Id: I56cd09d5f83f8096ba0fe8aa8e93ca4286f42e3a
/frameworks/base/core/jni/android_view_Surface.cpp
e32e2b343dca94086badfe34080fb24b4215db27 15-Feb-2013 Kristian Monsen <kristianm@google.com> Fixup from merge, and compile fix due to different skia version

Change-Id: I644c5148904893a2854207f4d566395d973d4aff
/frameworks/base/core/jni/android_view_Surface.cpp
14567588028d0d70f7313251bda86ace2090f2ba 15-Feb-2013 Kristian Monsen <kristianm@google.com> resolved conflicts for merge of 58a1ca66 to master-chromium

Change-Id: I06b61e6d7d52b584eae03a95220381475b8bff0e
ab31d3574997eb3a628e80929e13c4d8d7d9c2cc 14-Feb-2013 Mathias Agopian <mathias@google.com> am a41b23d5: Merge "get rid of Surface.getIdentity()"

# Via Android (Google) Code Review (1) and Mathias Agopian (1)
* commit 'a41b23d55da1bd8e68eb784f28e2c3fe9ded080e':
get rid of Surface.getIdentity()
3866f0d581ceaa165710feeee9f37fe1b0d7067d 12-Feb-2013 Mathias Agopian <mathias@google.com> split Surface in two classes: SurfaceControl and Surface

SurfaceControl is the window manager side; it can
control the attributes of a surface but cannot push buffers
to it. Surface on the other hand is the application (producer)
side and is used to push buffers to the surface.

Change-Id: Ib6754c968924e87e8dd02a2073c7a447f729f4dd
/frameworks/base/core/jni/android_view_Surface.cpp
f9136fd9692158574d187af8d4031fa4b1e2b6e6 12-Feb-2013 Mathias Agopian <mathias@google.com> get rid of Surface.getIdentity()

Change-Id: I8b70d77cc1b38009ad71d92025c3beb481a18866
/frameworks/base/core/jni/android_view_Surface.cpp
7c1a49f5f5ed6613d736464bf5001b777e89ced2 13-Feb-2013 Chris Craik <ccraik@google.com> Revert "Merge remote-tracking branch 'goog/master-chromium' into 'goog/master'" DO NOT MERGE

This reverts commit 6c0307dd0aefe9a08794b155fc03ee60ebd14f25, reversing
changes made to a2cd828b749c444d55c2c41c7dbb85088ff94b9f.

Conflicts:
packages/SystemUI/res/values-sv/strings.xml

Change-Id: Ia178efe8b14751583d47b2826bfe3d3d5463dd2e
/frameworks/base/core/jni/android_view_Surface.cpp
fc615a0f643408956fc0dc1b997871e2b27cee7e 20-Dec-2012 Derek Sollenberger <djsollen@google.com> Remove calls to SkCanvas::setBitmapDevice()

Change-Id: Ib0aa2f65b77802b105c0e8a9d7cdde2e863d3673
/frameworks/base/core/jni/android_view_Surface.cpp
2fa54cef47887808d006f473a7d4f8dd5fb76704 19-Dec-2012 Derek Sollenberger <djsollen@google.com> Merge "Update framework to support r5967 of Skia." into master-chromium
d47f7d8b5fe3a3861d7cbdc5f912235407823c8e 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: I08e677faf2ebb418ef131d0a8008e01037db0e50
/frameworks/base/core/jni/android_view_Surface.cpp
ca79cf69d09efa0c327e9b1237d86a119aea5da7 14-Aug-2012 Derek Sollenberger <djsollen@google.com> Update framework to support r5967 of Skia.

bug: 6906025
Change-Id: Iefdb830ec3aa2ab3472c1c142484a7aa21788a15
/frameworks/base/core/jni/android_view_Surface.cpp
95429c3d1b8113c23b0aad3b74d724dccfad7fa9 23-Oct-2012 Jamie Gennis <jgennis@google.com> Surface: add the PhysicalDisplayInfo#secure field

Bug: 7368436
Change-Id: I38bf7bbfca354380c30da7516f628cf40416d350
/frameworks/base/core/jni/android_view_Surface.cpp
7bbf8163fb83afc54b353a8def52bfb87ecce047 20-Oct-2012 Jamie Gennis <jgennis@google.com> Set the secureness when creating displays

This change makes use of the new 'secure' argument to the
ISurfaceComposer::createDisplay method. In this change both the overlay and
wifi displays are hard-coded to be non-secure displays.

Bug: 7368436
Change-Id: Ib65312f2adab5104d8deefbfc32af9dc106a9129
/frameworks/base/core/jni/android_view_Surface.cpp
b6ce6e42cc89864354c7ecb9ae80504a6c9dddcf 16-Oct-2012 Jamie Gennis <jgennis@google.com> Flag window animation transactions as animations.

This change makes WindowManager use the new eAnimation flag when animating
windows. This prevents some of the window updates from being combined with
updates from prior animation frames.

Bug: 7353840
Change-Id: I5a9f8fa2c1a2f5f08363a45cd9f28bb97cd77080
/frameworks/base/core/jni/android_view_Surface.cpp
9e316a1a2a8d734315bbd56a85308f9657a92913 09-Oct-2012 Jeff Brown <jeffbrown@google.com> Blank or unblank all displays as need.

Ensures that both the internal display and HDMI are blanked
or unblanked in tandem.

Bug: 7309812
Change-Id: Ie8b96d393e8bb20d23c92f3320142d9f7cf42aff
/frameworks/base/core/jni/android_view_Surface.cpp
3bcbad7bcbc4c556a3550f40a3ba85876db7e7d8 18-Sep-2012 Andy McFadden <fadden@android.com> Plumb display name into SurfaceFlinger

Pass the display name into SF's createDisplay().

Bug 7058158

Change-Id: Ia21f07063db2c2fb5a34d6526e16d4b2d3694377
/frameworks/base/core/jni/android_view_Surface.cpp
cbad976b2a36a0895ca94510d5208a86f66cf596 05-Sep-2012 Jeff Brown <jeffbrown@google.com> Add support for Wifi display.

Change-Id: I99693786cf9d07d07d3400046c55eb4933730b80
/frameworks/base/core/jni/android_view_Surface.cpp
63f1c43fbef157397869475ef30d23e631b88bbe 05-Sep-2012 Mathias Agopian <mathias@google.com> update to new SurfaceComposerClient API

Change-Id: I8f2c96df56fe3a851b8ec03bb8734db0b6bea3d5
/frameworks/base/core/jni/android_view_Surface.cpp
64a55af0ac700baecb0877235eb42caac59a3560 26-Aug-2012 Jeff Brown <jeffbrown@google.com> Add plumbing for new surface flinger display API.

Cleaned up the implementation of Surface and SurfaceSession
to use more consistent naming and structure.

Added JNI for all of the new surface flinger display API calls.

Enforced the requirement that all Surfaces created by
the window manager be named.

Updated the display manager service to use the new methods.

Change-Id: I2a658f1bfd0437e1c6f9d22df8d4ffcce7284ca2
/frameworks/base/core/jni/android_view_Surface.cpp
0b722fe9ce98d97dbcb6fefd170b85ab7037e528 25-Aug-2012 Jeff Brown <jeffbrown@google.com> Use new surface flinger API.

Change-Id: Ic888577408a59a36481a48010e19c5e77c24e211
/frameworks/base/core/jni/android_view_Surface.cpp
98365d7663cbd82979a5700faf0050220b01084d 20-Aug-2012 Jeff Brown <jeffbrown@google.com> Refactor for multi-display support.

Split WindowManagerImpl into two parts, the WindowManager
interface implementation remains where it is but the global
communications with the window manager are now handled by
the WindowManagerGlobal class. This change greatly simplifies
the challenge of having separate WindowManager instances
for each Context.

Removed WindowManagerImpl.getDefault(). This represents the
bulk of this change. Most of the usages of this method were
either to perform global functions (now handled by WindowManagerGlobal)
or to obtain the default display (now handled by DisplayManager).

Explicitly associate each new window with a display and make
the Display object available to the View hierarchy.

Add stubs for some new display manager API features.

Start to split apart the concepts of display id and layer stack.
since they operate at different layers of abstraction.
While it's true that each logical display uniquely corresponds to a
surface flinger layer stack, it is not necessarily the case that
they must use the same ids. Added Display.getLayerStack()
and started using it in places where it was relatively easy to do.

Change-Id: I29ed909114dec86807c4d3a5059c3fa0358bea61
/frameworks/base/core/jni/android_view_Surface.cpp
9de4936c99b979f6010440b043edc6d6142d1980 02-Aug-2012 Craig Mautner <cmautner@google.com> Add features to DisplayManager.

Added Surface.setDisplayId().
Added callbacks to DisplayManagerService.

Change-Id: Idd3f85f8ca1f1208962f1196efd6a3ab51c8c259
/frameworks/base/core/jni/android_view_Surface.cpp
fa25bf5382467b1018bd9af7f1cb30a23d7d59f7 24-Jul-2012 Jeff Brown <jeffbrown@google.com> Add display manager skeleton.

The purpose of this change is to remove direct reliance on
SurfaceFlinger for describing the size and characteristics of
displays.

This patch also starts to make a distinction between logical displays
and physical display devices. Currently, the window manager owns
the concept of a logical display whereas the new display
manager owns the concept of a physical display device.

Change-Id: I7e0761f83f033be6c06fd1041280c21500bcabc0
/frameworks/base/core/jni/android_view_Surface.cpp
ef4e817ad642303509da1cb28ce5a265e1ac3e17 17-Jul-2012 Jeff Brown <jeffbrown@google.com> Remove freeze(), unfreeze() and setFreezeTint().

This is all dead code.

Change-Id: Ia8a3068606bfe277a16cde5690f47996657863e8
/frameworks/base/core/jni/android_view_Surface.cpp
55e395ab33f24b009d87a4d45a5566394260fff7 16-Jul-2012 Jeff Brown <jeffbrown@google.com> Remove freezeDisplay(), which is no-op.

Change-Id: I981ee49e6e2d41a09feaee4b384392e83f7faf3d
/frameworks/base/core/jni/android_view_Surface.cpp
78b8ef3f3ad8ab935f677d8d672db0d97bff8119 07-May-2012 Jamie Gennis <jgennis@google.com> Surface: replace active rect with window crop

This change replaces the setActiveRectCrop method on Surface, which was called
from app processes, with the setWindowCrop method that is to be called from the
window manager.

Bug: 6299171
Change-Id: Ica51efcd8c488a526e7013b83d80df4856694519
/frameworks/base/core/jni/android_view_Surface.cpp
b40696cc216f6a5874189fe83055ddaa7b428ce0 01-May-2012 Jamie Gennis <jgennis@google.com> Surface: add JNI plumbing for setActiveRect.

Bug: 6299171
Change-Id: If26e63ebe7def645626af251bed899ff9389f8e5
/frameworks/base/core/jni/android_view_Surface.cpp
c14bacf1fb511472138eeb5dc84a9423fc003214 24-Apr-2012 Mathias Agopian <mathias@google.com> add a (hidden) api on Surface to query if the consumer is running behind the producer

Change-Id: I71ec1602f66a4850b130893fc7017b5b1ac1b647
/frameworks/base/core/jni/android_view_Surface.cpp
497db8bfdab58c7e14ab3e2007bbe22250963246 13-Apr-2012 Pannag Sanketi <psanketi@google.com> Making the setSurface non-static

The setSurface method can be used to set a java Surface object from a
native Surface object. Making it non-static so that it can be accessed
from other units as well.

Change-Id: Id49b077ec0e7ad91cf10a4bd66938e238062408d
/frameworks/base/core/jni/android_view_Surface.cpp
2e76c992bfa955cb637417005941e3e93810a99d 23-Feb-2012 Daniel Lam <dalam@google.com> SurfaceTexture: Fully refactored from BufferQueue

Cleaning up camera and media interactions as part of SurfaceTexture refactoring

Change-Id: Iea2b10ff80b5f01f83ed0902c725df1d3b4c541a
/frameworks/base/core/jni/android_view_Surface.cpp
047238ced42eea812de9d39a9f32e94d002bfa5c 08-Mar-2012 Jeff Sharkey <jsharkey@android.com> Switch Parcel to static JNI calls, pass pointer.

Instead of using parcelForJavaObject(), pass down the mNativeObj
pointer explicitly. Benchmarks show that writeInt() is roughly 3x
faster with this approach.

Change-Id: I24ca235c334c44be716070aa8066ec8a429eadb7
/frameworks/base/core/jni/android_view_Surface.cpp
8335f1ccccedb6655d96d9d5b697a7f0938235dd 26-Feb-2012 Mathias Agopian <mathias@google.com> fix libgui header location

Change-Id: Iec71706cdd4f29c6904993648ce873e83ef9cafe
/frameworks/base/core/jni/android_view_Surface.cpp
8835f2928e56622955a05ec9f8aee043828575ca 31-Jan-2012 Bhanu Chetlapalli <bhanu@mips.com> Fix incorrect prototype for JNI call

This issue caused every Application launch to crash when using
portable JIT

Signed-Off-By: Bhanu Chetlapalli <bhanu@mips.com>

Change-Id: Id7cfdeb4fc00ba4b1ca6fa24bc01c8f3432857ff
/frameworks/base/core/jni/android_view_Surface.cpp
61566cc1932468720a831ad5cbc68ee080d613c9 03-Dec-2011 Dianne Hackborn <hackbod@google.com> Fix issue #5614559: Registering surface error in...

...Background Replacement on Stingray

This is how I should have done it in the first place. We get the
new surface from the window manager, and then just copy it in to
the constant Surface object we have for the holder.

Change-Id: I537a9e413829a18f689dfb46687014676b27156e
/frameworks/base/core/jni/android_view_Surface.cpp
34cb9f2a960c4173bdafb4b8a2444c1bca4c5f0d 31-Aug-2011 Mathias Agopian <mathias@google.com> fix Surface positions are not floats

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

Bug: 5239859
Change-Id: I903aef4ad5b5999142202fb8ea30fe216d805711
/frameworks/base/core/jni/android_view_Surface.cpp
0de171b0d490a5928d54d2fb67c912d140aac643 16-Jul-2011 Ted Bonkenburg <tedbo@google.com> Add support for creating a Surface from a a SurfaceTexture.

The Surface is already using SurfaceTexture internally and it is parcelable. This
is intended to replace and phase out ParcelSurfaceTexture in favor of creating a
new Surface.java object from an existing SurfaceTexture.

Change-Id: I8e2dd86614523da6abed6403e1d705a68fa19fdf
/frameworks/base/core/jni/android_view_Surface.cpp
4e8a5c922c287ec97fec847194e930f8598a1941 23-Jun-2011 tedbo <tedbo@google.com> Add method to create a ParcelSurfaceTexture from android.view.Surface.

Change-Id: I05e343ab7e327478f60322af9373574b70c148f5
/frameworks/base/core/jni/android_view_Surface.cpp
050316184b01c0d1a01c46afae7429b89a27c31b 07-Jun-2011 tedbo <tedbo@google.com> Add ParcelSurfaceTexture Java class to enable ISurfaceTexture sharing via Binder.

This adds a new ParcelSurfaceTexture.java class that can be instantiated with
a SurfaceTexture and used to send the corresponding ISurfaceTexture interface
to another process via Binder. The ParcelSurfaceTexture java object can then
be used to create an ANativeWindow based on the SurfaceTextureClient interface.

Change-Id: Ie38ea948b866e52f36a6d0f6cde19b54a8546817
/frameworks/base/core/jni/android_view_Surface.cpp
9638e5c167be321643bf3f3ee39e3fb45541fb3b 20-Apr-2011 Mathias Agopian <mathias@google.com> Get rid of the "pid" parameter from createSurface

Change-Id: I28635e3f803e6abe965d79998e305f54a202465d
/frameworks/base/core/jni/android_view_Surface.cpp
8451b25a4422656bbd6657a5855e69c0f4d53c74 08-Apr-2011 Elliott Hughes <enh@google.com> Use jniThrowException for exception throwing from native code.

I'll do media and the generated gl stuff separately. Otherwise, this
cleans up all direct calls of ThrowNew/Throw except the one in the
binder that needs to remain.

Change-Id: I8f95a5f020f53b25926ad31ac0c9477ddf85d04b
/frameworks/base/core/jni/android_view_Surface.cpp
375aa0b09ba2c6d6951a89299c6a772a3f68aaa0 04-Mar-2011 Carl Shapiro <cshapiro@google.com> Fix a compare of JNI references to use IsSameObject.

Change-Id: I9932761271034ff5031730874daf7c147b6b008a
/frameworks/base/core/jni/android_view_Surface.cpp
32a55cf66e12e5e56d2e05b73c6bef453477c2bb 26-Feb-2011 Mathias Agopian <mathias@google.com> Fix sp<> conversion operator / constructor

some of the conversion operators were not using the proper
pointer type when calling incStrong/decStrong, usually it
has no bad consequences, but for some implementation
of the ref-counted object it could lead to recording the wrong
owner id.

Change-Id: If574b9069b8a4cf6e0911a992c8f095aba799995
/frameworks/base/core/jni/android_view_Surface.cpp
6062c5912dc79704b489fc8c289b78a400ed05ee 22-Feb-2011 Derek Sollenberger <djsollen@google.com> Skia Merge (revision 808)

This is a companion CL to the one found in /external/skia

Change-Id: If81748545435cab20a5d8479329ab333cb973e16
/frameworks/base/core/jni/android_view_Surface.cpp
fea12b87f2988f20ea87314c4a1b47e1a0f4d95e 28-Jan-2011 Romain Guy <romainguy@google.com> Catch exception when ViewRoot's surface is not valid.
Bug #3399426

Change-Id: Id4e0b8714c9520c4e84e81c2978752d46c912b6b
/frameworks/base/core/jni/android_view_Surface.cpp
2a83f001fdb189f945e82e81e717ba204824b112 19-Jan-2011 Romain Guy <romainguy@google.com> Recreate the EGL surface when ViewRoot's surface changes.
Bug #3306150

Change-Id: Ifbf0ab9deca7a34eff7d844ea7276d12d7284788
/frameworks/base/core/jni/android_view_Surface.cpp
d2835935d2df8be70d1b37d3ef3b2fe0155b3422 14-Dec-2010 Dianne Hackborn <hackbod@google.com> Fix issue #3258849: Grab thumbnail when exiting an app via back

Also issue #3281400: Rotating a retained instance fragment leaks the fragment manager

And turn off fragment debug logging.

Change-Id: Ibdd7db82bb35618021bcba421ba92ced7cd691c2
/frameworks/base/core/jni/android_view_Surface.cpp
1f5b195ed0f7f4a3398903fc064af1788c108bad 29-Nov-2010 Dianne Hackborn <hackbod@google.com> Don't leak.

Change-Id: I756d54feeef4ff73f17c80d4b4405de56a5787a6
/frameworks/base/core/jni/android_view_Surface.cpp
a111187a5b4dc5d287e29ced7d65e8d20edca140 24-Nov-2010 Dianne Hackborn <hackbod@google.com> Change rotation freeze to all be implemented in window manager.

Lots of work for no visible change in behavior, but now we can
do some fancier stuff...

Also allow rotation in all 4 directions.

Change-Id: I7e5e9537c5e359f69b83c10f65cc1ce95f371461
/frameworks/base/core/jni/android_view_Surface.cpp
5ee65f0d441ca558bc95b60c1468f2aadfeeddbd 16-Jul-2010 Jamie Gennis <jgennis@google.com> Re-use existing Surface objects when reading them from parcels.

This change adds a process-global cache of previously deserialized Surface
objects so that if a Surface object wrapping the same ISurface gets received
again the same Surface can be used. This is important because the 'tail'
pointer in the SharedBufferClient is stored only on the client side, and needs
to be the same for all the Surface objects wrapping an ISurface instance. This
solves the problem by making there only be one Surface object wrapping an
ISurface per process.

Change-Id: I4bf0b8787885c56277622fca053022d2bb638902
/frameworks/base/core/jni/android_view_Surface.cpp
289b9b62372ef52a06113b83dfb870e2c2fb325a 09-Jul-2010 Dianne Hackborn <hackbod@google.com> Add ANativeWindow API for directly drawing to the surface bits.

Also other cleanup and fixes:

- We now properly set the default window format to 565.
- New APIs to set the window format and flags from native code.
- Tweaked glue for simpler handling of the "destroy" message.
- Um, other stuff.

Change-Id: Id7790a21a2fa9a19b91854d225324a7c1e7c6ade
/frameworks/base/core/jni/android_view_Surface.cpp
54a181b1a2b1517a9479b21fbf7705a688232faf 01-Jul-2010 Dianne Hackborn <hackbod@google.com> Make real API for native code to get its window.

Added implementation to use ANativeWindow and provide
it to a NativeActivity.

Change-Id: I890d71b6e15d4af71e6cf81b327961d7061ec1c2
/frameworks/base/core/jni/android_view_Surface.cpp
8b73ae4a1e5321753e54354e5202a38c5560fea9 11-Jun-2010 Mathias Agopian <mathias@google.com> fix [2757903] Crash in EGL when creating an EGLSurface

Change-Id: I995947ac40d1a5c86dce495550baf6864ecf5f54
/frameworks/base/core/jni/android_view_Surface.cpp
fae5cb2b356a1fef172b43066180a7ab4c32dbac 05-Jun-2010 Mathias Agopian <mathias@google.com> optimize Surface.readFromParcel()

this is called for each relayout() and used to create a full Surface (cpp)
which in turn did some heavy work (including an IPC with surfaceflinger),
most of the time to destroy it immediatelly when the returned surface
(the one in the parcel) was the same.

we now more intelligentely read from the parcel and construct the new
object only if needed.

Change-Id: Idfd40d9ac96ffc6d4ae5fd99bcc0773e131e2267
/frameworks/base/core/jni/android_view_Surface.cpp
55fb51aa411b574646cc3068ce36e73789b81616 27-Apr-2010 Marco Nelissen <marcone@google.com> resolved conflicts for merge of 86303198 to kraken

Change-Id: Idd921c7108e4c2cd4a861ee1fb8b43e5d56f8f2f
8138cb49e47f9a9905a316a217757710185c66aa 27-Apr-2010 Marco Nelissen <marcone@google.com> Make Surface.toString() show more useful info to help debug bug 2594388.

Change-Id: I005d3388503d8886e11a26fece30b87572934f15
/frameworks/base/core/jni/android_view_Surface.cpp
a8a0aa8b922c45fb4633f51610f264a19f9bd825 22-Apr-2010 Mathias Agopian <mathias@google.com> better fix for [2420565] Surface.lockCanvas() updates the dirty region too often

Change-Id: I83438b40effd21538f1c74396dc665254b9d5ab6
/frameworks/base/core/jni/android_view_Surface.cpp
8b138323d54e36fd66b22a634494648e20c53373 13-Apr-2010 Mathias Agopian <mathias@google.com> don't hardcode "mSurface" throughout our source code

this is used in a few places to get access to the android.view.Surface
native surface. use a macro instead. Also rename the field to mNativeSurface.

Change-Id: I1c6dea14abd6b8b1392c7f97b304115999355094
/frameworks/base/core/jni/android_view_Surface.cpp
af1e11b849ea527f4b1b1695924ce42cc9d7f670 23-Mar-2010 Mathias Agopian <mathias@google.com> one step toward fixing [2501808] sapphire: OOM in GPU Surface area

when a surface was returned from a remote process through the binder we
would leak its resources until a GC happened.

implement writeToParcel to release the source when PARCELABLE_WRITE_RETURN_VALUE
is set

Change-Id: I6a9fa369b0d164a9ca1229b8a2944d3c132a3720
/frameworks/base/core/jni/android_view_Surface.cpp
5d26c1e38dabb3ad8b4b6e1000375f3b1a6b7693 02-Mar-2010 Mathias Agopian <mathias@google.com> Added a name to Surface created by SurfaceFlinger

Updated the window manager to use this new facility.
Surfaces name are now printed by "dumpsys".
/frameworks/base/core/jni/android_view_Surface.cpp
000479f9e325b4e426a67033abd92d47da412725 10-Feb-2010 Mathias Agopian <mathias@google.com> split libsurfaceflinger_client and libcamera_client out of libui
/frameworks/base/core/jni/android_view_Surface.cpp
0586a1b77a788a119166a37fccd909bf9ed65f23 07-Sep-2009 Dianne Hackborn <hackbod@google.com> Fix issue #2095422: Some fades from opaque to transparent don't work

ViewRoot was using Surface.clear(), which has different behavior
in different processes -- in the system process it would kill the
surface, causing all windows in that process to immediately disappear
instead of animating away.

This change makes Surface.release() public and uses that instead. It
also renames Surface.clear() to Surface.destroy().

Also fixed some issues in the window manager that were causing the
wallpaper to not get immediately resized when the orientation changes
and its target window is removed and re-added.

Change-Id: I2a992e365cf5747511f0bf1193db32dc2525b218
/frameworks/base/core/jni/android_view_Surface.cpp
f1e5b0d4e5d0d2a78c234cd0cbd3005a74a79429 08-Aug-2009 Mathias Agopian <mathias@google.com> add support for RGBX_8888
/frameworks/base/core/jni/android_view_Surface.cpp
6158b1bf0364da1582468a98ec09d004ba99deec 11-May-2009 Mathias Agopian <mathias@google.com> Region now has its own implementation instead of relying on SkRegion, which allows us to break libui's dependency on libcorecg.
/frameworks/base/core/jni/android_view_Surface.cpp
69d62097e8195c947de7e4cdc4a491181aa56e61 17-Apr-2009 Mathias Agopian <mathias@google.com> cleanup, remove unused fields. Also make sure that we don't systematically allocate a Surface in Surface.java if only a SurfaceControl is needed (Common case).
/frameworks/base/core/jni/android_view_Surface.cpp
17f638b39f2e8b610ecfa1290e5bc42ab7700c98 17-Apr-2009 Mathias Agopian <mathias@google.com> more splitting of Surface/SurfaceControl. Surface.java is now implemented in terms of Surface and SurfaceControl.

The WindowManager side of Surface.java holds a SurfaceControl, while the client-side holds a Surface. When the client is in the system process, Surface.java holds both (which is a problem we'll try to fix later).
/frameworks/base/core/jni/android_view_Surface.cpp
402c34649f514669517c2208e35caa58ff8bb2b9 15-Apr-2009 Mathias Agopian <mathias@google.com> fix some issues with Surface's lifetime management.

To deal with Java's lack of destructors and delayed garbage collection, we used to duplicate Surface.cpp objects in some case; this caused some issues because Surface is supposed to be reference-counted and unique.
/frameworks/base/core/jni/android_view_Surface.cpp
1473f46cbc82aa6f0ba744cc896a36923823d55b 10-Apr-2009 Mathias Agopian <mathias@google.com> Integrate from //sandbox/mathias/donut/...@145728

SurfaceFlinger rework for new EGL driver model support.
/frameworks/base/core/jni/android_view_Surface.cpp
eb0c86e18b7d620b679ff2a45a0233867a53a334 28-Mar-2009 Mathias Agopian <> AI 143320: am: CL 143171 am: CL 142873 fix [1732012] Only show screen rotation animation when triggered by sensor
Original author: mathias
Merged from: //branches/cupcake/...
Original author: android-build
Merged from: //branches/donutburger/...

Automated import of CL 143320
/frameworks/base/core/jni/android_view_Surface.cpp
9066cfe9886ac131c34d59ed0e2d287b0e3c0087 04-Mar-2009 The Android Open Source Project <initial-contribution@android.com> auto import from //depot/cupcake/@135843
/frameworks/base/core/jni/android_view_Surface.cpp
d83a98f4ce9cfa908f5c54bbd70f03eec07e7553 04-Mar-2009 The Android Open Source Project <initial-contribution@android.com> auto import from //depot/cupcake/@135843
/frameworks/base/core/jni/android_view_Surface.cpp
3001a035439d8134a7d70d796376d1dfbff3cdcd 19-Feb-2009 The Android Open Source Project <initial-contribution@android.com> auto import from //branches/cupcake/...@132276
/frameworks/base/core/jni/android_view_Surface.cpp
54b6cfa9a9e5b861a9930af873580d6dc20f773c 21-Oct-2008 The Android Open Source Project <initial-contribution@android.com> Initial Contribution
/frameworks/base/core/jni/android_view_Surface.cpp