Merge changes I84e1ce43,I76b93d51 into devel/master
[platform/core/uifw/dali-core.git] / dali / internal / render / renderers / render-property-buffer.h
index ed1e0b2..b568259 100644 (file)
@@ -156,14 +156,39 @@ public:
     return mSize;
   }
 
+  /**
+   * Retrieve reference to the data storage vector
+   * @return Reference to the data storage
+   */
+  inline const Dali::Vector< char >& GetData() const
+  {
+    return *mData.Get();
+  }
+
+  /**
+   * Retrieve data writeable pointer ( direct access to the buffer data )
+   * @return Pointer to data converted to requested type
+   */
+  template <typename T>
+  inline T* GetDataTypedPtr()
+  {
+    Dali::Vector< char >* data = mData.Release();
+    mData = data;
+    return reinterpret_cast<T*>( &data->operator[]( 0 ) );
+  }
+
+  inline const PropertyBuffer::Format* GetFormat() const
+  {
+    return mFormat.Get();
+  }
+
 private:
-  OwnerPointer< PropertyBuffer::Format >  mFormat;  ///< Format of the buffer
-  OwnerPointer< Dali::Vector< char > >    mData;    ///< Data
-  OwnerPointer< GpuBuffer > mGpuBuffer;               ///< Pointer to the GpuBuffer associated with this RenderPropertyBuffer
+  OwnerPointer< PropertyBuffer::Format >  mFormat;    ///< Format of the buffer
+  OwnerPointer< Dali::Vector< char > >    mData;      ///< Data
+  OwnerPointer< GpuBuffer >               mGpuBuffer; ///< Pointer to the GpuBuffer associated with this RenderPropertyBuffer
 
   size_t mSize;       ///< Number of Elements in the buffer
   bool mDataChanged;  ///< Flag to know if data has changed in a frame
-
 };
 
 } // namespace Render