(Android) Add performance counters for input poll

This commit is contained in:
twinaphex 2012-12-16 17:13:49 +01:00
parent 22f5f67522
commit dca1175854
3 changed files with 13 additions and 5 deletions

View File

@ -1,6 +1,6 @@
RARCH_VERSION = "0.9.8-beta3"
LOCAL_PATH := $(call my-dir)
PERF_TEST := 0
PERF_TEST := 1
HAVE_NEON := 1
HAVE_SINC := 1
HAVE_LOGGER := 1

View File

@ -272,6 +272,9 @@ static void android_input_poll(void *data)
{
(void)data;
RARCH_PERFORMANCE_INIT(input_poll);
RARCH_PERFORMANCE_START(input_poll);
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));
@ -292,10 +295,8 @@ static void android_input_poll(void *data)
i = state_device_ids[id] = pads_connected++;
int motion_action = AMotionEvent_getAction(event);
int pointer_count = AMotionEvent_getPointerCount(event);
bool motion_do = ((motion_action == AMOTION_EVENT_ACTION_DOWN) || (motion_action ==
AMOTION_EVENT_ACTION_POINTER_DOWN) || (motion_action == AMOTION_EVENT_ACTION_MOVE)
&& pointer_count);
AMOTION_EVENT_ACTION_POINTER_DOWN) || (motion_action == AMOTION_EVENT_ACTION_MOVE));
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);
}
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)

View File

@ -216,6 +216,9 @@ static void gfx_ctx_check_window(bool *quit,
*quit = false;
*resize = false;
RARCH_PERFORMANCE_INIT(alooper_pollonce);
RARCH_PERFORMANCE_START(alooper_pollonce);
id = ALooper_pollOnce(0, NULL, 0, NULL);
@ -234,6 +237,8 @@ static void gfx_ctx_check_window(bool *quit,
engine_handle_cmd(android_app, cmd);
}
RARCH_PERFORMANCE_STOP(alooper_pollonce);
if (g_android.reinit_video)
{
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)
{
(void)reset;
#ifdef PERF_TEST
#if 0
if (reset)
gfx_window_title_reset();