+/*
+ * Copyright (c) 2017 Samsung Electronics Co., Ltd.
+ *
+ * Licensed under the Apache License, Version 2.0 (the "License");
+ * you may not use this file except in compliance with the License.
+ * You may obtain a copy of the License at
+ *
+ * http://www.apache.org/licenses/LICENSE-2.0
+ *
+ * Unless required by applicable law or agreed to in writing, software
+ * distributed under the License is distributed on an "AS IS" BASIS,
+ * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
+ * See the License for the specific language governing permissions and
+ * limitations under the License.
+ *
+ */
#include <dali/internal/render/renderers/render-property-buffer.h>
#include <dali/internal/event/common/property-buffer-impl.h> // Dali::Internal::PropertyBuffer
case Property::STRING:
case Property::ARRAY:
case Property::MAP:
+ case Property::EXTENTS:
case Property::RECTANGLE:
case Property::ROTATION:
{
case Property::STRING:
case Property::ARRAY:
case Property::MAP:
+ case Property::EXTENTS:
case Property::RECTANGLE:
case Property::ROTATION:
{
mDataChanged = true;
}
-void PropertyBuffer::SetData( Dali::Vector<char>* data )
+void PropertyBuffer::SetData( Dali::Vector<char>* data, size_t size )
{
mData = data;
- mDataChanged = true;
-}
-
-void PropertyBuffer::SetSize( unsigned int size )
-{
mSize = size;
mDataChanged = true;
}
-
-bool PropertyBuffer::Update( Context& context, bool isIndexBuffer )
+bool PropertyBuffer::Update( Context& context )
{
if( !mData || !mFormat || !mSize )
{
if ( mGpuBuffer )
{
DALI_ASSERT_DEBUG( mSize && "No data in the property buffer!" );
-
- const void *data = &((*mData)[0]);
- std::size_t dataSize = GetDataSize();
-
- // Index buffer needs to be unsigned short which is not supported by the property system
- Vector<unsigned short> ushortData;
- if( isIndexBuffer )
- {
- ushortData.Resize(mSize);
- const unsigned int* unsignedData = static_cast<const unsigned int*>(data);
- for( unsigned int i = 0; i < mSize; ++i )
- {
- ushortData[i] = unsignedData[i];
- }
- data = &(ushortData[0]);
- dataSize = ushortData.Size() * sizeof( unsigned short );
- }
-
- GpuBuffer::Target target = GpuBuffer::ARRAY_BUFFER;
- if(isIndexBuffer)
- {
- target = GpuBuffer::ELEMENT_ARRAY_BUFFER;
- }
- mGpuBuffer->UpdateDataBuffer( dataSize, data, GpuBuffer::STATIC_DRAW, target );
-
+ mGpuBuffer->UpdateDataBuffer( GetDataSize(), &((*mData)[0]), GpuBuffer::STATIC_DRAW, GpuBuffer::ARRAY_BUFFER );
}
mDataChanged = false;
GetPropertyImplementationGlType(attributeType),
GL_FALSE, // Not normalized
elementSize,
- (void*)attributeOffset );
+ reinterpret_cast< void* >( attributeOffset ) );
}
}