40 Commits

Author SHA1 Message Date
Romain Guy
dfa1046eca Add call sites for OpenGL's debug label extension
Change-Id: I9c689127e8166cbef92c935f8aa07217ab806dda
2012-05-12 16:22:35 -07:00
Romain Guy
bb0acdf9e1 Delete display list objects and resources on the UI thread
Bug #6073717
Bug #6065504
Bug #6026515
Bug #5971725

Prior to this patch, the destructor of DisplayList would always run
on the finalizer thread. This could cause a race condition if the UI
thread was busy rendering display lists at the same time leading to
various random native crashes.

Change-Id: Ie11108e3b1538d4b358a1a8b4cce1b2d33152d0c
2012-03-05 13:44:35 -08:00
Romain Guy
13631f3da8 Add debug markers to OpenGLRenderer
These markers will be used to group the GL commands by View in the
OpenGL ES debugging tool. This will help correlate individual GL
calls to higher level components like Views.

Change-Id: I73607ba2e7224a80ac32527968261ee008f049c6
2012-01-30 17:41:55 -08:00
Romain Guy
82bc7a7727 Properly restore the GL scissor after a GL draw functor
Bug #5781254

Change-Id: I1dc4809563a793b6b579814951d4d73b4c34bf32
2012-01-03 14:14:55 -08:00
Romain Guy
8f85e80b64 Generate even fewer GL commands
Change-Id: I0f4dcacb03ef5ee7f6ebd501df98bfead5f0a7f8
2011-12-14 19:23:32 -08:00
Romain Guy
a1d3c91afb Further reduce the number of GL commands sent to the driver
Change-Id: Id922b2a166ea4573b767c27d3195e11c70320b23
2011-12-13 14:58:14 -08:00
Romain Guy
15bc6437f8 Reduce the number of GL commands generated by the UI
This optimization along with the previous one lets us render an
application like Gmail using only 30% of the number of GL commands
previously required

Change-Id: Ifee63edaf495e04490b5abd5433bb9a07bc327a8
2011-12-13 13:11:32 -08:00
Romain Guy
f3a910b423 Optimize state changes
Change-Id: Iae59bc8dfd6427d0967472462cc1994987092827
2011-12-12 20:35:21 -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
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
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
bdf7609867 Trim OpenGLRenderer's memory usage whenever possible
Change-Id: I9225077184f374b1a43300add15cc1d5b6869d1c
2011-07-18 15:00:43 -07:00
Romain Guy
d6b2a00dd4 Add error checking to LayerRenderer::copyLayer
This method is invoked by TextureView.getBitmap() and failures must be
caught to avoid leaving the GL context in a potentially bad state.

Change-Id: I620de395ba1bc20154de58c81963223dc55cac78
2011-06-17 17:45:59 -07:00
Chet Haase
99585adeb4 Line endcaps for AA lines are now antialiased.
Also fixed other minor issues with AA and line rendering.

Change-Id: Icd4638d27c70e2ee0f28b5d9a2b97d8b29e8ac4d
2011-05-02 15:08:38 -07:00
Chet Haase
5b0200bd47 Enable anti-aliasing for hw-accelerated lines
Draw anti-aliased lines with OpenGL by constructing a quad with
a border that fades out (to mimic fragment coverage).

Change-Id: Ib81a3e62d663acdf1b46b401ac4aa7ee9855cc7e
2011-04-21 11:47:05 -07:00
Chet Haase
9c1e23baf5 Add logging of graphics acceleration info to bugreports
Change-Id: I9fa4cda6ccf92df9d1c644ccdc0e7274a30106e0
2011-04-01 13:24:53 -07: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
c9855a53ed Log only 1 line per process when using OpenGLRenderer.
Change-Id: Idbdd6b84f31301e58ed53e0d50fd61fece192dfa
2011-01-21 21:14:15 -08:00
Romain Guy
ff26a0c1c9 Remove unnecessary code.
Change-Id: I83eba3406c26a4028af08b4d4c95ecd02803e75a
2011-01-20 11:39:09 -08:00
Romain Guy
01d58e43ed Add rounded rects and circles support to OpenGLRenderer.
Change-Id: I6cedf2b495d58de7c0437096809fa9e4518a1b8c
2011-01-19 21:55:10 -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
57066eb64c Cleanup GL objects on the correct thread.
Change-Id: Iddfea6e08a6591a4fab147151098ef27005f373d
2011-01-12 12:53:32 -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
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
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
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
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
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
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
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
03750a067e Use VBOs to render most geometries.
Change-Id: I4360dc4fe5693ab425450c107282b2c22db4dca7
2010-10-18 14:49:19 -07:00
Romain Guy
11fd654a90 Reorder logs.
Change-Id: I4adbd53662e1f509c860898c8ff9d19eaabd6d5b
2010-10-04 17:12:16 -07:00
Romain Guy
e2d345ea67 Add debug mode to measure performance.
Change-Id: I9d4c84034dc200b99c8266165942a7cdbcb5c0c5
2010-09-24 18:39:22 -07:00
Romain Guy
29d8997bd4 Fix OpenGL errors in various places.
Change-Id: I3a4e115d8fb13b6c443e65460d92987b16f2524c
2010-09-22 16:44:49 -07:00
Romain Guy
a2341a9f6a Purge Skia objects from GL caches as needed.
Change-Id: I754c671cf790ad5ae8bf047ad328034217da4ecc
2010-09-08 18:04:33 -07:00
Romain Guy
b45c0c9774 Apply gamma correction to font rendering.
Change-Id: I1b05f40e356221b2a5eb9400e67d77ecd98ed6c4
2010-08-27 11:31:24 -07:00
Romain Guy
f6fcac7ce1 Fix passion build
Change-Id: I93322bd36a004ac5aa9a0409d22dbf36a2da1680
2010-08-24 18:17:31 -07:00
Romain Guy
fb8b763f76 Use only one GL context per process, share chaches.
Change-Id: Ieabaa25338d2f4b8d4fd90e7401ad6e7452eae11
2010-08-24 17:18:14 -07:00