From: Ferran Sole Date: Tue, 28 Jun 2016 15:56:40 +0000 (+0100) Subject: Changes following "Added support for compressed texture upload to Render::NewTexture" X-Git-Tag: dali_1.1.41~2 X-Git-Url: http://review.tizen.org/git/?p=platform%2Fcore%2Fuifw%2Fdali-demo.git;a=commitdiff_plain;h=e430fe112a6b54d9b5b9c24d838aef6b2a268b4b Changes following "Added support for compressed texture upload to Render::NewTexture" Change-Id: I3d25317e94d22389e94b4afd91bebedaca23b5b9 --- diff --git a/examples/atlas/atlas-example.cpp b/examples/atlas/atlas-example.cpp index 1d0f089..503d577 100644 --- a/examples/atlas/atlas-example.cpp +++ b/examples/atlas/atlas-example.cpp @@ -203,15 +203,15 @@ private: PixelData CreatePixelData( const Vector3& color, const unsigned int width, const unsigned int height ) { unsigned int size = width*height; - unsigned char* pixels = new unsigned char [size*3u]; + unsigned int bufferSize = size * Pixel::GetBytesPerPixel(Pixel::RGB888); + unsigned char* pixels = new unsigned char [bufferSize]; for( unsigned int i = 0; i < size; i++ ) { pixels[i*3u] = 0xFF * color.x; pixels[i*3u+1u] = 0xFF * color.y; pixels[i*3u+2u] = 0xFF * color.z; } - - return PixelData::New( pixels, width, height, Pixel::RGB888, PixelData::DELETE_ARRAY ); + return PixelData::New( pixels, bufferSize, width, height, Pixel::RGB888, PixelData::DELETE_ARRAY ); }