summaryrefslogtreecommitdiff
path: root/libs/hwui/renderthread/CanvasContext.cpp
AgeCommit message (Collapse)Author
2020-01-30[HWUI] Use ANativeWindow inteception methods in ReliableSurfaceAlec Mouri
Test: boots Test: manually test with opening and scrolling through settings app Change-Id: I8d7a44d3ead0b2350318e1514153e256f97ccca5
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-11-21Fix for Surface#lockHardwareCanvas lockupsJohn Reck
By avoiding setting a dequeue buffer timeout we avoid hitting a different path in BufferQueue that prevents async behavior from happening. This restores P's behavior in this path. Bug: 143860379 Test: repro app in bug Change-Id: Iffbd9f9e6689a40876ff3aa74c10020e3f09fc6a
2019-11-13Fix an issue with GPU stats not enabledStan Iliev
Invoke Surface::enableFrameTimestamps after eglDestroySurface. eglDestroySurface internally disables time stats. Order is important, when CanvasContext::setSurface is invoked with a surface, that is already current (which happens all the time). Test: ran UiBench microbenchmark tests Change-Id: I3d023c3a87da6329c556426d553c744e541b9dff
2019-11-07Merge "[HWUI] Get DeviceInfo through stable ABI"Alec Mouri
2019-11-04[frameworks][base][hwui] re-fix -Wimplicit-int-float-conversionNick Desaulniers
A new instance snuck in since I haven't completed the platform toolchain upgrade yet. There was imprecision in this call; accept it by making the implicit cast explicit. Bug: 139945549 Test: mm Change-Id: Id704d9741b480eba4cf3955e70119d935776faf6 Signed-off-by: Nick Desaulniers <ndesaulniers@google.com>
2019-10-31Fix wrong surfaceRequiresRedraw checkJohn Reck
We only need to redraw if the size /changed/ not if it was the same. Also fix damageId to not use frameNumber as repeated redraws of the same frame would toggle. Bug: 143711430 Test: systrace Change-Id: I8ac4629c9ff4fd51de33d1be7aa46ccc995ba342
2019-10-29Merge "[HWUI] Use ANativeWindow_get{Height, Width}"TreeHugger Robot
2019-10-25[HWUI] Use ANativeWindow_get{Height, Width}Alec Mouri
gui/Surface will eventually be removed since HWUI needs to depend on a stable ABI, so use the NDK methods for querying width and height that operates on ANativeWindow instead. Bug: 137012798 Test: builds Change-Id: I1309e31992190e7b44c6ea83f962f372b6b0afcf
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-10-04Delete VectorDrawableAtlasJohn Reck
Poking around in a few apps it doesn't appear that the VectorDrawableAtlas is achieving sufficient utilization to justify its existence. The potential for draw call merging doesn't seem warranted for the RAM cost of the atlas. Bug: 137853925 Test: builds Change-Id: Id2419bc6dccb6316636d50c568f8fac75a2d563f
2019-10-04Drop all caches in UI_HIDDENJohn Reck
Bug: 137853925 Test: none Change-Id: Idf7002d9b07cc6b71b38ce76e7b6382100279a99
2019-09-06[HWUI] Remove nanosecond conversion from duration queries.Alec Mouri
Now that they return nanoseconds, there's no reason to lose precision. Bug: 137012798 Test: builds Change-Id: I52ca20cb010b4f1829596e0a765b7013ae3665ca
2019-09-06[HWUI] Use ANativeWindow_setDequeueTimeoutAlec Mouri
Don't use the ReliableSurface version now that we have an APEX stub. Bug: 137012798 Test: builds Change-Id: I63d1d9d2ff60b54a75d5b4865a63eb22ac347208
2019-09-06[HWUI] hook in ANativeWindow_getLastDequeueStartTimeAlec Mouri
Bug: 137012798 Test: builds Change-Id: I37fd2a7c40398053082f606f0a085db0a239e2e0
2019-09-05[HWUI] use ANativeWindow_getLastQueueDuration apiAlec Mouri
Replaces the query call with an abi-stable one. Bug: 137012798 Test: builds Change-Id: Ia8f01c3be0b79037cef88782913af55f6d00a6a2
2019-09-04Merge "[HWUI] use ANativeWindow_getLastDequeueDuration api"TreeHugger Robot
2019-08-29use rect version of join, the other is deprecatedMike Reed
Test: make Change-Id: I29f4ff6cea209ac5c053a525ff06cd1bfea6c9c0
2019-08-20[HWUI] use ANativeWindow_getLastDequeueDuration apiAlec Mouri
Replaces the query() call for getting the duration of the internal dequeue() call a call that will be abi stable. Bug: 137012798 Test: builds Change-Id: I6d2118a7c093dd2ecc4ebfb4b4ee8556f7e709a7
2019-08-01Add GPU draw stats to gfxinfo and GraphicsStatsServiceStan Iliev
Test: ran dumpsys with gfxinfo and graphicsstats Change-Id: Id9950de87dc4343c6878baa6a6dd42fbc8aeddef
2019-07-26Fix ReliableSurface to be more reliableJohn Reck
Handle TIMED_OUT better by rescheduling (TODO: give up after N attempts?) Fix SYNC_SURFACE_LOST_REWARD_IF_FOUND path to actually go fetch a new surface. Bug: 137509524 Test: Injected errors randomly, verified nothing got permanently dead. Change-Id: Id30f8ad1dd7196041ee84c16c8cf5c814002a6ce
2019-07-22Merge "Increase dequeueBuffer timeout" into qt-r1-dev am: 5ab5cd7aa2John Reck
am: 6769f25c17 Change-Id: I13931cd14fead1141acbea5cef8deb61a6c9119e
2019-07-18Increase dequeueBuffer timeoutJohn Reck
Timeout recovery isn't working properly, so increase it to avoid any false-positives from something like a slow screen-on Bug: 137509524 Test: none Change-Id: Ic4fae04b41f71600479f9557e334f67c27851db4
2019-06-27Remove unused (mostly GL-related) headersFedor Kudasov
Bug: 117921091 Test: all tests should pass Change-Id: I419aafd30bfc19f2180eedf924bbd55d5cd36170
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-05-14Revert "hwui: ro.hwui.render_ahead=0 queue on high FPS"Miguel de Dios
This reverts commit f802abe47f5bafd617ab64c2330a3d1827a4f95c. Reason for revert: We're seeing jank increase after this patch. Change-Id: Ic8d77df3fbbeeedeed4b8f31737454d9c056f8b0 Bug: 132733305
2019-04-25hwui: ro.hwui.render_ahead=0 queue on high FPSKevin DuBois
ro.hwui.render_ahead was behaving the same as -1 when it was set to zero. Correct it so that ro.hwui.render_ahead will queue frames when set to zero on any display rate FPS. Fixes: 131340980 Test: Test presence or not of timestamps with -1,0,1,2 settings Change-Id: Ibd1974253e947130fb03a0b86f599e0e5f5eac38
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-16Merge "Do not cache AVDs that are off screen" into qt-devLeon Scroggins
2019-04-12Support render-ahead in vulkanJohn Reck
Bug: 127822449 Test: verified render_ahead working with skiavk Change-Id: Iae1b227a763f6def035057f38cca4b0ab65c7e82
2019-04-12Do not cache AVDs that are off screenLeon Scroggins III
Bug: 128805564 Test: Manual + systrace; hwui_unit_tests; CtsUiRenderingTestCases Only update a VectorDrawable's cache if it is onscreen. This fixes a Twitter use case where the app has a ProgressBar that is exactly one pixel offscreen. Prior to this CL, we repeatedly drew the ProgressBar's AVD to a GPU surface, even though we clip it out later and never draw that GPU surface. Now, we recognize that the AVD is outside of the bounds of the screen, so we never draw to the GPU surface. TreeInfo: - store the size of the screen, retrieved from CanvasContext::getNextFrameSize. SkiaDisplayList: - Store the matrix at the time of recording a VectorDrawable. Concat that with the current matrix to determine whether the VD is on screen, based on the TreeInfo. If it is offscreen, do not add it to the list of AVDs that need to be updated ahead of rendering. - In addition, if it is offscreen (or not dirty), do not call setPropertyChangeWillBeConsumed(true). This prevents triggering dispatchFrameCallbacks to update on the RenderThread when there is no need to. This also mimics what would happen if the View/RenderNode had been completely offscreen. - Add a method to append an AVD to mVectorDrawables. Now that the vector is of Pairs, this simplifies the call sites. Add a second helper to just add an AVD without a matrix, for use in tests. SkiaRecordingCanvas: - get the current matrix and store it in the display list along with the AVD. CanvasContext: - add getNextFrameSize, for reporting the size of the next frame without dequeuing it VectorDrawable.cpp: - call quickReject to potentially short circuit drawing. This is for a hypothetical use case (verified in a test app) where the containing RenderNode is partially onscreen, but the AVD itself is not. Even without the change to VectorDrawable.cpp, we skip uploading to the GPU cache, the SkiaDisplayList still attempts to draw it. This change keeps us from drawing it at all. SkiaDisplayListTests.cpp: - Now that I've hidden mVectorDrawables, call the new public APIs. - prepareListAndChildren test - for the clean VD, assert that getPropertyChangeWillBeConsumed returns FALSE. This is due to the behavior change that we do not set it unless the VD is dirty. - set the bounds, so our onscreen check works. - Add another test for prepareListAndChildren, which puts VDs offscreen. Change-Id: Iae0a07adcf58e7884e0854720de644e7b2faf2bf
2019-04-04Add back render-ahead supportJohn Reck
Currently only supported in the EGL path. Vulkan support Coming Soon Bug: 127822449 Test: trace of hwuimacro Change-Id: Iac2b039e11d964aab5b8ca1bdf2a5430b187e2ea
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-03-07Re-enable empty damage drop optimizationJohn Reck
Fixes: 113796161 Test: device seemed to behave correctly? Change-Id: Id43e1eaad29d07c06c1003c0653e5d1ee7084cfe
2018-12-14New WebViewFunctor APIJohn Reck
Should function alongside existing functor API. Bug: 120997728 Test: hwuiunit passes Change-Id: I8f6143d0be1111431b55016f34de319f6b8c8910
2018-12-06Revert "Revert "Make HWUI's surface Reliable^TM""John Reck
This reverts commit dd08224e4d75689c42bf452d44617f84072649a1. Bug: 120097554 Bug: 120342364 Bug: 120421537 Test: verified emulator can boot OK, with no log warnings Test: verified keyboard works in landscape Change-Id: Iae2cd1140d81755b126adfb21ec885181f3bc6b6
2018-12-03Remove dead codeJohn Reck
No longer needed Test: none Change-Id: Id260e4a2b1026b9ccd853f277f5e527fb7568f69
2018-12-03Revert "Make HWUI's surface Reliable^TM"Bo Hu
This reverts commit 650bd9a7b35139354916d2522b59cc57eb5fddc3. Reason for revert: broken emulator b/120342364 Exempt-From-Owner-Approval: Change-Id: If05d9d87325e1d836375d7dc79ff66ef057d228d
2018-11-28Make HWUI's surface Reliable^TMJohn Reck
You won't believe this one weird trick to make EGL_BAD_ALLOC errors never happen again! libgui hates it! Bug: way too many to list Test: none - there probably should be, though Change-Id: I8e7fc3e584f90c01e0fd932497604a1d93710ba6
2018-11-08Refactors and a potential public API for renderingJohn Reck
Split out the View/ViewRootImpl bits from the hardware rendering bits. Create a potential public API surface for hardware rendering Bug: 112709971 Test: builds & boots Change-Id: I9e6f44b07a170574a905f42338282c4bb7e95f56
2018-09-27Partially revert "[HWUI] Implement legacy color mode."Peiyong Lin
Reason for partially revert: Step back a little bit to think about how we want to move the view system forward. This patch removes the legacy mode we have added, as well as move color type and color space of the surface to SkiaPipeline. BUG: 111436479 BUG: 113530681 Test: Build, flash, boot and check dumpsys SurfaceFlinger Change-Id: I1ab7b88d41347284d87649618e5a15f5c6bcf8fe
2018-09-20Refactor RenderState and remove unused functionality.Derek Sollenberger
Test: hwui_unit_tests still pass Change-Id: Ie943671535ab8c5da1bac05985e815e0cb842dc1
2018-09-13[HWUI] Implement legacy color mode.Peiyong Lin
Previously, HWUI always produces SRGB buffers. We introduced new APIs for SurfaceFlinger, a.k.a. the composer service to return to composition preference for data space, and pixel format. This patch makes HWUI query composition preference from composer service, and creates the corresponding EGL surface with the correct attributes. In legacy mode, HWUI will take the pixel value from source color space, and interpret it as pixel value in destination color space. BUG: 111436479 BUG: 113530681 Test: Build, flash, boot and check dumpsys SurfaceFlinger Change-Id: I64562d5ea6f653076c8b448feb56b5e0624bc81c
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-04Revert "Revert "Revert "TextureView Vulkan support and optimized OpenGL draw"""Stan Iliev
This reverts commit 85f9096b5272c9a39e592e2e97cbbe6cb0e767ab. Reason for revert: lensblur broken. Change-Id: I83ac163159fc537bc15936a0f8597a7512ca9d6e
2018-08-31Revert "Revert "TextureView Vulkan support and optimized OpenGL draw""Stan Iliev
This reverts commit 867c43de0544217d26c3ee18f4d6603bb2ea97ce. Reason for revert: Fixed issue with unsupported hardware buffer formats by landing https://skia-review.googlesource.com/c/skia/+/150470 "Support more hardware buffer formats" Bug: 113673613 Change-Id: I1f7c528f138e290160e75833c8d989d9535002ee
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