summaryrefslogtreecommitdiff
path: root/libs/hwui/pipeline/skia/SkiaPipeline.cpp
AgeCommit message (Collapse)Author
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-03Format the world (or just HWUI)John Reck
Test: No code changes, just ran through clang-format Change-Id: Id23aa4ec7eebc0446fe3a30260f33e7fd455bb8c
2017-10-20Merge "Convert skpCaptureEnabled compile time flag into a property"TreeHugger Robot
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-10-20Fix crash in "Tree::updateBitmapCache"Stan Iliev
Fix crash caused by updating vectordrawable cache for objects from previous frames, which may have been deleted. Bug: 67940327 Test: Ran CtsUiRenderingTestCases test Change-Id: I4466235e78e9b7937a0d4428240574d9e3d0989f
2017-09-26Unpin images when skia pipeline object is destroyedStan Iliev
Unpin images when skia pipeline object is destroyed. This fixes an assert in skia ~SkImage_Raster. Test: Built and ran Android on a device. Bug: 66730647 Change-Id: I73603efd4fc2ca584cdb8f6a4774e48a187f6787
2017-09-08Enable multi-threading of cpu intensive tasks when using Skia pipelinesDerek Sollenberger
Test: CtsUiRenderingTestCases Change-Id: Ifa36371f55d3f2d78faf0a23fb283c904ff1af5f
2017-09-05Only flush after all layers are drawn instead of after each layer.Derek Sollenberger
This approach avoids paying for any extra overhead in flushing commands from Skia to the GPU. Test: LauncherJankTests#testOpenAllAppsContainer Change-Id: Ie4be3592d1b032a06d848c994b8be435638d24c8
2017-08-31Render VectorDrawables in software and then upload to the VDAtlas.Derek Sollenberger
For frames with multiple VDs the context switching involved was causing worst case frame times of ~40ms to draw all VDs in the frame whereas this new approach has worst case performance of ~5ms when drawing the same frame (w/ approximately 26 VDs). Bug: 64487466 Test: SystemUiJankTests#testGoToFullShade Change-Id: I5cad0b5df86e5eac3722ee8695fc7511b38b8a7c
2017-08-31Adding traces and some generic cleanup.Derek Sollenberger
Test: CtsUiRenderingTestCases Change-Id: I6863eca20bf6ca2d17e9867c3c3ac12cb35dc809
2017-07-27Enable colorspace conversion while perserving legacy blending.Derek Sollenberger
When requesting an SkImage from a android::Bitmap we will also return a colorFilter that will perform the sRGB conversion at draw time. Bug: 62347704 Test: CtsUiRenderingTestCases, CtsGraphicsTestCases, CtsViewTestCases Change-Id: Icc4694e2c42605e29fcc834c252bc21263bac658
2017-07-26Use F16 render target when wide color rendering is enabledStan Iliev
Support F16 render targets in Skia pipeline. Enable readback from F16 surface. Test: device boots with Skia pipeline Change-Id: Ib31e618be1a987de3736987a496c799693923594
2017-07-19Merge "Fix incorrect asserts"TreeHugger Robot
2017-07-18Cache VectorDrawables in an atlasStan Iliev
Optimize VectorDrawables for Skia pipeline: draw small VectorDrawables in a GPU atlas instead of seprate offscreen buffers. This implementation is using CacheManger and allows for the atlas to be released if there is a memory pressure. Test: A new unit test for VectorDrawableAtlas is passing. Systrace shows 0.5ms faster DrawFrame for fling in Settings app main screen. Change-Id: Ide3884eefae777e1547f1dfdb67b807185839fb4
2017-07-18Fix incorrect assertsStan Iliev
Fix a few Skia asserts, which prevent HWUI from compiling and running when SkDebug is defined. Test: Built and ran Android on device. Change-Id: Ie7f16016ba105e1d376c266c5b030e4bc04629d9
2017-06-14Use RGBA16F layers when wide color gamut rendering is onRomain Guy
Layers created using View.setLayerType() or Canvas.saveLayer() need to be RGBA16F/scRGB-nl when within a window that requested wide color gamut rendering. Bug: 29940137 Test: CtsUiRenderingTestCases, CtsGraphicsTestCases, hwui_unit_tests Change-Id: I42fd6355448c92041491a7109e3ac8a153d38bf9
2017-06-06Implement CacheManager for the Skia pipelines.Derek Sollenberger
The core of the implementation is complete and provides heuristic cache sizing based on the size of the surface being used. This CL will also be used to add the following features in the future... 1) Support Vulkan pipeline reporting on the size of the surface. 2) Complete the VectorDrawableAtlas stub code 3) Automatic purging of stale resources for low memory devices. Test: hwui_unit_tests (new test added) and CtsUiRendering Bug: 62260637 Change-Id: Ib85159cca28b646fe249f2190b07f1b7e0f50d8f
2017-06-02Implement HW Bitmap for Skia pipelineStan Iliev
Implement HW Bitmap for Skia pipeline. Use new Skia SkImage::MakeFromAHardwareBuffer API, which will enable to record HW Bitmap into a picture. Move logic that uploads SkBitmap into a GraphicBuffer into pipeline specific classes. Test: All CTS and other tests pass for HWUI pipleine. For Skia pipeline graphics CTS tests pass, 2 UIRendering CTS tests which excise HW bitmaps with color spaces fail, bitmapShaderEglImage macrobench fails (to be fixed by a CL in Skia), HWUI unit tests pass, no EGL leaks found. Change-Id: Id5926d7cccd81af8b55400f44fb524a427543d05
2017-05-17Revert "Fix recent apps in system UI for Skia pipeline"John Reck
This reverts commit b33013fb3c570e0a3ced8729dced9f0d294761a6. Reason for revert: Caused a memory leak, b/38330767 Bug: 38136140 Bug: 38330767 Test: manual, verified memory isn't leaking doing the steps in b/38330767 Change-Id: I98b2dfd750be57a15785808e2d5723616e2ce20a
2017-05-12Fix recent apps in system UI for Skia pipelineStan Iliev
Enable HW Bitmaps for Skia pipeline just enough to make recent apps list working by adding support for BitmapShader. Drawing HW bitmaps in a canvas is also supported. Test: recent apps work, HWUI unit tests pass, CTS tests pass. bug: 38136140 Change-Id: Ibd06c859c86dc213310d5ce5272497e1882d0cc6
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-17Use access directly instead of sk_exists.Ben Wagner
Skia would like to move SkOSFile and make it private spi. This appears to be the only place SkOSFile is used outside Skia, and using access here directly is more apropriate. Test: Simple inline refactor, built and ran. Changes test code only. Change-Id: Ib76c180bb3bccc54c20dcadc842837e3e8270929
2017-03-02Fix potential use-after-free in LayerUpdateQueueJohn Reck
Change-Id: I090af2191576175b165a9db574a80123c16f0778 Fixes: 26548204 Test: Builds & hwui unit tests pass
2016-12-16Ensure root render node clip cannot expand beyond dirty areaStan Iliev
Use new Skia API to enfore clip restriction for root render node. This brings Skia pipeline in line with HWUI. Unit test is updated to reflect the new behaviour. Test: Built and ran angler-eng, ran HWUI unit tests. Change-Id: Iffce70fd37b6aff45eb6a23c8b1a64f45b5f1463
2016-12-16Revert "try to stop using exotic clipps"Chris Craik
This reverts commit 834653bcf80a3879c4d80004469053f205d45b69. Change-Id: Ie8cb787490832a0be154ec1263313982157faa81
2016-12-15try to stop using exotic clippsMike Reed
Change-Id: Id11d7744daa69c19fdc9b7723862b3d71ad21384
2016-12-14SkClipOp is now an enum classMike Reed
Change-Id: If423dd013a264162ae0b7674a0eeef34bc2cdaae
2016-12-13Remove unnecessary dependency, and fix the chainLeon Scroggins III
Test: No new tests. This should not affect behavior; only dependencies. Font.h does not need to include SkGlyphCache.h, and doing so requires a transitive dependency on external/skia/src/utils, which was not intended. Forward declare it instead, and fix the build errors that resulted. Change-Id: Ifd09430bb848d51b139df0f0c06c63e7e48711eb
2016-12-12Add more Skia pipeline unit tests.Stan Iliev
Add more Skia pipeline unit tests and fix an issue in backdrop/content bounds clip logic. Test: built and run angler-eng and HWUI unit tests. Change-Id: Ie41f80ff7ce9802a4d76e8b14f1695dbc9771a2b
2016-12-07Merge "switch over clip calls to use SkClipOp instead of SkRegion::Op"Mike Reed
2016-12-07switch over clip calls to use SkClipOp instead of SkRegion::OpMike Reed
Change-Id: I67d23c487b5249bc31d96e3b2393f693c0b2bcff
2016-12-07SkImageEncoder->SkEncodeImageHal Canary
Test: none Change-Id: I15630d2852d12840329181f135852e28d287bbcf (cherry picked from commit 8c6bac4c77caeefb667bec90d16b5384fd2b2b31)
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-17Merge "Update pinImages to report when GPU resource limits are exceeded."Derek Sollenberger
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-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-08Merge "Add debug memory tracking to SkiaGLPipeline"TreeHugger Robot
2016-11-07Add debug memory tracking to SkiaGLPipelineMatt Sarett
Test: Sample output is below D/OpenGLRenderer: Resource Cache Usage: D/OpenGLRenderer: 32 items out of 8192 maximum items D/OpenGLRenderer: 4635572 bytes (4.42 MB) out of 96.00 MB maximum This is less verbose than OpenGL memory debug output for two reasons: (1) SkiaGL has less caches. (2) SkiaGL does not support printing on cache additions/evictions. This seems like more of an internal debugging tool rather than a user-facing debug feature. I think it's best to leave this unimplemented until we find that it might be useful. BUG:32370375 Change-Id: Ib063f1c2a7f88e9840341b1001d227f556d88f26
2016-11-07Refactor pin/unpinImages to work across pipelines.Derek Sollenberger
Test: existing CTS tests still pass Change-Id: Ib2607e9853396bad42f298829b5c5da0d210af32
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