summaryrefslogtreecommitdiff
path: root/libs/hwui/renderthread/CanvasContext.cpp
AgeCommit message (Collapse)Author
2014-11-07am f1923c36: am 8dda03a0: am ca93f69c: Merge "Have an actual fallback if the ↵John Reck
surface is lost" into lmp-mr1-dev * commit 'f1923c368c5c08a477b9f94dea6a499798d91d4f': Have an actual fallback if the surface is lost
2014-11-07Have an actual fallback if the surface is lostJohn Reck
Bug: 17516789 This will force a relayout/reinitialize pass if the Surface is lost mid-render instead of crashing on the next frame Change-Id: If08bfa16f740728fa7c05904fa11e26f07b81e2e
2014-11-04Remove status return from all uirenderer::Renderer functionsTom Hudson
This moves the interface closer to android::Canvas. The only use of return values was in the OpenGLRenderer subclass; that is replaced with an internal dirty flag: returned from finish(), checked by CanvasContext. This is part of a series of CLs to refactor the Graphics JNI bindings. BUG:15672762 R=djsollen@google.com,ccraik@google.com Change-Id: Ifd533eb8839a254b0d3a5d04fc5a2905afdfc89e
2014-10-31Layer changesJohn Reck
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-23Add some free zoom to lockHardwareCanvasJohn Reck
Bug: 18099195 Don't use EGL_SWAP_BUFFER_PRESERVED on surfaces that will never benefit. Also clean up some confusing naming Change-Id: I674ca64e0464a3282cff79e5ecd350d08f47c014
2014-10-08Trim graphics memory when closing the shadeJorim Jaggi
Graphics memory usually gets trimmed in applications when the activity goes into the background. We use quite a lot of graphics memory when the shade/lockscreen is open, and some of them never gets freed unless the recents activity is closed, because we don't have these activity-trimming-heuristics for the shade. This change proactively trims the graphics memory when the shade gets closed or when the lockscreen is hidden, to emulate the same heuristics as for activities. This change also adds trimMemory on RenderThread to systrace to verify that no jank is introduced with this change. This change immediately saves around 10-30 MB on an xxhdpi device after the shade is closed. Bug: 17581375 Change-Id: I4fb622efb51815fe08187be97ba15d012d4de5d4
2014-10-03Cleanup DeferredLayerUpdaterJohn Reck
Bug: 17765082 DeferredLayerUpdater had fallen behind RT updates. Re-snap to latest expectations, ensuring to call requireGlContext() prior to detachSurfaceTexture to avoid leaking SurfaceTextures Change-Id: Ic65fb9831e5284f658866da8da9ad5af1d227699
2014-09-19Merge "Fix garbage showing up beneath dialogs" into lmp-devChris Craik
2014-09-18Fix garbage showing up beneath dialogsChris Craik
bug:17463894 Fixes the setViewport method to immediately affect the return values of getViewportWidth/Height methods. Also works around tiling extension issues observed on first frame after window resize by disabling tiling for that frame. Change-Id: Ie172d572d20d74a1be9cc58ad389af2cffa0e4b6
2014-09-17Special case EGL_BAD_SURFACEJohn Reck
Bug: 17516789 Change-Id: I3dcb10360c2aef6326f7dbbff6815866d4c143b6
2014-09-05Fix race conditionJohn Reck
Bug: 17372309 AnimationContext::startFrame() happens both with and without the UI thread lock. Pass the TraversalMode into it so that ThreadedRenderer's subclass can correctly decide when it is safe to push over mPendingAnimatingRenderNodes, as doing so outside of the lock is Very Bad. Change-Id: Ife5dd3a2b46b0a207cd9234c159a674afdbf5efd
2014-09-04Yet more layer tracking loggingJohn Reck
Bug: 17208461 Change-Id: I55e7d0921eb565867e966d68b798b7b92c391b55
2014-09-03Fix some wrong-thread issues around animator managementJohn Reck
Bug: 17372309 Fixes a case where UI thread and RT thread both used the same method which wasn't safe for either of them. Adds additional assertions & logging in unusual circumstances to try and track down where the issue is occuring from. Change-Id: I93d31a6fd0c5927259b67bdf96a475944226eee6
2014-09-03Have destroy call freePrefetchedLayersJohn Reck
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-02Implement TODOJohn Reck
Change-Id: I551ad0dab6356baa4c7787718b54d5b7337a3f26
2014-08-29Free prefetched layers on TRIM_MEMORYJohn Reck
Bug: 17208461 Change-Id: I831c10d29d5920274b90e11a67d6cd106972a058
2014-08-28Track buildLayer calls, destroy if unusedJohn Reck
Bug: 17208461 Change-Id: Ibdb104a493285d77a6891c5e74e38a52c7014da9
2014-08-27Animator stuffJohn Reck
Bug: 17228458 Change-Id: Id884a429a512f9cd2be0ed16dbd0f10e92b4440d
2014-08-21Don't run animators in buildLayerJohn Reck
Bug: 17172689 Change-Id: Ib47d589c002543327fa336718440f9f8c95524e0
2014-08-20Implement full View.buildLayerJohn Reck
Bug: 17152292 Change-Id: Ia3cc2aadf72fe14517f50762fc634794df51ad5a
2014-08-15Define shadow casting behavior within layersChris Craik
bug:15860114 Savelayers and HW layers both now support shadow casting. For save layers, the light source should always be correct, for HW layers, the light source position is set when the layer is created, and updated when it is resized. Change-Id: Ie85567dd43c2bb0a0b08fd0bd4db41efa793ac2b
2014-07-24Connect shadow style attributes to rendererChris Craik
bug:15859361 Moves lighting info out of StatefulBaseRenderer, since it's not useful at record time, and only used by OGLR. Change-Id: I7ab065d02d9304afad1dc4c48597a7a621366f8e
2014-07-17Fix loggingJohn Reck
Bug: 16357287 Change-Id: Ic14e32c941e42ab1f1ed51ff8ed7185979e57a55
2014-07-16Fix root RenderNode damage calculationJohn Reck
Bug: 15888445 Change-Id: I281ec9271c9889673dcdfcb6d31e341a7b47b7de
2014-07-08Fix layers lifecycle issuesJohn Reck
Bug: 16118540 Fix an issue where we could have a reference to a Layer after the GL context was destroyed Change-Id: I7bfd909d735ca6b942ebe188fc10099422eb6d95
2014-07-07Add missing requireGlContextJohn Reck
Change-Id: I7100e5e9986f502f66a23ecea07a6057522c43ac
2014-06-30Fix onTrimMemory for HardwareRendererJohn Reck
Also fixes detachFunctor possibly drawing after return Bug: 15189843 Bug: 15990672 Change-Id: I64c48cb674c461a8eeaba407b697e09f72c98ce3
2014-06-26Animator refactoring & fixesJohn Reck
Tweaks animators to have less unnecessary refcounting Pull animator management out into seperate class More control to tweak animator lifecycle, such as doing Java-side handling of start delay by attaching but not starting the animator Change-Id: I4ff8207580ca11fb38f45ef0007b406e0097281c
2014-06-24Fix contants; RT-enable WebView pt2John Reck
Bug: 15838537 * Fix kSync_UIRedrawRequired constant value (woops) * Tell CanvasContext that WebView is now rt-safe Change-Id: Idf15cf21115c2ca24b8ccd00025e8502864cd87c
2014-06-23No-fail invokeFunctorJohn Reck
Bug: 15513308 Bug: 15449247 Change-Id: I13a29f9c8d4975cdda6dcb33b6332c2555ff0f7c
2014-06-23Update 'DisplayList' vs 'RenderNode' naming in several placesChris Craik
Change-Id: I635c6627d098b661fb9b0ba1bd42fa6d7277d287
2014-06-17Interrupt canvas before invokeChris Craik
Change-Id: I5b818958f6255c594339bd10d9efa99e9e2c00d4
2014-06-12Move LayerType to RenderNodeJohn Reck
Change-Id: Icb79a5015cb0362b1f3a66d09007450730135a97
2014-06-04Even FASTER damage calculations!John Reck
* Now with more native! * Less matrix math thanks to bulk-property-update support! * Zero JNI on the View.damageInParent() path! * Fully aware of RT-driven animators! * Likely full of new and exciting bugs! * But it also fixes at least 1 existing invalidate bug! Change-Id: Ie0773f85a60850ff2668370c58defef2e8aa079f
2014-05-30Re-jigger layersJohn Reck
Bug: 15185239 Bug: 15238382 Make DeferredLayerUpdater ref counted so that HardwareLayer:finalizer() works non-crashily on leaked layers Give DeferredLayerUpdater the ability to have a layer destroyer set so that leaked layers can still be recycled on the RenderThread Order layer updates based off of pushLayerUpdate() calls to fix issue with nested layers Change-Id: I4449cee607f7e5126e02fed7464cf48038e3dfdf
2014-05-29Merge "Enable debug stuffs" into lmp-preview-devJohn Reck
2014-05-29Enable debug stuffsJohn Reck
Bug: 14596762 * dumpsys gfxinfo implemented * profile GPU visual_bars implemented Change-Id: Icb948a9d5af5989b5615504d0d76ade64b93ef5b
2014-05-29Re-enable atlasJohn Reck
Bug: 14590563 Change-Id: I04ed5bf1b2654dab4a65c1e43faaeba32459870f
2014-05-23Implement FlushCaches TODOJohn Reck
Change-Id: Id05429e98ffe0858275b32c41fb215c1d8d930b2
2014-05-23Bag of scheduling tweaksJohn Reck
Bug: 15118640 * Prevent over-stuffing the queue by dropping frames * Prevent double-drawing in one pulse by RT by deferring vsync registration until post-draw so that it catches the next vsync pulse instead of the current one * Bias vsync race condition towards the UI thread * Fix queueDelay to actually work Change-Id: Ibf584258bd93ebcbba058bd976dc8b307f1c6155
2014-05-21Define light position (using new lighting spec) in JavaChris Craik
Also updates the relative shadow strengths. Change-Id: I6cac7275d38df98aea9f0dda463cd7207102986a
2014-05-14Disable texture atlasJohn Reck
Bug: 14952384 Change-Id: If38b3e4c08c2c3dd9c00ae9e6e8c10e208e737d1
2014-05-13Wire up texture atlasJohn Reck
Bug: 14590563 Change-Id: I2dffbc089dc801f5fb2d1c8fd38e1c71d160e110
2014-05-07Merge "Cleanup attachFunctor"John Reck
2014-05-07Cleanup attachFunctorJohn Reck
Bug: 13961296 Change-Id: Id48d11bfcc234afd1fd7e4fdd409a50e7208c81d
2014-05-07Merge "Implement TODO(romainguy)"John Reck
2014-05-07Implement TODO(romainguy)John Reck
Bug: 14277445 Change-Id: Id52d6f7fcc023000adcc440bd4da67d9a673536b
2014-05-07Don't try to draw if there's no canvas or surfaceJohn Reck
Bug: 14616376 doFrame() can happen after the canvas or surface is destroyed, handle it gracefully Change-Id: Ibbbbdbfa77fa2134bd2abc215ca1a0886d706969
2014-05-05Make RenderNodeAnimator and WebView play niceJohn Reck
Change-Id: Ifaefcf510b2d377663fc86f60608d6ec9be8329a
2014-05-05TIME LORD!John Reck
Bug: 14444180 Change-Id: I68bec3807c4d1c88d5af1aec2fe6907d60b5f2f3