Commit Graph

254 Commits

Author SHA1 Message Date
Mathias Agopian
01e4483b29 fix [2793164] Spam 2x/second with TOT master in SurfaceFlinger
Make sure to not use GL_TEXTURE_EXTERNAL when it's not supported
by the GL. The error was harmless, but annoying.

Change-Id: I571a9a9b05d35da51420950a6a6e95629067efd0
2010-06-24 21:28:59 -07:00
Mathias Agopian
3f3a74a53a remove unused YUV formats
Change-Id: Id0ae28b1700cf771cdbe0ca27b139d32cab90b2a
2010-06-21 18:22:09 -07:00
Mathias Agopian
f955be995d fix [2785833] valgrind error in android::Layer::requestBuffer
fix uninitialized variable

Change-Id: I99e1b619ae8c88dd9d77b3abf4762f801019047e
2010-06-21 15:19:26 -07:00
Mathias Agopian
0a91775c4d Added support for the GL_TEXTURE_EXTERNAL target
This will allow us to support YUV surfaces.

Change-Id: I2d4da75f1006a5285bdc552695d4caeecccf2183
2010-06-15 17:31:17 -07:00
Mathias Agopian
579b3f88d0 allow re-targetting of surfaces
Surfaces can now be parcelized and sent to remote
processes. When a surface crosses a process
boundary, it looses its connection with the
current process and gets attached to the new one.

Change-Id: I39c7b055bcd3ea1162ef2718d3d4b866bf7c81c0
2010-06-08 20:10:02 -07:00
Mathias Agopian
53503a97a9 fix [2751143] Device crashes when in a text box for too long 2010-06-08 15:40:56 -07:00
Mathias Agopian
b7e930db17 split surface management from surface's buffers management
Change-Id: If3c5655d1231f8f0c49ba68f972b1b20c93b3f87
2010-06-04 18:57:41 -07:00
Mathias Agopian
96f0819f81 clean-up client management.
simplified things a lot, the biggest change is that the concept
of "ClientID" is now gone, instead we simply use references.

Change-Id: Icbc57f80865884aa5f35ad0d0a0db26f19f9f7ce
2010-06-04 18:57:40 -07:00
Mathias Agopian
49753266d2 fix a bug where fading in/out of opaque 32-bits windows wasn't working
opaque 32-bits windows are now allocated as RGBX_8888 buffers and
SurfaceFlinger always uses GL_MODULATE instead of trying to
optimize to GL_REPLACE when possible (makes no sense on
h/w accelerated GL).

we still have a small hack for devices that don't support
RGBX_8888 in their gralloc implementation where we revert to
RGBA_8888.
2010-06-01 15:57:44 -07:00
Mathias Agopian
7e27f05739 more clean-up in preparation of bigger changes
the most important change here is the renaming of
ISurfaceFlingerClient to ISurfaceComposerClient

Change-Id: I94e18b0417f50e06f21377446639c61f65f959b3
2010-05-28 17:19:16 -07:00
Mathias Agopian
010fccb063 minor clean-up GLclampx -> GLclampf 2010-05-26 22:26:12 -07:00
Mathias Agopian
dc7a80f07a clean-up dead-code 2010-05-26 22:19:19 -07:00
Mathias Agopian
a7f669256f Make sure to use filtering while in fixed-size mode 2010-05-26 22:10:04 -07:00
Mathias Agopian
631f358d34 fix [2712278] The preview buffer left some black borders in left and bottom edges
we were incorrectly flagging push_buffer surfaces as invalid

Change-Id: I4dfd4ffbbe8a71f7e23e835db8d71966416c29bb
2010-05-25 17:51:34 -07:00
Mathias Agopian
a138f89c5e added the notion of fixed-size buffers
the new native_window_set_buffers_geometry allows
to specify a size and format for all buffers to be
dequeued. the buffer will be scalled to the window's
size.

Change-Id: I2c378b85c88d29cdd827a5f319d5c704d79ba381
2010-05-24 18:26:01 -07:00
Mathias Agopian
bb641244d7 fix the threading issue for setBuffercount()
this change introduces R/W locks in the right places.
on the server-side, it guarantees that setBufferCount()
is synchronized with "retire" and "resize".
on the client-side, it guarantees that setBufferCount()
is synchronized with "dequeue", "lockbuffer" and "queue"
2010-05-20 18:00:42 -07:00
Mathias Agopian
0d4e00dd6a fix uninitialized variable in DisplayHardware
this fixes the issue where the display is all messed-up sometimes.

Change-Id: I20be91b5166bfff0c6d353a777351842c9df8e95
2010-05-14 18:33:30 -07:00
Mathias Agopian
b5b7f260da SharedBufferStack now can grow up to 16 buffers.
there is a new resize() api, which currently only allows growing.

Change-Id: Ia37b81b73be466d2491ffed7f3a23cd8e113c6fe
2010-05-12 17:28:20 -07:00
Mathias Agopian
d606de6bb6 Refactor some code in surfaceflinger in preparation of upcoming changes
the new TextureMagager class now handle texture creation and upload
as well as EGL image creation and binding to GraphicBuffers. This is
used indirectly by Layer and directly by LayerBuffer

the new BufferManager class handles the set of buffers used for a
Layer (Surface), it abstracts how many buffer there is as well as
the use of EGLimage vs. regular texture ops (glTexImage2D).

Change-Id: I2da1ddcf27758e6731400f6cc4e20bef35c0a39a
2010-05-12 17:26:22 -07:00
Mathias Agopian
89141f9492 remove the "memcpy" hack
this hack was used for gpus that don't support cached buffers
for s/w clients. currently we have no gpu with this issue.
this removes quite a bit of complexity.

Change-Id: I72564669f124f92805030e61983711f61c76b6d9
2010-05-12 15:44:26 -07:00
Mathias Agopian
0c7af77450 am 56aed6bd: am c69775d6: Merge "fix [2664345] Flash: Bad flicker at the end of a pinch zoom." into froyo
Merge commit '56aed6bde0c52658d2cb1207c0cfe8ba0a764c59' into kraken

* commit '56aed6bde0c52658d2cb1207c0cfe8ba0a764c59':
  fix [2664345] Flash: Bad flicker at the end of a pinch zoom.
2010-05-10 09:49:19 -07:00
Mathias Agopian
179169e88e fix [2664345] Flash: Bad flicker at the end of a pinch zoom.
the window manger puts SurfaceViews up before they have been
rendered into, because of that surfaceflinger doesn't have
anything ready to draw for that surface when an udpate occurs
and responds by filling the surface with black.
With this fix, we only fill those areas of the framebuffer
that would otherwise be undefined (no content at all).

in the Flash case, the "flash" window is not drawn at all
until it has some content, instead the underlaying browser
window is shown.

Change-Id: Ifb610f7f8c27b88edf83e09adc4803fc295c15a1
2010-05-06 20:21:45 -07:00
Mathias Agopian
1b5e1021b8 more surfaceflinger cleanups
get rid of the "fake rtti" code, and use polymorphism instead.
also simplify how we log SF's state (using polymorphism)

Change-Id: I2bae7c98de4dd207a3e2b00083fa3fde7c467922
2010-04-21 22:28:20 -07:00
Mathias Agopian
245e4d78c5 better fix for [2420565] Surface.lockCanvas() updates the dirty region too often
Change-Id: I83438b40effd21538f1c74396dc665254b9d5ab6
2010-04-21 22:25:35 -07:00
Mathias Agopian
11777e9a6e DO NOT MERGE fix [2557396] Adreno200: glDrawTexi() doesn't work with height <= 16
don't use glDrawTexi() anymore

Change-Id: If71334de39114b0edce7771366f8d8dc26f6911e
2010-04-20 21:55:40 -07:00
Mathias Agopian
78fd5010a8 clean-up surfaceflinger a bit
get rid of the glDrawTexi path and use floating points instead of fixed point maths

Change-Id: I3aa9ce2dc082f702160e605a16ba5fe987cdf087
2010-04-20 15:58:36 -07:00
Mathias Agopian
ddf1dd1353 am e7d5a2f9: am 45423465: Merge "fix [2594950] Flash: Zooming in on some content crashes the Nexus One and causes it to reboot (runtime restart)" into froyo
Merge commit 'e7d5a2f9ae47d8ea8face3f1e451314ed36f4026' into kraken

* commit 'e7d5a2f9ae47d8ea8face3f1e451314ed36f4026':
  fix [2594950] Flash: Zooming in on some content crashes the Nexus One and causes it to reboot (runtime restart)
2010-04-14 18:25:21 -07:00
Mathias Agopian
ca99fb8f65 fix [2594950] Flash: Zooming in on some content crashes the Nexus One and causes it to reboot (runtime restart)
We now limit the size of the surface to the maximum size supported by the GPU.
On Nexus One this will 2048 -- it could be different on other devices.
Surface creation fails if the limit is exceeded.

Change-Id: I9ecfc2e9c58c9e283782b61ebfc6b590f71df785
2010-04-14 16:43:44 -07:00
Mathias Agopian
8f10540cd5 Make pixels prettier.
Change-Id: If3b0774b70cbe943894c15ffa1da111ad887010f
2010-04-05 18:12:27 -07:00
Mathias Agopian
ab02873e8f fix [2511580] Window poop on screen - drop down list left some residual when it resized
Change-Id: Ib9a3622e7a568ba26717a93b5bfa4a191651f4d0
2010-03-16 17:54:27 -07:00
Mathias Agopian
d343e3d5e3 fix [2515291] Native crash and runtime restart while trying to preview captured picture on Sapphire
if a buffer couldn't be allocated because of an OOM, SF could, in some case dereference
a null pointer.

Change-Id: I5321248c38a21e56d5278b6aada2694e64451378
2010-03-15 18:15:20 -07:00
Mathias Agopian
d129659347 fix [2483456] Video orientation is wrong on Droid for some videos
Change-Id: I450191f1335f57bffc51aff3e27295395847dbc0
2010-03-11 12:55:39 -08:00
Mathias Agopian
948d69fca4 improve SF logging/debugging a little bit
Change-Id: I6a57f89c25defc293fd748cc1fbd710031c02ec2
2010-03-08 19:30:56 -08:00
Mathias Agopian
f23a5e052e Merge "fixes for [2474091] Saw Poor behaviour playing a video." 2010-03-08 15:35:44 -08:00
Mathias Agopian
fcfeb4b597 fixes for [2474091] Saw Poor behaviour playing a video.
- fix a bug when hacking video buffers into gralloc buffers
 where the buffer size was incorrect this was causing the
 "direct-form-texture" mode to fail

- also when the above fails, make sure to revert to the
 "mdp copy mode" before going to "slow mode"

- finally disable completely the "direct-from-texture" mode
 for now. It cannot work because the allocated buffers can't
 respect the GPU constraints (alignment and such). We'll
 have to find a solution for that.
2010-03-08 11:14:20 -08:00
Dima Zavin
4fe6ac33d1 surfaceflinger: remove un-cached buffers hack for Adreno
Change-Id: I5ae4e74bfa3e25b55be2cddf7b3c51368a140ab9
Signed-off-by: Dima Zavin <dima@android.com>
2010-03-02 16:44:46 -08:00
Mathias Agopian
064e1e672e fix [2425395] portrait UI briefly shows in landscape
the "freeze" timeout was not initialized properly which caused it
to kick-in immediately instead of after 5s
2010-03-01 18:36:14 -08:00
Mathias Agopian
285dbde2e0 Added a name to Surface created by SurfaceFlinger
Updated the window manager to use this new facility.
Surfaces name are now printed by "dumpsys".
2010-03-01 18:34:50 -08:00
Mathias Agopian
45853c9759 to help debugging [2461567] Home screen redraw messed up
log SF's idea of the front buffer in dumpsys.
2010-02-26 18:59:23 -08:00
Mathias Agopian
eda65400f5 remove a dependency of surfaceflinger on libskia
libskia was only used for a small part of SkTransform. We now implement
Transform is surfaceflinger directly.
2010-02-22 17:30:40 -08:00
Mathias Agopian
ca6fab2b53 Initialize layer position 2010-02-19 17:51:58 -08:00
Mathias Agopian
54ed4f6282 get rid off the YUV formats at the libui layer 2010-02-16 17:33:37 -08:00
Mathias Agopian
c9e4a12546 minor cleanup. 2010-02-12 18:50:28 -08:00
Mathias Agopian
9cce325fae split libsurfaceflinger_client and libcamera_client out of libui 2010-02-11 13:16:22 -08:00
Mathias Agopian
2b92d89e23 Add support for physically rotated displays
This feature is currently controled by a system property.
"ro.sf.hwrotation" can be set to either 90 or 270. It'll cause
SF to rotate the screen by 90 and 270 degres respectively.

That is, if the driver reports 800x480 for instance, and
ro.sf.hwrotation is set to 90, applications will "see" a
480x800 display and will run in portrait.

This is implemented by introducing an extra "display"
transformation in the GraphicPlane.
2010-02-08 15:49:35 -08:00
Mathias Agopian
a7e380396e Add support for direct EGLImageKHR use with pushbuffer API
We now always first try to use the EGLImageKHR directly before
making a copy with copybit. The copy may be needed when
EGLImage doesn't support the requested format, which is
currently the case with YUV.
2010-02-04 17:13:06 -08:00
Chih-Chung Chang
5994a330ac Add support for 180/270 degrees rotation. 2010-01-22 16:30:39 -08:00
Chih-Chung Chang
52e7200b6e Add an orientation parameter for overlay, so we can do camera preview in portrait mode. 2010-01-21 20:20:08 -08:00
Mathias Agopian
edfd97c0f2 fix [2324665] texture leak in surfaceflinger when using camera 2010-01-21 16:29:34 -08:00
Mathias Agopian
8c3b597aa7 fix a texture leak introduced recently.
create the texture name once and for all for a given BufferSource
and make sure to recreate it when we're forced to delete the texture.
2010-01-21 16:27:30 -08:00