2 // Open Service Platform
3 // Copyright (c) 2012-2013 Samsung Electronics Co., Ltd.
5 // Licensed under the Flora License, Version 1.0 (the License);
6 // you may not use this file except in compliance with the License.
7 // You may obtain a copy of the License at
9 // http://floralicense.org/license/
11 // Unless required by applicable law or agreed to in writing, software
12 // distributed under the License is distributed on an AS IS BASIS,
13 // WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
14 // See the License for the specific language governing permissions and
15 // limitations under the License.
19 * @file FUiEffects_RendererEngineModelBuffer.h
20 * @brief Shaders attributes data buffers
24 #ifndef _FUI_EFFECTS_INTERNAL_RENDERER_ENGINE_MODEL_BUFFER_H_
25 #define _FUI_EFFECTS_INTERNAL_RENDERER_ENGINE_MODEL_BUFFER_H_
27 #include <renderer/engine-model/FUiEffects_RendererEngineModelForwardDeclaration.h>
28 #include <renderer/engine-model/FUiEffects_RendererEngineModelCache.h>
29 #include <renderer/engine-model/FUiEffects_RendererEngineModelBufferVisitor.h>
33 namespace Tizen { namespace Ui { namespace Effects { namespace _Renderer { namespace EngineModel
39 virtual ~Buffer(void);
41 virtual void Visit(BufferVisitor& v)
48 typedef Tizen::Ui::Effects::_Renderer::System::SmartPtr<Buffer> BufferPtr;
50 class SolidBufferStrategy
68 typedef BufferUsageEnum Value;
71 SolidBufferStrategy(void) {}
72 virtual ~SolidBufferStrategy(void)
80 virtual void* GetData(void) = 0;
81 virtual size_t GetSize(void) const = 0;
82 virtual BufferUsage::Value GetUsage(void) const = 0;
83 virtual CachePtr GetCache(void)
87 virtual void SetCache(CachePtr aCache)
100 class TypedBufferStrategy
117 typedef DataTypeEnum Value;
120 TypedBufferStrategy(void) {}
121 virtual ~TypedBufferStrategy(void) {}
123 virtual DataType::Value GetDataType(void) const = 0;
126 class VertexBuffer: public Buffer, public SolidBufferStrategy, public TypedBufferStrategy
129 VertexBuffer(void) {}
130 virtual ~VertexBuffer(void) {}
132 virtual void Visit(BufferVisitor& v) { v.OnVertexBuffer(*this); }
133 virtual size_t GetComponentsPerElement(void) const = 0;
136 typedef Tizen::Ui::Effects::_Renderer::System::SmartPtr<VertexBuffer> VertexBufferPtr;
140 public SolidBufferStrategy,
141 public TypedBufferStrategy
147 enum PrimitiveTypeEnum
160 typedef PrimitiveTypeEnum Value;
164 virtual ~IndexBuffer(void) {}
166 virtual void Visit(BufferVisitor& v) { v.OnIndexBuffer(*this); }
167 virtual PrimitiveType::Value GetPrimitiveType() const = 0;
170 typedef Tizen::Ui::Effects::_Renderer::System::SmartPtr<IndexBuffer> IndexBufferPtr;
172 class CompositeVertexBuffer:
174 public SolidBufferStrategy,
175 public TypedBufferStrategy
178 CompositeVertexBuffer(void) {}
179 virtual ~CompositeVertexBuffer(void) {}
181 virtual void Visit(BufferVisitor& v)
183 v.OnCompositeVertexBuffer(*this);
188 typedef Tizen::Ui::Effects::_Renderer::System::SmartPtr<CompositeVertexBuffer> CompositeVertexBufferPtr;
190 class PartVertexBuffer:
192 public TypedBufferStrategy
195 PartVertexBuffer(void) {}
196 virtual ~PartVertexBuffer(void)
204 virtual void Visit(BufferVisitor& v)
206 v.OnPartVertexBuffer(*this);
210 virtual CachePtr GetCache(void) {return _pCache;}
212 virtual void SetCache(CachePtr pCache)
222 virtual size_t GetStride(void) const = 0;
223 virtual size_t GetOffset(void) const = 0;
224 virtual CompositeVertexBufferPtr GetCompositeBuffer(void) const = 0;
225 virtual size_t GetComponentsPerElement(void) const = 0;
231 typedef Tizen::Ui::Effects::_Renderer::System::SmartPtr<PartVertexBuffer> PartVertexBufferPtr;
233 }}}}} //Tizen::Ui::Effects::_Renderer::EngineModel
235 #endif //_FUI_EFFECTS_INTERNAL_RENDERER_ENGINE_MODEL_BUFFER_H_