[Tizen] To get MaxTextureSize by using glGetIntegerv not by using environment variable
[platform/core/uifw/dali-adaptor.git] / dali / internal / imaging / common / image-loader.cpp
index e8b3b79..5980796 100755 (executable)
@@ -33,7 +33,6 @@
 #include <dali/internal/system/common/file-reader.h>
 
 using namespace Dali::Integration;
-using namespace Dali::Internal::Platform;
 
 namespace Dali
 {
@@ -48,6 +47,8 @@ Integration::Log::Filter* gLogFilter = Debug::Filter::New( Debug::Concise, false
 
 static unsigned int gMaxTextureSize = 4096;
 
+static bool gMaxTextureSizeUpdated = false;
+
 /**
  * Enum for file formats, has to be in sync with BITMAP_LOADER_LOOKUP_TABLE
  */
@@ -148,10 +149,10 @@ bool GetBitmapLoaderFunctions( FILE *fp,
                                const std::string& filename )
 {
   unsigned char magic[MAGIC_LENGTH];
-  size_t read = InternalFile::fread(magic, sizeof(unsigned char), MAGIC_LENGTH, fp);
+  size_t read = fread(magic, sizeof(unsigned char), MAGIC_LENGTH, fp);
 
   // Reset to the start of the file.
-  if( InternalFile::fseek(fp, 0, SEEK_SET) )
+  if( fseek(fp, 0, SEEK_SET) )
   {
     DALI_LOG_ERROR("Error seeking to start of file\n");
   }
@@ -236,7 +237,7 @@ bool GetBitmapLoaderFunctions( FILE *fp,
   }
 
   // Reset to the start of the file.
-  if( InternalFile::fseek(fp, 0, SEEK_SET) )
+  if( fseek(fp, 0, SEEK_SET) )
   {
     DALI_LOG_ERROR("Error seeking to start of file\n");
   }
@@ -419,6 +420,7 @@ ImageDimensions GetClosestImageSize( Integration::ResourcePointer resourceBuffer
 void SetMaxTextureSize( unsigned int size )
 {
   gMaxTextureSize = size;
+  gMaxTextureSizeUpdated = true;
 }
 
 unsigned int GetMaxTextureSize()
@@ -426,6 +428,11 @@ unsigned int GetMaxTextureSize()
   return gMaxTextureSize;
 }
 
+bool MaxTextureSizeUpdated()
+{
+  return gMaxTextureSizeUpdated;
+}
+
 } // ImageLoader
 } // TizenPlatform
 } // Dali