Romain Guy
7444da5126
Yet another fix for 9patch rendering.
...
Bug #3362133
Change-Id: Ia6521d31a8c208a2ad2506a23b6a01e5e442ad86
2011-01-17 10:53:44 -08:00
Romain Guy
fb13abd800
Fix 9patch rendering in ExpandableListView.
...
Change-Id: I60843d61a40b0cb7dd09923cb4489a5a76f20486
2011-01-16 15:16:38 -08:00
Romain Guy
f219da5e32
Don't blend transparent pixels when rendering layers.
...
With this change, the rendere keeps track of what regions are rendered into
and generates a mesh that matches these regions exactly. The mesh is used
to composite the layer on screen.
Change-Id: I1f342576b9134fb29caff7fb8f4c1da179fe956d
2011-01-16 12:54:25 -08:00
Romain Guy
1bd1bad0b4
Preapre region tracking in layers
...
Change-Id: Ied1fa0d36c99ef4e33cb8fde7e3106a793db3a4c
2011-01-14 20:07:20 -08:00
Romain Guy
43ccf4663c
Don't crash Launcher on config change.
...
Change-Id: Ibbbd7146c5ff69e9639b433f39041053654d808c
2011-01-14 18:51:01 -08:00
Romain Guy
1f1fcb70b6
Don't delete objects twice...
...
Change-Id: Ibc67aed098c9300cf45eb46abda1938c418808c3
2011-01-14 15:37:54 -08:00
Romain Guy
24c0021668
Copy shaders when recording them in display lists.
...
Change-Id: I3f22dd35f1e31c9e5102955d76548098b7b0cd8d
2011-01-14 15:31:00 -08:00
Romain Guy
f5106847fc
Don't add clipped rects to layer regions.
...
Bug #3350208
Change-Id: I9266862f1d4d57b4598852e8dfa202b5f5099cce
2011-01-14 11:27:12 -08:00
Romain Guy
1e3a431d07
Remove debug code
...
Change-Id: Idbc54d16adb4d86185d7196ea0297b5019d14ae4
2011-01-13 17:47:15 -08:00
Romain Guy
ffac7fc504
Add debug logs for display lists.
...
Change-Id: I7bae8fd96e9eccb51f29f73e4069b4d3e6bdbdd7
2011-01-13 17:22:58 -08:00
Romain Guy
ada830f639
Cleanup implementation of hardware layers.
...
The new implementation relies on OpenGLRenderer's existing layer
code instead of duplicating it. The new code is much cleaner, with
simpler and better APIs and allows tracking of drawn regions inside
layers. Region tracking is not yet enabled but this will be done
in a future CL.
Change-Id: Ie826121a2227de8252c77b992a61218defea5143
2011-01-13 12:13:20 -08:00
Romain Guy
c038ea358a
Reenable region composition pipeline for layers
...
Bug #3341848
It works this time!
Change-Id: I0d371d8b2c75c67d4ce5009ddb990fe5e55a0a27
2011-01-12 15:08:47 -08:00
Romain Guy
1fc883b271
Add logging to the new layers API.
...
Change-Id: I78b9426eb17de3e775aca9fafe4a50bd9c0785c4
2011-01-12 14:31:55 -08:00
Romain Guy
57066eb64c
Cleanup GL objects on the correct thread.
...
Change-Id: Iddfea6e08a6591a4fab147151098ef27005f373d
2011-01-12 12:53:32 -08:00
Romain Guy
35f24545e5
Disable the region compositing pipeline for layers.
...
This composition mode is affecting Gmail in a bad way. Disabling until
I can figure out the problem.
Change-Id: I00e657ea2d05fc7b4a606242d19dc84dd88c1e35
2011-01-11 18:01:25 -08:00
Romain Guy
a9d0711392
Don't break the build!
...
Change-Id: I42f68c7b023c03adeedc4e979e5f4705188ee9f4
2011-01-11 17:59:10 -08:00
Romain Guy
6c319ca127
Better backend for hardware layers.
...
With this new backend, a hardware layer is only recreated when
its associated view is udpated. This offers fast composition
in GL and fast update of the layer in GL as well.
Change-Id: I97c43a612f5955c6bf1c192c8ca4af10fdf1d076
2011-01-11 17:53:19 -08:00
Romain Guy
32228288a9
Solve translucency issue when drawing paths.
...
Change-Id: I68ae0e2ccddaca2f76b5b2dd3e3cf1277fddaad6
2011-01-11 15:02:21 -08:00
Romain Guy
7230a74e9a
Composite layers as regions.
...
This change detects what area of a layer was drawn into and generates a mesh
to match this area exactly. This can be used to avoid blending empty pixels
when the layer is composited.
This change also adds proper layers support to lines rendering and implements
layers composition in a more readable way.
Change-Id: I4a5588b98b19bd66891ebdc39631b193c5e31999
2011-01-10 22:26:16 -08:00
Romain Guy
a07105b7d2
Better logging of out of memory errors in OpenGLRenderer.
...
Change-Id: I6b72a084340d8d4b6e0b0a100ed4314d09d441ef
2011-01-10 21:14:18 -08:00
Romain Guy
171c592f0b
New layers API for Views.
...
This API can be used to back a view and its children with either a
software layer (bitmap) or hardware layer (FBO). Layers have
various usages, including color filtering and performance
improvements during animations.
Change-Id: Ifc3bea847918042730fc5a8c2d4206dd6c9420a3
2011-01-06 18:34:30 -08:00
Chet Haase
5977baa1fa
Reuse of native display list objects
...
Change-Id: Ia4553e23930ad20e56c11faa7809be788a1ad4bb
2011-01-06 12:50:30 -08:00
Romain Guy
325a0f969c
The font cache should respect the fake bold flag.
...
Change-Id: Ie4edc9ba46610edde831b55e769944e9a19bdcb5
2011-01-05 15:33:37 -08:00
Patrick Dubroy
f890fab5a6
Ensure bitmaps aren't freed while referenced from a display list
...
Also removes the reference queue finalizers. They aren't necessary
anymore now that Bitmaps are allocated in the heap.
2010-12-20 17:02:15 -08:00
Romain Guy
b146b1214e
Fix text shadow rendering issue.
...
Change-Id: Ic9eb0d38ad684d2f2c95a4f586f865db911cb872
2010-12-15 17:28:30 -08:00
Romain Guy
8d0d4783a0
Cleanup OpenGLRenderer::drawLines()
...
Change-Id: I3545a616e964335897c6e4148c431a07a2ce2a8b
2010-12-14 20:13:35 -08:00
Patrick Dubroy
982b71bf47
Merge "Allocate bitmap backing buffers in the Java heap."
2010-12-14 16:56:07 -08:00
Patrick Dubroy
e4ac2d6b57
Allocate bitmap backing buffers in the Java heap.
...
Change-Id: I60f6ccff13357c1c518e9d56b02fe0171637edd1
2010-12-14 16:50:50 -08:00
Romain Guy
86568198f2
Continue cleanup refactoring in OpenGLRenderer.
...
Methods that still need refactoring:
- drawLines
- composeLayerRegion
Change-Id: If546641adf598d49c330988803667264fda50ac2
2010-12-14 16:04:12 -08:00
Romain Guy
fa7952dbb8
Colors are in the [0..1] range, not [0..255]
...
This fixes rendering in YouTube and other applications.
Change-Id: Ib5f3df632cde97374113ed42f895f136b2796373
2010-12-14 13:45:54 -08:00
Romain Guy
5536841e54
OpenGLRenderer would not render colors < ALPHA_THRESHOLD
...
Bug #3282805
This bug was introduced with a previous refactoring. This also fixes
issues with setting the alpha when drawing bitmaps.
Change-Id: Id47641d26a4536c7e540041f92243bf6db9fc96d
2010-12-14 10:59:41 -08:00
Romain Guy
70ca14e08a
Refactor OpenGLRenderer to simplify OpenGL drawing code.
...
This is the first step of the refactoring:
- drawColorRect
- drawTextureMesh
Remaining methods to refactor:
- setupTextureAlpha8
- drawPath
- setupShadow
- drawText
- drawLines
- composeLayerRegion
Change-Id: I0fced6a05b6b6eee10ee7cef0c3fbdaa6cefab20
2010-12-13 18:24:33 -08:00
Romain Guy
32963c393a
Ignore empty layers.
...
Change-Id: Ib2f99cdab654881fe079306e27d87c5ef9535700
2010-12-10 14:43:41 -08:00
Romain Guy
25dc3a7dba
Correctly compare strings in UTF-8 instead of UTF-16
...
Bug #3272858
Change-Id: Idacd5d7c2c052b4834a8ddb5906ab32b3f548f73
2010-12-10 12:33:05 -08:00
Romain Guy
af636ebf5f
Don't set the invisible flag when saving an empty layer.
...
Bug #3270371
Change-Id: I65e85671c2fb70d74553c91213e5e759e0ac64ee
2010-12-09 17:47:21 -08:00
Romain Guy
a957eea785
New, better line drawing implementation.
...
Bug #3207544
Bug #3225875
Change-Id: Ibdd1dfc64e01625d5c441f39eb0aa3ee647f6ff5
2010-12-08 19:06:58 -08:00
Romain Guy
67f27952c1
Correctly release the OpenGL Canvas on EGL error.
...
Change-Id: Ib31fd8445f7ce5f7aa7e0205de0e7db80d024fc2
2010-12-07 20:12:50 -08:00
Romain Guy
8ab4079ca2
Fix 9patch rendering
...
Bug #3253396
Some quads were incorrectly assumed to be degenerate.
Change-Id: I9155699edc3424afe9d5a131886bb9966d46b109
2010-12-07 13:30:10 -08:00
Romain Guy
3a3fa1be9a
Draw text decorations correctly.
...
Change-Id: I237c0ca8bfe9f233e62476e80f72bcea4359398e
2010-12-06 18:47:50 -08:00
Romain Guy
6620c6d413
Correctly render text when coordinates are not integers.
...
Bug #3225632
Change-Id: If09759e6e95eb2885362ab3ba088cf5aae64c7bf
2010-12-06 18:07:02 -08:00
Romain Guy
a5ef39a216
Don't render degenerate triangles in 9patches.
...
Bug #3251983
Change-Id: Ib0b38a7b8111542372f4c4c106b6321c26fe4ad4
2010-12-03 16:48:20 -08:00
Romain Guy
bd41a11078
Correctly index transparent quads when generating 9patch meshes.
...
Bug #3250026
Change-Id: Id7e051e9ed81f6b4e7748756503d8055ac7d531a
2010-12-02 17:16:26 -08:00
Romain Guy
5e3af5fcba
Rescale ColorMatrix' vector to the [0..1] range
...
Bug #3246354
Change-Id: Idea7a1e6633c71119628315d65315076bc445eb0
2010-12-02 10:41:47 -08:00
Romain Guy
6f72bebe92
Update 9patch structure when rendering with different divs/colors.
...
Bug #3221488
Change-Id: Ifc9e42a991d630feadc9e8032322f37504d09d6d
2010-11-30 12:06:39 -08:00
Chet Haase
5cafc52fb1
Fix hang in native bitmap recycling due to nested mutex locks
...
Change-Id: Ic37d5408ddb3f68aba6520fb0c78ffde91dfbe62
2010-11-23 14:11:43 -08:00
Chet Haase
e7d2295c06
make ResourceCache for display lists thread-safe
...
Change-Id: I41885b4ae249d7d7c000bab17bf32340ba85ab3a
2010-11-11 16:44:46 -08:00
Romain Guy
fe48f65922
Free resources only from the GL context thread.
...
Bug #3179882
Resources were freed following garbage collections on a worker thread.
This worker thread had no EGL context, which would cause the renderer
to incorrectly assume that the memory was liberated.
Change-Id: Ifdb51f94ddf42641e8654522787bfac532976c7c
2010-11-11 15:36:56 -08:00
Romain Guy
01d0657957
Reduce number of GL calls when drawing with shaders.
...
Change-Id: I27aca9f6d381d5c7e363d90a93225d185f2ff4e3
2010-11-11 12:06:27 -08:00
Romain Guy
e190aa6975
Add new runtime debug flags.
...
Change-Id: I07955de166a89b5053c6c13f250bb3e2936ca86e
2010-11-10 19:01:29 -08:00
Romain Guy
c15008e72e
Move all debug flags in a single place.
...
This change also adds a new memory usage flag. When turned on, the
following is printed after every frame:
D/OpenGLRenderer( 3723): Current memory usage / total memory usage (bytes):
D/OpenGLRenderer( 3723): TextureCache 3766680 / 20971520
D/OpenGLRenderer( 3723): LayerCache 3538944 / 8388608
D/OpenGLRenderer( 3723): GradientCache 135168 / 524288
D/OpenGLRenderer( 3723): PathCache 41180 / 4194304
D/OpenGLRenderer( 3723): TextDropShadowCache 0 / 2097152
D/OpenGLRenderer( 3723): FontRenderer 0 262144 / 262144
D/OpenGLRenderer( 3723): FontRenderer 1 262144 / 262144
D/OpenGLRenderer( 3723): FontRenderer 2 262144 / 262144
D/OpenGLRenderer( 3723): Other:
D/OpenGLRenderer( 3723): FboCache 2 / 12
D/OpenGLRenderer( 3723): PatchCache 31 / 512
D/OpenGLRenderer( 3723): Total memory usage:
D/OpenGLRenderer( 3723): 8268404 bytes, 7.89 MB
This should help tracking possibe memory issues.
Change-Id: I83f483ca1d2dbef904829bce368e33fe5503e8d6
2010-11-10 11:59:15 -08:00