From: Timo Lotterbach Date: Wed, 2 Jan 2013 15:52:45 +0000 (-0800) Subject: CMake: build WaylandDrmGLESRenderer independently X-Git-Tag: 1_0_rc~70 X-Git-Url: http://review.tizen.org/git/?a=commitdiff_plain;h=fc9bc4fe49441201aac5b261244bc922856b73e0;p=profile%2Fivi%2Flayer-management.git CMake: build WaylandDrmGLESRenderer independently this renderer can now be built independently of all other renderers. this allows building multiple renderers at once. Signed-off-by: Timo Lotterbach --- diff --git a/CMakeLists.txt b/CMakeLists.txt index c8ebbc1..39dff4d 100644 --- a/CMakeLists.txt +++ b/CMakeLists.txt @@ -182,6 +182,14 @@ if (WITH_WAYLAND_X11_LIB) add_subdirectory_once (LayerManagerPlugins/Renderers/GraphicLib/LayerManagerGraphicWaylandX11GLESv2) endif(WITH_WAYLAND_X11_LIB) +if (WITH_WAYLAND_DRM) + add_subdirectory_once (LayerManagerUtils) + add_subdirectory_once (LayerManagerBase) + add_subdirectory_once (LayerManagerPlugins/Renderers/GraphicLib/LayerManagerGraphicWaylandDrmGLESv2) + add_subdirectory_once (LayerManagerPlugins/Renderers/Platform/WaylandGLESRenderer) + add_subdirectory_once (LayerManagerPlugins/Renderers/Platform/WaylandDrmGLESRenderer) +endif(WITH_WAYLAND_DRM) + if (WITH_WAYLAND_DRM_LIB) add_subdirectory_once (LayerManagerPlugins/Renderers/GraphicLib/LayerManagerGraphicWaylandDrmGLESv2) endif(WITH_WAYLAND_DRM_LIB) diff --git a/LayerManagerPlugins/Renderers/Platform/WaylandDrmGLESRenderer/CMakeLists.txt b/LayerManagerPlugins/Renderers/Platform/WaylandDrmGLESRenderer/CMakeLists.txt new file mode 100644 index 0000000..c02fa05 --- /dev/null +++ b/LayerManagerPlugins/Renderers/Platform/WaylandDrmGLESRenderer/CMakeLists.txt @@ -0,0 +1,103 @@ + +############################################################################ +# +# Copyright 2010-2012 BMW Car IT GmbH +# Copyright (C) 2011 DENSO CORPORATION and Robert Bosch Car Multimedia Gmbh +# Copyright (C) 2012 Bayerische Motorenwerke Aktiengesellschaft +# +# +# Licensed under the Apache License, Version 2.0 (the "License"); +# you may not use this file except in compliance with the License. +# You may obtain a copy of the License at +# +# http://www.apache.org/licenses/LICENSE-2.0 +# +# Unless required by applicable law or agreed to in writing, software +# distributed under the License is distributed on an "AS IS" BASIS, +# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. +# See the License for the specific language governing permissions and +# limitations under the License. +# +############################################################################ + +cmake_minimum_required (VERSION 2.6) + +#=========================================================================== +# plugin configuration +#=========================================================================== +project(WaylandDrmGLESRenderer) + +find_package(Wayland REQUIRED) +find_package(EGL REQUIRED) +find_package(GLESv2 REQUIRED) +find_package(Threads REQUIRED) + +include_directories( + include + ${CMAKE_SOURCE_DIR}/LayerManagerBase/include + ${CMAKE_SOURCE_DIR}/LayerManagerUtils/include + ${CMAKE_SOURCE_DIR}/LayerManagerPlugins/Renderers/Base/include + ${CMAKE_SOURCE_DIR}/LayerManagerPlugins/Renderers/Graphic/include + ${CMAKE_SOURCE_DIR}/LayerManagerPlugins/Renderers/Platform/WaylandGLESRenderer/include +) + +set(LIBS + LayerManagerUtils + WaylandGLESRenderer + LayerManagerGraphicWaylandDrmGLESv2 +) + +set(SRC_FILES + src/WaylandDrmGLESRenderer.cpp +) + +set(PLUGIN_INSTALL_PATH lib/layermanager/renderer) + +set(X11GLES_RENDERER_PATH ${CMAKE_SOURCE_DIR}/LayerManagerPlugins/Renderers/Platform/X11GLESRenderer) +install(FILES ${X11GLES_RENDERER_PATH}/renderer_frag_clear.glslf + ${X11GLES_RENDERER_PATH}/renderer_frag.glslf + ${X11GLES_RENDERER_PATH}/renderer_frag_no_blend.glslf + ${X11GLES_RENDERER_PATH}/renderer_frag_no_ualpha.glslf + ${X11GLES_RENDERER_PATH}/renderer_frag_add_uchromakey.glslf + ${X11GLES_RENDERER_PATH}/renderer_frag_no_blend_no_ualpha.glslf + ${X11GLES_RENDERER_PATH}/renderer_frag_2surf.glslf + ${X11GLES_RENDERER_PATH}/renderer_frag_2surf_no_blend.glslf + ${X11GLES_RENDERER_PATH}/renderer_frag_2surf_no_ualpha.glslf + ${X11GLES_RENDERER_PATH}/renderer_frag_2surf_no_blend_no_ualpha.glslf + ${X11GLES_RENDERER_PATH}/renderer_frag_2surf_no_ualpha_0.glslf + ${X11GLES_RENDERER_PATH}/renderer_frag_2surf_no_blend_no_ualpha_0.glslf + ${X11GLES_RENDERER_PATH}/renderer_frag_2surf_no_ualpha_1.glslf + ${X11GLES_RENDERER_PATH}/renderer_frag_2surf_no_blend_no_ualpha_1.glslf + ${X11GLES_RENDERER_PATH}/renderer_vert.glslv + ${X11GLES_RENDERER_PATH}/renderer_vert_2surf.glslv + DESTINATION lib/layermanager/renderer +) + +#=========================================================================== +# create statically linked plugin +#=========================================================================== +if (WITH_STATIC_LIBRARIES) + + add_library(${PROJECT_NAME} STATIC ${SRC_FILES}) + + set (STATICALLY_LINKED_PLUGINS ${STATICALLY_LINKED_PLUGINS} + ${PROJECT_NAME} CACHE INTERNAL "list of static plugins") + +#=========================================================================== +# create dynamically linked plugin +#=========================================================================== +else(WITH_STATIC_LIBRARIES) + + add_library(${PROJECT_NAME} SHARED ${SRC_FILES}) + + install(TARGETS ${PROJECT_NAME} LIBRARY DESTINATION ${PLUGIN_INSTALL_PATH}) + +endif(WITH_STATIC_LIBRARIES) + + +#=========================================================================== +# external libraries +#=========================================================================== +target_link_libraries(${PROJECT_NAME} ${LIBS}) + +add_dependencies(${PROJECT_NAME} ${LIBS}) diff --git a/LayerManagerPlugins/Renderers/Platform/WaylandDrmGLESRenderer/include/WaylandDrmGLESRenderer.h b/LayerManagerPlugins/Renderers/Platform/WaylandDrmGLESRenderer/include/WaylandDrmGLESRenderer.h new file mode 100644 index 0000000..9653b3a --- /dev/null +++ b/LayerManagerPlugins/Renderers/Platform/WaylandDrmGLESRenderer/include/WaylandDrmGLESRenderer.h @@ -0,0 +1,40 @@ +/*************************************************************************** + * + * Copyright 2010-2012 BMW Car IT GmbH + * Copyright (C) 2011 DENSO CORPORATION and Robert Bosch Car Multimedia Gmbh + * Copyright (c) 2012, NVIDIA CORPORATION. All rights reserved. + * + * + * Licensed under the Apache License, Version 2.0 (the "License"); + * you may not use this file except in compliance with the License. + * You may obtain a copy of the License at + * + * http://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an "AS IS" BASIS, + * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * See the License for the specific language governing permissions and + * limitations under the License. + * + ****************************************************************************/ + +#ifndef _WAYLANDDRMGLESRENDERER_H_ +#define _WAYLANDDRMGLESRENDERER_H_ + +#include "WaylandGLESRenderer.h" + +class WaylandDrmGLESRenderer : public WaylandGLESRenderer +{ +public: + WaylandDrmGLESRenderer(ICommandExecutor& executor, Configuration& config); + + // from PluginBase + virtual t_ilm_const_string pluginGetName() const; + + // from WaylandGLESRenderer + virtual WaylandBaseWindowSystem* getWindowSystem(const char* displayname); + virtual GLESGraphicsystem* getGraphicSystem(PfnShaderProgramCreator shaderProgram); +}; + +#endif /* _WAYLANDDRMGLESRENDERER_H_*/ diff --git a/LayerManagerPlugins/Renderers/Platform/WaylandDrmGLESRenderer/src/WaylandDrmGLESRenderer.cpp b/LayerManagerPlugins/Renderers/Platform/WaylandDrmGLESRenderer/src/WaylandDrmGLESRenderer.cpp new file mode 100644 index 0000000..fa4bcec --- /dev/null +++ b/LayerManagerPlugins/Renderers/Platform/WaylandDrmGLESRenderer/src/WaylandDrmGLESRenderer.cpp @@ -0,0 +1,47 @@ +/*************************************************************************** + * + * Copyright 2010-2012 BMW Car IT GmbH + * Copyright (C) 2011 DENSO CORPORATION and Robert Bosch Car Multimedia Gmbh + * + * + * Licensed under the Apache License, Version 2.0 (the "License"); + * you may not use this file except in compliance with the License. + * You may obtain a copy of the License at + * + * http://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an "AS IS" BASIS, + * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * See the License for the specific language governing permissions and + * limitations under the License. + * + ****************************************************************************/ + +#include "WaylandDrmGLESRenderer.h" +#include "WindowSystems/WaylandDrmWindowSystem.h" +#include "GraphicSystems/DrmGLESGraphicSystem.h" +#include "Configuration.h" + + +WaylandDrmGLESRenderer::WaylandDrmGLESRenderer(ICommandExecutor& executor, Configuration& config) +: WaylandGLESRenderer(executor, config) +{ +} + +t_ilm_const_string WaylandDrmGLESRenderer::pluginGetName() const +{ + return "WaylandDrmGLESRenderer"; +} + +WaylandBaseWindowSystem* WaylandDrmGLESRenderer::getWindowSystem(const char* displayname) +{ + return new WaylandDrmWindowSystem(displayname, m_width, m_height, m_pScene, m_pInputManager); +} + +GLESGraphicsystem* WaylandDrmGLESRenderer::getGraphicSystem(PfnShaderProgramCreator shaderProgram) +{ + return new DrmGLESGraphicSystem(m_width, m_height, shaderProgram); +} + +DECLARE_LAYERMANAGEMENT_PLUGIN(WaylandDrmGLESRenderer) diff --git a/LayerManagerPlugins/Renderers/Platform/WaylandGLESRenderer/CMakeLists.txt b/LayerManagerPlugins/Renderers/Platform/WaylandGLESRenderer/CMakeLists.txt index 76e99d8..623cc1a 100644 --- a/LayerManagerPlugins/Renderers/Platform/WaylandGLESRenderer/CMakeLists.txt +++ b/LayerManagerPlugins/Renderers/Platform/WaylandGLESRenderer/CMakeLists.txt @@ -31,11 +31,15 @@ find_package(EGL REQUIRED) find_package(GLESv2 REQUIRED) find_package(Threads REQUIRED) +SET(RENDERERBASE_DIR ${CMAKE_SOURCE_DIR}/LayerManagerPlugins/Renderers/Base) +SET(GRAPHIC_LIB_DIR ${CMAKE_SOURCE_DIR}/LayerManagerPlugins/Renderers/Graphic) +set(X11GLES_RENDERER_DIR ${CMAKE_SOURCE_DIR}/LayerManagerPlugins/Renderers/Platform/X11GLESRenderer) + include_directories( include - ../X11GLESRenderer/include - ../../Base/include - ../../Graphic/include + ${X11GLES_RENDERER_DIR}/include + ${RENDERERBASE_DIR}/include + ${GRAPHIC_LIB_DIR}/include ${CMAKE_SOURCE_DIR}/config ${CMAKE_SOURCE_DIR}/LayerManagerBase/include ${CMAKE_SOURCE_DIR}/LayerManagerUtils/include @@ -54,31 +58,7 @@ set(LIBS set(SRC_FILES src/WaylandGLESRenderer.cpp - ../X11GLESRenderer/src/ShaderProgramGLES.cpp -) - -set(PLUGIN_INSTALL_PATH lib/layermanager/renderer) - -install( - FILES - renderer_frag_clear.glslf - renderer_frag.glslf - renderer_frag_no_blend.glslf - renderer_frag_no_ualpha.glslf - renderer_frag_add_uchromakey.glslf - renderer_frag_no_blend_no_ualpha.glslf - renderer_frag_2surf.glslf - renderer_frag_2surf_no_blend.glslf - renderer_frag_2surf_no_ualpha.glslf - renderer_frag_2surf_no_blend_no_ualpha.glslf - renderer_frag_2surf_no_ualpha_0.glslf - renderer_frag_2surf_no_blend_no_ualpha_0.glslf - renderer_frag_2surf_no_ualpha_1.glslf - renderer_frag_2surf_no_blend_no_ualpha_1.glslf - renderer_vert.glslv - renderer_vert_2surf.glslv - DESTINATION - lib/layermanager/renderer + ${X11GLES_RENDERER_DIR}/src/ShaderProgramGLES.cpp ) #=========================================================================== diff --git a/LayerManagerPlugins/Renderers/Platform/WaylandGLESRenderer/src/WaylandGLESRenderer.cpp b/LayerManagerPlugins/Renderers/Platform/WaylandGLESRenderer/src/WaylandGLESRenderer.cpp index 9c6a63b..6dab2d8 100644 --- a/LayerManagerPlugins/Renderers/Platform/WaylandGLESRenderer/src/WaylandGLESRenderer.cpp +++ b/LayerManagerPlugins/Renderers/Platform/WaylandGLESRenderer/src/WaylandGLESRenderer.cpp @@ -23,10 +23,6 @@ #include "Shader.h" #include "ShaderProgramGLES.h" #include "TextureBinders/WaylandGLESTexture.h" -#ifdef WITH_WAYLAND_DRM -#include "WindowSystems/WaylandDrmWindowSystem.h" -#include "GraphicSystems/DrmGLESGraphicSystem.h" -#endif // WITH_WAYLAND_DRM WaylandGLESRenderer::WaylandGLESRenderer(ICommandExecutor& executor, Configuration& config) : BaseRenderer(executor, config) @@ -53,27 +49,14 @@ bool WaylandGLESRenderer::start(int width, int height, const char* displayname) screenList.push_back(lmScreen); // create Wayland windows, register as composite manager etc - m_pWindowSystem = NULL; -#ifdef WITH_WAYLAND_FBDEV m_pWindowSystem = getWindowSystem(displayname); -#endif -#ifdef WITH_WAYLAND_X11 - m_pWindowSystem = getWindowSystem(displayname); -#endif -#ifdef WITH_WAYLAND_DRM - m_pWindowSystem = new WaylandDrmWindowSystem(displayname, width, height, m_pScene, m_pInputManager); -#endif if( m_pWindowSystem == NULL ) { LOG_ERROR("WaylandGLESRenderer", "Window system is not specified. Consider to specify WITH_WAYLAND_X11 or WITH_WAYLAND_FBDEV"); goto fail; // TODO bad style } -#ifdef WITH_WAYLAND_DRM - m_pGraphicSystem = new DrmGLESGraphicSystem(width,height, ShaderProgramGLES::createProgram); -#else m_pGraphicSystem = getGraphicSystem(ShaderProgramGLES::createProgram); -#endif if (!m_pWindowSystem->init((BaseGraphicSystem*) m_pGraphicSystem)) {