401 Commits

Author SHA1 Message Date
Romain Guy
46685db957 Merge "Fix crash in existing applications Bug #5659476" into ics-mr1 2011-11-28 16:06:52 -08:00
Chet Haase
08837c246c Fix flashing wifi dialog after rotating back from landscape.
There was an error in some of the OpenGL layer logic such that we would
occasionally set up a layer for rendering and then not clean up when it was
done. This caused future OpenGL rendering to go into that layer instead of
to the buffers being displayed on the screen, resulting in artifacts including
flashes and displaying of stale content. This happened specifically when
using the wifi settings dialog with the InputMethod keyboard displayed,
but it was probably visible in other situations as well.

Issue #5628248: Flickering/flashing after entering password for WiFi

Change-Id: I38139f620b310f4309570fa7224552d2ee633999
2011-11-28 15:19:22 -08:00
Romain Guy
ff98fa5a84 Fix crash in existing applications
Bug #5659476

The FontRenderer was not cleaning up its temporary state, leading
to crashes when invoking renderDropShadow.

Change-Id: I43b24820dd5625af8c080bbe11b64de2f74164b2
2011-11-28 14:55:56 -08:00
Romain Guy
421458aad7 Draw in the correct FBO after invoking a GL functor
Bug #5650514

After invoking a GL functor, libhwui restores a few OpenGL states
including the current FBO. The renderer was however making the
wrong assumption that the FBO to restore to was the base layer
instead of the FBO associated with the current canvas state.

Change-Id: Ie565500832ebffd673f6a43b83422d6cc05470a0
2011-11-21 15:14:37 -08:00
Dave Burke
7077506f99 Revert "Discard framebuffer rendering queues when discarding layers"
This reverts commit da96f8ac2c1c35a54f3f36e6d776cb386a251d03.
2011-11-14 11:39:30 -08:00
Romain Guy
da96f8ac2c Discard framebuffer rendering queues when discarding layers
Bug #5581817

Change-Id: If612846ec5f7793710fc4df152791fb32c506551
2011-11-10 19:23:58 -08:00
Romain Guy
8ff6b9ebee Terminate EGL when an app goes in the background
This does not happen on high end gfx devices. This happens
only if only one EGL context is initialized in the current
process.

Change-Id: Ibd1737efdf84eef8a84108b05795440d1ae9964e
2011-11-10 16:44:49 -08:00
Romain Guy
eca0ca2424 Memory optimizations for libhwui
Bug #5566149

Lazily initialize font renderers
Keep 60% of the texture cache when an app goes to the background
Delete least used font renderer when going to the background
Delete all font renderers on full memory trim

Change-Id: I3c2454d46dc1107ec0f0f72a9ce69cbbcc8825e7
2011-11-04 16:23:47 -07:00
Romain Guy
5e7c469c7a Make sure 9patches are not filtered when not necessary
Bug #5383406

Change-Id: I061c8069a4d9f4eaf45671283710b564639eeb32
2011-10-20 20:33:07 -07:00
Romain Guy
a62f172215 Correctly dump DrawPatch operations in display lists
Change-Id: I8cd1c764ddc184ce45727913fa2a23a3d81b337e
2011-10-19 17:06:19 -07:00
Romain Guy
5cd5c3f7e4 Return early when we cannot allocate a hardware layer
Bug #5462308

Change-Id: I52dab809662f6f42a49ca03edc50f6b98fc35a06
2011-10-17 17:10:02 -07:00
Romain Guy
71e36aa7db Add missing public native API
Change-Id: Ie3bc706b2ac91d686a5b888e8ae841820e9d37c7
2011-10-12 14:11:32 -07:00
Romain Guy
7953745dd5 Reduce the size of libhwui by 50%
This change removes unnessary symbols. All symbols are hidden by
default, public APIs with exported symbols are explicitly marked
with ANDROID_API.

Change-Id: I692fde432a86c12108de1cfd1f6504919a7d5f3f
2011-10-12 13:48:51 -07:00
Romain Guy
a9dc86b21d Correctly apply transforms when getting a TextureView's bitmap
Bug #5439406

Change-Id: I271a9a2e38f5b3600dc158f8f442a6b0893f472b
2011-10-11 14:06:21 -07:00
Romain Guy
5a6d3a4c03 Stupid fixed point math.
Bug #5423215

Change-Id: I39379e1f8fb4d59de4ede6e4fe7cf7a2c7cc625a
2011-10-07 15:03:24 -07:00
Romain Guy
ed7a8fc768 Canvas.getClipBounds() was broken and unreliable with OpenGL ES 2.0
This bug was affecting several third party applications. The bug was
introduced by an optimization that prevented the local clip to be
recomputed when needed.

Change-Id: I7b5c464db21b5ff1a7274af75a3a64d0e9d84772
2011-10-04 19:21:27 -07:00
Romain Guy
59c7f80dd2 TextureView works best when it draws stuff.
Bug #5391188

Change-Id: I5e754881ccb08ff288ebd60de77282c9cbcf3f86
2011-09-29 17:21:45 -07:00
Mathias Agopian
83b186a246 fix the float Rect in OpenGLRenderer to handle NANs
- we want functions like isEmpty() to return true if NANs are
involved in the Rect

- also clean-up the intersect familly of calls

- minor cleanup in the int32_t Rect as well

These played a role in http://b/5331198.

Bug: 5331198

Change-Id: I5369725ab482e4b83da9f1bd4cee5256e5de75b2
2011-09-19 16:50:07 -07:00
Jeff Brown
13ede62fd7 Make LTE_FLOAT a strict weak order.
Bug: 5327776

Currently LTE_FLOAT isn't even a valid partial order, let alone
a strict weak order as needed by binary search.  Consequently,
KeyedVectors with keys whose types have operator< using LTE_FLOAT
sometimes find the wrong values!

This problem affects several graphics caches including the
TextLayoutCache.

(This is still not a total order because NaNs are not comparable
but hopefully we don't ever search for NaNs this way!)

Change-Id: Ic447a34c7d87f681ee81538f22a0937a039072dd
2011-09-16 12:00:05 -07:00
Romain Guy
2ffefd48e2 Add support for 3 new blend modes when blending with framebuffer:
Add
  Multiply
  Screen

Change-Id: I92a3c2612c86613087568bf0c03cc6f92b5ded44
2011-09-08 15:33:03 -07:00
Romain Guy
8a3957d43b Add reminder in the code to fix T-junctions
Change-Id: I52b112694f930e641f01fb78dc55412986023411
2011-09-07 17:55:15 -07:00
Romain Guy
799833a8b4 Text would disappear when the font size is 75px.
Bug #5230196

Yes, 75px. Any other font size would work. Don't ask.

Change-Id: I96c7db9926a97f65128d60c8238c3640ee2444ba
2011-08-30 14:41:48 -07:00
Romain Guy
04c9d8c2ff Optimize display lists
Remove redundant or useless operations

Change-Id: If989b4eaa9143eef4254c38b39959aeed1f2b9ab
2011-08-25 14:01:48 -07:00
Romain Guy
631582f7f7 Enable linear filter when scaling bitmaps
Bug #5205673

Change-Id: I8b0f90877df6b6c6757d35dcf6cd14e79e840b96
2011-08-24 11:51:35 -07:00
Romain Guy
6816972eb6 Don't use bilinear filtering on unscaled bitmaps
Bug #5198590

Change-Id: I4333d850501ac849eeeeb247e4178dd469b9de3d
2011-08-22 17:33:33 -07:00
Romain Guy
28d8ff6dbc Move constants to the correct header
Change-Id: Id4bd14f72487bd7156cd2e1930eaf97b47896273
2011-08-22 14:01:34 -07:00
Romain Guy
302a9df1d5 Add an API to set the transform on a TextureView's surface texture.
Bug #5156689

Change-Id: I635a625885c9b832a60d44ece0de7613ceb84109
2011-08-16 13:55:02 -07:00
Romain Guy
e5df231434 Make sure we correctly copy caches keys.
Bug #5136067

Change-Id: I366e840bef44415436dc7b13d89cfb610feed663
2011-08-12 14:23:53 -07:00
Romain Guy
9d865512f1 Remove unnecessary private API
Change-Id: I2ecb367528ec0691c07153a3d163b82a6ca33fdf
2011-08-11 17:37:02 -07:00
Romain Guy
4974bc1be6 Prevent crash when purging the gradients cache.
Bug #5133876

Change-Id: I3d1fa4e29498044796d725337ac93e6a1e8f0bcb
2011-08-08 10:55:55 -07:00
Romain Guy
bd496bc3d4 Paint style and stroke width affect text rendering.
Bug #5112207

Change-Id: Ic34037ace21a5058ba23dd15e51aae58c998454d
2011-08-02 17:32:41 -07:00
Romain Guy
6203f6c814 Reduce the amount of data cached by the gradients cache.
Change-Id: I8546f5a5ecf38031c9a40bdcc434d4c7f22da63d
2011-08-01 18:56:21 -07:00
Romain Guy
a60c388971 Use high precision iterators on specific GPUs
Bug #5098359

Change-Id: I52ee8c7b4c9e8d4c7bedb684eaf7bef6c44c74b9
2011-08-01 15:28:16 -07:00
Romain Guy
b50149825f Correctly apply linear filter to drawBitmap(Rect, Rect)
Change-Id: I1049282e1996b1020c92cb7bec46e9f28e94e967
2011-07-28 15:40:47 -07:00
Romain Guy
65b345fa22 Reclaim more memory, more often.
Yay.

Change-Id: I04557ad575c307a55088549f48f0e9ad994b7275
2011-07-27 18:51:50 -07:00
Romain Guy
6d7475d666 Destroy layers and flush layers cache when a window is destroyed.
Change-Id: I3fa1bc3ff50fb99e3d2e490925bd6b0a0f809fff
2011-07-27 16:29:39 -07:00
Romain Guy
eea60692b0 Improve layers debugging
Change-Id: Ia4950dd5f0e0a224ecb69c581d33aa4f32260a7c
2011-07-26 20:35:55 -07:00
Romain Guy
912a7b32d0 Make sure we have a current EGL context when invoking EGL
Bug #5081795

Change-Id: Iee3382d362a71c1e6c5c498b319bf7f7bcf5a2f0
2011-07-26 18:57:28 -07:00
Romain Guy
e3c26851dc Improve rendering performance on some GPUs
This change sets textures filtering to GL_NEAREST by default. GL_LINEAR
filtering is only used when textures are transformed with a scale or
a rotation. This helps save a couple of fps on some GPUs.

Change-Id: I1efaa452c2c79905f00238e54d886a37203a2ac1
2011-07-25 16:36:01 -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
Romain Guy
f2fc460a95 Reduce the fade area to save bandwidth.
Change-Id: I8ccea17fc1fb3c132329baa0acc1b3d5a140a5c6
2011-07-19 15:20:03 -07:00
Romain Guy
bdf7609867 Trim OpenGLRenderer's memory usage whenever possible
Change-Id: I9225077184f374b1a43300add15cc1d5b6869d1c
2011-07-18 15:00:43 -07:00
Kenny Root
042f7d64b5 Fix debugging for hwui caches
Debugging code attempted to delete a stack item.

Also, the flag fields weren't exactly clear, so rewrite it so it's
clear that kDebugMoreCaches is a combined flag.

Change-Id: If42b7f0f754919343301da5656aee5943cc9bd4a
2011-07-13 09:51:00 -07:00
Romain Guy
40c4b86b72 Align paths on pixel boundaries when rasterizing in bitmaps.
Bug #5003739

Change-Id: I3dfbf4eb92e2c870f33c96947a7d6439e3730965
2011-07-08 16:50:15 -07:00
Romain Guy
b2479153b7 Correctly position layers.
Change-Id: I1678b1c5bdab140b44e56556c50ab8329255f18a
2011-07-08 11:57:29 -07:00
Romain Guy
ec19b4a764 Use NEAREST filtering mode for TextureView.getBitmap().
Change-Id: I4649062bbdf18ebba7924bdf578f39ad8f6576ac
2011-07-07 21:27:14 -07:00
Romain Guy
9ace8f5e79 Use NEAREST filtering for layers whenever possible.
Change-Id: Id5bee1bd4a322cf93e8000b08e18f1e1b058648e
2011-07-07 20:50:11 -07:00
Romain Guy
9ff3cb57ee Fix parameter order evaluation issue.
This problem was affecting Android builds with gcc/x86.

Change-Id: Ibb7978413c89bd1ac09f0d1ea78f5cb4fe61f6ed
2011-06-28 14:02:11 -07:00
Romain Guy
4a5a71518a Don't set texture parameters on every frame.
Change-Id: Iec368405ad6a4ccfd569a0b3b4d681871a770396
2011-06-24 17:53:53 -07:00
Romain Guy
80429c4585 Properly tear down TextureView
Change-Id: Ic23cd9257889d0abe8cc3fc1d04a66d0505e383e
2011-06-24 17:20:32 -07:00