mirror of
https://github.com/thorvg/thorvg.git
synced 2025-06-14 12:04:29 +00:00
gl_engine: fix compile error.
After refactoring header includsion, gl_engine has a break at file dependencies. now this fixes it.
This commit is contained in:
parent
74f8da845e
commit
ea028a479c
17 changed files with 153 additions and 45 deletions
|
@ -23,8 +23,10 @@
|
|||
#ifndef _TVG_GL_COMMON_H_
|
||||
#define _TVG_GL_COMMON_H_
|
||||
|
||||
#include "tvgCommon.h"
|
||||
#include <assert.h>
|
||||
#include <GLES2/gl2.h>
|
||||
#include "tvgCommon.h"
|
||||
#include "tvgRender.h"
|
||||
|
||||
|
||||
#define GL_CHECK(x) \
|
||||
|
|
|
@ -20,11 +20,9 @@
|
|||
* SOFTWARE.
|
||||
*/
|
||||
|
||||
#include <float.h>
|
||||
#include "tvgGlGpuBuffer.h"
|
||||
#include "tvgGlGeometry.h"
|
||||
#include "tvgGlCommon.h"
|
||||
|
||||
#include <GLES2/gl2.h>
|
||||
|
||||
|
||||
uint32_t GlGeometry::getPrimitiveCount()
|
||||
|
|
|
@ -23,6 +23,8 @@
|
|||
#ifndef _TVG_GL_GEOMETRY_H_
|
||||
#define _TVG_GL_GEOMETRY_H_
|
||||
|
||||
#include <math.h>
|
||||
#include <vector>
|
||||
#include "tvgGlCommon.h"
|
||||
|
||||
class GlPoint
|
||||
|
|
|
@ -20,10 +20,11 @@
|
|||
* SOFTWARE.
|
||||
*/
|
||||
|
||||
#include "tvgGlCommon.h"
|
||||
#include "tvgGlGpuBuffer.h"
|
||||
|
||||
#include <assert.h>
|
||||
/************************************************************************/
|
||||
/* Internal Class Implementation */
|
||||
/************************************************************************/
|
||||
|
||||
GlGpuBuffer::GlGpuBuffer()
|
||||
{
|
||||
|
|
|
@ -23,8 +23,7 @@
|
|||
#ifndef _TVG_GL_GPU_BUFFER_H_
|
||||
#define _TVG_GL_GPU_BUFFER_H_
|
||||
|
||||
#include <stdlib.h>
|
||||
#include <GLES2/gl2.h>
|
||||
#include "tvgGlCommon.h"
|
||||
|
||||
class GlGpuBuffer
|
||||
{
|
||||
|
|
|
@ -20,15 +20,21 @@
|
|||
* SOFTWARE.
|
||||
*/
|
||||
|
||||
#include "tvgGlCommon.h"
|
||||
#include <iostream>
|
||||
#include "tvgGlProgram.h"
|
||||
|
||||
#include <GLES2/gl2.h>
|
||||
|
||||
/************************************************************************/
|
||||
/* Internal Class Implementation */
|
||||
/************************************************************************/
|
||||
|
||||
uint32_t GlProgram::mCurrentProgram = 0;
|
||||
|
||||
|
||||
/************************************************************************/
|
||||
/* External Class Implementation */
|
||||
/************************************************************************/
|
||||
|
||||
unique_ptr<GlProgram> GlProgram::gen(std::shared_ptr<GlShader> shader)
|
||||
{
|
||||
return make_unique<GlProgram>(shader);
|
||||
|
|
|
@ -23,10 +23,8 @@
|
|||
#ifndef _TVG_GL_PROGRAM_H_
|
||||
#define _TVG_GL_PROGRAM_H_
|
||||
|
||||
#include "tvgGlShader.h"
|
||||
|
||||
#include <memory>
|
||||
#include <map>
|
||||
#include "tvgGlShader.h"
|
||||
|
||||
class GlProgram
|
||||
{
|
||||
|
|
|
@ -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<GlProgram> prog, std::string name, uint32_t propFormatSize, VertexProperty::PropertyType propType)
|
||||
{
|
||||
std::map<int32_t, VertexProperty>* vertexProperty = nullptr;
|
||||
|
|
|
@ -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 <string>
|
||||
#include <memory>
|
||||
#include <map>
|
||||
|
||||
#define ADD_ATTRIBUTE_PROPERTY(var, rtask, prog, varName, formatSize, location) \
|
||||
var = &PropertyInterface::addProperty(rtask, prog, varName, formatSize, VertexProperty::PropertyType::ATTRIBUTE); \
|
||||
|
|
|
@ -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 <memory>
|
||||
#include <string>
|
||||
#include <GLES2/gl2.h>
|
||||
|
||||
/************************************************************************/
|
||||
/* External Class Implementation */
|
||||
/************************************************************************/
|
||||
|
||||
GlRenderTask::GlRenderTask(RenderTypes renderType, shared_ptr<GlShader> shader)
|
||||
{
|
||||
|
|
|
@ -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 <string>
|
||||
#include <memory>
|
||||
#include <map>
|
||||
|
||||
#define MAX_GRADIENT_STOPS 4
|
||||
|
||||
class GlRenderTask
|
||||
|
|
|
@ -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;
|
||||
|
|
|
@ -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
|
||||
|
|
|
@ -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 <string>
|
||||
#include <memory>
|
||||
#include <vector>
|
||||
#include <map>
|
||||
#include "tvgGlCommon.h"
|
||||
#include "tvgGlProgram.h"
|
||||
|
||||
class PropertyValue
|
||||
{
|
||||
|
|
|
@ -20,11 +20,13 @@
|
|||
* SOFTWARE.
|
||||
*/
|
||||
|
||||
#include "tvgGlCommon.h"
|
||||
#include <iostream>
|
||||
#include "tvgGlShader.h"
|
||||
|
||||
#include <GLES2/gl2.h>
|
||||
|
||||
/************************************************************************/
|
||||
/* External Class Implementation */
|
||||
/************************************************************************/
|
||||
|
||||
shared_ptr<GlShader> GlShader::gen(const char* vertSrc, const char* fragSrc)
|
||||
{
|
||||
|
|
|
@ -23,7 +23,7 @@
|
|||
#ifndef _TVG_GL_SHADER_H_
|
||||
#define _TVG_GL_SHADER_H_
|
||||
|
||||
#include <memory>
|
||||
#include "tvgGlCommon.h"
|
||||
|
||||
class GlShader
|
||||
{
|
||||
|
|
|
@ -20,9 +20,8 @@
|
|||
* SOFTWARE.
|
||||
*/
|
||||
|
||||
#include "tvgGlShaderSrc.h"
|
||||
|
||||
#include <string>
|
||||
#include "tvgGlShaderSrc.h"
|
||||
|
||||
#define TVG_COMPOSE_SHADER(shader) #shader
|
||||
|
||||
|
|
Loading…
Add table
Reference in a new issue