140 Commits

Author SHA1 Message Date
John Reck
89add11bb4 resolve merge conflicts of f1df0f59c1 to master.
Change-Id: Ia0ae0f753541f5203a4a3683721361c5e90ddae8
2015-12-11 14:47:40 -08:00
Sangkyu Lee
441cc421b5 Fix memory leak in HWUI
std::unique_ptr::release just releases the ownership of the
managed object. To delete the object, std::unique_ptr::reset
function should be called.

Change-Id: If65f74085b1fc2be3a9fffc433326e0bcdb40ff3
2015-12-11 16:05:10 +09:00
John Reck
1540153198 Extensions must load in ctor
Because Caches is terrible

Change-Id: I91e2442d97664759ee2c7602eb7172f009b20d53
2015-11-16 10:42:36 -08:00
Christopher Ferris
be4d8ddf1d Fix bug where mExtensions was not initialized.
Recent changes to mExtensions moved the initialization code from the
constructor to a separate function called load. Make sure to call
this function in the initExtensions function call.

Bug: 25615666

Change-Id: Ic016232c42afefd3b5bc3e4bd5c8428a11c454ad
2015-11-13 20:10:17 -08:00
John Reck
6b50780363 Remove almost-all android::Singleton users
Bug: 25426213
Change-Id: I88e6206e8915cce95c3a8a8a82a4bb8fbf668141
2015-11-03 10:09:59 -08:00
Chris Craik
c08820f587 Remove lookup3 gamma code
Also clean up gamma / glyph cache properties

Change-Id: I75b1ac0cb55638bf787ffd3cf457483ae314f03b
2015-09-22 14:40:35 -07:00
Chris Craik
b9ce116dac Switch several enums to enum classes
Change-Id: I00ecd0b61657196b51704f70ca31a9d1c1ac254e
2015-08-21 23:05:44 +00:00
John Reck
149173d28c Support new EGL extensions
Bug: 21753739

Includes a revert of 13d1b4ab10fbee5e81a2ba1ac59cfae1e51d3ef0
as that only supported EGL_EXT_buffer_age

Change-Id: Ia86a47d19e3355c067934d7764c330b640c6958d
2015-08-12 14:26:05 -07:00
John Reck
9e5f4af1ed am 11f9da31: am bdb2a905: am d08fb687: am e5783e58: am 2abf0f24: Fix a race condition that could cause lockup
* commit '11f9da310ac3129cd859ef98f7f10d897308a59b':
  Fix a race condition that could cause lockup
2015-07-24 05:14:44 +00:00
John Reck
2abf0f24af Fix a race condition that could cause lockup
Bug: 22676664

If a task is queued on a worker thread that is busy
processing a task AND a trim memory signal comes along
prior to the initial task being completed then the
tasks that were queued prior to the exit request will
never be processed.

This is bad, as when those futures are used later on, such
as in trying to delete them from the cache, they will block
waiting for the orphaned task to be finished.

Simple fix is to just never stop the worker threads. Increase
RAM usage slightly as we won't reclaim that stack space, but
this cost is fairly small

Change-Id: I818b011f9bc6ba06942fdad81c27656bd97b42d4
2015-07-23 17:34:14 +00:00
Chris Craik
5a4690bf26 Clean up unncessary defines
LOG_TAG and TRACE_TAG are already defined in the makefile

Change-Id: I9e53e3dacbe018441edd74cb7c8c90846defee74
2015-07-14 13:25:38 -07:00
John Reck
d7db4d7672 Eliminate requireGlContext
Bug: 20297820

Change-Id: I37c63bab6f6c0d2337c8c6002046d2ef17e74097
2015-05-20 11:24:57 -07:00
Chris Craik
2507c34d91 Cleanup properties
bug:19967854

Separate properties from Caches, into static, RenderThread-only class.

Also rewrites the means for java to set properties to correctly handle
threading, and adds an override for profile bars so that SysUi doesn't clutter
the screen with them.

Change-Id: I6e21a96065f52b9ecc49d1a126244804ba106fa9
2015-05-05 10:36:09 -07:00
Chris Craik
db663fe83f Rename native DisplayListRenderer to DisplayListCanvas
Change-Id: I33e6f8cc85da1e7da7ff7bf18d4ebde64222067a
2015-04-20 14:20:47 -07:00
John Reck
fb10ffe484 Merge "Add null egl/gles stub support" 2015-02-26 00:01:48 +00:00
John Reck
041b985dbb Add null egl/gles stub support
Change-Id: I41372585202f69ef31a4ef95efc75fb7a1ff7289
2015-02-25 16:00:02 -08:00
ztenghui
06518aa8de Merge "Correctly name the lightRadius" 2015-02-20 22:56:55 +00:00
ztenghui
62aa44c5ee Correctly name the lightRadius
b/18282208

Change-Id: I5b6edcb37b710464c6ff0f5c05583bb7da720ff3
2015-02-20 10:53:40 -08:00
Chris Craik
f27133df2d Glop layer mesh rendering
Change-Id: I2d902819d5d77f496b67d4d25a298782903e410d
2015-02-19 18:06:05 -08:00
Chris Craik
117bdbcfa3 Glop ColorFilter & VertexBuffer support, initial enable
Enables Glop rendering for supported Rects and VertexBuffers
Also removes unused Query object

Change-Id: Ibe227bc362685a153159f75077664f0947764e06
2015-02-06 13:42:25 -08:00
Chris Craik
3472568774 Don't try to fully tear down program in terminate()
bug:19277550

The program will be destroyed anyway by nature of the program cache cleanup.

Change-Id: I304becd34fdf40baf314bae8b37d2c072ad44409
2015-02-05 09:27:23 -08:00
Chris Craik
6c15ffa196 Refactoring of Program ownership/lifecycle, and WIP Glop rendering path
Change-Id: I2549032790bddbc048b0bccc224ed8f386b4517c
2015-02-02 14:08:57 -08:00
Chris Craik
44eb2c0086 Refactor blending and texture gl state
Change-Id: Ia6b3c8b2afd3dfcee7f3ce401d846b789612054a
2015-01-30 10:49:05 -08:00
John Reck
49bc4acfad resolved conflicts for merge of fe5ac4fc to master
Change-Id: I6c0cc82db14b56297586469f940e408c0e218b3b
2015-01-29 12:53:38 -08:00
John Reck
57998017ff Allow ~Layer() to happen after onGLContextDestroyed
Bug: 19146354
Change-Id: I9e885936168bd541bfbed4064ad67ab524f58e32
2015-01-29 10:17:57 -08:00
Chris Craik
96a5c4c7ba Move more GL state management to RenderState and its directory
Change-Id: Ic68584e1c08dc64be2ad43450cb6caa1de834fdc
2015-01-28 16:32:39 -08:00
Chris Craik
65fe5eeb19 Move scissor state to RenderState
Change-Id: I1227a3886fb24e4d9fad79fca469794f06cfb15e
2015-01-27 17:12:39 -08:00
Chris Craik
d41c4d8c73 Add overrides and switch to nullptr keyword for all files
Adds remaining missing overrides and nullptr usages, missed due to
an extreme failure in tool usage.

Change-Id: I56abd72975a3999ad13330003c348db40f59aebf
2015-01-05 16:49:13 -08:00
Chris Craik
51d6a3db97 Cleanup various clang warnings, use unique_ptrs in several places
Change-Id: I347904b25e51fcc7de14b1e72f1acd0f6ba26f3f
2014-12-23 16:53:56 -08:00
John Reck
a2732a2bf9 Stop pretending USE_OPENGL_RENDERER is a thing
Change-Id: I732b490431fe90eafa00a00f3b5429f0d3a067e6
2014-12-18 14:12:27 -08:00
Yohann Roussel
59cf734f9e resolved conflicts for merge of d67bb501 to master
Change-Id: I40698ce1e382cb41eec7af5ea49ac0e2f997d555
2014-12-11 11:10:50 +01:00
John Reck
ebd52610cf Don't preload textures for AssetAtlas
Bug: 18317479

RenderNode::prepareSubTree calls prefetchAndMarkInUse
on every bitmapResoruce in the DisplayList. However,
this resulted in textures being uploaded for bitmaps
that would be drawn from the AssetAtlas instead.

To fix this we teach TextureCache about the AssetAtlas
so that calls to TextureCache return the Texture from
AssetAtlas if it exists. Thus usage of AssetAtlas
is now purely to allow for further optimizations via
draw merging instead of a requirement to get
any benefit at all.

Change-Id: I65282fa05bac46f4e93822b3467ffa0261ccf200
2014-12-10 17:07:41 -08:00
John Reck
27eaec2388 am 842697a3: am decc26df: am f0f68117: Merge "Trace some interesting events" into lmp-mr1-dev
* commit '842697a3602204036e991cfea8b74da3df6e7f14':
  Trace some interesting events
2014-11-18 21:37:59 +00:00
John Reck
fbc8df03e4 Trace some interesting events
Bug: 18337099
Change-Id: Ie2e60da2b9f06e0368061c944d8123ab6903355c
2014-11-17 10:18:31 -08:00
John Reck
6398d2d42e am 8a8a4055: am 541641d0: Merge "Fix counting" into lmp-mr1-dev automerge: 5c8d135
* commit '8a8a40556ea3b0fb4cc8cd1ec063fb9988db497f':
  Fix counting
2014-11-03 18:50:10 +00:00
John Reck
88f5fc7c5a Fix counting
Change-Id: I9a3568908a7223d69430c1765fb5a4db96d7ac9c
2014-11-03 10:32:24 -08:00
John Reck
9481684560 am e05575e9: am a8d83d63: Merge "Layer changes" into lmp-mr1-dev automerge: a51fba0
* commit 'e05575e9c36850d8cfe49396ac9a1372511b12bf':
  Layer changes
2014-10-31 23:30:57 +00:00
John Reck
0e89e2b7bc Layer changes
Bug: 17208461

* Switch Layer to be VirtualLightRefBase instead of
  Caches' side-channel ref-counting
* Include active layers in gfxinfo dump
* Run gfxinfo dump on the correct thread
* Dump gfxinfo on Layer creation failure

Change-Id: I28d195699e2334518e215ab28c7a17355aee9678
2014-10-31 15:30:10 -07:00
Tom Hudson
2dc236b2ba Clean up physical coupling
Narrow the use of #include directives in hwui, replacing with forward
declarations where straightforward. Speeds compiles; doesn't do any
restructuring of code.

Change-Id: Icac2baffb5896f55d8c6718e9bd9d4bfa02d3ca0
2014-10-15 15:51:39 -04:00
John Reck
4ced2620b7 glFinish to flush deletes
Bug: 17479800
Change-Id: I4d4a3eeda510e037f806052025184f3cde18c847
2014-09-19 10:10:19 -07:00
Chris Craik
bfd1cd6209 Additional layer logging
bug:17208461

Track layer's last known state.

Change-Id: Ic1799191f5839a1d6cc56f598f2ac2671dc27a6f
2014-09-10 16:10:24 -07:00
Fred Fettinger
70735bd5dd hwui: Caches: use mBoundTextures only for GL_TEXTURE_2D
bug:17441218

GLConsumer uses glBindTexture() directly instead of going through
Caches::bindTexture(). This can cause libhwui to draw with the wrong
texture bound in the following case which involves 2 TextureViews:

Frame 1:
GLConsumer::updateTexImage() calls glBindTexture(GL_TEXTURE_EXTERNAL_OES, 1)
HWUI renders TextureView A:
    calls Caches::bindTexture(GL_TEXTURE_EXTERNAL_OES, 1) and draws

Frame 2:
GLConsumer::updateTexImage() calls glBindTexture(GL_TEXTURE_EXTERNAL_OES, 1)
GLConsumer::updateTexImage() calls glBindTexture(GL_TEXTURE_EXTERNAL_OES, 2)
HWUI renders TextureView A:
    calls Caches::bindTexture(GL_TEXTURE_EXTERNAL_OES, 1) and draws
HWUI renders TextureView B:
    calls Caches::bindTexture(GL_TEXTURE_EXTERNAL_OES, 2) and draws

In this case, HWUI will incorrectly draw TextureView A using texture 2 on
frame 2, because mBoundTextures[0]=1, even though the texture currently
bound to GL_TEXTURE_EXTERNAL_OES is 2.

Since GLConsumer is always used with a target of GL_TEXTURE_EXTERNAL_OES,
work around this problem by having mBoundTextures[] store only the
textures bound to the target GL_TEXTURE_2D. This is the common case
where the extra performance is needed. Since it's legal to have
different textures bound to GL_TEXTURE_2D and GL_TEXTURE_EXTERNAL_OES
on one texture unit, Caches::bindTexture() does not need to clear
mBoundTextures[mTextureUnit] when target != GL_TEXTURE_2D.

Change-Id: I8bc54ab8adcfacad7f3ed17a31236dc7a86c967a
Signed-off-by: Fred Fettinger <fred.fettinger@motorola.com>
2014-09-09 20:00:52 +00:00
John Reck
17035b0211 Have destroy call freePrefetchedLayers
Bug: 17208461

 There's a potential race condition between HardwareRenderer.destroy()
 being called (which calls destroyCanvasAndSurface()) and the renderer
 being finalized (which is what calls freePrefetchedLayers), during which
 time it's possible we get a TRIM_MEMORY_COMPLETE and destroy the EGL
 context.

 Fix this race condition by moving stopDrawing() and freePrefetchedLayers()
 into destroyCanvasAndSurface() where they should have been in the first
 place.

 Also, if we hit the assertion failure, dump the current state of
 Caches to try and provide more context for the failure.

Change-Id: Ife0ba3562041e8b08e87e3e13640472b3004eed6
2014-09-03 11:13:53 -07:00
ztenghui
14a4e35208 Bring back the shadow strength tweak
bug:16712006

Change-Id: Ifc0ecca139d58140b45d7d227536a53069e1d480
2014-08-13 18:22:42 +00:00
Chris Craik
a736cd9d35 Remove scaling bucket hack
bug:16626221

Fixes glyph cache pressure and double scaling artifacts.

Change-Id: I06cde720db646531b45943283cb4ecb48af8ff5b
2014-08-04 13:18:38 -07:00
Chris Craik
58ddced277 Initializing variables - generally a good practice
Change-Id: Ib29a69f741eda869701493bb04e155d786e6e402
2014-07-16 19:11:46 -07:00
Chris Craik
59744b79ec Add hack for custom re-rasterization buckets
bug:14083128

Moves all of the font transform management into
OpenGLRenderer::findBestFontTransform(), and now simply passes down
final rasterization transforms into the FontRenderer.

Change-Id: Ie02752e6af863347b142367c7d628db5f9fc2998
2014-07-07 19:14:55 +00:00
Chris Craik
0732ba5756 am 88b1c9ad: am e709d53f: am 0d28bb47: Merge "Fix the texture ID reuse issue in HWUI."
* commit '88b1c9ad87ca6d6faaf824bff4ee9d3c799362e5':
  Fix the texture ID reuse issue in HWUI.
2014-06-17 01:31:21 +00:00
jiayuanr
4a473c7d94 Fix the texture ID reuse issue in HWUI.
Issue: When the layer of previous frame is destroyed, it doesn't clear the
texture id in mBoundTextures[mTextureUnit], so in the next frame, if
glGenTexture returns same texture ID of the previous frame,
the new texture is not bound.

CRs-fixed: 671736

Change-Id: Ifc5fd2115fb1863b3c006ab14b0faabeaeb4eab4
2014-06-16 09:29:22 +05:30
Chris Craik
05f3d6e511 Tessellate on worker threads
Tessellate and cache (where possible) shadow and round rect
tessellation tasks.

Change-Id: I2cfda8e11d83d51ea74af871235cf26e8f831d40
2014-06-10 01:53:17 +00:00