Loading libs/hwui/FrameInfo.cpp +1 −1 Original line number Diff line number Diff line Loading @@ -53,7 +53,7 @@ static_assert(static_cast<int>(FrameInfoIndex::NumIndexes) == 24, "Must update value in FrameMetrics.java#FRAME_STATS_COUNT (and here)"); void FrameInfo::importUiThreadInfo(int64_t* info) { memcpy(mFrameInfo, info, UI_THREAD_FRAME_INFO_SIZE * sizeof(int64_t)); memcpy(mFrameInfo.data(), info, UI_THREAD_FRAME_INFO_SIZE * sizeof(int64_t)); mSkippedFrameReason.reset(); } Loading libs/hwui/FrameInfo.h +4 −2 Original line number Diff line number Diff line Loading @@ -84,6 +84,8 @@ enum { }; }; using FrameInfoBuffer = std::array<int64_t, static_cast<size_t>(FrameInfoIndex::NumIndexes)>; class UiFrameInfoBuilder { public: static constexpr int64_t INVALID_VSYNC_ID = -1; Loading Loading @@ -152,7 +154,7 @@ public: set(FrameInfoIndex::Flags) |= static_cast<uint64_t>(frameInfoFlag); } const int64_t* data() const { return mFrameInfo; } const FrameInfoBuffer& data() const { return mFrameInfo; } inline int64_t operator[](FrameInfoIndex index) const { return get(index); } Loading Loading @@ -201,7 +203,7 @@ public: } private: int64_t mFrameInfo[static_cast<int>(FrameInfoIndex::NumIndexes)]; FrameInfoBuffer mFrameInfo; std::optional<SkippedFrameReason> mSkippedFrameReason; }; Loading libs/hwui/FrameMetricsObserver.h +3 −1 Original line number Diff line number Diff line Loading @@ -18,12 +18,14 @@ #include <utils/RefBase.h> #include "FrameInfo.h" namespace android { namespace uirenderer { class FrameMetricsObserver : public VirtualLightRefBase { public: virtual void notify(const int64_t* buffer) = 0; virtual void notify(const FrameInfoBuffer& buffer) = 0; bool waitForPresentTime() const { return mWaitForPresentTime; }; void reportMetricsFrom(uint64_t frameNumber, int32_t surfaceControlId) { Loading libs/hwui/FrameMetricsReporter.cpp +3 −1 Original line number Diff line number Diff line Loading @@ -16,10 +16,12 @@ #include "FrameMetricsReporter.h" #include "FrameInfo.h" namespace android { namespace uirenderer { void FrameMetricsReporter::reportFrameMetrics(const int64_t* stats, bool hasPresentTime, void FrameMetricsReporter::reportFrameMetrics(const FrameInfoBuffer& stats, bool hasPresentTime, uint64_t frameNumber, int32_t surfaceControlId) { FatVector<sp<FrameMetricsObserver>, 10> copy; { Loading libs/hwui/FrameMetricsReporter.h +1 −1 Original line number Diff line number Diff line Loading @@ -69,7 +69,7 @@ public: * stats of frames that are from "old" surfaces (i.e. with surfaceControlIds older than the one * the observer was attached on) nor those that are from "old" frame numbers. */ void reportFrameMetrics(const int64_t* stats, bool hasPresentTime, uint64_t frameNumber, void reportFrameMetrics(const FrameInfoBuffer& stats, bool hasPresentTime, uint64_t frameNumber, int32_t surfaceControlId); private: Loading Loading
libs/hwui/FrameInfo.cpp +1 −1 Original line number Diff line number Diff line Loading @@ -53,7 +53,7 @@ static_assert(static_cast<int>(FrameInfoIndex::NumIndexes) == 24, "Must update value in FrameMetrics.java#FRAME_STATS_COUNT (and here)"); void FrameInfo::importUiThreadInfo(int64_t* info) { memcpy(mFrameInfo, info, UI_THREAD_FRAME_INFO_SIZE * sizeof(int64_t)); memcpy(mFrameInfo.data(), info, UI_THREAD_FRAME_INFO_SIZE * sizeof(int64_t)); mSkippedFrameReason.reset(); } Loading
libs/hwui/FrameInfo.h +4 −2 Original line number Diff line number Diff line Loading @@ -84,6 +84,8 @@ enum { }; }; using FrameInfoBuffer = std::array<int64_t, static_cast<size_t>(FrameInfoIndex::NumIndexes)>; class UiFrameInfoBuilder { public: static constexpr int64_t INVALID_VSYNC_ID = -1; Loading Loading @@ -152,7 +154,7 @@ public: set(FrameInfoIndex::Flags) |= static_cast<uint64_t>(frameInfoFlag); } const int64_t* data() const { return mFrameInfo; } const FrameInfoBuffer& data() const { return mFrameInfo; } inline int64_t operator[](FrameInfoIndex index) const { return get(index); } Loading Loading @@ -201,7 +203,7 @@ public: } private: int64_t mFrameInfo[static_cast<int>(FrameInfoIndex::NumIndexes)]; FrameInfoBuffer mFrameInfo; std::optional<SkippedFrameReason> mSkippedFrameReason; }; Loading
libs/hwui/FrameMetricsObserver.h +3 −1 Original line number Diff line number Diff line Loading @@ -18,12 +18,14 @@ #include <utils/RefBase.h> #include "FrameInfo.h" namespace android { namespace uirenderer { class FrameMetricsObserver : public VirtualLightRefBase { public: virtual void notify(const int64_t* buffer) = 0; virtual void notify(const FrameInfoBuffer& buffer) = 0; bool waitForPresentTime() const { return mWaitForPresentTime; }; void reportMetricsFrom(uint64_t frameNumber, int32_t surfaceControlId) { Loading
libs/hwui/FrameMetricsReporter.cpp +3 −1 Original line number Diff line number Diff line Loading @@ -16,10 +16,12 @@ #include "FrameMetricsReporter.h" #include "FrameInfo.h" namespace android { namespace uirenderer { void FrameMetricsReporter::reportFrameMetrics(const int64_t* stats, bool hasPresentTime, void FrameMetricsReporter::reportFrameMetrics(const FrameInfoBuffer& stats, bool hasPresentTime, uint64_t frameNumber, int32_t surfaceControlId) { FatVector<sp<FrameMetricsObserver>, 10> copy; { Loading
libs/hwui/FrameMetricsReporter.h +1 −1 Original line number Diff line number Diff line Loading @@ -69,7 +69,7 @@ public: * stats of frames that are from "old" surfaces (i.e. with surfaceControlIds older than the one * the observer was attached on) nor those that are from "old" frame numbers. */ void reportFrameMetrics(const int64_t* stats, bool hasPresentTime, uint64_t frameNumber, void reportFrameMetrics(const FrameInfoBuffer& stats, bool hasPresentTime, uint64_t frameNumber, int32_t surfaceControlId); private: Loading