130 Commits

Author SHA1 Message Date
Stan Iliev
7e100e912c Improve layer rendering quality
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
2018-01-22 16:10:26 -05:00
Stan Iliev
a31973fe3a Create an empty stub for Vulkan readback
Create a stub for Vulkan readback. This avoids crashing,
because OpenGL readback does not work for Vulkan.

Test: Ran calc and gmail apps with skiavk pipeline.
Change-Id: I11cddde0a1efae1aa549e7a47d01051ec975f470
2018-01-12 11:50:29 -05:00
Stan Iliev
ba72f9a288 Remove error log messages when skia shader cache is disabled
Ideally processes with a render thread, would turn on shader
caching, but system_server is an exception.

Test: checked logcat for ShaderCache not initialized messages
Bug: 71718344
Change-Id: I5d4df6ae912a6fec3f019c9c831a1177937ea53b
2018-01-09 15:59:35 -05:00
Mike Reed
ebf96fbed7 SkPixelSerialize is deprecated (and unneeded in this case)
Test: make

Change-Id: Icc421586de82a516cb5e32b60949315d1108a9a3
2017-12-13 13:44:13 -05:00
Stan Iliev
e12d7315dd Enable fast drawing for solid color nine patch rectangles
Pass a hint to Skia, about which lattice rectangles are solid
color rectangles.

Bug: 69796044
Test: Measured ninepatch performance using sample app from the bug
Change-Id: Ib07b1b64c78ab16195f9af88a989d28682084565
2017-12-11 18:22:17 +00: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
Derek Sollenberger
03e6cff7a6 Allocate textures in multiples of LAYER_SIZE.
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-12-05 10:41:07 -05:00
Yuqian Li
5ebbc8e5e3 Always draw render node with a non-empty projected display list
(cherry picked from commit f701ad3b4b43ea3c26d5881652a840120fca222d)

Test: tested lockscreen ripple on taimen-eng

Bug: 68859852
Change-Id: I234bba143dd4bbd5e6895dd2534eafb012ea1f16
2017-11-29 16:10:29 +00:00
John Reck
3c0369bf02 Create colored shadows demo
Test: HwAccelerationTest demo
Bug: 68211332
Change-Id: Ia53a6ac2854570d0495b355bbebee1dcec2f47ba
2017-11-13 16:53:48 -08:00
Derek Sollenberger
c061b43847 Merge "Fix bug in View system recording where Skia dropped the colorFilter." 2017-11-10 19:44:42 +00:00
Derek Sollenberger
4eb214459f Fix bug in View system recording where Skia dropped the colorFilter.
Test: CtsUiRenderingTestCases added ColorFilterTests::testColorMatrix
Bug: 69071705
Change-Id: I45268c9a40e47d44045d795ccb772ea93c3e699d
2017-11-09 16:35:56 -05:00
Stan Iliev
f1f3c38908 Use Skia API to detect if FP16 render buffer is supported
Use Skia GrCaps to detect if we can render into a FP16 buffer.
Exclude Extension class initialization from SkiaGL pipeline.

Bug: 68383159
Test: Passed testWindowProducerCopyToRGBA16F on gce_x86_phone emu
Change-Id: I3355bad891ed5403fbd94d18bb8ba110a3b77325
2017-11-09 12:56:34 -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
Romain Guy
8472ac67fd Fix PixelCopyTest failure in CTS
This feature needs support for renderable float textures, but the checks
were only guaranteeing support for float texture reads.

Bug: 68754504
Test: CtsViewTestCases

Change-Id: I0ce4a81cb8e09c10a5f1e65234685767a24ef8c4
2017-11-01 13:06:54 -07:00
TreeHugger Robot
a89c2a3160 Merge "Fix testWindowProducerCopyToRGBA16F test on x86 emulator" 2017-10-31 21:07:55 +00:00
Stan Iliev
7475d0f8db Fix testWindowProducerCopyToRGBA16F test on x86 emulator
Fix readback to return correct error code on X86 emulator, when
half float pixel format is not supported.

Test: Ran and passed all CtsViewTestCases tests on x86 emulator
Bug: 68383159
Change-Id: Id66484b73488e2c8d29fbecbd45a97af285a0710
2017-10-31 11:47:54 -04:00
Stan Iliev
cf91788ec6 Fix PixelCopy readback
Apply correct texture transform and use filter if source and dest
have different size.

Test: Ran and passed CtsUiRenderingTestCases,
Test: CtsGraphicsTestCases, CtsViewTestCases tests and the
Test: DecodeAccuracyTest.
Bug:68051015
Change-Id: Iee885e243e43497c9294f7475c0c5b9c1a783754
2017-10-30 13:46:20 -04:00
TreeHugger Robot
30dfc68a9f Merge "Convert skpCaptureEnabled compile time flag into a property" 2017-10-20 23:57:03 +00:00
TreeHugger Robot
59dc558e89 Merge "Fix crash in "Tree::updateBitmapCache"" 2017-10-20 22:20:57 +00:00
Stan Iliev
e9d0012bbf Convert skpCaptureEnabled compile time flag into a property
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-20 17:49:12 -04:00
Stan Iliev
47fed6ba6a Fix crash in "Tree::updateBitmapCache"
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-10-20 16:03:25 -04:00
Stan Iliev
d56d2188fc Fix crash in Vulkan pipeline at boot time
Fix a crash caused by calling OpenGL APIs with Vulkan pipeline
(likely a regression from ag/2706458).

Test: Ran CtsViewTestCases tests with SkiaGL pipeline.
Change-Id: Ibabeb4229ef88de57c99f2961a10a68ca71b25ab
2017-10-18 13:12:32 -04:00
Stan Iliev
a73b0be1ea Fix layer transform matrix for TextureView
Fix order of matrix multipication and use drawImage instead of
shader.

Test: Ran camera app, message app and smart face lock app.
Bug: 67405584
Change-Id: I3df161d58218e1b1845f1c1ca2db2b12c51b3532
2017-10-06 12:22:07 -04:00
TreeHugger Robot
2f3072bcf4 Merge "Unpin images when skia pipeline object is destroyed" 2017-09-29 18:17:38 +00:00
Stan Iliev
944dbf255a Apply texture matrix to the layer canvas
Fix camera preview shown inverted. Apply texture matrix when
drawing opengl layer.

Test: Ran camera preview in message app and smart lock with face.
Ran CtsUiRenderingTestCases and CtsGraphicsTestCases tests.
Bug: 65534412
Change-Id: I3ed52a6c62921fcdfe30104dd176802ed1533fad
2017-09-27 14:39:07 -04:00
Stan Iliev
232f3628bc Unpin images when skia pipeline object is destroyed
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-26 17:12:50 -04:00
Stan Iliev
1843ac7cc9 Fix alpha fading in System UI
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-09-21 17:14:10 -04: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
Derek Sollenberger
f7df184fa1 Only flush after all layers are drawn instead of after each layer.
This approach avoids paying for any extra overhead in flushing
commands from Skia to the GPU.

Test: LauncherJankTests#testOpenAllAppsContainer
Change-Id: Ie4be3592d1b032a06d848c994b8be435638d24c8
2017-09-05 14:37:28 -04:00
Derek Sollenberger
7fe53c1eaf Render VectorDrawables in software and then upload to the VDAtlas.
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-31 15:50:41 -04:00
Derek Sollenberger
9552c2c98c Adding traces and some generic cleanup.
Test: CtsUiRenderingTestCases
Change-Id: I6863eca20bf6ca2d17e9867c3c3ac12cb35dc809
2017-08-31 15:37:52 -04:00
Derek Sollenberger
579317d4eb Avoid performing the pathOp for clipped shadows if possible.
Bug: 64487466
Test: SystemUiJankTests#testRecentAppsFling
Change-Id: I2ca96bd6adba299cd31e12f005b2529c559740d2
2017-08-30 12:47:08 -04:00
Stan Iliev
6b894d7746 Release VectorDrawable cache surface on render thread
Release VectorDrawable cache surface on render thread.
This is fixing an assert in skia GrSingleOwner.h:33.

Test: Ran gmail before and after the change.
Bug: 64842607
Change-Id: I46e0c2557ac5b2fc3be2cc2d35abf96f6d6c9399
2017-08-25 10:25:11 -04:00
Derek Sollenberger
6c2a9e2bc1 Use the faster path when calling drawImageRect.
Bug: 64487466
Test: CtsGraphicsTestCases, CtsUiRenderingTestCases
Change-Id: Ib2312598b50d402b1749d62a10c6ec343eff5b89
2017-08-15 16:23:01 -04:00
TreeHugger Robot
a977a9f90f Merge "Fix CtsViewTestCases when running on swiftshader emulators." 2017-08-09 20:13:04 +00:00
Derek Sollenberger
4170db32c0 Fix CtsViewTestCases when running on swiftshader emulators.
Test: CtsViewTestCases
Bug: 64478761
Change-Id: Ie85d25054c2f426cc88cf512c166c175b894a8fe
2017-08-09 13:58:38 -04:00
TreeHugger Robot
886ae9fd26 Merge "Use colorFilters when rendering to an sRGB bitmap." 2017-08-07 14:43:06 +00:00
Derek Sollenberger
fa3e340431 Use colorFilters when rendering to an sRGB bitmap.
Bug: 62347704
Test: CtsUiRenderingTestCases, CtsGraphicsTestCases, hwui_unit_tests
Change-Id: I3e237b64cd92217b02d4995bdd695a28d3f393ee
2017-08-07 08:43:23 -04:00
Derek Sollenberger
a7f6af2c51 Revert "Use colorFilters when rendering to an sRGB bitmap."
This reverts commit b851b197497783f894b72edcaed8f93d035ddea0.

Change-Id: I5bb8fe9bf9f5d411674e289c467b3f569f7bb068
2017-08-02 21:57:42 +00:00
Stan Iliev
6a3b0553d9 Implement efficiently non-rectangular clips in GLFunctorDrawable
Implement non-rectangular clips by writing into the stencil
buffer using new Skia API. This CL is fixing
PathClippingTests#testWebViewClipWithCircle test, which was
failing on some devices.

Bug: 34454070
Bug: 31489986
Test: CtsUiRenderingTestCases tests passed for Skia pipeline.
Change-Id: I29d7af02e2af53943540a91393f5d7a8c4e44049
2017-08-02 16:05:11 -04:00
Derek Sollenberger
b851b19749 Use colorFilters when rendering to an sRGB bitmap.
Bug: 62347704
Test: CtsUiRenderingTestCases, CtsGraphicsTestCases
Change-Id: I55a574ffd9305588b82345a598da7818952a131d
2017-08-02 11:37:46 -04:00
TreeHugger Robot
d1cc7910c4 Merge "Fix SurfaceTexture CTS test case when using the Skia pipeline." 2017-07-28 19:44:06 +00:00
TreeHugger Robot
f8e19f6802 Merge "Enable colorspace conversion while perserving legacy blending." 2017-07-27 17:15:19 +00:00
Derek Sollenberger
fb0c8fc3d5 Enable colorspace conversion while perserving legacy blending.
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-27 10:52:11 -04:00
Stan Iliev
1220a2a4ce Fix Skia pipeline readback for non-portrait mode (part 2)
Apply correctly the image trans form matrix passed to
SkiaOpenGLReadback::copyImageInto. This is a fix for capture when
screen is rotated on 180 degrees.

Test: Ran CtsViewTestCases CTS tests for Skia pipelines.
Bug: 63629735
Change-Id: I2b86390352feb2538ad1591b18aa5e5a175f4c95
2017-07-26 14:22:43 -04:00
Stan Iliev
08fc19af87 Use F16 render target when wide color rendering is enabled
Support F16 render targets in Skia pipeline. Enable readback from
F16 surface.

Test: device boots with Skia pipeline
Change-Id: Ib31e618be1a987de3736987a496c799693923594
2017-07-26 09:27:29 -04:00
TreeHugger Robot
71b257b5f4 Merge "Fix Skia pipeline readback for non-portrait mode" 2017-07-19 13:37:19 +00:00
TreeHugger Robot
8709b82c4d Merge "Improve color correctness for drawing bitmaps with Skia pipeline" 2017-07-19 13:25:27 +00:00
Stan Iliev
0a3ff952a6 Improve color correctness for drawing bitmaps with Skia pipeline
Fix drawing of bitmaps with color profiles. This CL is making
ColorSpaceTests and Rgba16fTests CTS tests to pass with Skia
pipeline. Drawing bitmaps withs pixels outside SRGB range
may need more work (ColorSpaceTests#testDrawDisplayP3 test use a
a wider gamut, but the actual pixels fall into the SRGB range).

Test: Ran CtsUiRenderingTestCases with HWUI and Skia pipeline.
Bug: 62347704
Change-Id: I8d318076bb38f7d32bfde7e5492ae7a61f4731a5
2017-07-19 09:22:39 -04:00