183 Commits

Author SHA1 Message Date
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
Romain Guy
f70a7e3495 Fix possible crash when texture is NULL in the drop shadow cache.
Change-Id: I2142c55dbcfebcdf013a7f4ae04b266a60f5ce8a
2010-11-09 16:37:28 -08:00
Romain Guy
9e10841c27 Correctly remove unused paths from the cache.
Change-Id: I41d9334dcd9871634037344ab49bf69383498161
2010-11-09 14:37:42 -08:00
Chet Haase
0d200833fd Fix GL rendering of translucent surfaces
GL renderer was not initializing scissor correctly for translucent
surfaces, resulting in invisible window backgrounds in some cases
like fading popup windows

Change-Id: I87a964986e1ba2c4f59708c8892c5fa71903e6fc
2010-11-09 06:38:56 -08:00
Romain Guy
0fe478ea04 Support nested display lists.
Change-Id: I3815a2832fc0f722c668ba8f51c5f177edb77c94
2010-11-08 12:15:28 -08:00
Romain Guy
7f78b0c3ae Lines would not set the scissor before drawing.
Lines were not drawing in Calendar because they were getting clipped
by the previous clip rectangle. This change simply updates the scissor
as needed. This change also reduces the number of state changes in GL.

Change-Id: I41ab13dca3a33cfa6d1a44371c48852ab418b04e
2010-11-04 14:36:26 -07:00
Romain Guy
1041aded2d Fix possible rendering issue when drawing a path.
Change-Id: I25f2e609589f0dd9294bcf7930de6398c0d7e377
2010-11-04 12:10:40 -07:00
Romain Guy
e45362cad9 Fix rendering bug with saveLayerAlpha/drawColor.
drawColor() was not calling quickReject because it fills the clip region
and thus always passes the test. However, quickReject also checks whether
the current layer is invisible. drawColor() now performs the same check
and avoid drawing inside an invisible layer.

Change-Id: I63d0e9a8a9c0fba774f0f5c3870d58e6ed96fbd1
2010-11-03 19:58:32 -07:00
Romain Guy
5ec9924d24 Fix rendering issue with layers.
Change-Id: I1d511ab2707000762a942d32c300a9944ab38603
2010-11-03 16:19:08 -07:00
Romain Guy
5b3b35296e Optimize FBO drawing with regions.
This optimization is currently disabled until Launcher is
modified to take advantage of it. The optimization can be
enabled by turning on RENDER_LAYERS_AS_REGIONS in the
OpenGLRenderer.h file.

Change-Id: I2fdf59d0f4dc690a3d7f712173ab8db3848b27b1
2010-11-02 16:17:23 -07:00
Romain Guy
f887594d0e Merge "Remove unnecessary GL calls." 2010-10-26 16:31:31 -07:00
Romain Guy
746b7401ce Remove unnecessary GL calls.
This change batches calls to glScissor() and removes extra GL
queries and glActiveTexture() calls.

Change-Id: I1cd079d314f87cd9c088f95c8d4909c2f860f6aa
2010-10-26 16:27:31 -07:00
Chet Haase
ad93c2bb63 Optimizing ColorFilter in display lists
Change-Id: Ie4d5e5b0bc45e0ce47bba144049303c270762e54
2010-10-26 12:52:03 -07:00
Chet Haase
dcaff67a80 Merge "DisplayList optimizations and fixes." 2010-10-26 06:59:19 -07:00
Chet Haase
d98aa2de9a DisplayList optimizations and fixes.
We now use a copy of SkPaint objects to avoid having it changed from under us.
We reuse copies that have not changed. We also copy the SkMatrix every time to
avoid the same problem.

Change-Id: If3fd80698f2d43ea16d23302063e0fd8d0549027
2010-10-26 06:54:55 -07:00
Romain Guy
9bca4793a3 Small cleanup.
Removes unnecessary forward class declaration, make Caches::currentBuffer
private instead of public.

Change-Id: Idba6325c8c602d89239e667cb8ec87e7943f8e75
2010-10-25 18:42:25 -07:00
Romain Guy
3e3ba155fc Don't change texture unit when not needed.
Change-Id: Ifa84426d234f2122402cb13533cb5964f1ce95ec
2010-10-25 18:33:16 -07:00
Romain Guy
8164c2d338 Don't change textures wrap modes on every draw.
Change-Id: If6d3f313778cc7f3e803a063338539c8b3e165e3
2010-10-25 18:03:28 -07:00
Chet Haase
715a89ebbf Merge "Fix Caches singleton to avoid resource leaks" 2010-10-24 12:35:07 -07:00
Chet Haase
dd78ccacff Fix Caches singleton to avoid resource leaks
The declaration of Singleton objects must be in CPP files (not header
files) to avoid creating separate instances of what is supposedly a
single object.

Change-Id: Ie903384824a458b5572f3ce5b6cfb359c18a9c44
2010-10-24 12:27:22 -07:00
Romain Guy
ae88e5e8e9 Fix rendering issue with layers.
A change was made earlier in the renderer to not snap the current clip rect
on every clip operation. The clip rect must not be snapped to pixel boundaries
before being used for pixel precision operations. Some operations were doing
this correctly, others were not. For instance, a layer was always created by
rounding to the correct pixels, but composing a layer was done with a non
rounded clip, thus resulting in slightly odd behaviors.

Change-Id: I31c2cf0a343450470bcd449c3f13fe37648b9c7c
2010-10-22 17:49:18 -07:00
Romain Guy
58ae6db4ff Don't use two different variables to refer to mSnapshot.
Change-Id: Ie4a0616d2fe0b040ac14b734a9ddf77bf1f35b0c
2010-10-22 11:16:37 -07:00
Romain Guy
ae517591d9 Don't perform glCopyTextImage with coordinates outside the buffer.
Bug #3122179

Change-Id: I91ed397e9e553a8eeb69d82d0c5b1e49a3cdd5ff
2010-10-22 10:40:27 -07:00
Chet Haase
5c13d89c13 Optimizing display lists by referencing pointers to resources instead of copying them
Change-Id: I81ad3551d74aa1e5bb64d69e33d2eb29a6c1eb6a
2010-10-21 12:02:42 -07:00
Romain Guy
50c0f093d9 Solve rendering issue with embedded WebViews.
Bug #3094017

The blending mode was not appropriately set after WebView released the
context.

Change-Id: Ib36d48e82c12f6d131dd5a0bcde9106925b8da63
2010-10-19 11:42:22 -07:00
Romain Guy
2665b85b2b Small cleanup.
Change-Id: I0e5b9154a2d93af793d62f462d68cb7c6c3f6d75
2010-10-18 15:11:50 -07:00
Romain Guy
03750a067e Use VBOs to render most geometries.
Change-Id: I4360dc4fe5693ab425450c107282b2c22db4dca7
2010-10-18 14:49:19 -07:00
Romain Guy
054dc18409 Don't draw entirely transparent 9patch meshes.
Change-Id: If3e62e18b8e0dbde8a22f8ede2889b86500a4dc2
2010-10-15 17:55:25 -07:00
Romain Guy
9d13fe25f4 Fix text rendering artifact.
Change-Id: I50f47207846e4208d363dde4e8f5f1a0f23d2d75
2010-10-15 16:06:03 -07:00
Romain Guy
e5ebcb0107 Fix clipping issue in StackView.
Change-Id: I7ec28f25c3993a2bd7ef6399ba1923839d239905
2010-10-15 13:57:28 -07:00
Romain Guy
d2a1ff003b Fix text rendering issue.
The local clip rect could be off by one pixel when a 3D transform
was applied to a text primitive. This would cause small rendering
glitches in Launcher in particular.

Change-Id: I1254f6a5838c26810cbe969b096679d40b8dd504
2010-10-14 14:49:34 -07:00
Romain Guy
4afdf666fd Color filters were ignored by the program cache fast path.
Change-Id: I08f2f02d356234a674be778d088e0558fd49c849
2010-10-13 21:31:28 -07:00
Romain Guy
93d2361c6d Fix layer rendering glitch.
Change-Id: If2f987fe5526fc88743ca3e91edde4f8232ff658
2010-10-13 18:26:36 -07:00
Romain Guy
909cbaf8f9 Don't draw TextView's alpha layers when not needed.
Change-Id: Iedf42cbc62d727f18500c78fcccf2d081a761fec
2010-10-13 18:19:48 -07:00
Romain Guy
5d794412e3 Small potential performance improvement for fonts rendering.
Change-Id: If59c1e7803b84340fbc8b31ce6171ef0e5dc6189
2010-10-13 17:24:41 -07:00
Romain Guy
99bcdc52dc Return identity matrix when rendering in an FBO.
Change-Id: I57438e745b30c8cfe16c269f3cafcd719049d705
2010-10-13 17:24:41 -07:00
Romain Guy
41030da168 Add a getNativeMatrix() API.
This API can be used by WebView to apply the appropriate transform
on its rendering.

Change-Id: I79aa39a29805f462fb08226370328815e74bdc52
2010-10-13 13:40:37 -07:00
Romain Guy
eb07af6873 Optimize layer clears.
Don't clear the entire texture when we use textures that are bigger
than the layer itself. This will save time during the glClear() calls.

Change-Id: I06f3259ba62affb3708ba69ea41418832c7e1a65
2010-10-12 18:40:36 -07:00
Romain Guy
e91080581f Tweak layers caching for better performance in Launcher.
Change-Id: Ia6e67699d98f69c8a93385b3ecbdd814c7b16921
2010-10-12 18:15:42 -07:00
Romain Guy
1f114a55b5 Remove logging.
Change-Id: Ibcb11d704653d8875e22629ea39e4ee2ebce3c22
2010-10-12 17:47:34 -07:00
Romain Guy
4bb942083a Optimize 9patch rendering.
This change detects empty quads in 9patches and removes them from
the mesh to avoid unnecessary blending.

Change-Id: I4500566fb4cb6845d64dcb59b522c0be7a0ec704
2010-10-12 15:59:26 -07:00
Romain Guy
9db91243c5 Simplify black texture fragment shader.
Change-Id: If2d43f92f4c98ec128692761a670b0f31207a3c0
2010-10-12 13:13:09 -07:00
Romain Guy
c00972bb16 Don't recreate a new texture every time we draw a layer.
Change-Id: I3c28aff5acffc7c6f1ac74805869725426c62d28
2010-10-12 11:31:07 -07:00
Romain Guy
dbc26d2ba1 Don't draw fully transparent views/primitives.
Change-Id: Icd7d8ef1f57b51a24faf32f7004125e6300d4fdc
2010-10-11 17:58:29 -07:00
Romain Guy
707b2f78cc Optimize GLSL shaders.
Change-Id: I9a5e01bced63d8da0c61330a543a2b805388a59d
2010-10-11 16:34:59 -07:00
Romain Guy
7537f856f9 Improve performance of linear gradients.
Change-Id: If1caee31fc045dea13a4c5c10f25f2ffd325c4f8
2010-10-11 14:38:28 -07:00
Romain Guy
21b028a44f Move GenerationCache to the utils directory.
Change-Id: I210ffa8f1d76a102bb7d971c649c20a74d03fbe6
2010-10-08 18:44:56 -07:00
Romain Guy
2728f96161 Don't update 9patches on every frame.
Change-Id: I7ffb2365f83e0453e7d0a0cdcb3fc9308b305238
2010-10-08 18:36:57 -07:00