Commit Graph

770 Commits

Author SHA1 Message Date
Leon Scroggins
30d3678734 Revert "Drop max texture cache size from 12x to 5x"
Bug: 155002050
Test: Manual - scroll Pchome app

This reverts commit 05ac516412.

Reason for revert: When running Pchome, this change resulted in poor
performance while scrolling. Every frame appears to be uploading
several textures, potentially the same textures over and over again.

Change-Id: I0fc7216e16f783051d1bd87af764c1a6f361c138
2020-06-11 17:24:47 +00:00
John Reck
8ddbc59d55 Avoid excessive KGSL maps
Hook MIN_UNDEQUEUED_BUFFERS if possible to avoid thrashing kgsl
maps when render_ahead is being used

Bug: 143555869
Test: verified kgsl maps only happened once per buffer
Change-Id: I985fae0a9a7635be3a1cf6177186e5541a1169df
2020-05-07 16:47:10 -07:00
Dheeraj Shetty
21b6e912c2 Merge "Revert^2 "hwui: remove FatVector"" into rvc-dev 2020-05-01 23:27:43 +00:00
Jagadeesh Pakaravoor
b624af3dca Revert^2 "hwui: remove FatVector"
Revert submission 10449863-revert-fatvector

Reason for revert: b/149254345

Original change (of introducing FatVector) was reverted as a stop-gap solution to fix the aforementioned bug.

The bug was caused by an ABI lock between Surface's definition (that changed with Region) and lib-imsvt prebuilt.

Enabling this change now as we have re-compiled the prebuilt with the change enabled. Doing that via a revert of the revert.

Reverted Changes:
I8ac66acb8:Revert "hwui: remove FatVector"
Ib60dbf3ef:Revert "libui: rewrite Region with FatVector"

Original changes:
I09dc2fddd:hwui: remove FatVector
I265c6c831:libui: rewrite Region with FatVector

bug: 149254345

Change-Id: I9fb5e8908434abb9a763992e922445a2dc37e865
2020-05-01 15:57:15 +00:00
chaviw
5fc80e7b32 Send drawFinish callback even if did not draw
There are cases where ViewRootImpl requests to draw, but there was
nothing new to draw. In that case, the callback will never be invoked
and ViewRootImpl will wait forever.

This change will invoke the callback even if there is nothing to draw.
It will use the last frameNumber since nothing new has drawn

Test: Request draw with nothing new. Callback is invoked
Fixes: 155429223
Change-Id: I7c9ed7fd63a451b17133a11ffbcf8fb64be558e5
2020-04-30 14:38:52 -07:00
Alec Mouri
026106f6d6 [HWUI] Add null check for CanvasContext
If ReliableSurface is forced to acquire a fallback buffer then the
Surface may be abandoned. When getting frame timestamps we need to check
that the Surface still exists.

Bug: 152262035
Test: builds, boots
Test: dumpsys gfxinfo
Change-Id: Ifdb198ebf74cc9dc681c4ab51c4901176a7f5fc9
2020-03-26 18:09:53 -07:00
Tim Murray
894f132ba0 Revert "hwui: remove FatVector"
Revert "libui: rewrite Region with FatVector"

Revert submission 10248126-fatvector-region

Reason for revert: b/149254345
Reverted Changes:
I09dc2fddd:hwui: remove FatVector
I265c6c831:libui: rewrite Region with FatVector

also fix wrong license in FatVector.h

Test: boots
Bug: 149254345

Change-Id: I8ac66acb8b635324051edd41c5d4092c223157ff
2020-03-05 12:15:40 -08:00
Alec Mouri
680414e09e [HWUI] Remove libgui from libhwui's dependency list
* Add sync features extensions into EglExtensions
* Header cleanup

Bug: 136263382
Test: builds
Change-Id: Ibd29cfe5201419210c9dc09e82af10524454b6cd
2020-02-14 15:24:22 -08:00
Alec Mouri
43fe6fcde5 [HWUI] Remove references to gui/Surface.
ANativeWindow usage now has enough feature parity so that we can use
that instead.

Bug: 137012798
Test: builds
Test: Scroll through settings
Change-Id: I0054315058b28bcb5e779a6f71a3cfb164625a5f
2020-02-14 15:24:16 -08:00
TreeHugger Robot
bc12e084cd Merge "[ANativeWindow] Rename allocateBuffers to tryAllocateBuffers" 2020-02-14 12:04:48 +00:00
Alec Mouri
c9d5f3d952 [ANativeWindow] Rename allocateBuffers to tryAllocateBuffers
Renaming was done in response to API feedback.

Bug: 148962594
Test: builds
Change-Id: I05b3e99800d967dda243b6e7af48f1b645909bdd
2020-02-13 13:58:50 -08:00
Alec Mouri
8a82b141d1 [HWUI] use ANativeWindow_getLastQueuedBuffer api
Bug: 137012798
Test: builds
Change-Id: Ic33a21a73b0579726f47c53cc102fb91b5ead0d6
2020-02-13 13:28:36 -08:00
Tim Murray
072be5e5c0 Merge "hwui: remove FatVector" 2020-02-07 20:37:09 +00:00
Tim Murray
0865f2e7b2 hwui: remove FatVector
FatVector now lives in fw/native/libs/ui.

Test: builds, boots, works
Bug: 149096186
Change-Id: I09dc2fddd2a238ef47d7853b64b0bfbf74d3f71f
2020-02-07 17:57:44 +00:00
Derek Sollenberger
3109b4cc47 Merge "Ensure SkiaPipeline always has a valid colorspace." 2020-02-06 19:47:24 +00:00
Alec Mouri
ff07c8fd76 [HWUI] use native_window timestamp apis
These aren't finalized as stable yet until we sort out some BufferQueue
challenges.

Bug: 137012798
Test: builds
Change-Id: Icd5eb02afc4cf16a2be485e6710f71818b300b9d
2020-02-06 08:09:30 -08:00
Derek Sollenberger
1863d94e9a Ensure SkiaPipeline always has a valid colorspace.
Previously we didn't assign a colorspace to the pipeline until it
was provided a surface to render into.  This resulted in undefined
behavior if the application attempted to render an offscreen layer
before the OS provided the main window with its surface. Now instead
of deferring setting whether or not the application is wide gamut we
do initialize it to a default setting when the pipeline is created.

Bug: 148042673
Test: apct/device_boot_health_check_extra_postsubmit
Change-Id: I84d743511e949ac977486470bb14eec936de7f88
2020-02-06 07:41:50 -05:00
John Reck
869cb2ad7e Merge "Adjust present time calculation" 2020-02-05 20:39:54 +00:00
John Reck
56cffe5b6a Adjust present time calculation
Adjust the target present time when using
render_ahead to better fit in the gaps between
vsync pulses. This prevents small clock
drifts from causing jank.

Bug: 143540628
Test: manual, looked at systrace
Change-Id: I26ae6ebf16a3dea48dfd8e1c420d9e5e43e42bcb
2020-02-03 16:47:12 -08:00
Alec Mouri
80c7ef17db [HWUI] Use ANativeWindow_getNextFrameId api.
This is part of the work to move away from gui/Surface and onto
ANativeWindow in HWUI.

Bug: 137012798
Test: builds
Change-Id: I5862d7833b583b8295d1677e725ed58d97808b27
2020-02-03 10:25:24 -08:00
Alec Mouri
c2a6537fb9 [HWUI] Hook up ANativeWindow_allocateBuffers
Bug: 137012798
Test: builds
Change-Id: Iefe7b73470cb6229fc72d1a1aa33eceb827f527c
2020-01-30 18:28:48 -08:00
Alec Mouri
f023a323de [HWUI] Use ANativeWindow inteception methods in ReliableSurface
Test: boots
Test: manually test with opening and scrolling through settings app
Change-Id: I8d7a44d3ead0b2350318e1514153e256f97ccca5
2020-01-30 18:26:41 -08:00
Stan Iliev
e0fae2356b Add memory tracing in HWUI
Add ATRACE memory counters to track memory usage at the end
of each frame in HWUI.
There are 3 catagories: CPU, GPU and Texture memory.
There are 3 more counters for memory that can be purged.
This CL deletes GpuMemoryTracker class, which implemented
similar function for Android O HWUI renderer.

Test: Collected systrace with gmail and setting.
Test: memory tracing adds ~0.1ms per frame when ATRACE is enabled
Bug: 146580770
Change-Id: Icbcc0478bc426dff578e83726fe7c95df171ed93
2020-01-10 16:14:39 +00:00
TreeHugger Robot
68f7a52419 Merge "[HWUI] use AChoreographer in place of DisplayEventReceiver." 2020-01-08 17:18:49 +00:00
Alec Mouri
4a818f189c [HWUI] use AChoreographer in place of DisplayEventReceiver.
Bug: 136262896
Test: builds, boots
Test: scroll through settings app
Test: Toggle between 60/90hz and observe systrace
Change-Id: I8eef306a968525c55f3863ae688545faa43b23be
2019-12-26 10:11:40 -08:00
Alec Mouri
a5a0c962b6 [HWUI] Minor ANativeWindow usage cleanup
* Remove unused header in EglManager
* Rename usage of rotation flags to use the public names.

Bug: 137012798
Test: builds
Change-Id: Ia603e8d74c6ba51f77e352333d1e82816582d827
2019-12-23 08:59:57 -08:00
John Reck
cd18c2271d 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
2019-11-21 15:16:08 -08:00
Stan Iliev
10689992cf Fix an issue with GPU stats not enabled
Invoke Surface::enableFrameTimestamps after eglDestroySurface.
eglDestroySurface internally disables time stats. Order is
important, when CanvasContext::setSurface is invoked with
a surface, that is already current (which happens all the time).

Test: ran UiBench microbenchmark tests
Change-Id: I3d023c3a87da6329c556426d553c744e541b9dff
2019-11-13 11:48:04 -05:00
Stan Iliev
aaa9e834d4 Decouple SurfaceTexture from HWUI
Remove all Skia and HWUI types from SurfaceTexture
implementation.
Move SurfaceTexture to libgui (ag/9578265).
Define private C++ API for SurfaceTexture, which is consumed
by DeferredLayerUpdater.
Move AutoBackendTextureRelease/Skia code from SurfaceTexture
to HWUI.

Test: pass CtsUiRenderingTestCases and CtsViewTestCases
Bug: 136263580
Change-Id: I3f971bb490f64a3ac0b2a66a89ba935bf7f08213
2019-11-08 15:37:17 +00:00
Alec Mouri
05955610a0 Merge "[HWUI] Get DeviceInfo through stable ABI" 2019-11-07 17:15:47 +00:00
Nick Desaulniers
b451d87468 [frameworks][base][hwui] re-fix -Wimplicit-int-float-conversion
A new instance snuck in since I haven't completed the platform toolchain
upgrade yet. There was imprecision in this call; accept it by making the
implicit cast explicit.

Bug: 139945549
Test: mm
Change-Id: Id704d9741b480eba4cf3955e70119d935776faf6
Signed-off-by: Nick Desaulniers <ndesaulniers@google.com>
2019-11-04 17:18:51 -08:00
John Reck
4145919ef9 Fix wrong surfaceRequiresRedraw check
We only need to redraw if the size /changed/ not
if it was the same. Also fix damageId to not use
frameNumber as repeated redraws of the same frame
would toggle.

Bug: 143711430
Test: systrace
Change-Id: I8ac4629c9ff4fd51de33d1be7aa46ccc995ba342
2019-10-31 15:04:58 -07:00
TreeHugger Robot
b051671aa3 Merge "[HWUI] Use ANativeWindow_get{Height, Width}" 2019-10-29 09:39:18 +00:00
Alec Mouri
da819e47f1 [HWUI] Use ANativeWindow_get{Height, Width}
gui/Surface will eventually be removed since HWUI needs to depend on a
stable ABI, so use the NDK methods for querying width and height that
operates on ANativeWindow instead.

Bug: 137012798
Test: builds
Change-Id: I1309e31992190e7b44c6ea83f962f372b6b0afcf
2019-10-25 16:18:16 -07:00
John Reck
5a23400610 Merge "Delete VectorDrawableAtlas" 2019-10-25 22:28:40 +00:00
Alec Mouri
22d753f74d [HWUI] Get DeviceInfo through stable ABI
This also removes the dependency on ui/DeviceInfo other than in test
code.

Bug: 136263392
Bug: 136263238
Test: builds, boots
Change-Id: I6a4687e981359f0e6beb83be8a5501ed7fd16f15
2019-10-25 13:30:42 -07:00
John Reck
ca718a06d5 Fix buffer damage for quad-buffer
Test: none
Change-Id: I4789d84945e381d67e96ef37554a161dbd0ab16c
2019-10-21 10:15:02 -07:00
TreeHugger Robot
d4bd5714f9 Merge "Revert "Drop all caches in UI_HIDDEN"" 2019-10-09 01:01:35 +00:00
John Reck
f846aeec9d Revert "Drop all caches in UI_HIDDEN"
This reverts commit 8a207962ec.

Bug: 142301356
Test: none, speculative

Reason for revert: Seems to break alarm? 

Change-Id: Ia1680d1a937b596297c2eab3e54476daf9589347
2019-10-08 23:28:41 +00:00
John Reck
83161dcd6a Delete VectorDrawableAtlas
Poking around in a few apps it doesn't appear that
the VectorDrawableAtlas is achieving sufficient
utilization to justify its existence. The potential for
draw call merging doesn't seem warranted for the
RAM cost of the atlas.

Bug: 137853925
Test: builds
Change-Id: Id2419bc6dccb6316636d50c568f8fac75a2d563f
2019-10-04 14:49:20 -07:00
John Reck
05ac516412 Drop max texture cache size from 12x to 5x
Bug: 137853925
Test: none
Change-Id: I8d05871a5f54c8e5d6528a6a8ed48f73464a1221
2019-10-04 13:47:55 -07:00
John Reck
8a207962ec Drop all caches in UI_HIDDEN
Bug: 137853925
Test: none
Change-Id: Idf7002d9b07cc6b71b38ce76e7b6382100279a99
2019-10-04 13:30:51 -07:00
Alec Mouri
ce81728f1c Merge "[HWUI] Remove nanosecond conversion from duration queries." 2019-10-02 05:27:58 +00:00
Alec Mouri
5d76d44153 Merge "[HWUI] Use ANativeWindow_setDequeueTimeout" 2019-09-20 21:06:30 +00:00
TreeHugger Robot
ff38ce2478 Merge "[HWUI] hook in ANativeWindow_getLastDequeueStartTime" 2019-09-12 00:14:01 +00:00
TreeHugger Robot
ad72061767 Merge "Switch to using GrContext::setResourceCacheLimit and getResourceCacheLimit" 2019-09-11 20:57:09 +00:00
Alec Mouri
6e1271be3f [HWUI] Remove nanosecond conversion from duration queries.
Now that they return nanoseconds, there's no reason to lose precision.

Bug: 137012798
Test: builds
Change-Id: I52ca20cb010b4f1829596e0a765b7013ae3665ca
2019-09-06 11:45:01 -07:00
Alec Mouri
672e9b0ce6 [HWUI] Use ANativeWindow_setDequeueTimeout
Don't use the ReliableSurface version now that we have an APEX stub.

Bug: 137012798
Test: builds
Change-Id: I63d1d9d2ff60b54a75d5b4865a63eb22ac347208
2019-09-06 11:44:52 -07:00
Alec Mouri
8d0c5bd200 [HWUI] hook in ANativeWindow_getLastDequeueStartTime
Bug: 137012798
Test: builds
Change-Id: I37fd2a7c40398053082f606f0a085db0a239e2e0
2019-09-06 11:44:42 -07:00
Robert Phillips
57bb0bfb44 Switch to using GrContext::setResourceCacheLimit and getResourceCacheLimit
The old version that took a maxResourceCount are now deprecated

Test: does it compile
Change-Id: Ib4d69c8907169329c7765c648f46fa5e4a10bf7a
2019-09-06 13:22:11 -04:00