diff options
Diffstat (limited to 'emulator/opengl/host/libs/libOpenglRender')
4 files changed, 21 insertions, 6 deletions
diff --git a/emulator/opengl/host/libs/libOpenglRender/ColorBuffer.cpp b/emulator/opengl/host/libs/libOpenglRender/ColorBuffer.cpp index 532ffe7..e612294 100644 --- a/emulator/opengl/host/libs/libOpenglRender/ColorBuffer.cpp +++ b/emulator/opengl/host/libs/libOpenglRender/ColorBuffer.cpp @@ -298,6 +298,7 @@ bool ColorBuffer::bind_fbo() GL_TEXTURE_2D, m_tex, 0); GLenum status = s_gl.glCheckFramebufferStatusOES(GL_FRAMEBUFFER_OES); if (status != GL_FRAMEBUFFER_COMPLETE_OES) { + ERR("ColorBuffer::bind_fbo: FBO not complete: %#x\n", status); s_gl.glBindFramebufferOES(GL_FRAMEBUFFER_OES, 0); s_gl.glDeleteFramebuffersOES(1, &m_fbo); m_fbo = 0; diff --git a/emulator/opengl/host/libs/libOpenglRender/FrameBuffer.cpp b/emulator/opengl/host/libs/libOpenglRender/FrameBuffer.cpp index 238f2c9..e7a7960 100644 --- a/emulator/opengl/host/libs/libOpenglRender/FrameBuffer.cpp +++ b/emulator/opengl/host/libs/libOpenglRender/FrameBuffer.cpp @@ -551,15 +551,17 @@ void FrameBuffer::DestroyWindowSurface(HandleType p_surface) m_windows.erase(p_surface); } -void FrameBuffer::openColorBuffer(HandleType p_colorbuffer) +int FrameBuffer::openColorBuffer(HandleType p_colorbuffer) { emugl::Mutex::AutoLock mutex(m_lock); ColorBufferMap::iterator c(m_colorbuffers.find(p_colorbuffer)); if (c == m_colorbuffers.end()) { // bad colorbuffer handle - return; + ERR("FB: openColorBuffer cb handle %#x not found\n", p_colorbuffer); + return -1; } (*c).second.refcount++; + return 0; } void FrameBuffer::closeColorBuffer(HandleType p_colorbuffer) @@ -567,6 +569,7 @@ void FrameBuffer::closeColorBuffer(HandleType p_colorbuffer) emugl::Mutex::AutoLock mutex(m_lock); ColorBufferMap::iterator c(m_colorbuffers.find(p_colorbuffer)); if (c == m_colorbuffers.end()) { + ERR("FB: closeColorBuffer cb handle %#x not found\n", p_colorbuffer); // bad colorbuffer handle return; } @@ -581,6 +584,7 @@ bool FrameBuffer::flushWindowSurfaceColorBuffer(HandleType p_surface) WindowSurfaceMap::iterator w( m_windows.find(p_surface) ); if (w == m_windows.end()) { + ERR("FB::flushWindowSurfaceColorBuffer: window handle %#x not found\n", p_surface); // bad surface handle return false; } @@ -596,11 +600,13 @@ bool FrameBuffer::setWindowSurfaceColorBuffer(HandleType p_surface, WindowSurfaceMap::iterator w( m_windows.find(p_surface) ); if (w == m_windows.end()) { // bad surface handle + ERR("%s: bad window surface handle %#x\n", __FUNCTION__, p_surface); return false; } ColorBufferMap::iterator c( m_colorbuffers.find(p_colorbuffer) ); if (c == m_colorbuffers.end()) { + ERR("%s: bad color buffer handle %#x\n", __FUNCTION__, p_colorbuffer); // bad colorbuffer handle return false; } diff --git a/emulator/opengl/host/libs/libOpenglRender/FrameBuffer.h b/emulator/opengl/host/libs/libOpenglRender/FrameBuffer.h index 5b03624..f8683b2 100644 --- a/emulator/opengl/host/libs/libOpenglRender/FrameBuffer.h +++ b/emulator/opengl/host/libs/libOpenglRender/FrameBuffer.h @@ -73,7 +73,7 @@ public: HandleType createColorBuffer(int p_width, int p_height, GLenum p_internalFormat); void DestroyRenderContext(HandleType p_context); void DestroyWindowSurface(HandleType p_surface); - void openColorBuffer(HandleType p_colorbuffer); + int openColorBuffer(HandleType p_colorbuffer); void closeColorBuffer(HandleType p_colorbuffer); bool bindContext(HandleType p_context, HandleType p_drawSurface, HandleType p_readSurface); diff --git a/emulator/opengl/host/libs/libOpenglRender/RenderControl.cpp b/emulator/opengl/host/libs/libOpenglRender/RenderControl.cpp index 6a15138..83ba9c5 100644 --- a/emulator/opengl/host/libs/libOpenglRender/RenderControl.cpp +++ b/emulator/opengl/host/libs/libOpenglRender/RenderControl.cpp @@ -215,13 +215,20 @@ static uint32_t rcCreateColorBuffer(uint32_t width, return fb->createColorBuffer(width, height, internalFormat); } -static void rcOpenColorBuffer(uint32_t colorbuffer) +static int rcOpenColorBuffer2(uint32_t colorbuffer) { FrameBuffer *fb = FrameBuffer::getFB(); if (!fb) { - return; + return -1; } - fb->openColorBuffer( colorbuffer ); + return fb->openColorBuffer( colorbuffer ); +} + +// Deprecated, kept for compatibility with old system images only. +// Use rcOpenColorBuffer2 instead. +static void rcOpenColorBuffer(uint32_t colorbuffer) +{ + (void) rcOpenColorBuffer2(colorbuffer); } static void rcCloseColorBuffer(uint32_t colorbuffer) @@ -359,4 +366,5 @@ void initRenderControlContext(renderControl_decoder_context_t *dec) dec->set_rcColorBufferCacheFlush(rcColorBufferCacheFlush); dec->set_rcReadColorBuffer(rcReadColorBuffer); dec->set_rcUpdateColorBuffer(rcUpdateColorBuffer); + dec->set_rcOpenColorBuffer2(rcOpenColorBuffer2); } |