diff options
author | John Reck <jreck@google.com> | 2014-05-22 15:43:54 -0700 |
---|---|---|
committer | John Reck <jreck@google.com> | 2014-05-23 12:56:38 -0700 |
commit | a5dda645da738da7b4ae15e28fa7d93d3b04b94f (patch) | |
tree | 5ce51af907c91030662b69c37e8ece7a63e041ed /libs/hwui/renderthread/RenderProxy.cpp | |
parent | d30241541c3adcb126bb263ad8596e7902a6b5ae (diff) |
Bag of scheduling tweaks
Bug: 15118640
* Prevent over-stuffing the queue by dropping frames
* Prevent double-drawing in one pulse by RT by deferring
vsync registration until post-draw so that it catches
the next vsync pulse instead of the current one
* Bias vsync race condition towards the UI thread
* Fix queueDelay to actually work
Change-Id: Ibf584258bd93ebcbba058bd976dc8b307f1c6155
Diffstat (limited to 'libs/hwui/renderthread/RenderProxy.cpp')
-rw-r--r-- | libs/hwui/renderthread/RenderProxy.cpp | 17 |
1 files changed, 14 insertions, 3 deletions
diff --git a/libs/hwui/renderthread/RenderProxy.cpp b/libs/hwui/renderthread/RenderProxy.cpp index ef8e45bf57fe..2e103d887e75 100644 --- a/libs/hwui/renderthread/RenderProxy.cpp +++ b/libs/hwui/renderthread/RenderProxy.cpp @@ -112,7 +112,7 @@ bool RenderProxy::loadSystemProperties() { return (bool) postAndWait(task); } -CREATE_BRIDGE2(initialize, CanvasContext* context, EGLNativeWindowType window) { +CREATE_BRIDGE2(initialize, CanvasContext* context, ANativeWindow* window) { return (void*) args->context->initialize(args->window); } @@ -123,7 +123,7 @@ bool RenderProxy::initialize(const sp<ANativeWindow>& window) { return (bool) postAndWait(task); } -CREATE_BRIDGE2(updateSurface, CanvasContext* context, EGLNativeWindowType window) { +CREATE_BRIDGE2(updateSurface, CanvasContext* context, ANativeWindow* window) { args->context->updateSurface(args->window); return NULL; } @@ -135,7 +135,7 @@ void RenderProxy::updateSurface(const sp<ANativeWindow>& window) { postAndWait(task); } -CREATE_BRIDGE2(pauseSurface, CanvasContext* context, EGLNativeWindowType window) { +CREATE_BRIDGE2(pauseSurface, CanvasContext* context, ANativeWindow* window) { args->context->pauseSurface(args->window); return NULL; } @@ -292,6 +292,17 @@ void RenderProxy::fence() { postAndWait(task); } +CREATE_BRIDGE1(notifyFramePending, CanvasContext* context) { + args->context->notifyFramePending(); + return NULL; +} + +void RenderProxy::notifyFramePending() { + SETUP_TASK(notifyFramePending); + args->context = mContext; + mRenderThread.queueAtFront(task); +} + void RenderProxy::post(RenderTask* task) { mRenderThread.queue(task); } |