From 843e9f395ac68c424c8b1c2da94d52ef01d3dd1b Mon Sep 17 00:00:00 2001 From: Stefan Seyfried Date: Sat, 6 Apr 2013 12:06:18 +0200 Subject: [PATCH] glthread: blit OSD manually to help debugging of framebuffer issues, only blit the openGL framebuffer after an explicit blit() call --- src/driver/fbaccel.cpp | 7 +++++++ src/driver/glthread.cpp | 7 ++++++- src/driver/glthread.h | 3 +++ 3 files changed, 16 insertions(+), 1 deletion(-) diff --git a/src/driver/fbaccel.cpp b/src/driver/fbaccel.cpp index ba1a52786..aa2cfa828 100644 --- a/src/driver/fbaccel.cpp +++ b/src/driver/fbaccel.cpp @@ -30,6 +30,9 @@ #endif #include +#ifdef USE_OPENGL +#include "glthread.h" +#endif #include #include @@ -821,6 +824,10 @@ void CFbAccel::blit() /* not azbox and not spark -> no blit() needed */ void CFbAccel::blit() { +#ifdef USE_OPENGL + if (fb->mpGLThreadObj) + fb->mpGLThreadObj->blit(); +#endif } #endif diff --git a/src/driver/glthread.cpp b/src/driver/glthread.cpp index 40dcbda2a..d9a74d2bf 100644 --- a/src/driver/glthread.cpp +++ b/src/driver/glthread.cpp @@ -338,7 +338,12 @@ void GLThreadObj::render() { } // bltDisplayBuffer(); /* decoded video stream */ - bltOSDBuffer(); /* OSD */ + if (mState.blit) { + /* only blit manually after fb->blit(), this helps to find missed blit() calls */ + mState.blit = false; + //fprintf(stderr, "blit!\n"); + bltOSDBuffer(); /* OSD */ + } glBindTexture(GL_TEXTURE_2D, mState.osdtex); glClear(GL_COLOR_BUFFER_BIT | GL_DEPTH_BUFFER_BIT); diff --git a/src/driver/glthread.h b/src/driver/glthread.h index 97881eda8..2ce103db1 100644 --- a/src/driver/glthread.h +++ b/src/driver/glthread.h @@ -29,6 +29,7 @@ #include #include #include +#include "rcinput.h" //class SWDecoder; @@ -51,6 +52,7 @@ public: int getOSDWidth() { return mState.width; } int getOSDHeight() { return mState.height; } + void blit() { mState.blit = true; } void clear(); @@ -92,6 +94,7 @@ private: // GLuint displaytex; /* holds the display texture */ // GLuint displaypbo; int go3d; + bool blit; } mState; // boost::shared_ptrmpSWDecoder; /* our Decoder-Object that runs in its own thread */