X-Git-Url: http://review.tizen.org/git/?p=platform%2Fcore%2Fuifw%2Fdali-toolkit.git;a=blobdiff_plain;f=dali-toolkit%2Finternal%2Fimage-atlas%2Fimage-atlas-impl.cpp;h=33475c102effdd2b646882632d74659a0416f5bc;hp=ab70af43e915396b5a969d8042f03c1e51abc330;hb=23ceb4d9eef323cddf0c0f6d13f3a02226926911;hpb=479693b4fd773eb8888ae401d02b49188293e231 diff --git a/dali-toolkit/internal/image-atlas/image-atlas-impl.cpp b/dali-toolkit/internal/image-atlas/image-atlas-impl.cpp index ab70af4..33475c1 100644 --- a/dali-toolkit/internal/image-atlas/image-atlas-impl.cpp +++ b/dali-toolkit/internal/image-atlas/image-atlas-impl.cpp @@ -138,19 +138,19 @@ bool ImageAtlas::Upload( Vector4& textureRect, return false; } -bool ImageAtlas::Upload( Vector4& textureRect, PixelDataPtr pixelData ) +bool ImageAtlas::Upload( Vector4& textureRect, PixelData pixelData ) { unsigned int packPositionX = 0; unsigned int packPositionY = 0; - if( mPacker.Pack( pixelData->GetWidth(), pixelData->GetHeight(), packPositionX, packPositionY ) ) + if( mPacker.Pack( pixelData.GetWidth(), pixelData.GetHeight(), packPositionX, packPositionY ) ) { mAtlas.Upload( pixelData, packPositionX, packPositionY ); // apply the half pixel correction textureRect.x = ( static_cast( packPositionX ) +0.5f ) / mWidth; // left textureRect.y = ( static_cast( packPositionY ) +0.5f ) / mHeight; // right - textureRect.z = ( static_cast( packPositionX + pixelData->GetWidth() )-0.5f ) / mWidth; // right - textureRect.w = ( static_cast( packPositionY + pixelData->GetHeight() )-0.5f ) / mHeight;// bottom + textureRect.z = ( static_cast( packPositionX + pixelData.GetWidth() )-0.5f ) / mWidth; // right + textureRect.w = ( static_cast( packPositionY + pixelData.GetHeight() )-0.5f ) / mHeight;// bottom return true; } @@ -181,11 +181,11 @@ void ImageAtlas::UploadToAtlas() } else { - if( next->loader.GetPixelData()->GetWidth() < next->packRect.width || next->loader.GetPixelData()->GetHeight() < next->packRect.height ) + if( next->loader.GetPixelData().GetWidth() < next->packRect.width || next->loader.GetPixelData().GetHeight() < next->packRect.height ) { DALI_LOG_ERROR( "Can not upscale the image from actual loaded size [ %d, %d ] to specified size [ %d, %d ]\n", - next->loader.GetPixelData()->GetWidth(), - next->loader.GetPixelData()->GetHeight(), + next->loader.GetPixelData().GetWidth(), + next->loader.GetPixelData().GetHeight(), next->packRect.width, next->packRect.height ); } @@ -201,8 +201,8 @@ void ImageAtlas::UploadBrokenImage( const Rect& area ) { BitmapLoader loader = BitmapLoader::New(mBrokenImageUrl, ImageDimensions( area.width, area.height ) ); loader.Load(); - SizeType loadedWidth = loader.GetPixelData()->GetWidth(); - SizeType loadedHeight = loader.GetPixelData()->GetHeight(); + SizeType loadedWidth = loader.GetPixelData().GetWidth(); + SizeType loadedHeight = loader.GetPixelData().GetHeight(); bool needBackgroundClear = false; SizeType packX = area.x; @@ -223,7 +223,7 @@ void ImageAtlas::UploadBrokenImage( const Rect& area ) { SizeType size = area.width * area.height * Pixel::GetBytesPerPixel( mPixelFormat ); PixelBuffer* buffer = new PixelBuffer [size]; - PixelDataPtr background = PixelData::New( buffer, area.width, area.height, mPixelFormat, PixelData::DELETE_ARRAY ); + PixelData background = PixelData::New( buffer, area.width, area.height, mPixelFormat, PixelData::DELETE_ARRAY ); for( SizeType idx = 0; idx < size; idx++ ) { buffer[idx] = 0x00;