3683 Commits

Author SHA1 Message Date
Jamie Gennis
b71a4beb1a SurfaceTexture: add a deadlock scenario test
This change adds a test to ensure that a GL driver that's blocking on a
call to dequeueBuffer does not block other GL threads from rendering and
queueing buffers.

Change-Id: Ifdd234effc534b6a9cf8522ca87f64da5bb0bbd6
2011-07-22 14:03:31 -07:00
Jamie Gennis
95b4042285 Merge changes I799532f7,I5cffa6eb
* changes:
  SurfaceTexture: fix a comment
  SurfaceTexture: remove getAllocator
2011-07-22 13:34:57 -07:00
Mathias Agopian
672a05f0cf Merge "Fix a few issues with NATIVE_WINDOW_TRANSFORM_HINT" 2011-07-21 20:34:47 -07:00
Jeff Brown
08695111cf Merge "Decouple GLES20RecordingCanvas lifetime from GLES20DisplayList. Bug: 5062011" 2011-07-21 17:44:08 -07:00
Jeff Brown
162a021756 Decouple GLES20RecordingCanvas lifetime from GLES20DisplayList.
Bug: 5062011

Previously, each GLES20DisplayList would hold onto an instance of
GLES20RecordingCanvas.  In turn, each GLES20RecordingCanvas
held onto an SkWriter with a 16Kb buffer along with several other
objects.  With one display list per view and hundreds of views,
the overhead could add up to a few megabytes.

Ensured that the GLES20RecordingCanvas is reset as soon as
the display list has been constructed, thereby promptly freeing
the 16Kb buffer.

Changed GLES20DisplayList so that it acquires a GLES20RecordingCanvas
from a pool as needed and recycles it when done.

Removed some dead code and cruft related to the construction of
GLES20Canvas objects in general.  Some code was written with the
assumption that the underlying renderer object could change
behind the scenes or might be lazily constructed, but that isn't
actually the case so we can simplify things.

Removed an unnecessary weak reference from GLES20DisplayList
to the View.  It isn't actually used anywhere.

Fixed a bug in GLES20DisplayList where isValid() would return
true while the display list was being recorded.  This is incorrect
because the native display list might not actually exist.  Worse,
even if the native display list does exist, it is stale and
potentially refers to old Bitmaps that have been GC'd (because the
mBitmaps list was cleared when recording started).

Change-Id: Ib12d5483688cb253478edeb0156d34c476c2566b
2011-07-21 17:15:48 -07:00
Mathias Agopian
45b63dd11c Fix a few issues with NATIVE_WINDOW_TRANSFORM_HINT
- fixed uninitialized variable
- set hint to indentity when transform is too complex
- make sure FrameBufferNativeWindow doesn't fail on needed perform commands

Bug: 4487161
Change-Id: I7cb2b0869b72404732eca7cb2d145ff669e2ed9b
2011-07-21 14:50:29 -07:00
Jamie Gennis
5c23a2c72d SurfaceTexture: remove getAllocator
This change removes the SurfaceTexture::getAllocator method, as it's no
longer needed.  Proper refcounting of the Gralloc buffers is now handled
by the IGraphicBufferAlloc binder marshalling code.

Change-Id: I5cffa6ebfc1bc5828fb7ce0e0a5b2f55cd8479da
2011-07-21 14:32:56 -07:00
Kenny Root
4f3a8db64d am 3cf03987: Merge "Continue idmap generation even if name lookup fails."
* commit '3cf039876177b5b314b635bb12a1dae1b42f4605':
  Continue idmap generation even if name lookup fails.
2011-07-21 13:09:05 -07:00
Kenny Root
3cf0398761 Merge "Continue idmap generation even if name lookup fails." 2011-07-21 13:05:03 -07:00
Mathias Agopian
f5a4dd386f Merge "clean-up. get rid ofunused code and members in Surface[Control].cpp" 2011-07-20 18:52:51 -07:00
Jeff Brown
95661d5ece Merge "Remove unimplemented memory pool." 2011-07-20 17:42:36 -07:00
Mathias Agopian
50c24a2000 clean-up. get rid ofunused code and members in Surface[Control].cpp
Change-Id: Ia7790ae28af2c2ac99eae01c2c5044ace4a490a4
2011-07-20 16:53:13 -07:00
Jeff Brown
ac386073df Remove unimplemented memory pool.
dlmalloc does such a great job that we don't need a pool anyways.

Change-Id: I105b28c4a5c491543959190c7c0a9de75a5b8052
2011-07-20 15:19:50 -07:00
Alex Sakhartchouk
eac3503deb Merge "Correctly call glviewport when surface changes." 2011-07-20 09:41:50 -07:00
Alex Sakhartchouk
10ed04935d Correctly call glviewport when surface changes.
Change-Id: I7ef1539e39ea67245bac5ee410deb5918fc5dfcf
2011-07-19 17:50:29 -07:00
Stephen Hines
588bf7a53e Merge "Extract BC metadata using a single call." 2011-07-19 17:45:49 -07:00
Mathias Agopian
9ec1f1d259 Merge "implement: "Add an ANativeWindow API for SurfaceFlinger to suggest an optimal buffer orientation"" 2011-07-19 17:10:10 -07:00
Mathias Agopian
f07b8a3f69 implement: "Add an ANativeWindow API for SurfaceFlinger to suggest an optimal buffer orientation"
Bug: 4487161
Change-Id: I883f34efe542c2a566d04966f873374f40c50092
2011-07-19 15:24:46 -07:00
Romain Guy
1003aeb9de Merge "Reduce the fade area to save bandwidth." 2011-07-19 15:20:46 -07:00
Romain Guy
f2fc460a95 Reduce the fade area to save bandwidth.
Change-Id: I8ccea17fc1fb3c132329baa0acc1b3d5a140a5c6
2011-07-19 15:20:03 -07:00
Mathias Agopian
ff86f37b95 use SurfaceTexture new scaling mode in SF
SF now obeys SurfaceTexture's scaling mode instead
of inferring it from the buffer's size

Change-Id: I4d50e9851abedd7e64bfcfc8af9eefb9fb668529
2011-07-19 13:05:12 -07:00
Mathias Agopian
09d7ed7b39 Add set_scaling_mode() to ANativeWindow.
This allows to specify the scaling mode independently from
the buffer size.

Change-Id: Iaa2baa660445531a97d3fac192e580f4929c5d3b
2011-07-19 13:05:11 -07:00
Stephen Hines
c27d187569 Extract BC metadata using a single call.
BUG=4278636

Change-Id: Idc056c4fa50240aadbc81d300fbed759c5a187cf
2011-07-18 17:49:44 -07:00
Romain Guy
f40aa3834d Merge "Trim OpenGLRenderer's memory usage whenever possible" 2011-07-18 16:06:31 -07:00
Jamie Gennis
f4f79ac42a Merge "SurfaceTexture: add a multi-SurfaceTexture test" 2011-07-18 15:00:54 -07:00
Romain Guy
bdf7609867 Trim OpenGLRenderer's memory usage whenever possible
Change-Id: I9225077184f374b1a43300add15cc1d5b6869d1c
2011-07-18 15:00:43 -07:00
Mathias Agopian
10e6f34a67 Merge "move lock/unlock implementaion outside of Surface into SurfaceTextureClient" 2011-07-18 14:55:58 -07:00
Mathias Agopian
949be32b67 move lock/unlock implementaion outside of Surface into SurfaceTextureClient
This makes ANativeWindow_lock/ANativeWindow_unlockAndPost work
with ANativeWindows implemented by Surface and SurfaceTextureClient.

Also, Surface now inherits directly from SurfaceTextureClient.

Bug: 5003724
Change-Id: I9f285877c7bae9a262e9a7af91c2bae78804b2ef
2011-07-15 17:47:08 -07:00
Glenn Kasten
170626b2ba Fix build break on MacOS
Change-Id: Ica19984d0e623ac2482fc3512231e6c00671fd3a
2011-07-15 17:45:50 -07:00
Glenn Kasten
7e7de71f6e Merge "CPU statistics library" 2011-07-15 16:24:26 -07:00
Glenn Kasten
131515b681 CPU statistics library
Change-Id: I113e2a926466cc410cfa5602ceb165b390a290fc
2011-07-15 14:09:49 -07:00
Jamie Gennis
97912d0b9d Merge "SurfaceTexture: fix SurfaceTextureGLToGLTest" 2011-07-15 12:35:34 -07:00
Alex Sakhartchouk
e173b9d73b Merge "For the serialization context, no fifo initialization is necessary." 2011-07-15 10:57:33 -07:00
Jeff Brown
d639f4579c Merge "Add a call to pthread_attr_destroy to avoid potential memory leaks." 2011-07-14 22:31:27 -07:00
Mathias Agopian
d2734a5daa fix a typo in ISurfaceTexture IPC code
Change-Id: Ied1d9ddb0d849b17219d0ea3d333ce12be849419
2011-07-14 20:20:58 -07:00
Le-Chun Wu
da13560de2 Add a call to pthread_attr_destroy to avoid potential memory leaks.
Change-Id: Ib57efc3530e9793298190cc9cab19c9af54e11a7
2011-07-14 20:14:07 -07:00
Jamie Gennis
06b54d7184 Merge changes Id9aa1003,I8c154189
* changes:
  SurfaceTexture: make (dis)connect into an IPC
  SurfaceTexture: add support for new connect values
2011-07-14 17:54:27 -07:00
Jamie Gennis
9709687463 SurfaceTexture: make (dis)connect into an IPC
This change makes the ANativeWindow connect and disconnect calls result
in an IPC to the SurfaceTexture object.  This will allow us to prevent
multiple simultaneous connections from different processes.

Change-Id: Id9aa1003b1335b96ca6bd4a1f5a67aa433d42efb
2011-07-14 17:48:32 -07:00
Jamie Gennis
ec7ea37a0e SurfaceTexture: fix SurfaceTextureGLToGLTest
This change fixes a couple different issues in the
SurfaceTextureGLToGLTest test fixture:
  - incorrect use of conditions
  - move logging after the locks are acquired
  - call the parent class's TearDown method
  - clean up the SurfaceTexture before eglTerminate gets called

Change-Id: I6960e5ab7f144225f01a2089d3f849c99fed0b38
2011-07-14 17:11:47 -07:00
Jamie Gennis
a775f0d419 SurfaceTexture: add support for new connect values
This change adds support to SurfaceTextureClient for the new enum values
that can be passed to the ANativeWindow connect call.

Change-Id: I8c15418909e43a15673a9b22a5eb40df6923b273
2011-07-14 15:03:33 -07:00
Jeff Brown
ab561139f9 Minor code cleanups in vector.
Fixed a potential bug where calling replaceAt with a reference to
an existing element in the vector at the same index would cause
the element to be destroyed while being copied to itself.

Refactored the conditions in _grow and _shrink for clarity.
The computations are exactly the same but I think it reads better
this way.  In particular, the ssize_t variable 's' is gone: it didn't
need to be signed anyways because its value could never be negative.

Change-Id: If087841c15e6a87160eee874720c4a77eb0e99a6
2011-07-14 04:11:23 -07:00
Jeff Brown
11bf79d6e3 Replace Vector _grow/_shrink checks with assert.
On review of the code, _grow and _shrink are checking for conditions
that cannot happen and that don't even really make sense.  For
example, if _shrink is called with where + amount > mCount then
this is really bad, however the check only considered the case
when where >= mCount and then it would arbitrarily choose a new
value for where.  Huh?

As it happens, the callers are correctly validating the
arguments before passing them down to these methods so we can
get rid of this code.

Change-Id: I921852dba8997065bb0e9cac733e82028d14afcd
2011-07-14 04:11:22 -07:00
Jeff Brown
f7537bccb2 Provide more descriptive name for InputChannel ashmem.
Change-Id: I4307de9f717ac4810b1b91ee0c1a3899325acf71
2011-07-13 22:27:37 -07:00
Alex Sakhartchouk
1bfcceaca6 For the serialization context, no fifo initialization is necessary.
On shutdown it was attempting to free uninitialized memory.

Change-Id: I9141be5a51253f87f21594ae38f7e653f9e69c6c
2011-07-13 17:32:05 -07:00
Mike Lockwood
e67ebacd15 Merge "Remove some #ifdef HAVE_ANDROID_OS that were needed for the simulator build" 2011-07-13 16:46:50 -07:00
Mike Lockwood
c1b9bbb21c Remove some #ifdef HAVE_ANDROID_OS that were needed for the simulator build
Change-Id: I13d9f251f86c05ae5405f37adbf6b8e9660935ba
Signed-off-by: Mike Lockwood <lockwood@android.com>
2011-07-13 19:45:44 -04:00
Jason Sams
b328269531 Merge "Fix native crash when GL driver fails to initialize." 2011-07-13 16:43:27 -07:00
Jason Sams
fb06b7a551 Fix native crash when GL driver fails to initialize.
Change-Id: I85714de9029285027dc75fb3b62076be41a4c985
2011-07-13 16:09:42 -07:00
Kenny Root
f953dee175 Merge "Fix debugging for hwui caches" 2011-07-13 15:53:03 -07:00
Christopher Tate
9a79cda53b Merge "Compress the backup output stream" 2011-07-13 15:37:21 -07:00