Files
RetroArch/samples/gfx/android_content_rect/Makefile
davey 24f9ff6d25 samples: hold the screen windows' rotation contract on the host
A turn of an Android display reaches RetroArch as a new size on paths
these harnesses already run on the host: the main window's content
rectangle or EGL surface, the second display's surface, and the window
layouts and display list the frontend publishes. Pin what each must do
with it, so a regression fails here and not only on a device.

- android_content_rect: a 1920x1080 to 1080x1920 swap asks one resize
  at the swapped size on the Vulkan context, and on the gl one, whose
  check_window() is now extracted too, with egl_get_video_size()
  stubbed.
- android_second_surface: the same surface at a new size is one
  GEOMETRY at that size, the same generation, no CLOSE, still shown;
  a window kept across a driver reinit meanwhile is taken at the size
  last drawn, and the next driver's first poll brings the new size.
- video_screens: a window drawn again at swapped dims lays the menu out
  at that size and maps touches through the new layout from the first
  read; a display whose size changes under the same name keeps its
  placement and does not ask again for a move that was given up; a
  menu waiting for a turned display's window lays out at the size
  listed now.
2026-11-07 21:28:27 +01:00

46 lines
1.6 KiB
Makefile

# Android's content rectangle, from the UI thread to the video thread.
#
# The functions are the shipping ones, taken out of their files at
# build time by extract.awk: onContentRectChanged() from
# frontend/drivers/platform_unix.c, and check_window() from the Vulkan
# and gl contexts in gfx/drivers_context/android_vk_ctx.c and
# android_ctx.c. The test supplies the few types they touch, so it
# builds and runs on the host.
TARGET := android_content_rect_test
CORE_DIR := ../../..
LIBRETRO_COMM_DIR := $(CORE_DIR)/libretro-common
CFLAGS += -Wall -std=gnu89 -Wdeclaration-after-statement -g1 -O1 \
-I$(LIBRETRO_COMM_DIR)/include -I$(CORE_DIR) -I.
LDFLAGS +=
ifneq ($(SANITIZER),)
CFLAGS := -fsanitize=$(SANITIZER) -fno-omit-frame-pointer $(CFLAGS)
LDFLAGS := -fsanitize=$(SANITIZER) $(LDFLAGS)
endif
all: $(TARGET)
content_rect_driver.h: extract.awk $(CORE_DIR)/frontend/drivers/platform_unix.c \
$(CORE_DIR)/gfx/drivers_context/android_vk_ctx.c \
$(CORE_DIR)/gfx/drivers_context/android_ctx.c
( awk -v FUNCS=onContentRectChanged -f extract.awk \
$(CORE_DIR)/frontend/drivers/platform_unix.c && \
awk -v FUNCS=android_gfx_ctx_vk_check_window -f extract.awk \
$(CORE_DIR)/gfx/drivers_context/android_vk_ctx.c && \
awk -v FUNCS=android_gfx_ctx_check_window -f extract.awk \
$(CORE_DIR)/gfx/drivers_context/android_ctx.c ) > $@.tmp
mv $@.tmp $@
$(TARGET): android_content_rect_test.c content_rect_driver.h
$(CC) $(CFLAGS) -o $@ android_content_rect_test.c $(LDFLAGS)
check: all
./$(TARGET)
clean:
rm -f $(TARGET) content_rect_driver.h content_rect_driver.h.tmp
.PHONY: all check clean