From: Michael Schuldt Date: Wed, 29 Jun 2011 11:59:27 +0000 (+0200) Subject: Bugfix : Improvement for handling, native X applications X-Git-Tag: ivi-layer-management_version_0_9_1~20^2^2~3 X-Git-Url: http://review.tizen.org/git/?a=commitdiff_plain;h=24e04b7337a19f9490f28d1bc8c3da9076bfdc0e;p=profile%2Fivi%2Flayer-management.git Bugfix : Improvement for handling, native X applications --- diff --git a/CMakeLists.txt b/CMakeLists.txt index cb94949..6c1c2d1 100644 --- a/CMakeLists.txt +++ b/CMakeLists.txt @@ -78,7 +78,7 @@ add_subdirectory (LayerManagerUtils) add_subdirectory (LayerManagerCommands) add_subdirectory (LayerManagerService) add_subdirectory (LayerManagerExamples/LayerManagerClientExample) - +add_subdirectory (LayerManagerExamples/LayerManagerToolBox) if (WITH_DESKTOP) add_subdirectory (LayerManagerPlugins/Renderers/Platform/GLXRenderer) @@ -97,3 +97,4 @@ if (WITH_GLX_EXAMPLE) endif(WITH_GLX_EXAMPLE) + diff --git a/LayerManagerCommands/src/CommitCommand.cpp b/LayerManagerCommands/src/CommitCommand.cpp index 913263f..6232a2e 100644 --- a/LayerManagerCommands/src/CommitCommand.cpp +++ b/LayerManagerCommands/src/CommitCommand.cpp @@ -26,10 +26,10 @@ ExecutionResult CommitCommand::execute(ICommandExecutor* executor) bool success = true; bool redraw = false; - Scene& scene = *(executor->getScene()); + Scene* scene = (executor->getScene()); - CommandListIterator iter = scene.m_toBeCommittedList.begin(); - CommandListIterator iterEnd = scene.m_toBeCommittedList.end(); + CommandListIterator iter = scene->m_toBeCommittedList.begin(); + CommandListIterator iterEnd = scene->m_toBeCommittedList.end(); for (; iter != iterEnd; ++iter) { @@ -51,7 +51,7 @@ ExecutionResult CommitCommand::execute(ICommandExecutor* executor) delete command; } } - scene.m_toBeCommittedList.clear(); + scene->m_toBeCommittedList.clear(); ExecutionResult returnValue = ExecutionFailed; diff --git a/LayerManagerExamples/LayerManagerClientExample/src/LayermanagerClientTest.c b/LayerManagerExamples/LayerManagerClientExample/src/LayermanagerClientTest.c index aeb1f57..5ec4fd0 100644 --- a/LayerManagerExamples/LayerManagerClientExample/src/LayermanagerClientTest.c +++ b/LayerManagerExamples/LayerManagerClientExample/src/LayermanagerClientTest.c @@ -106,6 +106,7 @@ ilmErrorTypes createLayers(t_ilm_int LayerWidth, t_ilm_int LayerHeight) } ilm_displaySetRenderOrder(0, &layer[0], 3); + ilm_commitChanges(); return error; } diff --git a/LayerManagerPlugins/Renderers/Graphic/include/TextureBinders/X11CopyGLES.h b/LayerManagerPlugins/Renderers/Graphic/include/TextureBinders/X11CopyGLES.h index f0016f0..816a015 100644 --- a/LayerManagerPlugins/Renderers/Graphic/include/TextureBinders/X11CopyGLES.h +++ b/LayerManagerPlugins/Renderers/Graphic/include/TextureBinders/X11CopyGLES.h @@ -35,7 +35,7 @@ public: // pseudo require EGL to have been initialised // we dont really need the handle }; - void swapPixmap(unsigned char* src,unsigned char* dest,unsigned int width,unsigned int height,bool swaprgb); + void swapPixmap(unsigned char* src,unsigned char* dest,unsigned int width,unsigned int height,bool swaprgb,bool includeAlpha); bool bindSurfaceTexture(Surface* surface); void createClientBuffer(Surface* surface); void destroyClientBuffer(Surface* surface); diff --git a/LayerManagerPlugins/Renderers/Graphic/src/TextureBinders/X11CopyGLES.cpp b/LayerManagerPlugins/Renderers/Graphic/src/TextureBinders/X11CopyGLES.cpp index 01d68ff..d562aa3 100644 --- a/LayerManagerPlugins/Renderers/Graphic/src/TextureBinders/X11CopyGLES.cpp +++ b/LayerManagerPlugins/Renderers/Graphic/src/TextureBinders/X11CopyGLES.cpp @@ -32,6 +32,7 @@ bool X11CopyGLES::bindSurfaceTexture(Surface* surface) GLenum sourceType = GL_RGBA; unsigned char* swapedData = NULL; bool swaprgb = false; + bool includeAlpha = false; if (surface != NULL ) { nativeSurface = (XPlatformSurface*)surface->platform; @@ -51,16 +52,28 @@ bool X11CopyGLES::bindSurfaceTexture(Surface* surface) glBindTexture(GL_TEXTURE_2D, nativeSurface->texture); glTexParameterf(GL_TEXTURE_2D, GL_TEXTURE_MIN_FILTER, GL_LINEAR); glTexParameterf(GL_TEXTURE_2D, GL_TEXTURE_MAG_FILTER, GL_LINEAR); - if ( xim->depth == 24 ) + if ( surface->getPixelFormat() == PIXELFORMAT_RGB888) { targetType = GL_RGB; sourceType = GL_RGB; - swaprgb = true; + swaprgb = true; swapedData = new unsigned char[surface->OriginalSourceWidth*surface->OriginalSourceHeight*3]; - } else { - swapedData = new unsigned char[surface->OriginalSourceWidth*surface->OriginalSourceHeight*4]; - } - swapPixmap((unsigned char*)xim->data, swapedData, surface->OriginalSourceWidth, surface->OriginalSourceHeight,swaprgb); + } + else if ( surface->getPixelFormat() == PIXELFORMAT_RGBA8888) + { + if (xim->depth == 24) + { + includeAlpha = true; + } + swapedData = new unsigned char[surface->OriginalSourceWidth*surface->OriginalSourceHeight*4]; + } + else + { + LOG_ERROR("X11CopyGLES","Pixelformat currently not supported : " << surface->getPixelFormat()); + XDestroyImage(xim); + return false; + } + swapPixmap((unsigned char*)xim->data, swapedData, surface->OriginalSourceWidth, surface->OriginalSourceHeight,swaprgb,includeAlpha); glTexImage2D(GL_TEXTURE_2D, 0, sourceType, surface->OriginalSourceWidth, surface->OriginalSourceHeight, 0, targetType, GL_UNSIGNED_BYTE, swapedData); XDestroyImage(xim); delete[] swapedData; @@ -69,7 +82,7 @@ bool X11CopyGLES::bindSurfaceTexture(Surface* surface) } return false; } -void X11CopyGLES::swapPixmap(unsigned char* src,unsigned char* dest, unsigned int width,unsigned int height,bool swaprgb) +void X11CopyGLES::swapPixmap(unsigned char* src,unsigned char* dest, unsigned int width,unsigned int height,bool swaprgb,bool includeAlpha) { unsigned int count = 0; if (swaprgb == false) @@ -79,10 +92,14 @@ void X11CopyGLES::swapPixmap(unsigned char* src,unsigned char* dest, unsigned in dest[j*4]=src[j*4+2]; dest[j*4+1]=src[j*4+1]; dest[j*4+2]=src[j*4]; - dest[j*4+3]=src[j*4+3]; + dest[j*4+3]=src[j*4+3]; + if (includeAlpha) + { + dest[j*4+3]=255; + } } } else { - count = width*height; + count = width*height; for (int j=0;jUnMapWindow(event.xunmap.window); - checkRedraw = true; + checkRedraw = true; break; case ReparentNotify: LOG_DEBUG("X11WindowSystem", "Reparent Event");