use modern construct 'nullptr' instead of 'NULL' or '0'
[platform/core/uifw/dali-core.git] / dali / internal / render / renderers / render-texture.cpp
index 5151dc1..73b73e2 100644 (file)
@@ -21,7 +21,7 @@
 #include <math.h>   //floor, log2
 
 // INTERNAL INCLUDES
-#include <dali/devel-api/images/native-image-interface-extension.h>
+
 
 namespace Dali
 {
@@ -708,7 +708,7 @@ void Texture::Destroy( Context& context )
 
     if( mNativeImage )
     {
-      mNativeImage->GlExtensionDestroy();
+      mNativeImage->DestroyResource();
     }
   }
 }
@@ -722,13 +722,9 @@ void Texture::Initialize(Context& context)
 {
   if( mNativeImage )
   {
-    if( mNativeImage->GlExtensionCreate() )
+    if( mNativeImage->CreateResource() )
     {
-      NativeImageInterface::Extension* extension = mNativeImage->GetExtension();
-      if( extension )
-      {
-        mTarget = extension->GetEglImageTextureTarget();
-      }
+      mTarget = mNativeImage->GetTextureTarget();
 
       context.GenTextures( 1, &mId );
       context.BindTexture( mTarget, mId );
@@ -744,7 +740,7 @@ void Texture::Initialize(Context& context)
       if( mNativeImage->TargetTexture() != 0u )
       {
         context.DeleteTextures( 1, &mId );
-        mNativeImage->GlExtensionDestroy();
+        mNativeImage->DestroyResource();
         mId = 0u;
       }
     }
@@ -766,11 +762,11 @@ void Texture::Initialize(Context& context)
     {
       if( !mIsCompressed )
       {
-        context.TexImage2D(GL_TEXTURE_2D, 0, mGlInternalFormat, mWidth, mHeight, 0, mGlFormat, mPixelDataType, 0 );
+        context.TexImage2D(GL_TEXTURE_2D, 0, mGlInternalFormat, mWidth, mHeight, 0, mGlFormat, mPixelDataType, nullptr );
       }
       else
       {
-        context.CompressedTexImage2D(GL_TEXTURE_2D, 0, mGlInternalFormat, mWidth, mHeight, 0, 0, 0 );
+        context.CompressedTexImage2D(GL_TEXTURE_2D, 0, mGlInternalFormat, mWidth, mHeight, 0, 0, nullptr );
       }
     }
     else if( mType == TextureType::TEXTURE_CUBE )
@@ -779,14 +775,14 @@ void Texture::Initialize(Context& context)
       {
         for( uint32_t i(0); i<6; ++i )
         {
-          context.TexImage2D(GL_TEXTURE_CUBE_MAP_POSITIVE_X + i, 0, mGlInternalFormat, mWidth, mHeight, 0, mGlFormat, mPixelDataType, 0 );
+          context.TexImage2D(GL_TEXTURE_CUBE_MAP_POSITIVE_X + i, 0, mGlInternalFormat, mWidth, mHeight, 0, mGlFormat, mPixelDataType, nullptr );
         }
       }
       else
       {
         for( uint32_t i(0); i<6; ++i )
         {
-          context.CompressedTexImage2D(GL_TEXTURE_CUBE_MAP_POSITIVE_X + i, 0, mGlInternalFormat, mWidth, mHeight, 0, 0, 0 );
+          context.CompressedTexImage2D(GL_TEXTURE_CUBE_MAP_POSITIVE_X + i, 0, mGlInternalFormat, mWidth, mHeight, 0, 0, nullptr );
         }
       }
       context.TexParameteri( mTarget, GL_TEXTURE_WRAP_R, GL_WRAP_DEFAULT );
@@ -796,7 +792,7 @@ void Texture::Initialize(Context& context)
 
 void Texture::Upload( Context& context, PixelDataPtr pixelData, const Internal::Texture::UploadParams& params  )
 {
-  DALI_ASSERT_ALWAYS( mNativeImage == NULL );
+  DALI_ASSERT_ALWAYS( mNativeImage == nullptr );
 
   //Get pointer to the data of the PixelData object
   uint8_t* buffer( pixelData->GetBuffer() );