Loading libs/gui/Surface.cpp +18 −0 Original line number Diff line number Diff line Loading @@ -1087,6 +1087,12 @@ int Surface::perform(int operation, va_list args) case NATIVE_WINDOW_SET_DEQUEUE_TIMEOUT: res = dispatchSetDequeueTimeout(args); break; case NATIVE_WINDOW_GET_LAST_DEQUEUE_DURATION: res = dispatchGetLastDequeueDuration(args); break; case NATIVE_WINDOW_GET_LAST_QUEUE_DURATION: res = dispatchGetLastQueueDuration(args); break; default: res = NAME_NOT_FOUND; break; Loading Loading @@ -1303,6 +1309,18 @@ int Surface::dispatchSetDequeueTimeout(va_list args) { return setDequeueTimeout(timeout); } int Surface::dispatchGetLastDequeueDuration(va_list args) { int64_t* lastDequeueDuration = va_arg(args, int64_t*); *lastDequeueDuration = mLastDequeueDuration; return NO_ERROR; } int Surface::dispatchGetLastQueueDuration(va_list args) { int64_t* lastQueueDuration = va_arg(args, int64_t*); *lastQueueDuration = mLastQueueDuration; return NO_ERROR; } bool Surface::transformToDisplayInverse() { return (mTransform & NATIVE_WINDOW_TRANSFORM_INVERSE_DISPLAY) == NATIVE_WINDOW_TRANSFORM_INVERSE_DISPLAY; Loading libs/gui/include/gui/Surface.h +2 −0 Original line number Diff line number Diff line Loading @@ -246,6 +246,8 @@ private: int dispatchSetAutoPrerotation(va_list args); int dispatchGetLastDequeueStartTime(va_list args); int dispatchSetDequeueTimeout(va_list args); int dispatchGetLastDequeueDuration(va_list args); int dispatchGetLastQueueDuration(va_list args); bool transformToDisplayInverse(); protected: Loading libs/nativewindow/ANativeWindow.cpp +11 −7 Original line number Diff line number Diff line Loading @@ -33,6 +33,12 @@ static int32_t query(ANativeWindow* window, int what) { return res < 0 ? res : value; } static int64_t query64(ANativeWindow* window, int what) { int64_t value; int res = window->perform(window, what, &value); return res < 0 ? res : value; } static bool isDataSpaceValid(ANativeWindow* window, int32_t dataSpace) { bool supported = false; switch (dataSpace) { Loading Loading @@ -271,18 +277,16 @@ int ANativeWindow_setAutoPrerotation(ANativeWindow* window, bool autoPrerotation * apex-stable **************************************************************************************************/ int ANativeWindow_getLastDequeueDuration(ANativeWindow* window) { return query(window, NATIVE_WINDOW_LAST_DEQUEUE_DURATION); int64_t ANativeWindow_getLastDequeueDuration(ANativeWindow* window) { return query64(window, NATIVE_WINDOW_GET_LAST_DEQUEUE_DURATION); } int ANativeWindow_getLastQueueDuration(ANativeWindow* window) { return query(window, NATIVE_WINDOW_LAST_QUEUE_DURATION); int64_t ANativeWindow_getLastQueueDuration(ANativeWindow* window) { return query64(window, NATIVE_WINDOW_GET_LAST_QUEUE_DURATION); } int64_t ANativeWindow_getLastDequeueStartTime(ANativeWindow* window) { int64_t time; int success = window->perform(window, NATIVE_WINDOW_GET_LAST_DEQUEUE_START, &time); return success < 0 ? success : time; return query64(window, NATIVE_WINDOW_GET_LAST_DEQUEUE_START); } int ANativeWindow_setDequeueTimeout(ANativeWindow* window, int64_t timeout) { Loading libs/nativewindow/include/apex/window.h +4 −4 Original line number Diff line number Diff line Loading @@ -27,17 +27,17 @@ __BEGIN_DECLS * Retrieves how long it took for the last time a buffer was dequeued. * * \return a negative value on error, otherwise returns the duration in * microseconds. * nanoseconds */ int ANativeWindow_getLastDequeueDuration(ANativeWindow* window); int64_t ANativeWindow_getLastDequeueDuration(ANativeWindow* window); /** * Retrieves how long it took for the last time a buffer was queued. * * \return a negative value on error, otherwise returns the duration in * microseconds * nanoseconds. */ int ANativeWindow_getLastQueueDuration(ANativeWindow* window); int64_t ANativeWindow_getLastQueueDuration(ANativeWindow* window); /** * Retrieves the system time in nanoseconds when the last time a buffer Loading libs/nativewindow/include/system/window.h +9 −3 Original line number Diff line number Diff line Loading @@ -147,11 +147,15 @@ enum { /* * Returns the duration of the last dequeueBuffer call in microseconds * Deprecated: please use NATIVE_WINDOW_GET_LAST_DEQUEUE_DURATION in * perform() instead, which supports nanosecond precision. */ NATIVE_WINDOW_LAST_DEQUEUE_DURATION = 14, /* * Returns the duration of the last queueBuffer call in microseconds * Deprecated: please use NATIVE_WINDOW_GET_LAST_QUEUE_DURATION in * perform() instead, which supports nanosecond precision. */ NATIVE_WINDOW_LAST_QUEUE_DURATION = 15, Loading Loading @@ -241,6 +245,8 @@ enum { NATIVE_WINDOW_SET_AUTO_PREROTATION = 35, NATIVE_WINDOW_GET_LAST_DEQUEUE_START = 36, /* private */ NATIVE_WINDOW_SET_DEQUEUE_TIMEOUT = 37, /* private */ NATIVE_WINDOW_GET_LAST_DEQUEUE_DURATION = 38, /* private */ NATIVE_WINDOW_GET_LAST_QUEUE_DURATION = 39, /* private */ // clang-format on }; Loading Loading
libs/gui/Surface.cpp +18 −0 Original line number Diff line number Diff line Loading @@ -1087,6 +1087,12 @@ int Surface::perform(int operation, va_list args) case NATIVE_WINDOW_SET_DEQUEUE_TIMEOUT: res = dispatchSetDequeueTimeout(args); break; case NATIVE_WINDOW_GET_LAST_DEQUEUE_DURATION: res = dispatchGetLastDequeueDuration(args); break; case NATIVE_WINDOW_GET_LAST_QUEUE_DURATION: res = dispatchGetLastQueueDuration(args); break; default: res = NAME_NOT_FOUND; break; Loading Loading @@ -1303,6 +1309,18 @@ int Surface::dispatchSetDequeueTimeout(va_list args) { return setDequeueTimeout(timeout); } int Surface::dispatchGetLastDequeueDuration(va_list args) { int64_t* lastDequeueDuration = va_arg(args, int64_t*); *lastDequeueDuration = mLastDequeueDuration; return NO_ERROR; } int Surface::dispatchGetLastQueueDuration(va_list args) { int64_t* lastQueueDuration = va_arg(args, int64_t*); *lastQueueDuration = mLastQueueDuration; return NO_ERROR; } bool Surface::transformToDisplayInverse() { return (mTransform & NATIVE_WINDOW_TRANSFORM_INVERSE_DISPLAY) == NATIVE_WINDOW_TRANSFORM_INVERSE_DISPLAY; Loading
libs/gui/include/gui/Surface.h +2 −0 Original line number Diff line number Diff line Loading @@ -246,6 +246,8 @@ private: int dispatchSetAutoPrerotation(va_list args); int dispatchGetLastDequeueStartTime(va_list args); int dispatchSetDequeueTimeout(va_list args); int dispatchGetLastDequeueDuration(va_list args); int dispatchGetLastQueueDuration(va_list args); bool transformToDisplayInverse(); protected: Loading
libs/nativewindow/ANativeWindow.cpp +11 −7 Original line number Diff line number Diff line Loading @@ -33,6 +33,12 @@ static int32_t query(ANativeWindow* window, int what) { return res < 0 ? res : value; } static int64_t query64(ANativeWindow* window, int what) { int64_t value; int res = window->perform(window, what, &value); return res < 0 ? res : value; } static bool isDataSpaceValid(ANativeWindow* window, int32_t dataSpace) { bool supported = false; switch (dataSpace) { Loading Loading @@ -271,18 +277,16 @@ int ANativeWindow_setAutoPrerotation(ANativeWindow* window, bool autoPrerotation * apex-stable **************************************************************************************************/ int ANativeWindow_getLastDequeueDuration(ANativeWindow* window) { return query(window, NATIVE_WINDOW_LAST_DEQUEUE_DURATION); int64_t ANativeWindow_getLastDequeueDuration(ANativeWindow* window) { return query64(window, NATIVE_WINDOW_GET_LAST_DEQUEUE_DURATION); } int ANativeWindow_getLastQueueDuration(ANativeWindow* window) { return query(window, NATIVE_WINDOW_LAST_QUEUE_DURATION); int64_t ANativeWindow_getLastQueueDuration(ANativeWindow* window) { return query64(window, NATIVE_WINDOW_GET_LAST_QUEUE_DURATION); } int64_t ANativeWindow_getLastDequeueStartTime(ANativeWindow* window) { int64_t time; int success = window->perform(window, NATIVE_WINDOW_GET_LAST_DEQUEUE_START, &time); return success < 0 ? success : time; return query64(window, NATIVE_WINDOW_GET_LAST_DEQUEUE_START); } int ANativeWindow_setDequeueTimeout(ANativeWindow* window, int64_t timeout) { Loading
libs/nativewindow/include/apex/window.h +4 −4 Original line number Diff line number Diff line Loading @@ -27,17 +27,17 @@ __BEGIN_DECLS * Retrieves how long it took for the last time a buffer was dequeued. * * \return a negative value on error, otherwise returns the duration in * microseconds. * nanoseconds */ int ANativeWindow_getLastDequeueDuration(ANativeWindow* window); int64_t ANativeWindow_getLastDequeueDuration(ANativeWindow* window); /** * Retrieves how long it took for the last time a buffer was queued. * * \return a negative value on error, otherwise returns the duration in * microseconds * nanoseconds. */ int ANativeWindow_getLastQueueDuration(ANativeWindow* window); int64_t ANativeWindow_getLastQueueDuration(ANativeWindow* window); /** * Retrieves the system time in nanoseconds when the last time a buffer Loading
libs/nativewindow/include/system/window.h +9 −3 Original line number Diff line number Diff line Loading @@ -147,11 +147,15 @@ enum { /* * Returns the duration of the last dequeueBuffer call in microseconds * Deprecated: please use NATIVE_WINDOW_GET_LAST_DEQUEUE_DURATION in * perform() instead, which supports nanosecond precision. */ NATIVE_WINDOW_LAST_DEQUEUE_DURATION = 14, /* * Returns the duration of the last queueBuffer call in microseconds * Deprecated: please use NATIVE_WINDOW_GET_LAST_QUEUE_DURATION in * perform() instead, which supports nanosecond precision. */ NATIVE_WINDOW_LAST_QUEUE_DURATION = 15, Loading Loading @@ -241,6 +245,8 @@ enum { NATIVE_WINDOW_SET_AUTO_PREROTATION = 35, NATIVE_WINDOW_GET_LAST_DEQUEUE_START = 36, /* private */ NATIVE_WINDOW_SET_DEQUEUE_TIMEOUT = 37, /* private */ NATIVE_WINDOW_GET_LAST_DEQUEUE_DURATION = 38, /* private */ NATIVE_WINDOW_GET_LAST_QUEUE_DURATION = 39, /* private */ // clang-format on }; Loading