diff options
author | John Reck <jreck@google.com> | 2018-04-05 16:41:41 -0700 |
---|---|---|
committer | John Reck <jreck@google.com> | 2018-04-09 10:58:15 -0700 |
commit | ec100976e0655acaa204c8800dfb83dadae20cc8 (patch) | |
tree | d7bd2d10c7be8ea0ccec63e85c8365efb87edfe4 /libs/hwui/renderthread/RenderProxy.h | |
parent | 413293ff626301e1ee9837f247c4d7321c59f472 (diff) |
Add support for render-ahead
For periods of time during which latency is less important
allow a client to request a deeper render-ahead pipeline.
The latency tradeoff results in less overall visual jank
Test: none, only used by macrobench
Change-Id: I516203b70bdc75b6415fa08bf9c4fb1b598b0102
Diffstat (limited to 'libs/hwui/renderthread/RenderProxy.h')
-rw-r--r-- | libs/hwui/renderthread/RenderProxy.h | 18 |
1 files changed, 17 insertions, 1 deletions
diff --git a/libs/hwui/renderthread/RenderProxy.h b/libs/hwui/renderthread/RenderProxy.h index 3425c5c68a72..bd5c9a9fc922 100644 --- a/libs/hwui/renderthread/RenderProxy.h +++ b/libs/hwui/renderthread/RenderProxy.h @@ -119,7 +119,23 @@ public: ANDROID_API void addFrameMetricsObserver(FrameMetricsObserver* observer); ANDROID_API void removeFrameMetricsObserver(FrameMetricsObserver* observer); - ANDROID_API long getDroppedFrameReportCount(); + + /** + * Sets a render-ahead depth on the backing renderer. This will increase latency by + * <swapInterval> * renderAhead and increase memory usage by (3 + renderAhead) * <resolution>. + * In return the renderer will be less susceptible to jitter, resulting in a smoother animation. + * + * Not recommended to use in response to anything touch driven, but for canned animations + * where latency is not a concern careful use may be beneficial. + * + * Note that when increasing this there will be a frame gap of N frames where N is + * renderAhead - <current renderAhead>. When decreasing this if there are any pending + * frames they will retain their prior renderAhead value, so it will take a few frames + * for the decrease to flush through. + * + * @param renderAhead How far to render ahead, must be in the range [0..2] + */ + ANDROID_API void setRenderAheadDepth(int renderAhead); ANDROID_API static int copySurfaceInto(sp<Surface>& surface, int left, int top, int right, int bottom, SkBitmap* bitmap); |