summaryrefslogtreecommitdiff
path: root/libs/hwui/renderthread/DrawFrameTask.h
diff options
context:
space:
mode:
authorScott Lobdell <slobdell@google.com>2021-07-27 17:02:32 +0000
committerScott Lobdell <slobdell@google.com>2021-07-27 17:02:32 +0000
commitcb84bc77bfeb89a940d8439f7458fe5d9bef7bef (patch)
treed6e70908803e918eb485e058341ce55d0a957188 /libs/hwui/renderthread/DrawFrameTask.h
parentdc5ea9d31ab76ba378da9c550813e6b7d8be1e69 (diff)
parent6aa393b52cd7362100a2b3e9b0b1dece473cf6dd (diff)
Merge SP1A.210723.002
Change-Id: I220cdfc5cb9db40162fd33f400a54591018d54cf
Diffstat (limited to 'libs/hwui/renderthread/DrawFrameTask.h')
-rw-r--r--libs/hwui/renderthread/DrawFrameTask.h24
1 files changed, 19 insertions, 5 deletions
diff --git a/libs/hwui/renderthread/DrawFrameTask.h b/libs/hwui/renderthread/DrawFrameTask.h
index 2455ea84c94e..6a61a2bb645f 100644
--- a/libs/hwui/renderthread/DrawFrameTask.h
+++ b/libs/hwui/renderthread/DrawFrameTask.h
@@ -16,8 +16,10 @@
#ifndef DRAWFRAMETASK_H
#define DRAWFRAMETASK_H
+#include <optional>
#include <vector>
+#include <performance_hint_private.h>
#include <utils/Condition.h>
#include <utils/Mutex.h>
#include <utils/StrongPointer.h>
@@ -60,9 +62,8 @@ public:
DrawFrameTask();
virtual ~DrawFrameTask();
- void setContext(RenderThread* thread, CanvasContext* context, RenderNode* targetNode);
- void setHintSessionCallbacks(std::function<void(int64_t)> updateTargetWorkDuration,
- std::function<void(int64_t)> reportActualWorkDuration);
+ void setContext(RenderThread* thread, CanvasContext* context, RenderNode* targetNode,
+ int32_t uiThreadId, int32_t renderThreadId);
void setContentDrawBounds(int left, int top, int right, int bottom) {
mContentDrawBounds.set(left, top, right, bottom);
}
@@ -85,6 +86,18 @@ public:
}
private:
+ class HintSessionWrapper {
+ public:
+ HintSessionWrapper(int32_t uiThreadId, int32_t renderThreadId);
+ ~HintSessionWrapper();
+
+ void updateTargetWorkDuration(long targetDurationNanos);
+ void reportActualWorkDuration(long actualDurationNanos);
+
+ private:
+ APerformanceHintSession* mHintSession = nullptr;
+ };
+
void postAndWait();
bool syncFrameState(TreeInfo& info);
void unblockUiThread();
@@ -95,6 +108,8 @@ private:
RenderThread* mRenderThread;
CanvasContext* mContext;
RenderNode* mTargetNode = nullptr;
+ int32_t mUiThreadId = -1;
+ int32_t mRenderThreadId = -1;
Rect mContentDrawBounds;
/*********************************************
@@ -112,8 +127,7 @@ private:
nsecs_t mLastDequeueBufferDuration = 0;
nsecs_t mLastTargetWorkDuration = 0;
- std::function<void(int64_t)> mUpdateTargetWorkDuration;
- std::function<void(int64_t)> mReportActualWorkDuration;
+ std::optional<HintSessionWrapper> mHintSessionWrapper;
};
} /* namespace renderthread */