Commit Graph

1484 Commits

Author SHA1 Message Date
Kenny Root
49a65e5526 Move extract native libraries to JNI code
The built-in ZipFile class was quite a long time to find an unpack
libraries. Move everything to using the libutils ZipFileRO class that
goes quite a bit faster. Initial measurements are 6 times faster than
the Java code.

Also, read files off the disk and compare their CRC against the APK's
CRC to see if we need to write the new file to disk. This also cuts down
the bootup time by up to a second per APK that has native files.

Change-Id: Ic464a7969a17368fb6a6b81d026888c4136c7603
2011-07-26 10:14:58 -07:00
Jamie Gennis
7b305fffc3 SurfaceTexture: add the abandon method.
This change adds the 'abandon' method to the SurfaceTexture C++ class.
This method may be used to put the SurfaceTexture in an abandoned state,
causing all ISurfaceTexture methods to fail.

Change-Id: Ibd261f7b73f44e2bec36a8508bf92113cfb7cf95
2011-07-22 14:20:41 -07:00
Jamie Gennis
6e50219aee 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
1259e9d6ac Merge changes I799532f7,I5cffa6eb
* changes:
  SurfaceTexture: fix a comment
  SurfaceTexture: remove getAllocator
2011-07-22 13:34:57 -07:00
Mathias Agopian
bb66c9b5a9 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
976f494d53 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
Mathias Agopian
aa5e671921 Merge "clean-up. get rid ofunused code and members in Surface[Control].cpp" 2011-07-20 18:52:51 -07:00
Mathias Agopian
c10d9d90b2 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
585ef1e14a 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
Mathias Agopian
97c602c5af 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
Mathias Agopian
933389f758 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
7734ebfe47 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
Jamie Gennis
a2f3b90d98 Merge "SurfaceTexture: add a multi-SurfaceTexture test" 2011-07-18 15:00:54 -07:00
Mathias Agopian
8f9dbf9e13 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
Jamie Gennis
0b7c4953a1 Merge "SurfaceTexture: fix SurfaceTextureGLToGLTest" 2011-07-15 12:35:34 -07:00
Jeff Brown
ce071667d0 Merge "Add a call to pthread_attr_destroy to avoid potential memory leaks." 2011-07-14 22:31:27 -07:00
Mathias Agopian
2773004a83 fix a typo in ISurfaceTexture IPC code
Change-Id: Ied1d9ddb0d849b17219d0ea3d333ce12be849419
2011-07-14 20:20:58 -07:00
Le-Chun Wu
3919950de8 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
677517ae3f 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
fe0a87b546 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
2640bfd168 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
3e646d62e5 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
c105333997 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
686f62fcaf 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
8a1d693e59 Provide more descriptive name for InputChannel ashmem.
Change-Id: I4307de9f717ac4810b1b91ee0c1a3899325acf71
2011-07-13 22:27:37 -07:00
Mike Lockwood
c2be743a9c 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
Christopher Tate
a100c02b8d Compress the backup output stream
Zlib compression, with a full flush between each application's
data.  Encryption will be performed on the already-compressed data
once that's implemented.

On restore, the streamed data is similarly uncompressed on the fly.

Change-Id: I19b65c88e759a66527d10913d18fffa9df0bc011
2011-07-13 15:30:41 -07:00
Jeff Brown
7175398247 Merge "Remove the simulator target from all makefiles. Bug: 5010576" 2011-07-12 12:15:07 -07:00
Jeff Brown
baa44b89ec Remove the simulator target from all makefiles.
Bug: 5010576

Change-Id: I04d722f258951a3078fe07899f5bbe8aac02a8e8
2011-07-11 22:12:16 -07:00
Jamie Gennis
c8251a06df SurfaceTexture: add a multi-SurfaceTexture test
This change adds a test that does simple, unverified GL rendering to
multiple SurfaceTextures.

Change-Id: I51a41d68ae5a27e01ae93842242897b0d3558ca6
2011-07-11 19:06:39 -07:00
Mathias Agopian
cb8be17537 Merge "Fix typo in an assert's log" 2011-07-11 18:30:29 -07:00
Mathias Agopian
f6f177f2e2 Fix typo in an assert's log
Change-Id: I94883a23a0a92eaf3e4976f942f747a2137499ac
2011-07-11 16:26:18 -07:00
Jamie Gennis
0d0c5a6d6b Merge "EGL: fix the ANativeWindow size/fmt override" 2011-07-11 15:47:20 -07:00
Jamie Gennis
bee205fd58 EGL: fix the ANativeWindow size/fmt override
This change fixes how the Android EGL layer overrides the size and
format of an ANativeWindow in eglCreateWindowSurface.  The new behavior
is to leave the size untouched when overriding the format.  The previous
behavior was to reset the ANativeWindow to use the default size set by
the ANativeWindow implementation.

It also adds two new 'perform' methods to the ANativeWindow interface:
set_buffers_dimensions and set_buffers_format, and redefines the
behavior of set_buffers_geometry to be the combination of these two new
methods.

Additionally, this change adds an error check for the return value of
the new native_window_set_buffers_format call, which required adding a
(stub) handler for to FramebufferNativeWindow.

Change-Id: I805c7ccd8d4730dfb132d10d8bc3fb058a0b9df1
2011-07-11 12:31:45 -07:00
Jeff Brown
e16986cae2 Eliminate single-process mode.
Bug: 5010576

Change-Id: Id450dc83efed4897d1e4ff451530fed14457aace
2011-07-08 19:54:07 -07:00
Mathias Agopian
6163091a2c Fix EGLUtils::selectConfigForPixelFormat()
- renderscript now calls EGL directly instead of relying on this function
- surfaceflinger also does its own EGLConfig selection
- selectConfigForPixelFormat stays for legacy reason (many tests use it) but
it now only tries to match the alpha channel of the format rather than the
format itself.

this will allow implementations who don't support the exact formats
defined in the HAL to work properly.

Bug: 4998223

Change-Id: Ic664dfc14d5072a514b6f77a115d1521bfc1578f
2011-07-08 14:37:05 -07:00
Jamie Gennis
798ff739a1 Merge "SurfaceTexture: enable newly passing tests." 2011-07-07 14:42:12 -07:00
Jamie Gennis
47dd726460 SurfaceTexture: enable newly passing tests.
This change enables the following four SurfaceTextures tests:
  UpdateTexImageBeforeFrameFinishedWorks
  UpdateTexImageAfterFrameFinishedWorks
  RepeatedUpdateTexImageBeforeFrameFinishedWorks
  RepeatedUpdateTexImageAfterFrameFinishedWorks

Change-Id: I7632630bc97873e50d4a765ffc44a86f16ae62f1
2011-07-06 14:47:47 -07:00
Glenn Kasten
be3c018f8b Merge "Add Thread::join" 2011-07-06 11:37:53 -07:00
Mathias Agopian
429526c326 Merge "fix ScreenshotsOfProtectedBuffersFail" 2011-07-06 11:10:06 -07:00
Mathias Agopian
7946e416b6 Merge "return an error code with gralloc buffer allocation failures" 2011-07-06 11:09:55 -07:00
Glenn Kasten
f44c896b09 Merge "Thread ID zero for androidSetThreadSchedulingGroup" 2011-07-05 15:08:31 -07:00
Mathias Agopian
9303eee7dc fix ScreenshotsOfProtectedBuffersFail
- put the test window at the front most screen position
- use RGBA_8888 which is a mandatory format
- handle devices that don't support the protected usage flags

Bug: 4950464

Change-Id: I0005fb667cfe094e5978816e2924b294c5ef817e
2011-07-01 15:41:32 -07:00
Mathias Agopian
d9e8c64c3d return an error code with gralloc buffer allocation failures
Change-Id: I471e5d37ea7a42fc8a0f93446ee3b4229da37807
2011-07-01 14:53:49 -07:00
Pannag Sanketi
19e0a8bfe9 Merge "Minor fix in SurfaceTexture" 2011-06-30 18:38:18 -07:00
Pannag Sanketi
292a31a4c2 Minor fix in SurfaceTexture
Change-Id: Ic859715becf3e6d5107bd8beb8c577034d00ec52
2011-06-30 15:41:19 -07:00
Mathias Agopian
e6786c92d7 Merge "SF transactions are now O(1) wrt IPC instead of O(N)." 2011-06-29 16:15:56 -07:00
Mathias Agopian
698c0873cf SF transactions are now O(1) wrt IPC instead of O(N).
Change-Id: I57669852cbf6aabae244ea86940a08a5a27ffc43
2011-06-29 15:05:41 -07:00
Jason Simmons
acfc4829e4 Merge "Add a linear transform library to libutils" 2011-06-29 13:48:39 -07:00
Jeff Brown
771e5828e8 Merge "Improve input event consistency invariants." 2011-06-28 20:17:59 -07:00