summaryrefslogtreecommitdiff
path: root/core/java/android/view/ThreadedRenderer.java
Commit message (Collapse)AuthorAgeFilesLines
* Scale light z value relative to screen sizeAlex Stetson2022-07-061-10/+23
| | | | | | | | | | | On larger screens, having the light z value lower down creates an undesirable amount of shadow since the source to view angle can be quite large. By scaling the z position of the source relative to the screen size, we can avoid these extreme shadows. Bug: 227425789 Test: run cts -t android.uirendering.cts.testclasses.ShadowTests --module CtsUiRenderingTestCases Change-Id: I8b7a3fcf93daaa565256a08f38deffed74b24ad4
* 1/ Remove some unused code from the shared libWinson Chung2022-02-241-0/+1
| | | | | | Bug: 219861883 Test: Builds/Presubmit Change-Id: I884392d2fcbfac6fd27c01f0077d4fb426a24d4a
* Send syncStatus and return FrameCommitCallback in FrameCallbackchaviw2021-12-281-3/+38
| | | | | | | | | | | | | | | | | | | | | | FrameCallback sends back the syncStatus and allows the caller to return a FrameCommitCallback. This is so the caller can evaluate the results of the sync and determine if it wants to continue waiting for a commit callback. In cases, where the sync has failed, there will never be a commit callback so the caller can avoid waiting. This is partically helpful for VRI because it wants to sync with a frame that will draw, but also doesn't want to get stuck indefinitely waiting on the callback. VRI can check the syncStatus and only handle blast sync and/or reportDraw when its determined that a draw will happen. This allows VRI to remove frameCompleteCallback since it can now wait until a buffer has drawn instead of when the vsync has completed. This makes sure it waits on FrameDropped since that result indicates HWUI will draw on the next vsync Test: BlastSync Bug: 200284684 Change-Id: Ic6e2f08ea21ac8a1634a3389c927fcb68ede3f7b
* Guard against NPE in ThreadedRendererSanguk Jeon2021-11-291-1/+4
| | | | | | | Bug: b/168319139 Test: compile & verify basic functions working Change-Id: Iaa2a6b7362d31f3501b3dd67f5af790ba3aebd24
* Support dump gfxinfo reset for process' without a WindowJohn Reck2021-10-011-6/+16
| | | | | | Bug: 199791928 Test: manual Change-Id: I995d236c2c9d60194f72275a3da1c82340f77898
* Move WebView overlay support off of NewWeakGlobalRefJohn Reck2021-08-131-0/+121
| | | | | | Test: ? Bug: 194893628 Change-Id: Idab4dbdfa958b383754db703b76503a63a8b9d26
* Track per-window information in ViewFrameInfoSiarhei Vishniakou2020-12-011-3/+5
| | | | | | | | | | | | | | | | | | | | FrameInfo will now be per-window; that is, per-ViewRootImpl. Some of the information should remain “global” (it remain in Choreographer), while some information is going to become ViewRootImpl-specific. Before the information gets passed to the native layer, the ViewRootImpl-specific info will be stitched together with the general Choreographer info. This change is useful in order to correctly correlate frames with a specific input event. In the unlikely scenario of a user touching two windows of the same app simultaneously, this change will allow us to correctly measure the latency of both frames produced by the windows. Design doc: https://docs.google.com/document/d/1KMpMBlOxnl7zkWBCbXZZE6ZlaHEA4efYnN6WYK8n3FE/edit?resourcekey=0-eqooVNP0SskupljlTFvtOQ Test: atest ViewFrameInfoTest Bug: 169866723 Change-Id: Ib0bf9cd51cbcc0b9b70460c929c480eb490ec322
* Remove some dead codeJohn Reck2020-10-161-40/+14
| | | | | | | Simplify state by deleting unused & always true stuff Test: builds Change-Id: Idf679aff5e809e567dac21a127cb9d6ace894f0e
* View Renderer: remove emulator hackbohu2019-08-261-19/+1
| | | | | BUG: 139998916 Change-Id: Icae145fe19f37da71ea30eabbe57c011dddeae66
* Fix ReliableSurface to be more reliableJohn Reck2019-07-261-5/+6
| | | | | | | | | | | | Handle TIMED_OUT better by rescheduling (TODO: give up after N attempts?) Fix SYNC_SURFACE_LOST_REWARD_IF_FOUND path to actually go fetch a new surface. Bug: 137509524 Test: Injected errors randomly, verified nothing got permanently dead. Change-Id: Id30f8ad1dd7196041ee84c16c8cf5c814002a6ce
* Merge "Removed unused variable from ThreadedRenderer"TreeHugger Robot2019-07-031-5/+0
|\
| * Removed unused variable from ThreadedRendererIssei Suzuki2019-07-031-5/+0
| | | | | | | | | | | | Bug: 136616503 Test: refactoring, check if existing tests pass Change-Id: I627832b2e8f964dbabbf95788279e437c4347adf
* | Extend ViewRootImpl to support multiple FrameDrawingCallbackIssei Suzuki2019-06-281-7/+17
|/ | | | | | Bug: 136150954 Test: WIP Change-Id: I690005fece924c38a5269cb35309061d0ccb6f1e
* Revert change to force_dark propertyJohn Reck2019-05-021-1/+1
| | | | | | | | | | | Settings can't write to persist.* without special selinux rules. Instead for debug simplicity just switch back to debug.hwui.force_dark and let it reset on reboot. Fixes: 131697927 Test: toggle override-force dark in dev options Change-Id: Ieac6edb2a7b444fc2f63d5d4f1b657bad6ead409
* Fix some force_dark prop behaviorsJohn Reck2019-04-251-1/+1
| | | | | | | | | | | | | | | | * 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
* Address API council feedbackJohn Reck2019-02-221-1/+1
| | | | | | | | | | | | | | | | Bug: 125027187 Bug: 125026102 Bug: 125026678 Bug: 125026234 Bug: 125027586 Bug: 125026476 Bug: 125026103 Bug: 125026237 Bug: 125027248 Bug: 125026475 Bug: 125027487 Test: RenderNodeTests Change-Id: Ic63ea7a3cfe359a7dff0c1b46e534e499f7e928b
* Make HardwareRenderer public APIJohn Reck2019-02-081-2/+4
| | | | | | Bug: 123661129 Test: HardwareRenderer CTS tests Change-Id: Ic7ff69c9489d00e3f525eec761a84d06cf81be7a
* Add continuous SKP capture test apiJohn Reck2019-01-221-0/+5
| | | | | | Bug: 122856066 Test: PictureCaptureDemo Change-Id: Iaf3a4bc1c8a2c18c7dff635c5f1cf726b331f8bf
* Ensure frame callback applied during scroll handling is applied.Winson Chung2018-12-101-6/+23
| | | | | | | | | | | | | | - By the time we call computeScroll(), the current frame's callback has already been consumed, which makes it impossible to apply surface updates with the current frame (in response to the scroll). Instead, we should only consume the frame callback after dispatching draw for the current frame (but before the window callbacks which may reset the frame callback). Test: Update surface transforms in response to scroll, ensure that it is updated with the current frame Change-Id: I52a640604ee15cf745c47fc0120b4844b67f35be
* Merge "[Magnifier-64] Fix light source alpha for renderer"TreeHugger Robot2018-11-131-4/+2
|\
| * [Magnifier-64] Fix light source alpha for rendererMihai Popa2018-11-131-4/+2
| | | | | | | | | | | | | | | | | | | | | | | | | | | | I9e6f44b07a170574a905f42338282c4bb7e95f56 changed the way the light source alphas were set for renderers - the alphas were passed as ints between 0 and 255 before, while now they are passed as a double between 0 and 1. This CL updates SimpleRenderer, which is only used by the magnifier, to use the API correctly. Before this CL, the incorrect usage was causing the value validation to fail and apps to crash when the magnifier was trigerred. Bug: 119423778 Test: manually tested the magnifier Change-Id: I8978ac16aca38906ec2cf4ae30a83beddfc9e941
* | Add force SmartDark dev settingJohn Reck2018-11-121-0/+6
|/ | | | | | Bug: 118348733 Test: toggled it Change-Id: I3fce6d399af79102c1c8bd583f8da27d5eadbeaa
* Refactors and a potential public API for renderingJohn Reck2018-11-081-611/+48
| | | | | | | | | | | | | Split out the View/ViewRootImpl bits from the hardware rendering bits. Create a potential public API surface for hardware rendering Bug: 112709971 Test: builds & boots Change-Id: I9e6f44b07a170574a905f42338282c4bb7e95f56
* Update some docs & tweak some method namesJohn Reck2018-10-261-2/+2
| | | | | Test: builds Change-Id: Id0e5cf6fdb3a391136a1d314498f75e0b954ceeb
* Rename & package shuffleJohn Reck2018-10-041-3/+5
| | | | | | | | | | Rename DisplayListCanvas -> RecordingCanvas Move RecordingCanvas to android.graphics Move RenderNode to android.graphics Bug: 112709971 Test: make & boot Change-Id: Iddeb6a89f8923ea81a1f37bbee4e9b1db8ede238
* Merge "Wire-up default force-dark based off of isLightTheme"John Reck2018-09-271-0/+20
|\
| * Wire-up default force-dark based off of isLightThemeJohn Reck2018-09-271-0/+20
| | | | | | | | | | | | | | | | | | | | Bug: 102591313 Test: Compared settings in light & dark UI modes with force_dark set to true. Observed that force_dark fixes were not present when UI mode was set to dark, indicating force_dark was appropriately globally-disabled Change-Id: I5882829bb5871829fc8fc9911682f52a6ba5f445
* | De-couple RenderNode from View packageJohn Reck2018-09-261-3/+1
|/ | | | | | | First step of moving RenderNode to the graphics package Test: builds Change-Id: Ife7f5ec6698e32393d1b85ed2bad909ef0210be4
* Add @UnsupportedAppUsage annotationsMathew Inwood2018-08-201-0/+7
| | | | | | | | | | | | | | | | | | | | | | For packages: android.view.textservice android.view.textclassifier.logging android.view.textclassifier android.view.inputmethod android.view.autofill android.view.accessibility android.view This is an automatically generated CL. See go/UnsupportedAppUsage for more details. Exempted-From-Owner-Approval: Mechanical changes to the codebase which have been approved by Android API council and announced on android-eng@ Bug: 110868826 Test: m Change-Id: I4147b038ed7adf0311ee9918b44766f82a057eaf
* Merge "Move allocateBuffers to RT" into pi-dev am: 2f8a3a4bb8Jorim Jaggi2018-07-181-0/+5
|\ | | | | | | | | | | am: c9756c9193 Change-Id: Ieed40312fe16a54c3e1974621b53e29b23ddcdbc
| * Move allocateBuffers to RTJorim Jaggi2018-07-171-0/+5
| | | | | | | | | | | | | | | | | | | | | | Such that it gets executed after setSurface, in order that mReqUsage has the correct flags set. Test: Take trace, ensure that allocateBuffers actually allocates in the right format/usage by ensuring that dequeueBuffer doesn't trash them immediately again. Bug: 111517695 Change-Id: I94b402d7b29d565155a77a2d09106246261712d2
| * Attempting to fix the black flickerJohn Reck2018-05-311-0/+19
| | | | | | | | | | | | | | | | Bug: 79231206 Test: Repro steps from bug Merged-In: I4c2810c42a7a4358f64584da3ab0cdf1499e71b6 Change-Id: I4c2810c42a7a4358f64584da3ab0cdf1499e71b6
| * Apply surface parameters in sync with RenderThreadJorim Jaggi2018-05-171-1/+5
| | | | | | | | | | | | | | | | | | | | 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
* | Tweak some RenderNode API surfacesJohn Reck2018-06-041-2/+4
| | | | | | | | | | | | | | | | | | | | | | * no-arg #start() * remove no-op #destroy method * fix a Java-imposed quirk that you can't draw a currently invalid RenderNode, forcing bottom-up recording for no particular reason Test: builds Change-Id: I28b41c83b4f7f9ddced843b0d57e9ac510d40ae5
* | Attempting to fix the black flickerJohn Reck2018-05-311-0/+19
| | | | | | | | | | | | | | Bug: 79231206 Test: Repro steps from bug Change-Id: I4c2810c42a7a4358f64584da3ab0cdf1499e71b6
* | Apply surface parameters in sync with RenderThreadJorim Jaggi2018-05-151-1/+5
| | | | | | | | | | | | | | | | | | Otherwise it could lead to parameters applied in the wrong frame, leading to jank. Test: Open notification Bug: 78611607 Change-Id: Ia7900e753b29187a7a7b81f393666687e8b8e04b
* | Removed logic to handle optimized software rendering pass for opaqueNader Jawad2018-05-081-4/+0
| | | | | | | | | | | | | | | | Views Change-Id: I149b8297e432a3d038ce18e8bd76022a39006a00 Fixes: 71521014 Test: Re-ran CtsWidgetTestCases and CtsGraphicsTestCases
* | Remove dead codeJohn Reck2018-04-091-6/+0
|/ | | | | | | | | Remove an old protobuf serialization experiement, skp capture does this better Test: builds Change-Id: Icd875eabee6b517729f901841e48e579d0e8de4d
* Add ability to change context priority of RT GL contextJorim Jaggi2018-04-061-0/+15
| | | | | | Test: Use method, observe GPU preemption behavior Bug: 75985430 Change-Id: Idc08d37f8c95f52c5aab7edf09c0cbff72b8482d
* Don't use IPC in isolateProcessJohn Reck2018-03-161-6/+15
| | | | | | | | | Fixes: 74395652 Test: hwuiunit passes in 'shell stop' state (pseudo-isolated process), manually checked non-isolated processes still have working vsync via systrace of RT animations demo Change-Id: I630ea011dc7eb2efa265b25673d3304b3b2510d3
* Fix NPE if app context is nullJohn Reck2018-03-071-4/+8
| | | | | | Change-Id: Ic21ae50e5421a8c711e133ffe2ff218160382297 Fixes: 74260094 Test: builds, boots, and graphicsstats still works
* Allow debuggable apps to do skp captureJohn Reck2018-03-011-0/+6
| | | | | | Change-Id: Ibb56887b28eb8260bf2ca0b38dbe78233e9cfaf4 Fixes: 74086676 Test: verified can still capture an skp
* [Magnifier-26] Wire up frame callback for realsiesMihai Popa2018-02-261-3/+2
| | | | | | | Test: none yet Bug: 73810478 Bug: 72041926 Change-Id: I7154ed4b3d2cd820dc8c8ff55eed130be87d1606
* Merge changes from topic "magnifier_sync_movement"Mihai Popa2018-02-221-0/+104
|\ | | | | | | | | | | | | * changes: [Magnifier-24] Add completion callback TestApi [Magnifier-21] Rate-limit drawings to renderer [Magnifier-20] Raw Surface instead of PopupWindow
| * [Magnifier-21] Rate-limit drawings to rendererMihai Popa2018-02-211-0/+2
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | Previously, we would make a renderer draw whenever a pixel copy completes. Because of this happening more than once per view frame, magnifier frames were being dropped or queued up and displayed later, which was consequently leading to the magnifier movement getting out of sync with the updates to its content. This CL changes the magnifier to be rendered from a draw job post'd to the UI thread queue. This way, multiple magnifier updates (the ones already pending in the UI thread queue when the draw job is added) are batched together in a single draw, naturally rate-limiting the draws we send to the magnifier renderer by the number of frames of the magnified view - this only holds when the user of the magnifier sends updates as a result of user interaction or when the magnified view is drawn. Also, previously the pixel copy finished events were post'd to the UI thread. Since they were not post'd as async messages, they would have to wait at frame barriers before being executed. This CL creates a dedicated thread for them to be post'd, to avoid this from happening. Bug: 72041926 Test: atest CtsWidgetTestCases:android.widget.cts.MagnifierTest Change-Id: I89563a341a74e958f903eff2d470c6c33fb203ef
| * [Magnifier-20] Raw Surface instead of PopupWindowMihai Popa2018-02-191-0/+102
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | Since the movement of PopupWindows is handled by the global window manager, using one does not provide synchronization guarantees between the window movement and its view tree rendering. In the case of the magnifier this was producing a shaky-text effect, when the window was moved in one frame, but the content was only updated in the following one (although the movement and content update were issued during the same #show operation on the UI thread). This CL abandons the usage of a PopupWindow for the magnifier, in favour of a raw Surface whose movement can be controlled using the deferred transactions API. This way, we can defer the surface movement until the frame when the updated content is rendered. The allocated magnifier surface is slightly bigger than the magnifier content to have space for drawing the elevation. We obtain a native elevation by using a RenderNode to draw the content of the magnifier. Bug: 72041926 Test: atest CtsWidgetTestCases:android.widget.cts.MagnifierTest Change-Id: Icb8ecf48a2f528e06790db95d54575f2ae119747
* | Rename HardwareLayer -> TextureLayerJohn Reck2018-02-211-5/+5
|/ | | | | | | | Update name to reflect meaning/usage Change-Id: Iddb3621cbca147f96faa83380867baa49c382aab Fixes: 20461288 Test: builds & boots
* Dump frame history for bugreportsJohn Reck2018-02-121-1/+8
| | | | | | | | | Can provide more insights into ANR reports that end in nSyncAndDrawFrame Test: verified 'dumpsys gfxinfo <package>' didn't change, but that bugreports did Change-Id: I4e0e4b071f761e35bb6d6c9d8174b5bde3220d92
* Revert "Add developer setting to set the default GPU renderer."Derek Sollenberger2018-01-241-12/+0
| | | | | | | | This reverts commit 4badfe6d3beda8e1e358334e32a95e00be39f031. Reason for revert: removing the option from the developer settings UI Change-Id: I9c8b32287160f61e34226391cfcb6477a0cd85b7
* Lower FSP on window animation tooMakoto Onuki2018-01-091-5/+1
| | | | | | Test: manual test with setprop debug.hwui.fps_divisor 4 Bug: 66945974 Change-Id: I4b637ed30003a9eae008b093f9e3d8b2a2f09319