- atlasDescriptor.mHorizontalStrip = BufferImage::New( blockWidth, SINGLE_PIXEL_PADDING, pixelformat );
- atlasDescriptor.mVerticalStrip = BufferImage::New( SINGLE_PIXEL_PADDING, blockHeight - DOUBLE_PIXEL_PADDING, pixelformat );
-
- PixelBuffer* buffer = atlasDescriptor.mHorizontalStrip.GetBuffer();
- if( buffer == NULL )
- {
- DALI_LOG_ERROR("atlasDescriptor.mHorizontalStrip.GetBuffer() returns NULL\n");
- return 0;
- }
- memset( buffer, 0, atlasDescriptor.mHorizontalStrip.GetBufferSize() );
-
- buffer = atlasDescriptor.mVerticalStrip.GetBuffer();
- if( buffer == NULL )
- {
- DALI_LOG_ERROR("atlasDescriptor.mVerticalStrip.GetBuffer() returns NULL\n");
- return 0;
- }
- memset( buffer, 0, atlasDescriptor.mVerticalStrip.GetBufferSize() );
-
- BufferImage filledPixelImage = BufferImage::New( 1u, 1u, pixelformat );
- buffer = filledPixelImage.GetBuffer();
- if( buffer == NULL)
- {
- DALI_LOG_ERROR("filledPixelImage.GetBuffer() returns NULL\n");
- return 0;
- }
-
- memset( buffer, 0xFF, filledPixelImage.GetBufferSize() );
- atlas.Upload( filledPixelImage, 0, 0 );
+ bufferSize = blockWidth * SINGLE_PIXEL_PADDING * Dali::Pixel::GetBytesPerPixel(pixelformat);
+ unsigned char* bufferHorizontalStrip = new unsigned char[bufferSize];
+ memset( bufferHorizontalStrip, 0, bufferSize );
+ atlasDescriptor.mHorizontalStrip = PixelData::New( bufferHorizontalStrip, bufferSize, blockWidth, SINGLE_PIXEL_PADDING, pixelformat, PixelData::DELETE_ARRAY );
+
+ bufferSize = SINGLE_PIXEL_PADDING * (blockHeight - DOUBLE_PIXEL_PADDING) * Dali::Pixel::GetBytesPerPixel(pixelformat);
+ unsigned char* bufferVerticalStrip = new unsigned char[bufferSize];
+ memset( bufferVerticalStrip, 0, bufferSize );
+ atlasDescriptor.mVerticalStrip = PixelData::New( bufferVerticalStrip, bufferSize, SINGLE_PIXEL_PADDING, blockHeight - DOUBLE_PIXEL_PADDING, pixelformat, PixelData::DELETE_ARRAY );
+
+ bufferSize = Dali::Pixel::GetBytesPerPixel(pixelformat);
+ unsigned char* buffer = new unsigned char[bufferSize];
+ memset( buffer, 0xFF, bufferSize );
+ PixelData filledPixelImage = PixelData::New( buffer, bufferSize, 1u, 1u, pixelformat, PixelData::DELETE_ARRAY );
+ atlas.Upload( filledPixelImage, 0u, 0u, 0u, 0u, 1u, 1u );