diff --git a/src/lib/gl_engine/tvgGlCommon.h b/src/lib/gl_engine/tvgGlCommon.h index 6acee47a..7c5ba2e6 100644 --- a/src/lib/gl_engine/tvgGlCommon.h +++ b/src/lib/gl_engine/tvgGlCommon.h @@ -23,8 +23,10 @@ #ifndef _TVG_GL_COMMON_H_ #define _TVG_GL_COMMON_H_ -#include "tvgCommon.h" #include +#include +#include "tvgCommon.h" +#include "tvgRender.h" #define GL_CHECK(x) \ diff --git a/src/lib/gl_engine/tvgGlGeometry.cpp b/src/lib/gl_engine/tvgGlGeometry.cpp index e940f26b..7af492eb 100644 --- a/src/lib/gl_engine/tvgGlGeometry.cpp +++ b/src/lib/gl_engine/tvgGlGeometry.cpp @@ -20,11 +20,9 @@ * SOFTWARE. */ +#include #include "tvgGlGpuBuffer.h" #include "tvgGlGeometry.h" -#include "tvgGlCommon.h" - -#include uint32_t GlGeometry::getPrimitiveCount() diff --git a/src/lib/gl_engine/tvgGlGeometry.h b/src/lib/gl_engine/tvgGlGeometry.h index 68dc99d4..2fb83f5c 100644 --- a/src/lib/gl_engine/tvgGlGeometry.h +++ b/src/lib/gl_engine/tvgGlGeometry.h @@ -23,6 +23,8 @@ #ifndef _TVG_GL_GEOMETRY_H_ #define _TVG_GL_GEOMETRY_H_ +#include +#include #include "tvgGlCommon.h" class GlPoint diff --git a/src/lib/gl_engine/tvgGlGpuBuffer.cpp b/src/lib/gl_engine/tvgGlGpuBuffer.cpp index f4024252..9ca680c4 100644 --- a/src/lib/gl_engine/tvgGlGpuBuffer.cpp +++ b/src/lib/gl_engine/tvgGlGpuBuffer.cpp @@ -20,10 +20,11 @@ * SOFTWARE. */ -#include "tvgGlCommon.h" #include "tvgGlGpuBuffer.h" -#include +/************************************************************************/ +/* Internal Class Implementation */ +/************************************************************************/ GlGpuBuffer::GlGpuBuffer() { diff --git a/src/lib/gl_engine/tvgGlGpuBuffer.h b/src/lib/gl_engine/tvgGlGpuBuffer.h index e3ed97cf..bf42941e 100644 --- a/src/lib/gl_engine/tvgGlGpuBuffer.h +++ b/src/lib/gl_engine/tvgGlGpuBuffer.h @@ -23,8 +23,7 @@ #ifndef _TVG_GL_GPU_BUFFER_H_ #define _TVG_GL_GPU_BUFFER_H_ -#include -#include +#include "tvgGlCommon.h" class GlGpuBuffer { diff --git a/src/lib/gl_engine/tvgGlProgram.cpp b/src/lib/gl_engine/tvgGlProgram.cpp index 38ed3e1b..63ee42b6 100644 --- a/src/lib/gl_engine/tvgGlProgram.cpp +++ b/src/lib/gl_engine/tvgGlProgram.cpp @@ -20,15 +20,21 @@ * SOFTWARE. */ -#include "tvgGlCommon.h" +#include #include "tvgGlProgram.h" -#include +/************************************************************************/ +/* Internal Class Implementation */ +/************************************************************************/ uint32_t GlProgram::mCurrentProgram = 0; +/************************************************************************/ +/* External Class Implementation */ +/************************************************************************/ + unique_ptr GlProgram::gen(std::shared_ptr shader) { return make_unique(shader); diff --git a/src/lib/gl_engine/tvgGlProgram.h b/src/lib/gl_engine/tvgGlProgram.h index 730274f6..173c5cdf 100644 --- a/src/lib/gl_engine/tvgGlProgram.h +++ b/src/lib/gl_engine/tvgGlProgram.h @@ -23,10 +23,8 @@ #ifndef _TVG_GL_PROGRAM_H_ #define _TVG_GL_PROGRAM_H_ -#include "tvgGlShader.h" - -#include #include +#include "tvgGlShader.h" class GlProgram { diff --git a/src/lib/gl_engine/tvgGlPropertyInterface.cpp b/src/lib/gl_engine/tvgGlPropertyInterface.cpp index ebb1c57b..af011eba 100644 --- a/src/lib/gl_engine/tvgGlPropertyInterface.cpp +++ b/src/lib/gl_engine/tvgGlPropertyInterface.cpp @@ -1,8 +1,38 @@ +/* + * Copyright (c) 2020 Samsung Electronics Co., Ltd. All rights reserved. + + * Permission is hereby granted, free of charge, to any person obtaining a copy + * of this software and associated documentation files (the "Software"), to deal + * in the Software without restriction, including without limitation the rights + * to use, copy, modify, merge, publish, distribute, sublicense, and/or sell + * copies of the Software, and to permit persons to whom the Software is + * furnished to do so, subject to the following conditions: + + * The above copyright notice and this permission notice shall be included in all + * copies or substantial portions of the Software. + + * THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR + * IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, + * FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE + * AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER + * LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, + * OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE + * SOFTWARE. + */ + #include "tvgGlPropertyInterface.h" -#include "tvgGlRenderTask.h" + +/************************************************************************/ +/* Internal Class Implementation */ +/************************************************************************/ VertexProperty PropertyInterface::mEmptyProperty; + +/************************************************************************/ +/* External Class Implementation */ +/************************************************************************/ + VertexProperty& PropertyInterface::addProperty(GlRenderTask* rTask, std::shared_ptr prog, std::string name, uint32_t propFormatSize, VertexProperty::PropertyType propType) { std::map* vertexProperty = nullptr; diff --git a/src/lib/gl_engine/tvgGlPropertyInterface.h b/src/lib/gl_engine/tvgGlPropertyInterface.h index c8f309ca..6c09e6df 100644 --- a/src/lib/gl_engine/tvgGlPropertyInterface.h +++ b/src/lib/gl_engine/tvgGlPropertyInterface.h @@ -1,12 +1,30 @@ +/* + * Copyright (c) 2020 Samsung Electronics Co., Ltd. All rights reserved. + + * Permission is hereby granted, free of charge, to any person obtaining a copy + * of this software and associated documentation files (the "Software"), to deal + * in the Software without restriction, including without limitation the rights + * to use, copy, modify, merge, publish, distribute, sublicense, and/or sell + * copies of the Software, and to permit persons to whom the Software is + * furnished to do so, subject to the following conditions: + + * The above copyright notice and this permission notice shall be included in all + * copies or substantial portions of the Software. + + * THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR + * IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, + * FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE + * AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER + * LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, + * OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE + * SOFTWARE. + */ + #ifndef _TVG_GL_PROPERTY_INTERFACE_H_ #define _TVG_GL_PROPERTY_INTERFACE_H_ -#include "tvgGlRendererProperties.h" #include "tvgGlRenderTask.h" -#include -#include -#include #define ADD_ATTRIBUTE_PROPERTY(var, rtask, prog, varName, formatSize, location) \ var = &PropertyInterface::addProperty(rtask, prog, varName, formatSize, VertexProperty::PropertyType::ATTRIBUTE); \ diff --git a/src/lib/gl_engine/tvgGlRenderTask.cpp b/src/lib/gl_engine/tvgGlRenderTask.cpp index accb957e..fc474161 100644 --- a/src/lib/gl_engine/tvgGlRenderTask.cpp +++ b/src/lib/gl_engine/tvgGlRenderTask.cpp @@ -1,12 +1,33 @@ -#include "tvgGlCommon.h" -#include "tvgGlShaderSrc.h" +/* + * Copyright (c) 2020 Samsung Electronics Co., Ltd. All rights reserved. + + * Permission is hereby granted, free of charge, to any person obtaining a copy + * of this software and associated documentation files (the "Software"), to deal + * in the Software without restriction, including without limitation the rights + * to use, copy, modify, merge, publish, distribute, sublicense, and/or sell + * copies of the Software, and to permit persons to whom the Software is + * furnished to do so, subject to the following conditions: + + * The above copyright notice and this permission notice shall be included in all + * copies or substantial portions of the Software. + + * THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR + * IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, + * FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE + * AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER + * LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, + * OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE + * SOFTWARE. + */ + #include "tvgGlRenderTask.h" +#include "tvgGlShaderSrc.h" #include "tvgGlPropertyInterface.h" -#include -#include -#include +/************************************************************************/ +/* External Class Implementation */ +/************************************************************************/ GlRenderTask::GlRenderTask(RenderTypes renderType, shared_ptr shader) { diff --git a/src/lib/gl_engine/tvgGlRenderTask.h b/src/lib/gl_engine/tvgGlRenderTask.h index d4b28e5e..d753bcc2 100644 --- a/src/lib/gl_engine/tvgGlRenderTask.h +++ b/src/lib/gl_engine/tvgGlRenderTask.h @@ -1,14 +1,30 @@ +/* + * Copyright (c) 2020 Samsung Electronics Co., Ltd. All rights reserved. + + * Permission is hereby granted, free of charge, to any person obtaining a copy + * of this software and associated documentation files (the "Software"), to deal + * in the Software without restriction, including without limitation the rights + * to use, copy, modify, merge, publish, distribute, sublicense, and/or sell + * copies of the Software, and to permit persons to whom the Software is + * furnished to do so, subject to the following conditions: + + * The above copyright notice and this permission notice shall be included in all + * copies or substantial portions of the Software. + + * THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR + * IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, + * FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE + * AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER + * LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, + * OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE + * SOFTWARE. + */ + #ifndef _TVG_GL_RENDER_TASK_H_ #define _TVG_GL_RENDER_TASK_H_ -#include "tvgGlShader.h" -#include "tvgGlProgram.h" #include "tvgGlRendererProperties.h" -#include -#include -#include - #define MAX_GRADIENT_STOPS 4 class GlRenderTask diff --git a/src/lib/gl_engine/tvgGlRenderer.cpp b/src/lib/gl_engine/tvgGlRenderer.cpp index 9e63e24a..896a80be 100644 --- a/src/lib/gl_engine/tvgGlRenderer.cpp +++ b/src/lib/gl_engine/tvgGlRenderer.cpp @@ -19,11 +19,10 @@ * OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE * SOFTWARE. */ -#include "tvgGlShaderSrc.h" + +#include "tvgGlRenderer.h" #include "tvgGlGpuBuffer.h" #include "tvgGlGeometry.h" -#include "tvgGlCommon.h" -#include "tvgGlRenderer.h" #include "tvgGlPropertyInterface.h" /************************************************************************/ @@ -32,6 +31,7 @@ static bool initEngine = false; static uint32_t rendererCnt = 0; + static void _termEngine() { if (rendererCnt > 0) return; diff --git a/src/lib/gl_engine/tvgGlRenderer.h b/src/lib/gl_engine/tvgGlRenderer.h index 79addd64..7d63c5a7 100644 --- a/src/lib/gl_engine/tvgGlRenderer.h +++ b/src/lib/gl_engine/tvgGlRenderer.h @@ -23,8 +23,6 @@ #ifndef _TVG_GL_RENDERER_H_ #define _TVG_GL_RENDERER_H_ -#include "tvgGlCommon.h" -#include "tvgGlProgram.h" #include "tvgGlRenderTask.h" class GlRenderer : public RenderMethod diff --git a/src/lib/gl_engine/tvgGlRendererProperties.h b/src/lib/gl_engine/tvgGlRendererProperties.h index dd009237..9aa56df0 100644 --- a/src/lib/gl_engine/tvgGlRendererProperties.h +++ b/src/lib/gl_engine/tvgGlRendererProperties.h @@ -1,13 +1,31 @@ +/* + * Copyright (c) 2020 Samsung Electronics Co., Ltd. All rights reserved. + + * Permission is hereby granted, free of charge, to any person obtaining a copy + * of this software and associated documentation files (the "Software"), to deal + * in the Software without restriction, including without limitation the rights + * to use, copy, modify, merge, publish, distribute, sublicense, and/or sell + * copies of the Software, and to permit persons to whom the Software is + * furnished to do so, subject to the following conditions: + + * The above copyright notice and this permission notice shall be included in all + * copies or substantial portions of the Software. + + * THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR + * IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, + * FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE + * AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER + * LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, + * OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE + * SOFTWARE. + */ + #ifndef _TVG_GL_RENDER_PROPERTIES_H_ #define _TVG_GL_RENDER_PROPERTIES_H_ -#include "tvgGlShader.h" -#include "tvgGlProgram.h" - -#include -#include #include -#include +#include "tvgGlCommon.h" +#include "tvgGlProgram.h" class PropertyValue { diff --git a/src/lib/gl_engine/tvgGlShader.cpp b/src/lib/gl_engine/tvgGlShader.cpp index 9838393f..4d94d918 100644 --- a/src/lib/gl_engine/tvgGlShader.cpp +++ b/src/lib/gl_engine/tvgGlShader.cpp @@ -20,11 +20,13 @@ * SOFTWARE. */ -#include "tvgGlCommon.h" +#include #include "tvgGlShader.h" -#include +/************************************************************************/ +/* External Class Implementation */ +/************************************************************************/ shared_ptr GlShader::gen(const char* vertSrc, const char* fragSrc) { diff --git a/src/lib/gl_engine/tvgGlShader.h b/src/lib/gl_engine/tvgGlShader.h index 60793e12..4cb29b6e 100644 --- a/src/lib/gl_engine/tvgGlShader.h +++ b/src/lib/gl_engine/tvgGlShader.h @@ -23,7 +23,7 @@ #ifndef _TVG_GL_SHADER_H_ #define _TVG_GL_SHADER_H_ -#include +#include "tvgGlCommon.h" class GlShader { diff --git a/src/lib/gl_engine/tvgGlShaderSrc.cpp b/src/lib/gl_engine/tvgGlShaderSrc.cpp index 91c31de0..63d796eb 100644 --- a/src/lib/gl_engine/tvgGlShaderSrc.cpp +++ b/src/lib/gl_engine/tvgGlShaderSrc.cpp @@ -20,9 +20,8 @@ * SOFTWARE. */ -#include "tvgGlShaderSrc.h" - #include +#include "tvgGlShaderSrc.h" #define TVG_COMPOSE_SHADER(shader) #shader