Commit Graph

26 Commits

Author SHA1 Message Date
Greg Daniel
1d857f03f7 Make sure to sync GPU after deleting memory in trimMemory.
On GL some devices may not delete gpu memory immediately after calling
delete and instead will just queue it up. We must call glFinish to
make sure the memory is deleted when we want it.

More importantly Vulkan memory will not be freed until the GPU is done
with all the work. Thus we require an additional flush to make sure the
previous gpu work we submitted has finished and we can delete the
memory.

Test: manual testing on device
Bug: b/130440975
Change-Id: I2a9202dd7d15d97b365120a8caf9e10b4100efc3
2019-04-22 13:43:06 +00:00
Derek Sollenberger
b9e296e18f Update the CPU text cache sizes to be the same as their GPU equivalents
Bug: 130684261
Test: uibench jank tests
Change-Id: Ieb837afd76d1990c796baa9794ba54a83b8cd46f
2019-04-19 15:29:48 -04:00
John Reck
0fa0cbcade Support render-ahead in vulkan
Bug: 127822449
Test: verified render_ahead working with skiavk
Change-Id: Iae1b227a763f6def035057f38cca4b0ab65c7e82
2019-04-12 13:33:25 -07:00
John Reck
322b8ab774 Remove old TaskManager system
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-18 09:34:11 -07:00
Christopher Dalton
3fcb697963 Revert "Enable CCPR in Ganesh"
This reverts commit 131654943d.

Reason for revert: b/124049413 

Change-Id: Iba0cf734ba8d6a16a1ee2930b162760e59a76444
2019-02-21 20:09:22 +00:00
Chris Dalton
131654943d Enable CCPR in Ganesh
Test: m, flashed, booted

Change-Id: I5568d9f0748598926eb5687e9c0c0fb40b880154
2019-01-09 18:02:34 +00:00
Stan Iliev
43d0613325 Change formula for font cache size
Set font cache size to one screen buffer size.
For Pixel 2 XL this increased the texture size from
3670016 to 4194304. Skia can allocate up to 4 textures
of that size.

Test: UiBenchJankTests#testInflatingEmojiListViewFling
Bug: 121157706
Change-Id: I7af1f184c6dbc10b45a8ef80a04200d518fbaa0e
2019-01-08 19:54:20 +00:00
Stan Iliev
564ca3e2c9 Reland "TextureView Vulkan support and optimized OpenGL draw"
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 a683eb3945.

Bug: 113673613
Test: Ran TextureView CTS and lensblur in camera app
Change-Id: If3bcf9cd5195de09fd67a753708568a8e3ca3a9a
2018-09-05 01:58:34 +00:00
Yichi Chen
9f95955620 Add cache validation to ensure the validity
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-09-04 04:04:58 +00:00
John Reck
867c43de05 Revert "TextureView Vulkan support and optimized OpenGL draw"
This reverts commit c8e22a6532.

Reason for revert: broke camera, b/113555199

Bug: 113555199
Change-Id: Iae9b462694d5de0cd99427afead63b567fb4d71d
2018-08-30 18:42:08 +00:00
Stan Iliev
c8e22a6532 TextureView Vulkan support and optimized OpenGL draw
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-29 10:22:03 -04:00
Stan Iliev
5d03348436 Fix path rendering issues
Fix remaining battery icon. Disable CCPR, which seems to
have caused a regression.


Test: Ran SystemUI and battery icon is drawn white.
Bug: skbug.com/8127
Change-Id: Ic82bce14b760a8889ea2261c44b2631dc755288f
2018-07-03 19:50:06 +00:00
John Reck
80e73eee08 Merge changes Ie7b336ea,I36a8cb45
* changes:
  Remove Properties::isSkiaPipeline (3/!?)
  So long OpenGLPipeline & OpenGLReadback (2/??)
2018-04-17 21:18:39 +00:00
John Reck
1072fffddb Remove Properties::isSkiaPipeline (3/!?)
Test: hwuiunit & CtsUiRenderingTestCases pass
Change-Id: Ie7b336eacdd1b8660e09653c64eb6ea0a7b4a258
2018-04-12 15:21:21 -07:00
Derek Sollenberger
92a9eb9713 Unpin bitmaps but don't purge all scratch resources.
This is a partial revert of b1f27aae89.

Test: hwui_unit_tests
Bug: 77654081
Change-Id: I5a58c156a280edfe3e9973ac3a8a30c97a2cff8b
2018-04-12 13:42:19 -04:00
Derek Sollenberger
b1f27aae89 Free up all scratch resources when the app's UI is hidden
Bug: 73808481
Test: hwui_unit_tests
Change-Id: I9f191c776a936c1be40702ff0924c7ad054526d5
2018-04-03 11:53:43 -04:00
Derek Sollenberger
0057db22fe Print detailed memory usage of Skia for dumpsys gfxinfo
Bug: 74435803
Test: adb shell dumpsys gfxinfo [package_name]
Change-Id: I1f2bcab500fb47c5e0b50c7459d4a876b063916b
2018-04-02 15:37:06 -04:00
Greg Daniel
660d6eca99 Update GrContext creation calls to use sk_sp
Test: manual testing

Change-Id: I68d8706ffa7bc7c6622ea0b8c45d7297a131f6bf
2017-12-11 09:39:16 -05:00
Stan Iliev
e75ef1fb3f Enable Skia shader cache
Enable Skia shader cache after fix for image and text drawing
issues were landed in Skia.

Test: Ran Hangouts, Settings, CNN, Drive, GMail, Calendar, Clock
Test: Maps, Docs, Play store, YouTube apps.
Change-Id: I94cd07e95b704bc164894aa8b8c63f49ded198f5
2017-11-29 18:28:47 -05:00
Stan Iliev
01b439475c Disable skia shader cache
Disable skia shader cache, which is causing image rendering
issues.

Test: Ran CNN app and images are OK.
Bug: 69264347
Change-Id: Ie81f3398074f28ac1670333f1fd3c95267b2beb3
2017-11-14 13:42:42 -05:00
Stan Iliev
d495f43992 Implement SkSL cache
Implement SkSL cache by reusing code and logic from egl_cache_t.

Test: Improves startup times for gmail by 15ms and 10ms for calc app.
Bug: 66740665
Change-Id: I9ba479c649ba97a2c29a48d40579ba001264c957
2017-11-08 18:55:41 +00:00
John Reck
1bcacfdcab Format the world (or just HWUI)
Test: No code changes, just ran through clang-format
Change-Id: Id23aa4ec7eebc0446fe3a30260f33e7fd455bb8c
2017-11-03 10:57:44 -07:00
Derek Sollenberger
8ec9e88cda Enable multi-threading of cpu intensive tasks when using Skia pipelines
Test: CtsUiRenderingTestCases
Change-Id: Ifa36371f55d3f2d78faf0a23fb283c904ff1af5f
2017-09-08 10:24:27 -04:00
Stan Iliev
dd098e8d78 Disable VD shared atlas surface
Using a shared atlas surface is causing a variance in AA pixels
when drawing the same content. This is causing some CTS tests in
CtsPreference2TestCases to fail because of up to RGB(1,1,1)
difference in AA pixels in screenshots of a recreated activity.
Another effect is reducing memory usage ("GL mtrack" down by
10MB for clock app).

Test: Ran CtsPreference2TestCases tests.
Bug: 64487466
Change-Id: I1e5a547285c885136b6885d129d566d5b0c2ed76
2017-08-09 14:55:36 -04:00
Stan Iliev
3310fb1b24 Cache VectorDrawables in an atlas
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-18 19:00:15 -04:00
Derek Sollenberger
f9e45d1d81 Implement CacheManager for the Skia pipelines.
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-06 14:19:37 -04:00