Skip to content

Commit

Permalink
Fix black screen after activity restart in exact resolution mode.
Browse files Browse the repository at this point in the history
  • Loading branch information
twaik committed Jan 27, 2025
1 parent 1fee411 commit 696e9d0
Show file tree
Hide file tree
Showing 3 changed files with 5 additions and 2 deletions.
3 changes: 1 addition & 2 deletions app/src/main/cpp/lorie/InitOutput.c
Original file line number Diff line number Diff line change
Expand Up @@ -94,7 +94,6 @@ typedef struct {

struct lorie_shared_server_state* state;
struct {
LorieBuffer* buffer;
Bool legacyDrawing;
uint8_t flip;
uint32_t width, height;
Expand Down Expand Up @@ -161,7 +160,7 @@ void OsVendorInit(void) {

void lorieActivityConnected(void) {
lorieSendSharedServerState(pvfb->stateFd);
lorieSendRootWindowBuffer(pvfb->root.buffer);
lorieSendRootWindowBuffer(((LoriePixmapPriv*) exaGetPixmapDriverPrivate(pScreenPtr->devPrivate))->buffer);
}

static LoriePixmapPriv* lorieRootWindowPixmapPriv(void) {
Expand Down
1 change: 1 addition & 0 deletions app/src/main/cpp/lorie/activity.c
Original file line number Diff line number Diff line change
Expand Up @@ -195,6 +195,7 @@ static int xcallback(int fd, int events, __unused void* data) {
log(INFO, "Received shared buffer width %d height %d format %d", desc.width, desc.height, desc.format);
rendererSetBuffer(buffer);
LorieBuffer_release(buffer);
break;
}
}
}
Expand Down
3 changes: 3 additions & 0 deletions app/src/main/cpp/lorie/renderer.c
Original file line number Diff line number Diff line change
Expand Up @@ -569,10 +569,13 @@ void rendererRedrawLocked(JNIEnv* env) {
}

// Perform a little drawing operation to make sure the next buffer is ready on the next invocation of drawing
glEnable(GL_SCISSOR_TEST);
glViewport(0, 0, 1, 1);
glClearColor(0, 0, 0, 0);
glScissor(0, 0, 1, 1);
glClear(GL_COLOR_BUFFER_BIT);
glViewport(0, 0, ANativeWindow_getWidth(win), ANativeWindow_getHeight(win));
glDisable(GL_SCISSOR_TEST);
fence = eglCreateSyncKHR(egl_display, EGL_SYNC_FENCE_KHR, NULL);
eglClientWaitSyncKHR(egl_display, fence, 0, EGL_FOREVER);
eglDestroySyncKHR(egl_display, fence);
Expand Down

0 comments on commit 696e9d0

Please sign in to comment.