(Android) Add performance counters for input poll
This commit is contained in:
parent
22f5f67522
commit
dca1175854
|
@ -1,6 +1,6 @@
|
||||||
RARCH_VERSION = "0.9.8-beta3"
|
RARCH_VERSION = "0.9.8-beta3"
|
||||||
LOCAL_PATH := $(call my-dir)
|
LOCAL_PATH := $(call my-dir)
|
||||||
PERF_TEST := 0
|
PERF_TEST := 1
|
||||||
HAVE_NEON := 1
|
HAVE_NEON := 1
|
||||||
HAVE_SINC := 1
|
HAVE_SINC := 1
|
||||||
HAVE_LOGGER := 1
|
HAVE_LOGGER := 1
|
||||||
|
|
|
@ -272,6 +272,9 @@ static void android_input_poll(void *data)
|
||||||
{
|
{
|
||||||
(void)data;
|
(void)data;
|
||||||
|
|
||||||
|
RARCH_PERFORMANCE_INIT(input_poll);
|
||||||
|
RARCH_PERFORMANCE_START(input_poll);
|
||||||
|
|
||||||
struct android_app* android_app = g_android.app;
|
struct android_app* android_app = g_android.app;
|
||||||
|
|
||||||
g_extern.lifecycle_state &= ~((1ULL << RARCH_RESET) | (1ULL << RARCH_REWIND) | (1ULL << RARCH_FAST_FORWARD_KEY) | (1ULL << RARCH_FAST_FORWARD_HOLD_KEY) | (1ULL << RARCH_MUTE) | (1ULL << RARCH_SAVE_STATE_KEY) | (1ULL << RARCH_LOAD_STATE_KEY) | (1ULL << RARCH_STATE_SLOT_PLUS) | (1ULL << RARCH_STATE_SLOT_MINUS));
|
g_extern.lifecycle_state &= ~((1ULL << RARCH_RESET) | (1ULL << RARCH_REWIND) | (1ULL << RARCH_FAST_FORWARD_KEY) | (1ULL << RARCH_FAST_FORWARD_HOLD_KEY) | (1ULL << RARCH_MUTE) | (1ULL << RARCH_SAVE_STATE_KEY) | (1ULL << RARCH_LOAD_STATE_KEY) | (1ULL << RARCH_STATE_SLOT_PLUS) | (1ULL << RARCH_STATE_SLOT_MINUS));
|
||||||
|
@ -292,10 +295,8 @@ static void android_input_poll(void *data)
|
||||||
i = state_device_ids[id] = pads_connected++;
|
i = state_device_ids[id] = pads_connected++;
|
||||||
|
|
||||||
int motion_action = AMotionEvent_getAction(event);
|
int motion_action = AMotionEvent_getAction(event);
|
||||||
int pointer_count = AMotionEvent_getPointerCount(event);
|
|
||||||
bool motion_do = ((motion_action == AMOTION_EVENT_ACTION_DOWN) || (motion_action ==
|
bool motion_do = ((motion_action == AMOTION_EVENT_ACTION_DOWN) || (motion_action ==
|
||||||
AMOTION_EVENT_ACTION_POINTER_DOWN) || (motion_action == AMOTION_EVENT_ACTION_MOVE)
|
AMOTION_EVENT_ACTION_POINTER_DOWN) || (motion_action == AMOTION_EVENT_ACTION_MOVE));
|
||||||
&& pointer_count);
|
|
||||||
|
|
||||||
if(type == AINPUT_EVENT_TYPE_MOTION && motion_do)
|
if(type == AINPUT_EVENT_TYPE_MOTION && motion_do)
|
||||||
{
|
{
|
||||||
|
@ -343,6 +344,8 @@ static void android_input_poll(void *data)
|
||||||
}
|
}
|
||||||
AInputQueue_finishEvent(android_app->inputQueue, event, handled);
|
AInputQueue_finishEvent(android_app->inputQueue, event, handled);
|
||||||
}
|
}
|
||||||
|
|
||||||
|
RARCH_PERFORMANCE_STOP(input_poll);
|
||||||
}
|
}
|
||||||
|
|
||||||
static int16_t android_input_state(void *data, const struct retro_keybind **binds, unsigned port, unsigned device, unsigned index, unsigned id)
|
static int16_t android_input_state(void *data, const struct retro_keybind **binds, unsigned port, unsigned device, unsigned index, unsigned id)
|
||||||
|
|
|
@ -217,6 +217,9 @@ static void gfx_ctx_check_window(bool *quit,
|
||||||
*quit = false;
|
*quit = false;
|
||||||
*resize = false;
|
*resize = false;
|
||||||
|
|
||||||
|
RARCH_PERFORMANCE_INIT(alooper_pollonce);
|
||||||
|
RARCH_PERFORMANCE_START(alooper_pollonce);
|
||||||
|
|
||||||
id = ALooper_pollOnce(0, NULL, 0, NULL);
|
id = ALooper_pollOnce(0, NULL, 0, NULL);
|
||||||
|
|
||||||
if(id == LOOPER_ID_MAIN)
|
if(id == LOOPER_ID_MAIN)
|
||||||
|
@ -234,6 +237,8 @@ static void gfx_ctx_check_window(bool *quit,
|
||||||
engine_handle_cmd(android_app, cmd);
|
engine_handle_cmd(android_app, cmd);
|
||||||
}
|
}
|
||||||
|
|
||||||
|
RARCH_PERFORMANCE_STOP(alooper_pollonce);
|
||||||
|
|
||||||
if (g_android.reinit_video)
|
if (g_android.reinit_video)
|
||||||
{
|
{
|
||||||
uninit_drivers();
|
uninit_drivers();
|
||||||
|
@ -283,7 +288,7 @@ static void gfx_ctx_set_resize(unsigned width, unsigned height)
|
||||||
static void gfx_ctx_update_window_title(bool reset)
|
static void gfx_ctx_update_window_title(bool reset)
|
||||||
{
|
{
|
||||||
(void)reset;
|
(void)reset;
|
||||||
#ifdef PERF_TEST
|
#if 0
|
||||||
if (reset)
|
if (reset)
|
||||||
gfx_window_title_reset();
|
gfx_window_title_reset();
|
||||||
|
|
||||||
|
|
Loading…
Reference in New Issue