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
This commit is contained in:
John Reck
2018-04-05 16:41:41 -07:00
parent 413293ff62
commit ec100976e0
14 changed files with 107 additions and 21 deletions

View File

@@ -25,8 +25,8 @@
#include "hwui/Bitmap.h"
#include "pipeline/skia/SkiaOpenGLPipeline.h"
#include "pipeline/skia/SkiaOpenGLReadback.h"
#include "pipeline/skia/SkiaVulkanReadback.h"
#include "pipeline/skia/SkiaVulkanPipeline.h"
#include "pipeline/skia/SkiaVulkanReadback.h"
#include "renderstate/RenderState.h"
#include "renderthread/OpenGLPipeline.h"
#include "utils/FatVector.h"
@@ -93,14 +93,11 @@ public:
DummyVsyncSource(RenderThread* renderThread) : mRenderThread(renderThread) {}
virtual void requestNextVsync() override {
mRenderThread->queue().postDelayed(16_ms, [this]() {
mRenderThread->drainDisplayEventQueue();
});
mRenderThread->queue().postDelayed(16_ms,
[this]() { mRenderThread->drainDisplayEventQueue(); });
}
virtual nsecs_t latestVsyncEvent() override {
return systemTime(CLOCK_MONOTONIC);
}
virtual nsecs_t latestVsyncEvent() override { return systemTime(CLOCK_MONOTONIC); }
private:
RenderThread* mRenderThread;
@@ -147,13 +144,13 @@ void RenderThread::initializeDisplayEventReceiver() {
auto receiver = std::make_unique<DisplayEventReceiver>();
status_t status = receiver->initCheck();
LOG_ALWAYS_FATAL_IF(status != NO_ERROR,
"Initialization of DisplayEventReceiver "
"failed with status: %d",
status);
"Initialization of DisplayEventReceiver "
"failed with status: %d",
status);
// Register the FD
mLooper->addFd(receiver->getFd(), 0, Looper::EVENT_INPUT,
RenderThread::displayEventReceiverCallback, this);
RenderThread::displayEventReceiverCallback, this);
mVsyncSource = new DisplayEventReceiverWrapper(std::move(receiver));
} else {
mVsyncSource = new DummyVsyncSource(this);