summaryrefslogtreecommitdiff
path: root/libs/hwui/renderthread/RenderProxy.h
diff options
context:
space:
mode:
authorJohn Reck <jreck@google.com>2019-03-13 16:25:20 -0700
committerJohn Reck <jreck@google.com>2019-04-03 14:33:04 -0700
commit859f98d82c1ff38f34c0495d180561121f8a1a81 (patch)
tree5be87addae0b90b835b310dccafb786ce421a4b9 /libs/hwui/renderthread/RenderProxy.h
parenta3151aa9ebb6764ed8de418c1cfc39bf284f521f (diff)
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
Diffstat (limited to 'libs/hwui/renderthread/RenderProxy.h')
-rw-r--r--libs/hwui/renderthread/RenderProxy.h17
1 files changed, 17 insertions, 0 deletions
diff --git a/libs/hwui/renderthread/RenderProxy.h b/libs/hwui/renderthread/RenderProxy.h
index a1a5551722bc..a0f08cbd26f9 100644
--- a/libs/hwui/renderthread/RenderProxy.h
+++ b/libs/hwui/renderthread/RenderProxy.h
@@ -123,6 +123,23 @@ public:
ANDROID_API void removeFrameMetricsObserver(FrameMetricsObserver* observer);
ANDROID_API void setForceDark(bool enable);
+ /**
+ * 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);
ANDROID_API static void prepareToDraw(Bitmap& bitmap);