Logging improvements

This commit is contained in:
Henrik Rydgård 2019-10-06 13:21:57 +02:00
parent 87b2f4e186
commit f342d8d856
3 changed files with 16 additions and 2 deletions

View file

@ -636,6 +636,11 @@ void TouchTestScreen::CreateViews() {
root_->Add(new Button(di->T("Back")))->OnClick.Handle<UIScreen>(this, &UIScreen::OnBack); root_->Add(new Button(di->T("Back")))->OnClick.Handle<UIScreen>(this, &UIScreen::OnBack);
} }
#if PPSSPP_PLATFORM(ANDROID)
extern int display_xres;
extern int display_yres;
#endif
void TouchTestScreen::render() { void TouchTestScreen::render() {
UIDialogScreenWithBackground::render(); UIDialogScreenWithBackground::render();
UIContext *ui_context = screenManager()->getUIContext(); UIContext *ui_context = screenManager()->getUIContext();
@ -659,11 +664,17 @@ void TouchTestScreen::render() {
} }
snprintf(buffer, sizeof(buffer), snprintf(buffer, sizeof(buffer),
#if PPSSPP_PLATFORM(ANDROID)
"display_res: %dx%d\n"
#endif
"dp_res: %dx%d\n" "dp_res: %dx%d\n"
"pixel_res: %dx%d\n" "pixel_res: %dx%d\n"
"g_dpi: %f\n" "g_dpi: %f\n"
"g_dpi_scale: %0.3fx%0.3f\n" "g_dpi_scale: %0.3fx%0.3f\n"
"g_dpi_scale_real: %0.3fx%0.3f\n", "g_dpi_scale_real: %0.3fx%0.3f\n",
#if PPSSPP_PLATFORM(ANDROID)
display_xres, display_yres,
#endif
dp_xres, dp_yres, dp_xres, dp_yres,
pixel_xres, pixel_yres, pixel_xres, pixel_yres,
g_dpi, g_dpi,

View file

@ -1006,6 +1006,7 @@ void NativeRender(GraphicsContext *graphicsContext) {
} }
if (resized) { if (resized) {
ILOG("Resized flag set - recalculating bounds");
resized = false; resized = false;
if (uiContext) { if (uiContext) {
@ -1275,6 +1276,7 @@ void NativeMessageReceived(const char *message, const char *value) {
void NativeResized() { void NativeResized() {
// NativeResized can come from any thread so we just set a flag, then process it later. // NativeResized can come from any thread so we just set a flag, then process it later.
if (g_graphicsInited) { if (g_graphicsInited) {
ILOG("NativeResized - setting flag");
resized = true; resized = true;
} else { } else {
ILOG("NativeResized ignored, not initialized"); ILOG("NativeResized ignored, not initialized");

View file

@ -101,8 +101,9 @@ static int deviceType;
// Should only be used for display detection during startup (for config defaults etc) // Should only be used for display detection during startup (for config defaults etc)
// This is the ACTUAL display size, not the hardware scaled display size. // This is the ACTUAL display size, not the hardware scaled display size.
static int display_xres; // Exposed so it can be displayed on the touchscreen test.
static int display_yres; int display_xres;
int display_yres;
static int display_dpi_x; static int display_dpi_x;
static int display_dpi_y; static int display_dpi_y;
static int backbuffer_format; // Android PixelFormat enum static int backbuffer_format; // Android PixelFormat enum