Commit Graph

4862 Commits

Author SHA1 Message Date
John Reck
ff299aef20 Fix for Surface#lockHardwareCanvas lockups
By avoiding setting a dequeue buffer timeout we avoid
hitting a different path in BufferQueue that prevents
async behavior from happening. This restores P's
behavior in this path.

Bug: 143860379
Test: repro app in bug
Change-Id: Iffbd9f9e6689a40876ff3aa74c10020e3f09fc6a
Merged-In: Iffbd9f9e6689a40876ff3aa74c10020e3f09fc6a
2019-11-22 19:16:21 +00:00
John Reck
3f333d6d72 Increase dequeueBuffer timeout
Timeout recovery isn't working properly, so increase it
to avoid any false-positives from something like a
slow screen-on

Bug: 137509524
Test: none
Change-Id: Ic4fae04b41f71600479f9557e334f67c27851db4
2019-07-18 10:48:49 -07:00
John Reck
282048a2b0 Merge "Fix setPositionListener race condition" into qt-dev
am: 2c52298236

Change-Id: Iea1515f11646a38bf7252ac7ee547296aeddced1
2019-06-12 18:10:47 -07:00
John Reck
097e1d3330 Fix setPositionListener race condition
Fixes: 131625115
Test: atest android.view.cts.SystemGestureExclusionRectsTest android.view.cts.SurfaceViewSyncTest android.uirendering.cts.testclasses.SurfaceViewTests

Change-Id: Ia357ff6fa5d5fe1e152abc23bbd6d8051cfd7aa7
2019-06-12 15:41:50 -07:00
Ady Abraham
9c501aad4b DisplayEventDispatcher: use eConfigChangedDispatch
In order to get DISPLAY_EVENT_CONFIG_CHANGED, eConfigChangedDispatch needs
to be used when creating DisplayEventDispatcher.

Bug: 131688378
Test: adb shell /data/nativetest64/libsurfaceflinger_unittest/libsurfaceflinger_unittest
Test: trigger config change and observe logcat
Change-Id: I0de8037ee5b024b7d9729750f582be919087be41
2019-06-07 10:26:47 -07:00
Nader Jawad
476d0d1605 Brought back compatibility check for falling back on dest_out
whenever clear is used as a blend mode to draw bitmaps

Modified SkiaRecordingCanvas to call filterBitmap instead of
filterPaint in order to conduct the necessary compatibility checks
to use dest_out instead of clear whenever a bitmap is drawn

Test: In progress..
Bug: 131689368
Change-Id: I56d015e773b312cac948d850ca2997d8df0cc66d
Merged-In: I56d015e773b312cac948d850ca2997d8df0cc66d
2019-05-30 15:51:37 -07:00
TreeHugger Robot
7ede526835 Merge "Log less" into qt-dev 2019-05-24 20:48:31 +00:00
John Reck
db72e7aa8a Log less
These aren't really actionable logs by whatever
is producing them, so move to verbose

Bug: 131773342
Test: build
Change-Id: Icd020d889d83deae5dfd4aac3352bc9b1e1159bc
2019-05-23 14:41:32 -07:00
TreeHugger Robot
9fdd35e9aa Merge "Fix fading edge effect from impacting neighboring pixels" into qt-dev 2019-05-22 21:32:59 +00:00
TreeHugger Robot
0117a744e9 Merge "Fix light center position for layers" into qt-dev 2019-05-22 21:22:42 +00:00
Stan Iliev
36b75f7961 Fix light center position for layers
SkiaLayer::inverseTransformInWindow should be the inverse
matrix of Layer transform. This CL fixes a bug, that matrix
value was not inverted.
This matrix is used in one place: to transform light
center coordinates from device to RenderNode/layer
coordinate space.

Bug: 132758858
Test: Ran test app attached to bug. Manually compared coordinates.
Change-Id: Id8e887276a5296091a8264d7a0b1bcc955620a6a
2019-05-22 14:43:44 -04:00
Derek Sollenberger
9d25cc242f Fix fading edge effect from impacting neighboring pixels
Bug: 132354626
Bug: 129117085
Test: skia unit tests and test cases described in the bug
Change-Id: Ieaa7c831dd6298ac0565e6f1837b1c1dbd4545da
(cherry picked from commit ac33a48751)
2019-05-17 17:59:57 +00:00
Miguel de Dios
515e7a7464 Merge "Revert "hwui: ro.hwui.render_ahead=0 queue on high FPS"" into qt-dev 2019-05-15 21:06:07 +00:00
Miguel de Dios
509627ba33 Revert "hwui: ro.hwui.render_ahead=0 queue on high FPS"
This reverts commit f802abe47f.

Reason for revert: We're seeing jank increase after this patch.

Change-Id: Ic8d77df3fbbeeedeed4b8f31737454d9c056f8b0
Bug: 132733305
2019-05-14 23:56:21 +00:00
Greg Daniel
13a31b2648 Merge "Remove workaround in VulkanSurface for missing vendor flag." into qt-dev 2019-05-14 21:32:29 +00:00
Greg Daniel
cdfc90231c Remove workaround in VulkanSurface for missing vendor flag.
Test: manual building and testing
Bug: b/128923272
Change-Id: I6be67fddbbf06d4eb7efe316f7e6fd12157e2852
2019-05-14 09:25:41 -04:00
Kevin DuBois
1a4bce9917 Merge "hwui: ro.hwui.render_ahead=0 queue on high FPS" into qt-dev 2019-05-10 15:08:10 +00:00
John Reck
4b5e5551ba Be quiet
Fixes: 131863240
Test: logcat
Change-Id: I0276082b949f9521a804a4c1ef8af2148b69621b
2019-05-02 17:10:46 -07:00
TreeHugger Robot
862a21c977 Merge "Zygote: add a way to preload Vulkan driver" into qt-dev 2019-04-26 05:20:34 +00:00
John Reck
8538ceba82 Merge "Fix some force_dark prop behaviors" into qt-dev 2019-04-25 23:37:05 +00:00
Kevin DuBois
f802abe47f hwui: ro.hwui.render_ahead=0 queue on high FPS
ro.hwui.render_ahead was behaving the same as -1 when it was set
to zero. Correct it so that ro.hwui.render_ahead will queue frames
when set to zero on any display rate FPS.

Fixes: 131340980
Test: Test presence or not of timestamps with -1,0,1,2 settings
Change-Id: Ibd1974253e947130fb03a0b86f599e0e5f5eac38
2019-04-25 16:05:01 -07:00
Yiwei Zhang
4bf3d9eda4 Zygote: add a way to preload Vulkan driver
Since HWUI render pipeline has both GL and Vulkan backends now, we'd
like to preload either GL or Vulkan driver based upon HWUI's choice on
the render backend.

1) Keep using ro.zygote.disable_gl_preload property to disable Vulkan
driver preloading if HWUI's render pipeline uses Vulkan backend.
Properly rename the corresponding APIs for driver preloading.

2) Add a path to preload Vulkan driver based on HWUI's render backend.

Bug: 131249898
Test: build, flash and boot.
Test: verified with set USE_VULKAN=true
Test: verified with setprop debug.hwui.renderer skiagl/skiavk
Change-Id: Ie0bf5d18edcf907c75a25ac3249e2620ec21b63c
2019-04-25 14:29:34 -07:00
John Reck
8915167a88 Fix some force_dark prop behaviors
* Make it persist.hwui.force_dark so the dev option
  survices reboots.

* Remove the internal super-override behavior it applied
  using only the intended ViewRootImpl theme-aware behavior.

Fixes: 127350499
Fixes: 130354206
Test: set dev option, verified nothing went dark. Set dark
theme, verified non-dark apps were force-darked. Rebooted
and verified property still set.

Change-Id: I43adcbc25320669510fb03b162c98cbd14612f55
2019-04-25 10:59:23 -07:00
Greg Daniel
f58e51b4e3 Merge "Fix deletion of VkSemaphores in VulkanManager." into qt-dev 2019-04-24 23:30:35 +00:00
TreeHugger Robot
30a25acb83 Merge "Disable flaky tests" into qt-dev 2019-04-24 06:58:00 +00:00
Greg Daniel
d92a9b158e Fix deletion of VkSemaphores in VulkanManager.
We were deleting the VkSemaphore objects too quickly when
importing/exporting the semaphores. Even though the semaphore payload
gets reset on these operations the VkSemaphore still needs to be
finished its use in Vulkan before being deleted.

Test: manual build and testing of vulkan apps and vulakn ImageConsumer
Bug: b/130643604
Change-Id: I7f03087e477d812c0174ede3a10f12dc1df72ee1
2019-04-23 14:36:37 -04:00
Greg Daniel
68406a2dd5 Merge "Make sure to sync GPU after deleting memory in trimMemory." into qt-dev 2019-04-23 16:52:06 +00:00
John Reck
c24e8e6c5e Disable flaky tests
Fixes: 130587638
Fixes: 130158977
Test: this
Change-Id: I173a56b61205aff0903141beeb65e84b739d66e0
2019-04-23 09:23:52 -07:00
John Reck
eecc52d796 Merge "Dynamically adjust renderahead" into qt-dev 2019-04-22 19:18:53 +00:00
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
cf185f5b0d Dynamically adjust renderahead
Tracks refresh rate changes and adjusts renderahead
based off of the active refresh rate.

Default is 60hz = 0 render ahead & > 70hz is render ahead 1

Bug: 127822449
Test: systraced stuff

Change-Id: I9849aa065262f21f7602d44cd1761373279dc28d
2019-04-18 14:20:56 -07:00
Leon Scroggins
949305fe52 Merge "Do not cache AVDs that are off screen" into qt-dev 2019-04-16 12:15:16 +00:00
TreeHugger Robot
8d8d704cf7 Merge "Fix set_buffers_damage in VulkanSurface" into qt-dev 2019-04-15 21:00:08 +00:00
John Reck
08ca2a2560 Merge "Support render-ahead in vulkan" into qt-dev 2019-04-15 18:20:28 +00: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
321d8e538d Fix set_buffers_damage in VulkanSurface
Fixes: 130363483
Test: `setprop debug.hwui.renderer skiavk` and ensure
      surface damage in dumpsys surfaceflinger is expected
      in portrait & landscape orientations.

Change-Id: I973c47038e534c86f38112de7b863477d982d150
2019-04-12 13:06:11 -07:00
Leon Scroggins III
6c5864c098 Do not cache AVDs that are off screen
Bug: 128805564
Test: Manual + systrace; hwui_unit_tests; CtsUiRenderingTestCases

Only update a VectorDrawable's cache if it is onscreen. This fixes a
Twitter use case where the app has a ProgressBar that is exactly one
pixel offscreen. Prior to this CL, we repeatedly drew the ProgressBar's
AVD to a GPU surface, even though we clip it out later and never draw
that GPU surface. Now, we recognize that the AVD is outside of the
bounds of the screen, so we never draw to the GPU surface.

TreeInfo:
- store the size of the screen, retrieved from
  CanvasContext::getNextFrameSize.
SkiaDisplayList:
- Store the matrix at the time of recording a VectorDrawable. Concat
  that with the current matrix to determine whether the VD is on screen,
  based on the TreeInfo. If it is offscreen, do not add it to the list
  of AVDs that need to be updated ahead of rendering.
- In addition, if it is offscreen (or not dirty), do not call
  setPropertyChangeWillBeConsumed(true). This prevents triggering
  dispatchFrameCallbacks to update on the RenderThread when there is no
  need to. This also mimics what would happen if the View/RenderNode had
  been completely offscreen.
- Add a method to append an AVD to mVectorDrawables. Now that the vector
  is of Pairs, this simplifies the call sites. Add a second helper to
  just add an AVD without a matrix, for use in tests.
SkiaRecordingCanvas:
- get the current matrix and store it in the display list along with the
  AVD.
CanvasContext:
- add getNextFrameSize, for reporting the size of the next frame without
  dequeuing it
VectorDrawable.cpp:
- call quickReject to potentially short circuit drawing. This is for a
  hypothetical use case (verified in a test app) where the containing
  RenderNode is partially onscreen, but the AVD itself is not. Even
  without the change to VectorDrawable.cpp, we skip uploading to the GPU
  cache, the SkiaDisplayList still attempts to draw it. This change
  keeps us from drawing it at all.
SkiaDisplayListTests.cpp:
- Now that I've hidden mVectorDrawables, call the new public APIs.
- prepareListAndChildren test
  - for the clean VD, assert that getPropertyChangeWillBeConsumed
    returns FALSE. This is due to the behavior change that we do not
    set it unless the VD is dirty.
  - set the bounds, so our onscreen check works.
- Add another test for prepareListAndChildren, which puts VDs offscreen.

Change-Id: Iae0a07adcf58e7884e0854720de644e7b2faf2bf
2019-04-12 14:31:31 -04:00
TreeHugger Robot
8bffd47f7a Merge "Revert "Revert "Fix lifecycle issue in CommonPool""" into qt-dev 2019-04-10 17:42:09 +00:00
Leon Scroggins III
87e99a29aa Ensure that hardware Bitmap has a ColorSpace
Bug: 129355537
Test: I9e004fbb7c966bb58ae374087fecd66a1bb72346

android_view_ThreadedRenderer_createHardwareBitmapFromRenderNode in
SkiaGL could create an android::Bitmap without an SkColorSpace. Treat
HAL_DATASPACE_UNKNOWN as sRGB, as this is how we treat it internally.

Change-Id: Iad7f7d7cafce0a8759a84a4296ae5c3ce86dff4c
(cherry picked from commit 7fb4c9e4bb)
Merged-In: Iad7f7d7cafce0a8759a84a4296ae5c3ce86dff4c
2019-04-10 12:10:52 +00:00
John Reck
cfd929dffd Revert "Revert "Fix lifecycle issue in CommonPool""
This reverts commit 162305aace.

Adjusted tests to ensure they pass on cf_x86

Bug: 129250875
Test: this on cf_x86 & blueline

Change-Id: Ic3245ec8db784ae356b7fa66dda9a2fc91c622ea
2019-04-08 16:30:22 -07:00
Derek Sollenberger
4670126b86 Respect the hardware buffer usage flags set by the consumer.
Test: CtsUiRenderingTestCases
Bug: 130121294
Change-Id: Ie77dee104fa8935978dfd6c0c506d2995f20cd79
2019-04-08 20:31:16 +00:00
TreeHugger Robot
da4d6e86a3 Merge "Revert "Fix lifecycle issue in CommonPool"" into qt-dev 2019-04-07 22:23:51 +00:00
David James
162305aace Revert "Fix lifecycle issue in CommonPool"
This reverts commit 5ff61f32a7.

Reason for revert: causes global presubmit to be very flaky, see b/130081457
Fixes: b/130081457

Change-Id: I93aa5d6686cd6b5bf831766c9e47c291749526a9
2019-04-07 04:28:50 +00:00
John Reck
562888399c Merge "Fix lifecycle issue in CommonPool" into qt-dev 2019-04-05 17:59:10 +00:00
John Reck
5ff61f32a7 Fix lifecycle issue in CommonPool
Destroy things more faster

Fixes: 129250875
Test: hwui_unit_tests
Change-Id: I7e060fcb61f5321dd9e68a3ee4a01868033b3fc3
2019-04-04 16:05:10 -07:00
John Reck
4d527226fd Add back render-ahead support
Currently only supported in the EGL path.
Vulkan support Coming Soon

Bug: 127822449
Test: trace of hwuimacro
Change-Id: Iac2b039e11d964aab5b8ca1bdf2a5430b187e2ea
2019-04-04 18:03:35 +00:00
TreeHugger Robot
0c682d04bd Merge "Add workaround for qualcomm vulkan AHDARDWAREBUFFER_USAGE_VENDER_0" 2019-04-02 13:37:05 +00:00
Greg Daniel
2173f1890c Add workaround for qualcomm vulkan AHDARDWAREBUFFER_USAGE_VENDER_0
Test: manual building and testing on device. Bugs related to lack of
flag go away.
Bug: 128923272
Change-Id: I2457988c097d73020162947c346a8716d373185e
2019-04-02 13:21:28 +00:00
TreeHugger Robot
d91a716cf3 Merge "Don't load EGL driver always" 2019-04-01 17:32:35 +00:00