summaryrefslogtreecommitdiff
path: root/libs/hwui/renderthread/RenderThread.cpp
AgeCommit message (Collapse)Author
2020-05-01Revert^2 "hwui: remove FatVector"Jagadeesh Pakaravoor
Revert submission 10449863-revert-fatvector Reason for revert: b/149254345 Original change (of introducing FatVector) was reverted as a stop-gap solution to fix the aforementioned bug. The bug was caused by an ABI lock between Surface's definition (that changed with Region) and lib-imsvt prebuilt. Enabling this change now as we have re-compiled the prebuilt with the change enabled. Doing that via a revert of the revert. Reverted Changes: I8ac66acb8:Revert "hwui: remove FatVector" Ib60dbf3ef:Revert "libui: rewrite Region with FatVector" Original changes: I09dc2fddd:hwui: remove FatVector I265c6c831:libui: rewrite Region with FatVector bug: 149254345 Change-Id: I9fb5e8908434abb9a763992e922445a2dc37e865
2020-03-05Revert "hwui: remove FatVector"Tim Murray
Revert "libui: rewrite Region with FatVector" Revert submission 10248126-fatvector-region Reason for revert: b/149254345 Reverted Changes: I09dc2fddd:hwui: remove FatVector I265c6c831:libui: rewrite Region with FatVector also fix wrong license in FatVector.h Test: boots Bug: 149254345 Change-Id: I8ac66acb8b635324051edd41c5d4092c223157ff
2020-02-07hwui: remove FatVectorTim Murray
FatVector now lives in fw/native/libs/ui. Test: builds, boots, works Bug: 149096186 Change-Id: I09dc2fddd2a238ef47d7853b64b0bfbf74d3f71f
2020-01-10Add memory tracing in HWUIStan Iliev
Add ATRACE memory counters to track memory usage at the end of each frame in HWUI. There are 3 catagories: CPU, GPU and Texture memory. There are 3 more counters for memory that can be purged. This CL deletes GpuMemoryTracker class, which implemented similar function for Android O HWUI renderer. Test: Collected systrace with gmail and setting. Test: memory tracing adds ~0.1ms per frame when ATRACE is enabled Bug: 146580770 Change-Id: Icbcc0478bc426dff578e83726fe7c95df171ed93
2019-12-26[HWUI] use AChoreographer in place of DisplayEventReceiver.Alec Mouri
Bug: 136262896 Test: builds, boots Test: scroll through settings app Test: Toggle between 60/90hz and observe systrace Change-Id: I8eef306a968525c55f3863ae688545faa43b23be
2019-10-25[HWUI] Get DeviceInfo through stable ABIAlec Mouri
This also removes the dependency on ui/DeviceInfo other than in test code. Bug: 136263392 Bug: 136263238 Test: builds, boots Change-Id: I6a4687e981359f0e6beb83be8a5501ed7fd16f15
2019-06-14Replace CLOCK_MONOTONIC with SYSTEM_TIME_MONOTONICJerome Gaillard
Using SYSTEM_TIME_MONOTONIC works for Android (where it translates to CLOCK_MONOTONIC) and host targets, while CLOCK_MONOTONIC is not defined on macOS. Bug: 117921091 Test: existing tests should pass Change-Id: I1fad472881830fb0701a320cf37319e083932ad4
2019-06-07Merge "DisplayEventDispatcher: use eConfigChangedDispatch" into qt-r1-dev ↵Ady Abraham
am: 619946fdc4 am: 8c219250c7 Change-Id: I70fd60cd1324ade4f3bc6b88036ec7b9be6d9e01
2019-06-07DisplayEventDispatcher: use eConfigChangedDispatchAdy Abraham
In order to get DISPLAY_EVENT_CONFIG_CHANGED, eConfigChangedDispatch needs to be used when creating DisplayEventDispatcher. Bug: 131688378 Test: adb shell /data/nativetest64/libsurfaceflinger_unittest/libsurfaceflinger_unittest Test: trigger config change and observe logcat Change-Id: I0de8037ee5b024b7d9729750f582be919087be41
2019-05-29Delete wrap_gles capabilityJohn Reck
* Error enforcement doesn't work with libhwui anymore * We can just do the real, proper thing for unit tests & microbenchmarks, which is arguably better anyway * hwui doesn't have much opengl code left that was wrapped Fixes: 128629988 Test: hwuiunit, hwuimacro, and hwuimicro all still run Change-Id: If2568ea0745a67f83e1290860d474c1a01870376
2019-04-18Dynamically adjust renderaheadJohn Reck
Tracks refresh rate changes and adjusts renderahead based off of the active refresh rate. Default is 60hz = 0 render ahead & > 70hz is render ahead 1 Bug: 127822449 Test: systraced stuff Change-Id: I9849aa065262f21f7602d44cd1761373279dc28d
2019-04-12Support render-ahead in vulkanJohn Reck
Bug: 127822449 Test: verified render_ahead working with skiavk Change-Id: Iae1b227a763f6def035057f38cca4b0ab65c7e82
2019-04-01Merge "Don't load EGL driver always"TreeHugger Robot
2019-04-01Don't load EGL driver alwaysStan Iliev
EGL driver is preloaded only if HWUI renders with GL. Test: Ran several apps, passed CtsGraphics and CtsUiRendering Change-Id: Ib38d6f51a19a2ee3631c7d9c99283286c389e476
2019-03-29Invalidate Skia shader cache if Vulkan driver has changedStan Iliev
Test: Ran apps several time and observed shader cache validation Change-Id: I7c2620b9a0eefcb7acedc86647ecf44805518b2f
2019-03-19Add support for uploading to AHBs using Vulkan.Greg Daniel
Test: manual build and testing on blueline. Change-Id: I240a5f1e3ba34677b03131eba36ffd8783d99041
2019-03-18Merge "Remove old TaskManager system"John Reck
2019-03-18Remove old TaskManager systemJohn Reck
Replace it with a newer, fancier, WorkQueue-inspired one that's just a global common thread pool. Test: hwuiunit passes Change-Id: Ib5d03104a08bbac9a4ec67a1bfc0db2b35d6700f
2019-03-15Fix profile gpu bars to use display fpsJohn Reck
Also adds a 'good' bar at 80% threshold and a 'bad' bar at 150% threshold (where triple buffering would start to get iffy) Fixes: 127371028 Test: eyeball'd it Change-Id: I109cd293f87f8cb9c8f1e66d49fb8fb2188b0bec
2019-02-20Start RenderThread earlier to preload Vulkan/EGL driversStan Iliev
This CL should fix application startup regression for Vulkan detected by "Hermetic Startup: EmptyActivity" test. EGL drivers are loaded in a temp thread to leave more time in RenderThread for other work. Loading EGL drivers on the RenderThread may cause a perf regression. Test: Ran cold-dropcache-test test. Bug: 122659224 Bug: 123361175 Change-Id: I8ca818e98fac196a41d079be15594caca5cb1bab
2019-02-19Fix RenderThread setForLooperJohn Reck
RenderThread doesn't use ThreadBase::threadLoop so it also needs to explicitly Looper::setForLooper Fixes: 124467483 Test: hwuiunit Change-Id: I3703b5d3dbbbaa68e88fc23756dfccacfce863cb
2019-02-13Decouple VulkanManager from RenderThreadStan Iliev
This CL allows for more than one VulkanManager to exist. VulkanManager ctor are public allowing for classes other than RenderThread to instantiate it. Secondary VulkanManager can be used to render on a thread other than RT. Test: Ran HWUI unit tests and several apps Change-Id: Ibfd76c86ff67e01617a500902bba7431b928f5c0
2019-02-06Fix RenderThread and worker thread names used by toolsStan Iliev
Test: collected systrace and RenderThread hwuiTask1/2 shown Change-Id: I1114ff72a7ed8c9dc86a64ebd15ca783d1b2ff08
2019-02-05Merge "Tell JVM to not wait for HWUI worker threads upon shutdown"TreeHugger Robot
2019-02-05Tell JVM to not wait for HWUI worker threads upon shutdownStan Iliev
RenderThread is setup as a daemon thread, which allows JVM to exit without waiting on it. This CL does same setup for HWUI worker threads, which offload work from the RenderThread. This fixes an issue exposed by Vulkan pipeline, which is pushing different loads to the worker threads and causing some java tests to hang on exit. This is not a Vulkan specific issue, because GL also hangs if worker thread is started. Bug: 123374538 Test: Ran DismissDialogsInstrumentation test Change-Id: Ie4ee94737ced975323a0792f57f8426c958e8056
2019-02-04Fix crash when VulkanSurface is no longer validStan Iliev
SkiaVulkanPipeline::mVkSurface can become obsolete if RenderThread destroys Vulkan context. This CL enables RenderThread to notify active Vulkan pipelines that their surface is invalid. Improve error handling, when trying to draw a frame with null VulkanSurface. Bug: 123640274 Bug: 123541940 Test: Ran several apps Change-Id: If7fba00713d097192c96179df36e90b54f4f8090
2019-01-10Invoke Vulkan initialize earlierStan Iliev
Invoke VulkanManager::initialize as soon as the RenderThread is started. This reduces time spent in the first call to CanvasContext::setSurface by ~20ms. Test: Ran Hermetic Startup: EmptyActivity BUg: 122659224 Change-Id: Ifa160b0b0bbe43adc82f061fac51082878164804
2018-12-14New WebViewFunctor APIJohn Reck
Should function alongside existing functor API. Bug: 120997728 Test: hwuiunit passes Change-Id: I8f6143d0be1111431b55016f34de319f6b8c8910
2018-09-20Fix crash when EGLSurface is no longer valid.Derek Sollenberger
The EGLSurface stored in the pipeline can become obsolete if the EglManager/RenderThread has to destroy the context. This CL enables the RenderThread to notify all active pipelines that their surface is invalid. Bug: 115290937 Test: hwui_unit_tests Change-Id: Ib3054822273bc35406630b7442229a81b39a2c91
2018-09-18Refactor DeviceInfo in HWUIDerek Sollenberger
Remove the need for both Vulkan and EGL managers to initialize it. Also remove unused code paths. Test: hwui_unit_tests Change-Id: I33ad881468eddbf91ec63207f0d82bed8d97f5ad
2018-09-10Refactor HWUI readback code to be backend independentStan Iliev
Implement readback from Surface, TextureView and HW Bitmap for Vulkan pipeline by wrapping the graphics buffer in an SkImage. Refactor both Vulkan and GL readback to use common code. TextureView readback is moved from IRenderPipeline interface to Readback class. Refactor all 3 readback flows to use common implementation. Test: Passed all view, uirendering and graphics CTS tests with GL Test: Passed many CTS test with Vulkan, that require readback Bug: 113673613 Change-Id: Ifbfd8170a5401f87a709b4b1b9fa058e8e11768d
2018-09-05Reland "TextureView Vulkan support and optimized OpenGL draw"Stan Iliev
Fix an issue with incorrect texture matrix, when there is 90/270 rotation. This happened, because after refactoring SkImage has buffer width/height, instead of layer width/height. This reverts commit a683eb3945320f592f58705c3c31b3c044f4bd72. Bug: 113673613 Test: Ran TextureView CTS and lensblur in camera app Change-Id: If3bcf9cd5195de09fd67a753708568a8e3ca3a9a
2018-09-04Add cache validation to ensure the validityYichi Chen
Create cache identity from GL_VERSION and store in ShaderCache. In the next time ShaderCache is restored from disk, compare the cache identity to ensure its validity. If GL_VERSION changes in between, flush out entire FileBlobCache and start from an empty one. Bug: b/71800782 Test: Wrote a new unit test to save and restore ShaderCache Test: hwui_unit_tests Change-Id: Ie573dc4f18733eee090725be30445d879765231b
2018-08-30Merge "Revert "TextureView Vulkan support and optimized OpenGL draw""Stan Iliev
2018-08-30Revert "TextureView Vulkan support and optimized OpenGL draw"John Reck
This reverts commit c8e22a653297837da9a80b0ba65f6854c8986c96. Reason for revert: broke camera, b/113555199 Bug: 113555199 Change-Id: Iae9b462694d5de0cd99427afead63b567fb4d71d
2018-08-29Merge "TextureView Vulkan support and optimized OpenGL draw"TreeHugger Robot
2018-08-29TextureView Vulkan support and optimized OpenGL drawStan Iliev
Render TextureView as hardware bitmaps, instead of GL textures. Cache SkImage for each observed GraphicBuffer, which is faster even for GL. Implement C++ SurfaceTexture, which allows Java SurfaceTexture to be used with Vulkan HWUI render thread and application GL. threads. Delete GLLayer and VkLayer classes and texture code from old HWUI pipeline. Test: Ran skiagl and skiavk pipeline with a TextureView app. Test: TextureView CTS tests pass for GL pipeline. Test: Ran Android NDK Native codec sample app. Change-Id: Idc94f864ce2d34fd6ceff4be4fc7d3327e99879c
2018-08-15Prefer ES 2.0 with external image support vs ES 3.0 without that supportDerek Sollenberger
We currently attempt to use ES 3.0 shaders even if it lacks the extension for external images. This CL reverts back to ES 2.0 in the event that we find that the OES_EGL_image_external_essl3 is not present. Test: no change in graphics output Bug: 111220579 Change-Id: I6bd7145026d9686cfcf49393a19580208db8a367
2018-04-30Remove unneeded pipeline checkJohn Reck
Test: none Change-Id: I1123567c51efff3eef6c09f76c1624e48f71c802
2018-04-27Move all non-GL HW Bitmap work off RTJohn Reck
Bug: 78288006 Test: hwuiunit passes, systrace showed work distribution as expected, and photos using HW bitmaps still works Change-Id: Id3285b637b5d74d3c5891ed3051ac1e44015987a
2018-04-26Remove RenderThread from EglManagerJohn Reck
Refactor to make EglManager re-usable. Test: hwuiunit passes, hwuimacro works Change-Id: Ie8e9398c703fada1dc5d8baca5f42485eadea202
2018-04-18Revert "Add support for render-ahead"John Reck
This reverts commit ec100976e0655acaa204c8800dfb83dadae20cc8. Reason for revert: b/77971494 Test: hwuiunit passes Change-Id: I2e7dc719d2df1dd939b275496c0edc38e458c434
2018-04-12So long OpenGLPipeline & OpenGLReadback (2/??)John Reck
Hello EglReadback Test: hwuiunit & PixelCopyTests pass Change-Id: I36a8cb45b11141b09e75a2e978ed13e336425625
2018-04-11Remove RenderPipelineType::OpenGL (1/many)John Reck
Just removes the define & all things referencing the define. Test: hwui_unit passes Change-Id: I3f98c271e23ef696c40addf260abdc0fb149a70d
2018-04-09Add support for render-aheadJohn Reck
For periods of time during which latency is less important allow a client to request a deeper render-ahead pipeline. The latency tradeoff results in less overall visual jank Test: none, only used by macrobench Change-Id: I516203b70bdc75b6415fa08bf9c4fb1b598b0102
2018-03-16Don't use IPC in isolateProcessJohn Reck
Fixes: 74395652 Test: hwuiunit passes in 'shell stop' state (pseudo-isolated process), manually checked non-isolated processes still have working vsync via systrace of RT animations demo Change-Id: I630ea011dc7eb2efa265b25673d3304b3b2510d3
2018-01-12Create an empty stub for Vulkan readbackStan Iliev
Create a stub for Vulkan readback. This avoids crashing, because OpenGL readback does not work for Vulkan. Test: Ran calc and gmail apps with skiavk pipeline. Change-Id: I11cddde0a1efae1aa549e7a47d01051ec975f470
2017-12-11Update GrContext creation calls to use sk_spGreg Daniel
Test: manual testing Change-Id: I68d8706ffa7bc7c6622ea0b8c45d7297a131f6bf
2017-12-01Switch RenderThread to a Java daemon threadJohn Reck
Bug: 69962494 Test: device boots, hwui unit tests pass Change-Id: I9d5f2fccebf845328914c82aa97285cf605a4354
2017-11-14Disable skia shader cacheStan Iliev
Disable skia shader cache, which is causing image rendering issues. Test: Ran CNN app and images are OK. Bug: 69264347 Change-Id: Ie81f3398074f28ac1670333f1fd3c95267b2beb3