4336 Commits

Author SHA1 Message Date
Stan Iliev
cccd03859c Don't apply filter in readback, when there is no scaling
Fix check for scaling in SkiaOpenGLReadback: old code was not
taking into account that matrix rotation swaps width/height.

Test: Passed PixelCopyTest#testWindowProducerCopyToRGBA16F
Bug: 110097060
Bug: 111776948
Change-Id: I0d26416fa72a026bc376417773d5a73548b1f1a5
Merged-In: I0d26416fa72a026bc376417773d5a73548b1f1a5
(cherry picked from commit d50edd004b60bec3f1d36066725129276b4a53ec)
(cherry picked from commit ee7b63aa646c937e326ac5f39f07f724020533bb)
2018-08-29 15:03:08 +08:00
Stan Iliev
421449a4a6 Fix TextureView.getBitmap with scale layer transform
Fix TextureView.getBitmap to capture content only from the layer.

Bug: 111401911
Test: A new test TextureViewTest.testTransformScale is passing
Change-Id: I2b9cee17fc48de7b12ed03d5b4f173ce5445dbfe
Merged-In: I2b9cee17fc48de7b12ed03d5b4f173ce5445dbfe
(cherry-picked from ff129aefe2b68c5dc6fe51a9b1d34f98750d4973)
(cherry picked from commit 9675537555913a6aa7c25a71a6b854a083e22ede)
2018-08-29 14:54:53 +08:00
Greg Kaiser
174b50fa50 TreeInfo: Make ~ErrorHandler() virtual
ErrorHandler has a pure virtual function, so we also make its
destructor virtual, to assure any children classes will get
properly destructed.

Test: TreeHugger
Change-Id: Ie072511b450d507f8764b0888d232ffac8f6d6f5
2018-08-24 06:10:18 -07:00
Greg Kaiser
a95435b836 RenderThread: Make ~IFrameCallback() virtual
IFrameCallback has a pure virtual method, but its destructor was
non-virtual.  While CanvasContext, which inherits from
IFrameCallback, declares its own destructor virtual, this is not
sufficient when accessing via an IFrameCallback pointer.

We fix this by making the base destructor virtual.

Test: Treehugger
Change-Id: I6424f90c16caea417b5f80b60d76a7ca7c7ef97c
2018-08-23 17:07:56 -07:00
John Reck
af3e763358 Merge "Disable LTO on -eng"
am: 1918b39942

Change-Id: I925182b722d7bf6b1bb63c298a8ec9e345f0c4ac
2018-07-11 14:48:50 -07:00
John Reck
2729418128 Disable LTO on -eng
Speeds up incremental compile of one cpp file change
from over a minute to around 15 seconds

Bug: 111277863
Test: touch a .cpp file in hwui & mmm
Change-Id: I946ecad411a7a59f87ed9e1eeb146d6f57bd038a
2018-07-11 18:24:58 +00:00
Haibo Huang
9fada2364f Merge "Remove CSV support"
am: 0faecf7b89

Change-Id: I02e8b74299afda2642567e3fcf9a41653cb7b888
2018-07-09 14:41:03 -07:00
Haibo Huang
783d76ec31 Remove CSV support
CSV is deprecated upstream. See:
7b8d0249d8

Test: m checkbuild
Change-Id: I4b85535d4296c6f0d1f0eec95b40c065b3143134
2018-07-06 16:55:27 -07:00
Josh Gao
1c300861d2 Fix memory leak in RenderThread::dumpGraphicsMemory.
This would have been a double-close of fd, except we just leak the
FILE* instead.

Test: treehugger
Change-Id: I519366fbcf0eb6f03f79c22abfa2b1b1b493a70a
2018-06-26 12:37:42 -07:00
zhangkuili
399ac24bdf Merge "[Stability][hwui] check mmap return value"
am: b352dcd153

Change-Id: I8d04c5433ca881e62a23e0aa13e022cdf8d16d9a
2018-06-21 14:53:15 -07:00
zhangkuili
24a1bc39bb [Stability][hwui] check mmap return value
If mmap failed, it return -1 (MAP_FAILED)

Bug:110507462
Test: manual

Change-Id: I3d0bac2e7c8b0bdc9cfb4ebb7b766d858876679d
Signed-off-by: zhangkuili <zhangkuili@xiaomi.com>
2018-06-21 17:43:10 +08:00
Romain Guy
0e6f553743 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
Merged-In: I0ce4a81cb8e09c10a5f1e65234685767a24ef8c4
(cherry picked from commit 8472ac67fd1d815022874f5addace0c4334ae9f6)
(cherry picked from commit 8dc7f8275e5ba9004d219d7d7d990e91fc702095)
2018-06-20 22:52:35 +00:00
Yu Jia
048c6751d7 Merge "cts case com.android.server.cts.GraphicsStatsValidationTest#testDaveyDrawFrame in modue CtsIncidentHostTestCases failed" am: 2dd3d8cbef
am: d490e788f1

Change-Id: I6e3507cfb5b6501dd28fb2b6019fdbb74fb745f0
2018-06-04 19:42:29 -07:00
John Reck
b559512508 Merge "Attempting to fix the black flicker" into pi-dev 2018-06-01 03:05:51 +00:00
Derek Sollenberger
0fba15b2ba Bind correct FBO when drawing a WebView into a layer.
The WebView was unable to draw into either a standard clipped
layer or the "fading edges" unclipped layer. This CL and its
companion test cases ensure that both work with simple and
complex clips.

Bug: 79619253
Bug: 80443556
Bug: 80477645
Test: atest CtsUiRenderingTestCases:.LayerTests
Merged-In: I0e16b724f74415a61cc2a841ccf4a491f293ac94
Change-Id: I4900222975fc841b11828916878fb0ea6d87dcda
2018-06-01 01:08:15 +00:00
John Reck
5b02c629bd Attempting to fix the black flicker
Bug: 79231206
Test: Repro steps from bug

Merged-In: I4c2810c42a7a4358f64584da3ab0cdf1499e71b6
Change-Id: I4c2810c42a7a4358f64584da3ab0cdf1499e71b6
2018-05-31 12:56:28 -07:00
Yu Jia
e57493ab19 cts case
com.android.server.cts.GraphicsStatsValidationTest#testDaveyDrawFrame in
modue CtsIncidentHostTestCases failed

This cts case design 20 frames, every 4 frames include 700ms frame and
150ms frame

When activity launched, first 3 frames need allocate buffer during
dequeue buffer, bug some low-end platform took too long (>6ms), so
it will skip the fourth frame(150ms) and post a new draw callback that will cause cts failed
2018-05-30 13:34:19 +08:00
Stan Iliev
357c63d1e9 Make sure frame buffer 0 is bound before calling GL functor
Make sure view port and frame buffer are set to the correct values
before calling GL functor (WebView) draw.
Improve correctness for stencil clip by doing a second flush that
guarantees the stencil clear will be executed after draw commands.

Bug: 79619253
Test: XFINITY Connect app draws correctly
Change-Id: Ieb3d0d70caf0469b6393e6287f8529cd86519301
2018-05-23 15:29:09 -04:00
Jorim Jaggi
e4a8d4c7e9 Merge changes I608d4b61,Ia7900e75 into pi-dev
* changes:
  Follow up to Ia7900e753b29187a7a7b81f393666687e8b8e04b
  Apply surface parameters in sync with RenderThread
2018-05-18 11:49:56 +00:00
TreeHugger Robot
a2113aa4ad Merge "AnimatedImageDrawable: Eliminate unnecessary calls to redraw" into pi-dev 2018-05-17 19:54:50 +00:00
Jorim Jaggi
64be98d5d2 Apply surface parameters in sync with RenderThread
Otherwise it could lead to parameters applied in the wrong frame,
leading to jank.

Test: Open notification
Bug: 78611607
Change-Id: Ia7900e753b29187a7a7b81f393666687e8b8e04b
Merged-In: Ia7900e753b29187a7a7b81f393666687e8b8e04b
2018-05-17 01:57:31 +00:00
Leon Scroggins III
4afdd1caa4 AnimatedImageDrawable: Eliminate unnecessary calls to redraw
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-05-16 18:51:07 -04:00
Leon Scroggins
b638985cc1 Merge "Use filtering when drawing nine-patches" into pi-dev 2018-05-09 16:38:41 +00:00
Leon Scroggins III
5a663768c4 Use filtering when drawing nine-patches
Bug: 77917978
Test: Look at toggles; CtsUiRenderingTestCases

Prior to this change, the toggles look pixelated due to using a
"nearest" filter instead of a "bilerp".

This matches the behavior of the hwui renderer.

Depends on changes in Skia (Ib7d0abdd51981bddf36ec5c3fd84bb651f405f0f)
to respect the filter quality when drawing to a GPU canvas and to
remove the resulting "bleeding" effect from drawImageLattice.

Change-Id: I59d81a17f351e18574539479a38a580a02e1619b
2018-05-08 17:23:11 +00:00
John Reck
bf39913bbc Merge "Ensure GL & Gralloc both support FP16 before using it" into pi-dev 2018-05-07 20:26:02 +00:00
John Reck
b29c772429 Ensure GL & Gralloc both support FP16 before using it
Change-Id: I3bda750b6011d9a69969fc938a230c2445ee8dae
Merged-In: Id8a53885178d698c7b2fd6fc5ea8d4e36ce2ef15
Fixes: 77973662
Test: builds & CTS passes
2018-05-07 16:49:45 +00:00
Derek Sollenberger
2324991a77 Support readback of TextureView into 565 and extended sRGB.
Bug: 78906699
Test: CtsViewTestCases
Change-Id: I89e8544a883dcb3eb222c164ab57d20e55a073c3
2018-05-04 18:46:52 +00:00
android-build-team Robot
f28901f6c5 Merge "Invoke create_recording_canvas correctly in macro bench tests" into pi-dev 2018-05-02 19:38:43 +00:00
Derek Sollenberger
551d08e2d5 Respect a Layer's (e.g. SurfaceTexture) colorSpace when compositing
This CL extracts the android_dataspace from the GLConsumer and converts
it to a SkColorSpace.  HWUI always expects to composite into an sRGB
destination so when we draw the layer we run the draw through a
colorFilter that converts the input colorSpace into that of the
destination.

Test: CtsViewTestCases
Bug: 78016220
Merged-In: Ic0446a0d861e86a5a9d0382346b57fcc45c8a61b
Change-Id: Ic0446a0d861e86a5a9d0382346b57fcc45c8a61b
2018-05-01 02:45:43 +00:00
Stan Iliev
4f901c8cec Invoke create_recording_canvas correctly in macro bench tests
create_recording_canvas expects as a last parameter a render node,
which is used to reuse deallocated display lists. Passing the
render node improved performance in several tests and it is
matching how HWUI is using that API too.

bug: 69131471
Test: tvappGlTex DrawFrame is 1ms faster
Change-Id: I93d8da694c178d3fb8d1aa52afa76dd8271e93cb
2018-04-30 20:22:19 +00:00
Leon Scroggins
5bb709c31e Merge "Attach color space after performing a readback" into pi-dev 2018-04-24 20:01:22 +00:00
Leon Scroggins III
3eadfde67f Attach color space after performing a readback
Bug: 78463311
Test: I28713c3e5ce38dea15c75542801f9aef0e5b5b0a

Bitmap::getSkBitmap() is used by Bitmap#compress before encoding. If the
Bitmap has Config HARDWARE, we have to do a readback first. We cannot
necessarily do the readback using the SkColorSpace of the Bitmap, since
that requires creating an SkSurface, which does not support all
SkColorSpaces. Instead, continue using nullptr for the readback, and
then change the info and reattach the SkPixelRef.

This fixes a bug where encoding a non-SRGB HARDWARE Bitmap and then
decoding it results in a Bitmap with the wrong ColorSpace.

Change-Id: If55b2dbfeb17d81ceaf9594b32ed69b6a9058f06
2018-04-23 16:09:14 -04:00
Yao Chen
49954cd681 Add socket listener to statsd. And remove Davey atom.
+ The socket listener is behind a flag. It's disabled until we get sepolicy changes in.
+ Data parsing code is from logd, because we use the same format.

+ Removed Davey from JankTracker because it violates our new sepolicy

Test: manually
Bug: 78239479

Change-Id: Ib17729fbc362cdb13385f780e2d636a95adf9bc3
2018-04-20 17:41:25 -07:00
TreeHugger Robot
1c70ecb455 Merge "Unpin bitmaps but don't purge all scratch resources." into pi-dev 2018-04-16 17:05:45 +00:00
TreeHugger Robot
d0fdef9229 Merge "Revert "Revert "Update material_deep_teal_500 to #008577.""" into pi-dev 2018-04-12 23:23:00 +00:00
Kweku Adams
1856a4cfcc Adding privacy tags to graphicsstats proto.
Creating a copy of the graphicsstats proto so that one can be tagged
with privacy annotations and the other can be used internally while
still using the protobuf-cpp-lite library.

Bug: 72570104
Test: flash device and check incident output
Merged-In: I2d72e7bd17689c1401a16d5a13956e6528ddb525
Change-Id: I0a46ee6cc463b133925be1cf8dee8cf3d107930c
2018-04-12 14:23:15 -07:00
Derek Sollenberger
92a9eb9713 Unpin bitmaps but don't purge all scratch resources.
This is a partial revert of b1f27aae89a9da9fbf3cb15a47f1a401db5a7974.

Test: hwui_unit_tests
Bug: 77654081
Change-Id: I5a58c156a280edfe3e9973ac3a8a30c97a2cff8b
2018-04-12 13:42:19 -04:00
Andrew Sapperstein
8546c30fbf Revert "Revert "Update material_deep_teal_500 to #008577.""
This reverts commit 431d9d63e993c6056e95811e9a84869aa324e7a0.

Reason for revert: Rolling forward with a fix.

Change-Id: I5804e240535b84e0f4b2d306649b1981a9871632
Merged-In: I5804e240535b84e0f4b2d306649b1981a9871632
Bug: 74118164
Test: atest cts/hostsidetests/theme
2018-04-11 20:48:11 +00:00
Krzysztof Kosiński
052dd1e712 Merge "hwui/debug: Remove glMultiDrawElementsBaseVertexOES stubs." into pi-dev 2018-04-10 22:23:09 +00:00
TreeHugger Robot
2b28f0699a Merge "Improving jank tests diagnostics" into pi-dev 2018-04-06 20:57:25 +00:00
Vadim Tryshev
a90b243e46 Improving jank tests diagnostics
When there were 0 total frames, ProfileData generates something like:
Janky frames: 0 (nan%)

Then the test fails to parse it, and ends up with a mysterious
"Failed to parse NUM_JANKY" diag (see the bug).

Making the case 0/0 a 0%.

Bug: 77528721
Test: atest google/perf/jank/SystemUI/UbSystemUIJankTests:android.platform.systemui.tests.jank.LauncherJankTests#testOpenAllAppsContainer
Change-Id: Ib65b80dc689f7b6ee06b108114ffd7de9d739721
2018-04-06 12:25:40 -07:00
Jorim Jaggi
767e25ed61 Add ability to change context priority of RT GL context
Test: Use method, observe GPU preemption behavior
Bug: 75985430
Change-Id: Idc08d37f8c95f52c5aab7edf09c0cbff72b8482d
2018-04-06 12:12:07 +00: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
Krzysztof Kosiński
fc968058bf hwui/debug: Remove glMultiDrawElementsBaseVertexOES stubs.
This function was included by mistake in Khronos OpenGL headers.
See this link for further information:
https://github.com/KhronosGroup/OpenGL-Registry/issues/81

Bug: 32147090
Bug: 66900669
Bug: 72959780
Test: Built and flashed the build onto Pixel XL, ran some CTS tests.
Change-Id: If8f9837466b7d3eb0685624a70b5d5b6fbd86e2e
2018-04-02 09:44:22 -07:00
Stan Iliev
003a9f6738 Fix memory leak in ShaderCache
Fix memory leak in a limited memory situation within
ShaderCache::load().

Bug: 76213660
Test: Passed ShaderCacheTest unit test, ran a build on device.
Change-Id: Ibb6ea8fe167eb22bcbbaffc4cfffac12eda98c42
2018-03-30 14:19:39 +00:00
Leon Scroggins III
1a12ab26d4 Fix Skia's impl for TextureView.getBitmap
Bug: 73392905
Test: New test added with I2d4ef440f943a50b9367976ba1444f4350071bfd

When providing a width and height, getBitmap should scale to the
destination. Add a parameter to LayerDrawable::DrawLayer for a
destination rectangle to scale to. Pass the size of the bitmap in
SkiaOpenGLPipeline::copyLayerInto down to DrawLayer. The only other
caller of DrawLayer is unaffected.

Change-Id: I7aa192181c2d15bc8fd4de2fb15c4d276b05d2ac
2018-03-29 19:30:28 +00:00
dohyunia.kim
2e57a442f3 Change shader precision because of CTS fail
Change-Id: I5d8747ecf9091a251b56d3a9de4bdb8ab0260898
Merged-In: I5d8747ecf9091a251b56d3a9de4bdb8ab0260898
2018-03-29 19:26:09 +00:00
TreeHugger Robot
67a58660b9 Merge "Better error reporting for createOrUpdateLayer" into pi-dev 2018-03-28 20:28:59 +00:00
Stan Iliev
216b1572b4 Better error reporting for createOrUpdateLayer
Pass error handler down to the pipeline object, which allows
skia pipelines to print cache memory usage.
In case of an error, print arguments that were used to invoke
SkSurface::MakeRenderTarget.

Test: Ran android build on a device
Bug: 76115654
Change-Id: I5baddfa66debd505eddc3117cf94aa6ae69bedaa
2018-03-28 13:49:21 -04:00