mirror of
https://github.com/libretro/RetroArch.git
synced 2026-11-22 01:33:23 -10:00
A driver teardown let the second display's Presentation go. When content closed and the driver reinited, the hide could reach Android before RetroArch's Activity arrived on that display, which then showed neither. A context's window ops can now keep and take a window. At teardown, gl2 and vulkan keep each window their context can keep: its EGL or Vulkan surface goes, and the Presentation stays up with its last image. The next driver takes it at init and publishes it with no screens, so it still counts as shown on its display and the close's keep holds it. Placement lets it go as before. A window nobody took goes once the next driver is up, or at shutdown. gl2 no longer draws a kept window, so it keeps its last image as it does on vulkan.
57 lines
2.2 KiB
Makefile
57 lines
2.2 KiB
Makefile
# The second display's surface, from the Android UI thread to the
|
|
# renderer: nativeSurfaceChanged(), nativeSurfaceDestroyed() and
|
|
# android_second_surface_term() from frontend/drivers/platform_unix.c,
|
|
# android_windows_poll() and the keep across a driver reinit from
|
|
# gfx/common/android_windows.c, taken out of their files at build time
|
|
# by extract.awk.
|
|
include ../../sample_objdir.mk
|
|
|
|
TARGET := android_second_surface_test$(EXE)
|
|
CORE_DIR := ../../..
|
|
LRC := $(CORE_DIR)/libretro-common
|
|
JNI := Java_com_retroarch_browser_retroactivity_SecondDisplayController
|
|
|
|
SOURCES := android_second_surface_test.c \
|
|
$(CORE_DIR)/gfx/video_windows.c \
|
|
$(CORE_DIR)/gfx/video_views.c
|
|
OBJS := $(call sample_objs,$(SOURCES:.c=.o))
|
|
CFLAGS += -Wall -std=c89 -pedantic -Werror=declaration-after-statement \
|
|
-Wno-long-long -Wno-variadic-macros -g1 -O1 -I$(LRC)/include -I$(CORE_DIR) -I.
|
|
LDFLAGS += -lm
|
|
|
|
ifneq ($(SANITIZER),)
|
|
CFLAGS := -fsanitize=$(SANITIZER) -fno-omit-frame-pointer $(CFLAGS)
|
|
LDFLAGS := -fsanitize=$(SANITIZER) $(LDFLAGS)
|
|
endif
|
|
|
|
all: $(TARGET)
|
|
|
|
second_surface_driver.h: extract.awk $(CORE_DIR)/frontend/drivers/platform_unix.c \
|
|
$(CORE_DIR)/gfx/common/android_windows.c
|
|
( awk -v FUNCS=android_second_surface_free,android_second_surface_term,$(JNI)_nativeSurfaceChanged,$(JNI)_nativeSurfaceDestroyed \
|
|
-f extract.awk $(CORE_DIR)/frontend/drivers/platform_unix.c && \
|
|
awk -v FUNCS=android_windows_at,android_windows_poll,android_windows_let_go,android_windows_destroy,android_windows_keep,android_windows_take,android_windows_release_kept,android_windows_free \
|
|
-f extract.awk $(CORE_DIR)/gfx/common/android_windows.c ) > $@.tmp
|
|
mv $@.tmp $@
|
|
|
|
android_second_surface_test.o: android_second_surface_test.c second_surface_driver.h
|
|
$(CC) -c -o $@ $< $(CFLAGS)
|
|
|
|
$(SAMPLE_OBJDIR)/%.o: $$(call sample_src,$$*).c
|
|
@mkdir -p $(@D)
|
|
$(CC) -c -o $@ $< $(CFLAGS)
|
|
|
|
$(TARGET): $(OBJS)
|
|
$(CC) -o $@ $^ $(LDFLAGS)
|
|
|
|
check: all
|
|
$(RUNNER) ./$(TARGET)
|
|
|
|
clean:
|
|
@sample_objdir="$(SAMPLE_OBJDIR)"; rm -rf "$${sample_objdir:?}"
|
|
rm -f android_second_surface_test android_second_surface_test.exe \
|
|
android_second_surface_test.o \
|
|
second_surface_driver.h second_surface_driver.h.tmp
|
|
|
|
.PHONY: all check clean
|