summaryrefslogtreecommitdiffstats
path: root/libs/hwui/Caches.cpp
Commit message (Collapse)AuthorAgeFilesLines
* Fix a race condition that could cause lockupJohn Reck2015-07-231-5/+0
| | | | | | | | | | | | | | | | | | | | 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
* Eliminate requireGlContextJohn Reck2015-05-201-0/+4
| | | | | | Bug: 20297820 Change-Id: I37c63bab6f6c0d2337c8c6002046d2ef17e74097
* Cleanup propertiesChris Craik2015-05-051-112/+5
| | | | | | | | | | | | 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
* Rename native DisplayListRenderer to DisplayListCanvasChris Craik2015-04-201-1/+0
| | | | Change-Id: I33e6f8cc85da1e7da7ff7bf18d4ebde64222067a
* Merge "Add null egl/gles stub support"John Reck2015-02-261-8/+0
|\
| * Add null egl/gles stub supportJohn Reck2015-02-251-8/+0
| | | | | | | | Change-Id: I41372585202f69ef31a4ef95efc75fb7a1ff7289
* | Merge "Correctly name the lightRadius"ztenghui2015-02-201-4/+4
|\ \
| * | Correctly name the lightRadiusztenghui2015-02-201-4/+4
| |/ | | | | | | | | | | b/18282208 Change-Id: I5b6edcb37b710464c6ff0f5c05583bb7da720ff3
* | Glop layer mesh renderingChris Craik2015-02-191-1/+1
|/ | | | Change-Id: I2d902819d5d77f496b67d4d25a298782903e410d
* Glop ColorFilter & VertexBuffer support, initial enableChris Craik2015-02-061-5/+6
| | | | | | | Enables Glop rendering for supported Rects and VertexBuffers Also removes unused Query object Change-Id: Ibe227bc362685a153159f75077664f0947764e06
* Don't try to fully tear down program in terminate()Chris Craik2015-02-051-1/+1
| | | | | | | | bug:19277550 The program will be destroyed anyway by nature of the program cache cleanup. Change-Id: I304becd34fdf40baf314bae8b37d2c072ad44409
* Refactoring of Program ownership/lifecycle, and WIP Glop rendering pathChris Craik2015-02-021-3/+18
| | | | Change-Id: I2549032790bddbc048b0bccc224ed8f386b4517c
* Refactor blending and texture gl stateChris Craik2015-01-301-79/+7
| | | | Change-Id: Ia6b3c8b2afd3dfcee7f3ce401d846b789612054a
* resolved conflicts for merge of fe5ac4fc to masterJohn Reck2015-01-291-1/+1
|\ | | | | | | Change-Id: I6c0cc82db14b56297586469f940e408c0e218b3b
| * Allow ~Layer() to happen after onGLContextDestroyedJohn Reck2015-01-291-1/+1
| | | | | | | | | | Bug: 19146354 Change-Id: I9e885936168bd541bfbed4064ad67ab524f58e32
* | Move more GL state management to RenderState and its directoryChris Craik2015-01-281-180/+16
| | | | | | | | Change-Id: Ic68584e1c08dc64be2ad43450cb6caa1de834fdc
* | Move scissor state to RenderStateChris Craik2015-01-271-74/+6
| | | | | | | | Change-Id: I1227a3886fb24e4d9fad79fca469794f06cfb15e
* | Add overrides and switch to nullptr keyword for all filesChris Craik2015-01-051-7/+7
| | | | | | | | | | | | | | Adds remaining missing overrides and nullptr usages, missed due to an extreme failure in tool usage. Change-Id: I56abd72975a3999ad13330003c348db40f59aebf
* | Cleanup various clang warnings, use unique_ptrs in several placesChris Craik2014-12-231-13/+8
| | | | | | | | Change-Id: I347904b25e51fcc7de14b1e72f1acd0f6ba26f3f
* | Stop pretending USE_OPENGL_RENDERER is a thingJohn Reck2014-12-181-2/+0
| | | | | | | | Change-Id: I732b490431fe90eafa00a00f3b5429f0d3a067e6
* | resolved conflicts for merge of d67bb501 to masterYohann Roussel2014-12-111-2/+0
|\ \ | |/ | | | | Change-Id: I40698ce1e382cb41eec7af5ea49ac0e2f997d555
| * Don't preload textures for AssetAtlasJohn Reck2014-12-101-2/+0
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | 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
* | am 842697a3: am decc26df: am f0f68117: Merge "Trace some interesting events" ↵John Reck2014-11-181-0/+2
|\ \ | |/ | | | | | | | | | | into lmp-mr1-dev * commit '842697a3602204036e991cfea8b74da3df6e7f14': Trace some interesting events
| * Trace some interesting eventsJohn Reck2014-11-171-0/+2
| | | | | | | | | | Bug: 18337099 Change-Id: Ie2e60da2b9f06e0368061c944d8123ab6903355c
* | am 8a8a4055: am 541641d0: Merge "Fix counting" into lmp-mr1-dev automerge: ↵John Reck2014-11-031-1/+1
|\ \ | |/ | | | | | | | | | | 5c8d135 * commit '8a8a40556ea3b0fb4cc8cd1ec063fb9988db497f': Fix counting
| * Fix countingJohn Reck2014-11-031-1/+1
| | | | | | | | Change-Id: I9a3568908a7223d69430c1765fb5a4db96d7ac9c
* | am e05575e9: am a8d83d63: Merge "Layer changes" into lmp-mr1-dev automerge: ↵John Reck2014-10-311-26/+16
|\ \ | |/ | | | | | | | | | | a51fba0 * commit 'e05575e9c36850d8cfe49396ac9a1372511b12bf': Layer changes
| * Layer changesJohn Reck2014-10-311-26/+16
| | | | | | | | | | | | | | | | | | | | | | | | 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
* | Clean up physical couplingTom Hudson2014-10-151-0/+1
|/ | | | | | | | 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
* glFinish to flush deletesJohn Reck2014-09-191-0/+1
| | | | | Bug: 17479800 Change-Id: I4d4a3eeda510e037f806052025184f3cde18c847
* Additional layer loggingChris Craik2014-09-101-0/+1
| | | | | | | | bug:17208461 Track layer's last known state. Change-Id: Ic1799191f5839a1d6cc56f598f2ac2671dc27a6f
* hwui: Caches: use mBoundTextures only for GL_TEXTURE_2DFred Fettinger2014-09-091-2/+6
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | 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>
* Have destroy call freePrefetchedLayersJohn Reck2014-09-031-3/+7
| | | | | | | | | | | | | | | | | | | 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
* Bring back the shadow strength tweakztenghui2014-08-131-0/+10
| | | | | | bug:16712006 Change-Id: Ifc0ecca139d58140b45d7d227536a53069e1d480
* Remove scaling bucket hackChris Craik2014-08-041-16/+1
| | | | | | | | bug:16626221 Fixes glyph cache pressure and double scaling artifacts. Change-Id: I06cde720db646531b45943283cb4ecb48af8ff5b
* Initializing variables - generally a good practiceChris Craik2014-07-161-0/+2
| | | | Change-Id: Ib29a69f741eda869701493bb04e155d786e6e402
* Add hack for custom re-rasterization bucketsChris Craik2014-07-071-2/+6
| | | | | | | | | | 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
* am 88b1c9ad: am e709d53f: am 0d28bb47: Merge "Fix the texture ID reuse issue ↵Chris Craik2014-06-171-5/+10
|\ | | | | | | | | | | | | in HWUI." * commit '88b1c9ad87ca6d6faaf824bff4ee9d3c799362e5': Fix the texture ID reuse issue in HWUI.
| * Fix the texture ID reuse issue in HWUI.jiayuanr2014-06-161-5/+10
| | | | | | | | | | | | | | | | | | | | | | 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
* | Tessellate on worker threadsChris Craik2014-06-101-0/+4
| | | | | | | | | | | | Tessellate and cache (where possible) shadow and round rect tessellation tasks. Change-Id: I2cfda8e11d83d51ea74af871235cf26e8f831d40
* | Define light position (using new lighting spec) in JavaChris Craik2014-05-211-2/+2
| | | | | | | | | | | | Also updates the relative shadow strengths. Change-Id: I6cac7275d38df98aea9f0dda463cd7207102986a
* | Add more shadow control knobsChris Craik2014-04-301-12/+17
| | | | | | | | Change-Id: I1ff500bf429029a97b681ced9df652f4ee9f1332
* | Refcount RenderNodeJohn Reck2014-04-071-15/+1
| | | | | | | | Change-Id: I7a86db8acc2b78ef33d987a43a119f5933d7d752
* | Create one hole inside the umbra area to avoid overdraw.ztenghui2014-03-171-2/+2
| | | | | | | | | | | | bug:13439450 Change-Id: I859575196bd5a3029f447883025a6ec3a1f1face
* | Rename DisplayList->RenderNodeJohn Reck2014-03-121-3/+3
| | | | | | | | Change-Id: Id42e23c9a1a6eb6eaeafef707ced7fa6887b03d0
* | Remove experimental perspective projectionChris Craik2014-03-111-17/+1
| | | | | | | | Change-Id: Iad688c8395ccd4673cc129973802b5f01dfb45ba
* | Improve shadow tessellation performanceChris Craik2014-03-111-2/+2
| | | | | | | | | | | | | | | | - Tune and simplify shadow parameters - Remove additional inner rings - Improve polygon ray casting algorithm Change-Id: If0f28b2d66ae0480b675942bb65e8fcd2864425d
* | Use pre-computed index to draw the shadow.ztenghui2014-02-251-5/+25
| | | | | | | | | | | | | | | | Also draw the umbra part as triangle fans instead of zig zag fashion. b/12840179 Change-Id: Iaa5d15e77351acdd71f076bd8f9bb2d4d2b92faf
* | Separate spot and ambient shadow strength settingztenghui2014-02-131-4/+9
| | | | | | | | Change-Id: I4530e618b09a7f44b5382f8a40646c0ebf5f214c
* | Property support for light positioning.ztenghui2014-01-171-0/+19
| | | | | | | | | | | | Tune up the light size to make it look better. Change-Id: I139a05f3dd53dacbe55759b91188f0e1cc2c7f80