X-Git-Url: http://review.tizen.org/git/?p=platform%2Fcore%2Fuifw%2Fdali-adaptor.git;a=blobdiff_plain;f=dali%2Finternal%2Fimaging%2Fcommon%2Floader-ktx.cpp;h=0e0881bed0af60b185fd761330704bdf922bd580;hp=abaad260acf8ba5628d80220118e462895a4d0e9;hb=c1bb1606717a5a831a0e7bdaca8b4eb86dc5a89e;hpb=761f75cd51351b7a4e072130f4a2ad0b3e3231bb diff --git a/dali/internal/imaging/common/loader-ktx.cpp b/dali/internal/imaging/common/loader-ktx.cpp old mode 100644 new mode 100755 index abaad26..0e0881b --- a/dali/internal/imaging/common/loader-ktx.cpp +++ b/dali/internal/imaging/common/loader-ktx.cpp @@ -25,6 +25,10 @@ #include #include +#include + +using namespace Dali::Internal::Platform; + namespace Dali { @@ -194,7 +198,7 @@ inline bool ReadHeader( FILE* filePointer, KtxFileHeader& header ) const unsigned int readLength = sizeof( KtxFileHeader ); // Load the information directly into our structure - if( fread( &header, 1, readLength, filePointer ) != readLength ) + if( InternalFile::fread( &header, 1, readLength, filePointer ) != readLength ) { return false; } @@ -523,7 +527,7 @@ bool LoadKtxHeader( FILE * const fp, unsigned int& width, unsigned int& height, } // unnamed namespace // File loading API entry-point: -bool LoadKtxHeader( const ImageLoader::Input& input, unsigned int& width, unsigned int& height ) +bool LoadKtxHeader( const Dali::ImageLoader::Input& input, unsigned int& width, unsigned int& height ) { KtxFileHeader fileHeader; FILE* const fp = input.file; @@ -533,7 +537,7 @@ bool LoadKtxHeader( const ImageLoader::Input& input, unsigned int& width, unsign } // File loading API entry-point: -bool LoadBitmapFromKtx( const ImageLoader::Input& input, Dali::Devel::PixelBuffer& bitmap ) +bool LoadBitmapFromKtx( const Dali::ImageLoader::Input& input, Dali::Devel::PixelBuffer& bitmap ) { DALI_COMPILE_TIME_ASSERT( sizeof(Byte) == 1); DALI_COMPILE_TIME_ASSERT( sizeof(uint32_t) == 4); @@ -556,7 +560,7 @@ bool LoadBitmapFromKtx( const ImageLoader::Input& input, Dali::Devel::PixelBuffe // Skip the key-values: const long int imageSizeOffset = sizeof(KtxFileHeader) + fileHeader.bytesOfKeyValueData; - if(fseek(fp, imageSizeOffset, SEEK_SET)) + if(InternalFile::fseek(fp, imageSizeOffset, SEEK_SET)) { DALI_LOG_ERROR( "Seek past key/vals in KTX compressed bitmap file failed.\n" ); return false; @@ -564,7 +568,7 @@ bool LoadBitmapFromKtx( const ImageLoader::Input& input, Dali::Devel::PixelBuffe // Load the size of the image data: uint32_t imageByteCount = 0; - if ( fread( &imageByteCount, 1, 4, fp ) != 4 ) + if ( InternalFile::fread( &imageByteCount, 1, 4, fp ) != 4 ) { DALI_LOG_ERROR( "Read of image size failed.\n" ); return false; @@ -605,7 +609,7 @@ bool LoadBitmapFromKtx( const ImageLoader::Input& input, Dali::Devel::PixelBuffe return false; } - const size_t bytesRead = fread(pixels, 1, imageByteCount, fp); + const size_t bytesRead = InternalFile::fread(pixels, 1, imageByteCount, fp); if(bytesRead != imageByteCount) { DALI_LOG_ERROR( "Read of image pixel data failed.\n" );