summaryrefslogtreecommitdiff
path: root/libs/hwui/pipeline/skia/SkiaDisplayList.cpp
AgeCommit message (Collapse)Author
2021-07-01Disable Webview Overlay when invisibleHuihong Luo
Remove Webview overlays when Webview node is set to invisible Bug: 187292989 Test: play a video in a Webview, toggle visibility for the view, check existence of a surface control named as "Webview Overlay SurfaceControl#0" Change-Id: If47a78a8ae1f7b65b9e7ab983ec72f580d78191a
2021-01-19Merge "Check ProjectBackwards property for childrens after children's ↵Treehugger Robot
syncProperties()." am: b22ef02f1f am: 56f018b1e4 am: f1ec514926 Original change: https://android-review.googlesource.com/c/platform/frameworks/base/+/1550595 MUST ONLY BE SUBMITTED BY AUTOMERGER Change-Id: Icca967b1c9d5738be115e9db44ce55be58f3fd15
2021-01-14Check ProjectBackwards property for childrens after children's syncProperties().Minkyoung Kim
Children's ProjectBackwards is not applied. So it's skipped so far. This fix a problem that first ripple bg is not shown properly. :It uses ProjectBackwards&ProjectReceiver concept. For deeper understanding, refer to https://partnerissuetracker.corp.google.com/issues/173476923 Test: aosp build , Full test on samsung mobile device Change-Id: I36a1bc95673093ba2c886703974bf672c53c2cf3
2021-01-14Convert DisplayList to a value-type wrapperJohn Reck
Make DisplayList its own type instead of an alias, pushing the Skia aspect behind it mostly. Removes a bunch of manual memory management and opens the door to DisplayList being a union type with multiple implementations Test: builds (somehow), boots, hwuiunit passes, CtsUiRendering passes Change-Id: I1d7806aa3afc5d9ece08b06959920078a5814c59
2020-12-09Add initial benchmarks for CanvasOpJohn Reck
Also some minor other tweaks Test: this Change-Id: Idb8a5955839893ff000de87d4899fd130ede061c
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-07-29Isolate the graphics classes into their own static libDerek Sollenberger
Update additional headers to include-what-you-use to resolve compiler errors related to moving include paths. Test: CtsUiRenderingTestCases Change-Id: I230408a53610ad1926f9e46d5aff66f52fec4a3a
2019-06-26Enable RenderNode and RecordingCanvas for layoutlibFedor Kudasov
Bug: 117921091 Test: all tests should pass Change-Id: I574b12a5f7a6a54cbbcb17c35a3884368fd404e6
2019-04-17Use structured bindings for mVectorDrawablesLeon Scroggins III
Test: Build Change-Id: I60df096bf3720968039f7e4c5eac86682b2fc684
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-01-30Put Vulkan WebViews on a HW layer if stencil clipStan Iliev
Put WebViews in a HW layer, if the clip is a non-rect. This CL reuses logic implemented by ag/705975. This used to be the way GL WebViews were drawn in Android M. Implement complex clip detection at recording time, which was not previously supported by the canvas. Vulkan WebViews using GL interop are already drawn in a layer, but this CL will be useful when WebView supports new Vulkan interop. Test: WebView CTS pass for Vulkan and GL Bug: 115613038 Change-Id: I9b02c6f4de8efd504a7507633f3d849004215a16
2018-12-14New WebViewFunctor APIJohn Reck
Should function alongside existing functor API. Bug: 120997728 Test: hwuiunit passes Change-Id: I8f6143d0be1111431b55016f34de319f6b8c8910
2018-12-03Remove ; from closing namespaces in libs/hwuiChris Blume
When closing a namespace a } is sufficient. It doesn't need to be }; like closing a class or enum. Within frameworks/base/libs/hwui there is a mix between } and }; when closing a namespace. There are even mixes between a .h and the corresponding .cpp files. In a separate CL I was asked to not close with };. That was a good comment. I adopted the style from nearby code. This CL cleans up the nearby code. Test: I made sure the code still built as expected. Change-Id: Ieb314a4f48d6e33752463f3be4361fdc9be97482
2018-09-20Make auto-dark a bit betterJohn Reck
Handles transform of basic bitmaps Tweak to always treat text as foreground Test: builds, poked around with force_dark Change-Id: I733d39e05067438335da5a7eac06111f66f1228d
2018-09-18Implement WebView support for Vulkan using temporary bufferStan Iliev
Draw WebView in an offscreen GL buffer, then import and draw the buffer with Vulkan. Bug: 115610873 Test: Passed WebView CTS tests that are part of UiRendering. Change-Id: Ida137fe9b8652d2a936ec2798b909be7e77b3462
2018-05-16AnimatedImageDrawable: Eliminate unnecessary calls to redrawLeon Scroggins III
Bug: 78866720 Test: Manual + systrace; existing CTS Previously, we set hasAnimations to true when the AnimatedImageDrawable, so that we would get a call to redraw. But if the image does not need to show its next frame yet, the redraw was unnecessary. Instead, add a new field to TreeInfo::Out, representing the delay time until the image will need to be redrawn - i.e. when the duration of the current frame has passed. Each call to prepareTree will post at most one message to redraw, in time for the earliest animated image to be redrawn. Post the message for one rendered frame ahead of time, so that when it is time to show the next frame, the image has already gotten the message to update. On a screen with a single animated image, this drops the number of calls to dispatchFrameCallbacks to as infrequent as possible. It is called only when we need to draw a new frame of the image. On a screen with multiple animated images, the calls may be redundant, but they will not be more frequent than they would be without this change. Switch to nsecs_t and systemTime internally, matching the rest of HWUI. Remove mDidDraw and related. Its purpose was to prevent advancing the animation while the image is not being drawn. But it isn't really necessary. If it's not drawn, onDraw is not called, which is where we trigger decoding. And onDraw already has a defense against getting too far ahead - if its timer indicates that it should skip a frame or show it very briefly, it will back up its timer. More importantly, mDidDraw caused a bug, when combined with less frequent redraws. If the display list containing the drawable doesn't need to be redrawn for other reasons, the drawable's timer never advanced, so its animation stopped. Fix software drawing. Compute the milliseconds in the future to draw the next frame, and add that to SystemClock.uptimeMillis() to compute the time to pass to scheduleSelf. Change-Id: I13aab49922fa300f73b327be25561d7120c09ec4
2018-01-29Use a separate thread to decode AnimatedImageDrawableLeon Scroggins III
Bug: 63908092 Test: Manual: Ie18811ba29a1db163aca08472b04ae185e9344f0 Depends on https://skia-review.googlesource.com/#/c/skia/+/101544. That change removes the Skia class's time checks, and leaving it up to the client to keep track of the time. In this case, the client wants to keep track of the time because it only wants to update while it is being drawn. If it goes off screen (for example), it will just resume where it left off when it returns on screen. This allows for smooth animations. If an AnimatedImageDrawable is being drawn to a SkiaRecordingCanvas, decode on the new (lazily-created) AnimatedImageThread. When running, always decode one frame ahead on the AnimatedImageThread so that it will be ready when it is time to display. During prepareTree, update the time and check whether there is a new frame ready to draw or the next frame needs to be decoded. In either case, return true. The next frame to be decoded will be triggered by onDraw. Change-Id: If447976e9df417060a950f658dbca9cf7980dd02
2018-01-24Initial implmentation of AnimatedImageDrawables on the RenderThread.Derek Sollenberger
The current implementation schedules the next frame of the images to be decoded after the current frame completes but potentially schedules tasks that will result in a no-op execution if a new frame is not yet needed. Test: HwAccelerationTest Change-Id: I0510cb5a1b801abd651327e924deb586af0306d6
2017-11-03Format the world (or just HWUI)John Reck
Test: No code changes, just ran through clang-format Change-Id: Id23aa4ec7eebc0446fe3a30260f33e7fd455bb8c
2017-03-27Update VectorDrawables cache at frame startStan Iliev
Draw VectorDrawables in GPU backed surface. Render VD cache at the beginning of the frame to avoid context switching. Test: CTS graphics tests pass. Change-Id: Ia14e0ec4049c3fa87f03547fbda44043bf8dd793
2017-03-02Update SkiaDisplayList to use the modified SkLiteDLDerek Sollenberger
SkLiteDL is no longer refcounted or a subclass of SkDrawable. Test: on device testing in SkiaGL mode Change-Id: I9ad53d764a26ab382d80d54908325962f2075802
2017-02-09Implement "dump displaylist" button for skia pipelinesStan Iliev
Implement "dump displaylist" button in hierarchyviewer for skia pipelines. Test: ran hierarchyviewer for all pipelines. bug: 34819877 Change-Id: Ifeb578260f636cb67268f9f9259e7318bf7de453
2017-01-25Overhaul RenderNode's DisplayList managementJohn Reck
* Move mValid to native * Have destroyHardwareResources destroy everything * Remove flaky mParentCount checks in setStaging * All tree updates have an internal observer to ensure onRemovedFromTree() is a reliable signal * onRemovedFromTree() immediately releases resources to avoid displaylist "leaks" Test: Unit tests for validity added & pass, manually verified that b/34072929 doesn't repro Bug: 34072929 Change-Id: I856534b4ed1b7f009fc4b7cd13209b97fa42a71c
2016-11-22Fix Skia render node projection to match HWUIStan Iliev
Fix Skia render node projection to match HWUI. Port FrameBuilderTests_projectionReorder test for Skia pipeline. Add new tests in both HWUI and Skia to cover more projection use cases. Test: built and run on angler-eng Change-Id: Ibf27af211452ae95d595aca7723ea63f48b0b282
2016-11-17Update pinImages to report when GPU resource limits are exceeded.Derek Sollenberger
Bug: 32691999 Test: proposed CTS test (ag/1500396) and existing UiRendering tests Change-Id: I190f888ae5499ac048569af8256fdd31d19d1285
2016-11-07Refactor pin/unpinImages to work across pipelines.Derek Sollenberger
Test: existing CTS tests still pass Change-Id: Ib2607e9853396bad42f298829b5c5da0d210af32
2016-10-31Implement SkiaRecordingCanvas, RenderNodeDrawable and other drawables.Stan Iliev
Implement SkiaRecordingCanvas, RenderNodeDrawable, GLFunctorDrawable, LayerDrawable, StartReorderBarrierDrawable, EndReorderBarrierDrawable. Move AnimatedRoundRect and AnimatedCircle in a separate file. All Skia pipeline files are moved in hwui/pipeline/skia folder. Add unit tests for RenderNodeDrawable, StartReorderBarrierDrawable, EndReorderBarrierDrawable and SkiaRecordingCanvas. Test: I tested manually on 6P devices and did run the unit tests. Change-Id: If2a347bd1fc4689953822294ce5bf98c7f3f57c7