Bug fixes. 47/38947/1
authorFrancisco Santos <f1.santos@samsung.com>
Fri, 1 May 2015 10:53:26 +0000 (11:53 +0100)
committerFrancisco Santos <f1.santos@samsung.com>
Fri, 1 May 2015 10:53:26 +0000 (11:53 +0100)
Change-Id: Idf22935143d681904417ed0e39cbce0ed8b0b6b9

dali/internal/render/renderers/render-renderer-property-buffer.cpp
dali/internal/render/renderers/render-renderer-property-buffer.h
dali/internal/update/node-attachments/scene-graph-renderer-attachment.cpp

index 9205a6d..886ba64 100644 (file)
@@ -44,11 +44,9 @@ RenderPropertyBuffer::~RenderPropertyBuffer()
 
 void RenderPropertyBuffer::Upload( Context& context, BufferIndex bufferIndex )
 {
-  bool hasGpuBuffer = NULL != mGpuBuffer;
-
   // Check if we have a gpu-buffer
   unsigned int gpuBufferId = 0; // TODO: MESH_REWORK FIX THIS  mDataProvider.GetGpuBufferId( bufferIndex );
-  if ( ! hasGpuBuffer )
+  if ( ! mGpuBuffer )
   {
     // TODO: MESH_REWORK
 //    mGpuBuffer /*= gpuBufferCache.GetGpuBuffer( gpuBufferId ) */;
@@ -58,9 +56,10 @@ void RenderPropertyBuffer::Upload( Context& context, BufferIndex bufferIndex )
   }
 
   // Update the GpuBuffer
-  if ( ! hasGpuBuffer || mDataProvider.HasDataChanged( bufferIndex ) )
+  if ( mGpuBuffer || mDataProvider.HasDataChanged( bufferIndex ) )
   {
     std::size_t dataSize = mDataProvider.GetDataSize( bufferIndex );
+    DALI_ASSERT_DEBUG( dataSize && "No data in the property buffer!" );
 
     const void *data = &(mDataProvider.GetData( bufferIndex )[0]);
     Vector<unsigned short> ushortData;
@@ -70,7 +69,8 @@ void RenderPropertyBuffer::Upload( Context& context, BufferIndex bufferIndex )
     {
       ushortData.Resize( dataSize );
       const unsigned int* unsignedData = static_cast<const unsigned int*>(data);
-      for( unsigned int i = 0; i < dataSize; ++i )
+      unsigned int numberOfElements = dataSize / sizeof(unsigned int);
+      for( unsigned int i = 0; i < numberOfElements; ++i )
       {
         ushortData[i] = unsignedData[i];
       }
index aea8122..0d703a9 100644 (file)
@@ -105,7 +105,7 @@ private:
   const PropertyBufferDataProvider& mDataProvider;  ///< Data provider used by this property buffer
   Vector<GLint> mAttributesLocation;                ///< Location of the attributes for the property buffer in this renderer.
 
-  GpuBuffer* mGpuBuffer;                            ///< Pointer to the GpuBuffer associated with this RenderPropertyBuffer
+  OwnerPointer<GpuBuffer> mGpuBuffer;               ///< Pointer to the GpuBuffer associated with this RenderPropertyBuffer
   GpuBuffer::Target mGpuBufferTarget;               ///< The type of GPU buffer to create
   GpuBuffer::Usage mGpuBufferUsage;                 ///< The type of usage the  GPU buffer will have
 };
index 2de8fec..1b2dc56 100644 (file)
@@ -254,7 +254,6 @@ bool RendererAttachment::DoPrepareResources(
       {
         case CompleteStatusManager::NOT_READY:
         {
-          ready = false;
           if( metaData.GetIsFramebuffer() )
           {
             frameBufferCount++;