summaryrefslogtreecommitdiff
path: root/libs/hwui/pipeline/skia/RenderNodeDrawable.cpp
AgeCommit message (Collapse)Author
2021-09-28Fix initialization of snapshot SkImage instanceNader Jawad
Fix issue where the initial snapshot used to create a resultant SkImage instance with an SkImageFilter applied was not initialized. Fixes: 201312688 Test: Re-ran CTS tests Change-Id: I2440a161c70076850479c562c7c9e6dc8d756236
2021-09-22Conditionally cache RenderEffect resultsNader Jawad
Added property to conditionally cache SkImage instances with SkImageFilters applied. Some GL vendor implementations invoke Fence::waitForver without signalling, leading to ANRs throughout the system. Bug: 193145089 Test: manual Change-Id: I3e478b11b66205d96e9499a362f7412a1d6e952d
2021-06-10Refactor SkImageFilter usage to cache results.Nader Jawad
If an SkImageFilter is used, create an image snapshot with the filter applied to avoid re-computing it on each draw invocation Bug: 188450217 Test: Re-ran CTS tests Change-Id: Ib790669e14ada9d4ebbfac958d699e2b5242f2d7
2021-05-22Use TraceUtils.h from gui shared library.rnlee
Test: It makes Bug: 183120308 Change-Id: I331262dd2da59817031f0c708f4c102041dcb5e0
2021-05-17Add support to toggle different shaderNader Jawad
behaviors Updated HWUI to toggle overscroll stretch implementation based on whether the device supports high end graphics or not Bug: 187718492 Test: manual Change-Id: I13a91a8861c07bec8af43268ba22d0f5b7060b4f
2021-05-11Add some more scenes, replace linear with uniformJohn Reck
Test: this Bug: 187718492 Change-Id: I171b5c15cd18645c2da1cffffa9635f83f8877e6
2021-05-11Avoid creating a layer for linear stretchJohn Reck
Bug: 187718492 Test: manual logging no layer updates during benchmark Change-Id: I9a231625142e404882be6c53fa6d01b2fb81af1a
2021-05-10Updated StretchEffect typesNader Jawad
Added additional shader stretch effect type to distinguish between shader based stretches that are configured in HWUI as well as those that are configured in both HWUI and SurfaceFlinger Bug: 184297961 Test: manual Change-Id: Ie1083cef7cbaf4f877783d67d429af7f5edd0a3c
2021-05-10Add a linear variant of the stretch effectJohn Reck
Supports SurfaceViews & everything Test: setprop debug.hwui.stretch_mode 1 Bug: 187718492 Change-Id: I9a222fa4c1a40e80a74cdaf75becb9524cbeed9b
2021-05-03Update hole punch logic in HWUINader Jawad
--Updated HWUI holepunch logic for SurfaceView to also apply the stretch to the hole punch --Updated RenderNode callbacks to also include an offset from the ancestor RenderNode that also has a stretch configured on it --Added new test activity to verify hole punch logic Bug: 179047472 Test: manual Change-Id: Ibbaf8248a31839ba9dc352ecb9fef54e1276918e
2021-04-07Do not use SkImageFilter for StretchNader Jawad
Refactor stretch implementation to manually draw the shader as a rect instead of using SkImageFilter Bug: 184184033 Test: Re-ran stretch tests Change-Id: I6263f5474b185b3f81ef9fd1bec3e43e86da49f2
2021-04-06Holepunch layers for SurfaceViewNader Jawad
Update RenderNodeDrawable to hole punch areas into layers created for SurfaceView Bug: 184297961 Test: Added CTS test to SurfaceViewTests Change-Id: I1f03a4fe34c5a8b7411ebe728ea3d4195fcd1fac
2021-03-03Wire SKSL based stretch shader to HWUINader Jawad
--Ported SKSL based stretch shader from OpenGL prototype --Hooked up the stretch APIs in RenderNode to the stretch shader. --Updated RenderNode layer logic to promote the RenderNode to a layer if there is a stretch to be applied to it in order to feed the layer as input to the stretch shader Bug: 179047472 Test: builds + sample overscroll stretches + updated CTS test Change-Id: I744ff70099fe251ce07f23d067bf13444a468c08
2021-02-02Merge "Add stretch plumbing" into sc-devJohn Reck
2021-02-01Add stretch plumbingJohn Reck
Bug: 179047472 Test: builds & boots Change-Id: I30b5d6683160af598f98555f61af1cf5a7639bbe
2021-01-29Modernize calls to drawImageMike Reed
1. drawBitmap --> drawImage 2. drawImage now always requires sampling parameter Bug:178700363 Test: make Change-Id: I96f610a180b3774ba955cc334949fd62b1cf4d69
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-09-29Added RenderEffect property on RenderNodeNader Jawad
Introduced RenderEffect API to handle consuming SkImageFilter parameters on RenderNode objects in order to support blur. Updated SilkFX demo to use RenderEffect APIs on RenderNode instead of BlurShader Bug: 168549524 Test: Added tests to RenderNode CTS test cases Change-Id: I5005a322a6d75438dd104e6915630264406cf771
2019-12-11When saving MSKP files, record layers as SkPictures with annotations.Nathaniel Nifong
No change when saving single frame SKP files. Layer redraws (full or partial) that occur at the beginning of frames are recorded as SkPictures written as the first commands in the frame, each preceded by an annotation recording the node id of the layer drawn to, and the dirty area of the draw. When rendered layers are used, the drawImageRect command is preceded by an annotation that provides the node id of the relevant layer. the skia debugger or skpbench could then use this information to play back the animation's layers. Test: tested by capturing both multi and single frame files on apps that use and do not use layers. normal rendering isn't affected, and capturing works as intended. Change-Id: Ic8f6947ebcc168334b6b740b3d63fc1788509b54
2019-06-21Remove redundant include from RenderNodeDrawableFedor Kudasov
Bug: 117921091 Test: all tests should pass Change-Id: Iaac1a9fe2f04dedb5f04d7ae6288e69332824b00
2019-04-15Move AlphaFilterCanvas to new API.Ben Wagner
The AlphaFilterCanvas is only used when it will make a copy of the paint anyway. Remove the need to keep track of copy on write semantics when they are never used. Test: refactoring CL. Existing unit tests still pass. Change-Id: I20c0d618db7d1a76756bd4c16fe686ce7fb44f38
2019-02-22Allow outline for projected backward nodes to be a pathStan Iliev
Outlines are limited to rect and round rect, with exception of outlines clipping RippleDrawable (backward projected node). Test: Ran test app Bug: 27343928 Bug: 121359065 Change-Id: I40dd4801f7c0b400350e0aeff275a2ac10241cbe
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-11-29Add a unique ID to rendernodeJohn Reck
Bug: 120089776 Test: dump'd skp, verified ID present Change-Id: I97a03804ebc53925e1b79db3dd616a728eff0bfa
2018-08-21Remove use of SkTLazy.Ben Wagner
Skia is planning to make SkTLazy private to Skia. This changes uses of SkTLazy to std::optional. Test: refactoring CL. Existing unit tests still pass. Change-Id: Id92c27cb8b3b41eb2e531b1a930511064a47a6f7
2018-07-12Remove use of SkRefCnt_SafeAssign.Ben Wagner
Update pointer to SkRefCnt fields which require it to sk_sp. Test: refactoring CL. Existing unit tests still pass. Change-Id: I4f3eb790ee67c09746708458c4492569b64cc58f
2018-06-19Restore matrix transform for out-of-order render nodesStan Iliev
Restore matrix for render nodes, which are drawn out of order. Test: DrawChildBug-debug.apk draws correctly, new test ag/4355529 Bug: 80173852 Change-Id: I3f789a7cf0ee5816da84255199b265643f95af1c
2018-05-03Delete a bunch of codeJohn Reck
This removes the duality of DisplayList, removing a small amount of overhead Test: buids & hwuiunit passes Change-Id: I8bb3a20e9ead1caec4b4a8a3e9f2c08f717a7096
2018-02-20Remove Skia RenderPipeline saveLayer logic for software layers.Derek Sollenberger
Test: CtsUiRenderingTestCases:LayerTests Bug: 72052698 Change-Id: Ief845c409755e6bc61849a6ab3506ef60161f231
2018-01-22Improve layer rendering qualityStan Iliev
Increase filter quality when rendering a layer into the frame buffer from kNone_SkFilterQuality to kLow_SkFilterQuality. This visibly improves the quality if the layer is scaled. For example the circle shutter button in camera app looks better in pressed state (there is no jagged edge). Test: Ran camera app Bug: 72144993 Change-Id: I138d930a25301a369876d76a2cd322df0324f0f2
2017-12-05Allocate textures in multiples of LAYER_SIZE.Derek Sollenberger
This matches the behavior of the old HWUI renderer and avoids jank when trying to release a series of small textures. Test: UiBenchJankTests #testResizeHwLayer Bug: 69566781 Change-Id: Idc01f8438e85d4810032fd30a141132a6cdd47a1
2017-11-29Always draw render node with a non-empty projected display listYuqian Li
(cherry picked from commit f701ad3b4b43ea3c26d5881652a840120fca222d) Test: tested lockscreen ripple on taimen-eng Bug: 68859852 Change-Id: I234bba143dd4bbd5e6895dd2534eafb012ea1f16
2017-11-03Format the world (or just HWUI)John Reck
Test: No code changes, just ran through clang-format Change-Id: Id23aa4ec7eebc0446fe3a30260f33e7fd455bb8c
2017-10-20Convert skpCaptureEnabled compile time flag into a propertyStan Iliev
Convert SkiaPipeline::skpCaptureEnabled into a system property. Add ability to capture drawing in layers. Add ability to capture animations/sequence of frames. Fix crash when recording a TextureView. Test: Ran capture script. Change-Id: I463eecf6ec90a601a6cc172ad1901bd4bcc86ac8
2017-09-21Fix alpha fading in System UIStan Iliev
Fix alpha not being applied for Views that have non overlapping rendering (getHasOverlappingRendering is false). Test: Ran system UI Bug: 65857651 Change-Id: I31001de0f67bf95ab8425189a4b78427d062585d
2017-05-26Don't crash when presented with non-roundRect clipping outline.Derek Sollenberger
We still won't clip to the outline to match existing HWUI behavior. Test: CTS Graphics and hwui_unit_tests pass Bug: 38411077 Change-Id: Ia3161df77a4ccaf0e714d2fe1ac12396d1c8f9e9
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
2016-12-14SkClipOp is now an enum classMike Reed
Change-Id: If423dd013a264162ae0b7674a0eeef34bc2cdaae
2016-12-07switch over clip calls to use SkClipOp instead of SkRegion::OpMike Reed
Change-Id: I67d23c487b5249bc31d96e3b2393f693c0b2bcff
2016-11-30Merge "Add overdraw debugging feature to Skia pipelines"Matt Sarett
2016-11-29Add overdraw debugging feature to Skia pipelinesMatt Sarett
Test: Compared to OpenGL pipeline and sanity checked with understanding of the drawing pipeline. Also wrote a unit test. BUG:32370375 Change-Id: Iab397d21f0def725fa89551d48c764c67fd2bda8
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-16Add layer updates debugging feature to Skia pipelinesMatt Sarett
When this property is turned on, we flash green every time a hardware layer is updated. Test: Matches the behavior in OpenGLPipeline BUG:32370375 Change-Id: I916f94eee644c185d8a3f9fa4cd69e087ed1e92d
2016-11-03Merge "Fix RenderNodeDrawable to draw nonzero Z nodes when needed"TreeHugger Robot
2016-11-03Merge "Implement Skia pipelines for OpenGL and Vulkan."TreeHugger Robot
2016-11-03Fix RenderNodeDrawable to draw nonzero Z nodes when neededStan Iliev
Fix RenderNodeDrawable to draw nonzero Z nodes if not in a reordering section. Write an unit test modeled after FrameBuilder zReorder, which verifies the bug fix. Test: built and run unit tests on angler-eng. bug: 32541103 Change-Id: Ifbf2d51f4432f5de3af4abe5987c2a72fed14185
2016-11-03Implement Skia pipelines for OpenGL and Vulkan.Stan Iliev
Implement Skia pipelines for OpenGL and Vulkan: base SkiaPipeline, SkiaOpenGLPipeline and SkiaVulkanPipeline. Write unit tests for SkiaPipeline. Test: Built and run manually on angler-eng. Change-Id: Ie02583426cb3547541ad9bf91700602a6163ff58
2016-11-02Adding changes required by the master-skia merge.Derek Sollenberger
Test: compile only Change-Id: I39637a20da439edbf2831952df9bfa12da78e9b9
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