289 Commits

Author SHA1 Message Date
Romain Guy
f7098ce95d am d00353fe: am bc8a8e8c: Merge "Add support for partial invalidates in WebView Bug #3461349" into honeycomb-mr1
* commit 'd00353fe3191571a6773ef2d11921cfcff260bc4':
  Add support for partial invalidates in WebView Bug #3461349
2011-03-07 22:45:52 -08:00
Romain Guy
cabfcc1364 Add support for partial invalidates in WebView
Bug #3461349

This change also fixes two bugs that prevented partial invalidates
from working with other views. Both bugs were in our EGL implementation:
they were preventing the caller from comparing the current context/surface
with another context/surface. This was causing HardwareRenderer to always
redraw the entire screen.

Change-Id: I33e096b304d4a0b7e6c8f92930f71d2ece9bebf5
2011-03-07 18:09:03 -08:00
Fabrice Di Meglio
1eb1293732 Merge "Add TextLayout Cache" 2011-03-03 12:21:15 -08:00
Romain Guy
058f47e845 Merge "We need to go deeper. Bug #3431907" 2011-03-02 15:48:33 -08:00
Romain Guy
84962f2fe6 We need to go deeper.
Bug #3431907

When drawing layers inside a layer, the wrong target FBO would be used.
This would happen for instance with app widgets using a ViewFlipper
in Launcher. The ViewFlipper uses a fade animation that triggers a
call to saveLayerAlpha(), which in turns creates an FBO. If this happened
during a scroll, the ViewFlipper's FBO would be composited back directly
inside FBO 0, i.e. the screen. This properly initializes the snapshots
of hardware layers to use the layer's FBO as the default compositing
target instead of using 0.

This problem did not happen when drawing hardware layers inside
hardware layers because LayerRenderer already takes care of figuring
out the FBO it needs to composite into. The bug would occur only
with layers generated with saveLayer() and its saveLayerAlpha()
variation.

Layers inside hardware layers insider layers inside hardware layers
now work properly.

Change-Id: Ibe852301087f3d414ad8a18436eebc81f8ac66f5
2011-03-02 15:43:44 -08:00
Romain Guy
40a787f89a Properly initialize FBO textures for linear filtering.
Change-Id: I67fc4fd760483ef85809be8d6e608cf4f469650f
2011-03-02 15:15:42 -08:00
Romain Guy
a91320e364 Merge "Properly initialize FBO textures for linear filtering." 2011-03-02 15:14:52 -08:00
Romain Guy
4677c5118c Merge "Fix problem with glyph cache and textScaleX property" 2011-03-02 14:04:47 -08:00
Chet Haase
8668f8a633 Fix problem with glyph cache and textScaleX property
Glyphs drawn with paints that had different textScaleX values were not
being recognized as different, so the glyph cache was being used regardless
of different scaleX values. This change adds the scaleX attribute to the native
Font object to allow the cache to distinguish between this difference and cache
accordingly.

Change-Id: I5d8fc26d47460b27dc8e373a473d46b2f1b8dc30
2011-03-02 14:02:19 -08:00
Fabrice Di Meglio
d313c665e6 Add TextLayout Cache
- use GenerationCache for caching
- move GenerationCache.h from libs/hwui/utils to include/utils
- add #define for cache activation / deactivation

Change-Id: Ifaf519f0b5e33b087a453e4aa6430162d8438f20
2011-03-02 13:29:20 -08:00
Romain Guy
d643bb56fd Correctly mark layers dirty when drawing WebView.
Change-Id: I7ae0c3cfa0916d8fbeaf01e8da127c621a06a0f4
2011-03-01 14:55:21 -08:00
Romain Guy
321dce646d Avoid UTF-8 conversions and string copies whenever possible.
Change-Id: Ie4584417bbb7247e6c567fbfdb819529e548bb8f
2011-03-01 11:45:33 -08:00
David Li
4368c449d7 Merge "Fix mTexCoordsSlot > 0 check to mTexCoordsSlot >= 0" 2011-02-25 12:59:14 -08:00
David Li
cf28957c89 Fix mTexCoordsSlot > 0 check to mTexCoordsSlot >= 0
0 Is a valid attribute location.

Change-Id: Ib24335f48efd6cc59e2ab877569d7d0c95f8490a
Signed-off-by: David Li <davidxli@google.com>
2011-02-25 12:05:44 -08:00
Romain Guy
7b8b758924 Remove the right entries from the cache when a GC happens.
Change-Id: I4649b18c4721a5511a404299e771e675c843407b
2011-02-24 19:52:37 -08:00
Romain Guy
b37cbec6d0 Correctly blend translucent GIF bitmaps.
Change-Id: Ifeb2c1d97a4c6dfeb1a7b5b26f1a3153e9f8da7f
2011-02-24 17:21:29 -08:00
Derek Sollenberger
6062c5912d Skia Merge (revision 808)
This is a companion CL to the one found in /external/skia

Change-Id: If81748545435cab20a5d8479329ab333cb973e16
2011-02-22 16:07:36 -05:00
Alex Sakhartchouk
894df17eee Fixing font renderer attribute slot locations.
Change-Id: I6377bb641df7d8372d873c00790189f9a190afd6
2011-02-17 16:45:37 -08:00
Romain Guy
b18d2d0079 Dirty layers in the area covered by a drawBitmapMesh() call
Bug #3410827

Change-Id: Ic8b4f6201af94497bba86c75819588c78debddc2
2011-02-10 15:52:54 -08:00
Mike Cleron
851beae717 Merge "Properly handle dirty rectangles generated from 9-patches Bug #3409580" into honeycomb 2011-02-04 15:29:42 -08:00
Romain Guy
c78b5d50f9 Properly handle dirty rectangles generated from 9-patches
Bug #3409580

This bug affects anything that draws a 9patch inside a layer, this includes
launcher's workspace, all of the fade animations, etc.

Change-Id: Icbe8ecd158e3d5f44d07516462de68c5d1fb0a8f
2011-02-04 14:00:42 -08:00
Chet Haase
5a7e828842 Fix crash when Paths are GCd in hw accelerated apps
A recent change to optimize path rendering didn't account for
the destruction of native objects by the VM finalizer. We may be
done with the Java level version before we're done with the native
structure that's used by the display list. For example, a drawing
method on a View that creates a temporary path to render into the
canvas will implicitly create a native structure that is put onto
the GL display list. That temporary path may go away, but the native
version should stick around as long as the display list does.

The fix is to refcount the original native version of the path
and only delete it when the refcoutn reaches zero (which means that
it is no longer needed by any display list). This is a similar mechanism
used for bitmaps and shaders.

Change-Id: I4de1047415066d425d1c689aa60827f97729b470
2011-02-04 12:50:55 -08:00
Romain Guy
f28daffda5 Empty the clip rect when intersection is empty.
Bug #3410035

Change-Id: I5ceb80514d3b20c9ad230478549ad31ced403d53
2011-02-04 00:59:34 -08:00
Chet Haase
d63cbd1076 Fix leak in reused display lists
Change-Id: I32a9c41abf8f8cbcaaaa6fcc82d296800014a1b2
2011-02-03 16:33:26 -08:00
Romain Guy
2fc941e465 Fixes cache misses and extra allocations.
Bug #3421454

Change-Id: If4d5c960a7e4c581a9d213073e658284b4e1c497
2011-02-03 16:20:08 -08:00
Romain Guy
09b7c91de7 Allocate layers from the layers pool.
Bug #3413433

This change will be beneficial to Launcher to avoid hiccups when
swiping pages of icons. When a layer is discarded, it is kept
in the layers pool instead of being destroyed right away. This
favors memory reuse over allocations.

Change-Id: Ifb6944ba83d6ceb67c331527c0827b26ce648eb1
2011-02-02 20:28:09 -08:00
Romain Guy
62687ec12c Don't clobber the local dirty rect after rendering a layer.
Bug #3417254
Bug #3413433

Change-Id: I8045e9ec414ebe4ce4d38124142a00726d2c634d
2011-02-02 15:44:19 -08:00
Romain Guy
beff8d83ef Fix incorrect dirty rectangle transformation in hardware layers.
Bug #3413433

Change-Id: Iba201c7c4b4f11937797f3afcbf20c5a7395be25
2011-02-01 23:53:34 -08:00
Romain Guy
3a3133d876 Update layers based on the dirty region.
Bug #3413433

This helps Launcher when a widget updates during a scroll, or when interacting
with widgets on the workspace if layers are still turned on.

Change-Id: Ic7a42eb34f74f4ae988039754f815e2efd1d1e4f
2011-02-01 23:01:43 -08:00
Romain Guy
885153e2d0 Add more debug info for profiling.
Change-Id: I0c74e2aa108142cc6ddac4577ae2d0fe6c0ddb25
2011-01-27 18:34:41 -08:00
Chet Haase
a45c056e62 Merge "Fix display List bugs" into honeycomb 2011-01-26 23:49:23 -08:00
Chet Haase
678e0adbdb Fix display List bugs
Various property setters in View need to invalidate the parent's
cache to get redrawn properly when accelerated with display lists.

Also, fix logic around display lists and old-style Animations in
ViewGroup.

Change-Id: I70e1c2fa49e62228ee4a1301a006ce50bda4c305
2011-01-26 22:44:52 -08:00
Romain Guy
4f09f5417b Don't draw the same triangles several times.
Bug #3388197

Change-Id: Ief1dfd9447f144e9992340a173d2893e5e049129
2011-01-26 22:45:16 -08:00
Romain Guy
2b1847ea60 Remove unused API
Change-Id: I1714fd82a64b752f0350ef4ef9179ce19e089c6a
2011-01-26 13:43:01 -08:00
Romain Guy
f90f8171e6 Make sure the opaque bitmap is opaque. GL doesn't like being lied to.
Bug #3382992

The result still looks wrong but it works as designed, unfortunately.

Change-Id: I6108e199fa336cb01faaabf6c75faa3b71c2339b
2011-01-25 22:53:24 -08:00
Romain Guy
8d2959ddff Remove debugging log left by mistake.
Change-Id: I7d5165b4b682714940cea9886abeedd3f4858057
2011-01-25 11:03:00 -08:00
Romain Guy
82d41a5153 Fix display list support for shapes.
Change-Id: I8b4c9e9ec36266a83c0a53ba3fb6e45d61bbd6d9
2011-01-24 21:53:42 -08:00
Romain Guy
8168396d1a Fix rendering issues with animated layers.
Bug #3385247

- The layer's alpha was interpreted in the wrong range 0..255 instead of 0..1
- 9-patches would not correctly dirty the layer region, the generated mesh
  was incorrect

Change-Id: I4916249bedcdb0794929f3796bd17854971efc88
2011-01-24 20:40:18 -08:00
Romain Guy
7d7b5490a0 Enable partial invalidates when rendering with OpenGL.
Change-Id: Ie8be06c4776b815e8737753eb8003b4fd8936130
2011-01-24 18:39:56 -08:00
Chet Haase
daf98e941e Use optimized display lists for all hwaccelerated rendering
Previously, display lists were used only if hardware acceleration
was enabled for an application (hardwareAccelerated=true) *and* if
setDrawingCacheEnabled(true) was called. This change makes the framework
use display lists for all views in an application if hardware acceleration
is enabled.

In addition, display list renderering has been optimized so that
any view's recreation of its own display list (which is necessary whenever
the visuals of that view change) will not cause any other display list
in its parent hierarchy to change. Instead, when there are any visual
changes in the hierarchy, only those views which need to have new
display list content will recreate their display lists.

This optimization works by caching display list references in each
parent display list (so the container of some child will refer to its
child's display list by a reference to the child's display list). Then when
a view needs to recreate its display list, it will do so inside the same
display list object. This will cause the content to get refreshed, but not
the reference to that content. Then when the view hierarchy is redrawn,
it will automatically pick up the new content from the old reference.

This optimization will not necessarily improve performance when applications
need to update the entire view hierarchy or redraw the entire screen, but it does
show significant improvements when redrawing only a portion of the screen,
especially when the regions that are not refreshed are complex and time-
consuming to redraw.

Change-Id: I68d21cac6a224a05703070ec85253220cb001eb4
2011-01-24 08:43:20 -08:00
Romain Guy
a566b7c3aa Fix bitmap meshes to work in display lists.
Change-Id: Ie226d049840942d9ad9cf58e0c19132f49d62a75
2011-01-23 16:36:11 -08:00
Romain Guy
8b2f5267f1 Add support for arcs.
Change-Id: I96c057ff4eb1b464b03f132da0b85333777bee4f
2011-01-23 16:15:02 -08:00
Romain Guy
c1cd9ba335 Add support for ovals and stroked rectangles.
Change-Id: I1292e241386763c82e6622c8f7ed90b0f5b7bd4f
2011-01-23 14:18:41 -08:00
Romain Guy
f6834478b3 Always render text underline extra.
Bug #3381287

Change-Id: Ibfbc9c51c8dccef216daccc37d835e5dbf143a6a
2011-01-23 13:32:12 -08:00
Romain Guy
27454a42de Collapse sucessive calls to restoreToCount() in display lists.
Change-Id: Icb3d3dc2c579436d375269a9cb0b821a931c5a79
2011-01-23 12:01:41 -08:00
Romain Guy
4cf6e2f349 Fix potential crash in display lists.
Change-Id: I868821cbe69f7e71d93701b9cdb528a2ef796cd4
2011-01-23 11:35:13 -08:00
Romain Guy
c88e357d1e Fix regression with hardware layers.
The renderer was checking whether the layer's region is a rect to
draw it with a simple quad. This test was done against the layer's
region structure, which was cleared after generating the mesh.
Unfortunately Region::isRect() returns true when the region is
empty, which was causing the renderer to always use a quad to
draw a mesh on screen.

Change-Id: If4b874579ee0cedcb67367c9efa5c0c98ca55231
2011-01-22 00:35:23 -08:00
Romain Guy
c9855a53ed Log only 1 line per process when using OpenGLRenderer.
Change-Id: Idbdd6b84f31301e58ed53e0d50fd61fece192dfa
2011-01-21 21:14:15 -08:00
Romain Guy
5a7b466a2b Add support for drawBitmapMesh().
Change-Id: Ic77f9c534bb90dc7b9458299544bd50b8b6ae6a5
2011-01-20 19:09:30 -08:00
Romain Guy
ff26a0c1c9 Remove unnecessary code.
Change-Id: I83eba3406c26a4028af08b4d4c95ecd02803e75a
2011-01-20 11:39:09 -08:00