Commit Graph

118 Commits

Author SHA1 Message Date
Mathias Agopian
96e108271b Merge "remove dead code and member variables." 2011-07-26 12:08:07 -07:00
Mathias Agopian
3fbce7c560 remove dead code and member variables.
also fix some comments and improve debugging logs.

Change-Id: I83e55309f306332b59e1ec46104c4a7fffbf3c97
2011-07-25 20:03:43 -07:00
Jamie Gennis
fa1e002cec Merge "SurfaceTexture: enable RGB external textures" 2011-07-25 11:46:51 -07:00
Ted Bonkenburg
8d14330bd7 Merge "Add support for creating a Surface from a a SurfaceTexture." 2011-07-25 10:24:30 -07:00
Ted Bonkenburg
bd050ab2af 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
2011-07-22 16:36:44 -07:00
Jamie Gennis
1f8e09f40d SurfaceTexture: enable RGB external textures
This change removes support for conditionally using the GL_TEXTURE_2D
target for SurfaceTexture textures with RGB buffers.  It also enables
and fixes the RGB-based SurfaceTexture tests.

Change-Id: I9a251a981cf66af6b048b2e4c3fe7231e4774f4d
2011-07-22 15:45:18 -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
c10d9d90b2 clean-up. get rid ofunused code and members in Surface[Control].cpp
Change-Id: Ia7790ae28af2c2ac99eae01c2c5044ace4a490a4
2011-07-20 16:53:13 -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
Mathias Agopian
2773004a83 fix a typo in ISurfaceTexture IPC code
Change-Id: Ied1d9ddb0d849b17219d0ea3d333ce12be849419
2011-07-14 20:20:58 -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
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
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
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
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
698c0873cf SF transactions are now O(1) wrt IPC instead of O(N).
Change-Id: I57669852cbf6aabae244ea86940a08a5a27ffc43
2011-06-29 15:05:41 -07:00
Jamie Gennis
dfcff4b4ef SurfaceTexture: add a CPU -> GL sync test.
This change adds a test to verify that proper synchronization is done
when using SurfaceTexture to use CPU generated images as OpenGL ES
textures in 'synchronous mode'.  Synchronous mode is particularly tricky
because SurfaceTexture will allow the buffer that's currently bound to
the GL texture to be dequeued.  We rely on Gralloc's lock function to
block until this buffer is no longer being used by the OpenGL ES.

Change-Id: I1c4e37f3e9d60ab9a0905a90a1f5060fda8e485c
2011-06-28 13:18:07 -07:00
Jamie Gennis
50c4efc2a4 SurfaceTexture: consume buffers after err checks
This change moves the point at which queued buffers get consumed to
after any error checks that could cause updateTexImage to fail.  This
way, if updateTexImage returns an error the buffer remains queued.
2011-06-27 15:45:40 -07:00
Jamie Gennis
3d8063b02e SurfaceTexture: change onFrameAvailable behavior
This change alters the conditions under which the onFrameAvailable
callback gets called by the C++ SurfaceTexture class.  The new behavior
is to call the callback whenever a frame gets queued that will be
visible to the buffer consumer.  This means that buffers queued in
synchronous mode always trigger the callback, as those buffers will
remain pending until they are consumed.  Buffers queued in asynchronous
mode will only trigger the callback if there was not previously an
unconsumed buffer pending.

The new behavior means that a consumer should perform a draw operation
exactly once for every onFrameAvailable call that it recieves.  This
change also modifies SurfaceFlinger and the SurfaceTexture JNI to
support of the new behavior.

Change-Id: I8b2c6e00961d3d58b11c6af50b555b6e4c5f5b40
2011-06-27 15:45:39 -07:00
Grace Kloba
14a0e58074 Add allowSynchronousMode to SurfaceTexture constructor.
Change-Id: I54f30a3c16bbe6b813f3bcd1d389da5627531304
2011-06-23 21:21:47 -07:00
tedbo
1e7fa9e945 Add method to create a ParcelSurfaceTexture from android.view.Surface.
Change-Id: I05e343ab7e327478f60322af9373574b70c148f5
2011-06-22 16:18:09 -07:00
Jamie Gennis
c8c5152b19 SurfaceTexture: make tests use a large framebuffer.
This change makes the SurfaceTexture GL tests use a large (512x512)
framebuffer.  The tests now use glViewport to render to a region of the
framebuffer with a size matching that of the texture being drawn.  The
Npot test pixel checks must be changed because now the rendered region
is the same size as the texture.

Change-Id: Icc41803189c25e33ba1da7d2470720f0a11f3e4b
2011-06-20 15:42:57 -07:00
Jamie Gennis
b36bb97ae3 Merge "SurfaceTexture: fix a NULL ptr dereference." 2011-06-20 15:34:00 -07:00
Jamie Gennis
1c4414091c SurfaceTexture: fix a NULL ptr dereference.
This change adds a NULL check when searching the slot list in
SurfaceTextureClient for the slot corresponding to a buffer being
queued or canceled.

Bug: 4645023
Change-Id: I806cbc1e34da118ea33a83c4f25ce8193ba1c3ad
2011-06-20 14:16:49 -07:00
Jamie Gennis
07ed1a94bc SurfaceTexture: enable a test that now passes.
This change enables the QueryFormatAfterSettingWorks.

Change-Id: Ic868011a36a6c86c8646880246cd5b6960a13364
2011-06-15 12:44:01 -07:00
Jamie Gennis
d05bb2ed4c SurfaceTexture: enable a test that is now passing.
This change enables the TexturingFromCpuFilledYV12BufferPow2 test.

Change-Id: Ib356ee3d2f8979f34f849fd4090f598295e2e92e
2011-06-15 12:44:01 -07:00
Jamie Gennis
5dd0c4fd7e SurfaceTexture: increase the test's Surface layer.
This change increases the Surface layer used for displaying the test
results so that the tests will be visible over other windows in the
system.

Change-Id: I47f147f8743ff2a39d57d551811668371202bd31
2011-06-14 13:45:53 -07:00
Jamie Gennis
1876d13e45 SurfaceTexture: add some RGBA_8888 tests.
Change-Id: Id09915c98a00eca1209b7dab32039a06d260908e
2011-06-14 13:45:53 -07:00
Jamie Gennis
8b69defa2f SurfaceTextureClient: minor test refactoring.
Change-Id: Iabc6d27ca35d30d896c6aef65c4f1b5a1eed47b8
2011-06-14 13:45:52 -07:00
Jamie Gennis
135abde4c2 Merge "SurfaceTexture: add a format querying test." 2011-06-14 13:39:05 -07:00
Mathias Agopian
80728d87c9 Merge changes I9b8e1962,I7bb843ca
* changes:
  Temporarily don't return the current buffer in synchronous mode
  unify SurfaceTexture and Surface
2011-06-13 17:20:53 -07:00
Mathias Agopian
e122079be6 Temporarily don't return the current buffer in synchronous mode
activate synchronous mode by default.
2011-06-13 15:51:35 -07:00