use modern construct 'nullptr' instead of 'NULL' or '0'
[platform/core/uifw/dali-core.git] / dali / internal / event / rendering / texture-set-impl.cpp
index 07001a4..373daaf 100644 (file)
@@ -1,5 +1,5 @@
 /*
- * Copyright (c) 2019 Samsung Electronics Co., Ltd.
+ * Copyright (c) 2020 Samsung Electronics Co., Ltd.
  *
  * Licensed under the Apache License, Version 2.0 (the "License");
  * you may not use this file except in compliance with the License.
@@ -51,18 +51,18 @@ void TextureSet::SetTexture( uint32_t index, TexturePtr texture )
 
     for( uint32_t i(textureCount); i<=index; ++i )
     {
-      mTextures[i] = NULL;
+      mTextures[i] = nullptr;
 
       if( !samplerExist )
       {
-        mSamplers[i] = NULL;
+        mSamplers[i] = nullptr;
       }
     }
   }
 
   mTextures[index]= texture;
 
-  Render::Texture* renderTexture(0);
+  Render::Texture* renderTexture(nullptr);
   if( texture )
   {
     renderTexture = texture->GetRenderObject();
@@ -73,7 +73,7 @@ void TextureSet::SetTexture( uint32_t index, TexturePtr texture )
 
 Texture* TextureSet::GetTexture( uint32_t index ) const
 {
-  Texture* result(0);
+  Texture* result(nullptr);
   if( index < mTextures.size() )
   {
     result = mTextures[index].Get();
@@ -86,39 +86,6 @@ Texture* TextureSet::GetTexture( uint32_t index ) const
   return result;
 }
 
-void TextureSet::SetImage( uint32_t index, ImagePtr image )
-{
-  Texture* texture( NULL );
-  if( image )
-  {
-    uint32_t textureCount = static_cast<uint32_t>( mImages.size() );
-    if( index >= textureCount )
-    {
-      mImages.resize(index + 1);
-    }
-    mImages[index] = image;
-
-    texture = image->GetTexture();
-  }
-
-  SetTexture( index, texture );
-}
-
-Image* TextureSet::GetImage( uint32_t index ) const
-{
-  Image* result( NULL );
-  if( index < mImages.size() )
-  {
-    result = mImages[index].Get();
-  }
-  else
-  {
-    DALI_LOG_ERROR( "Error: Invalid index to TextureSet::GetImage\n");
-  }
-
-  return result;
-}
-
 void TextureSet::SetSampler( uint32_t index, SamplerPtr sampler )
 {
   uint32_t samplerCount = static_cast<uint32_t>( mSamplers.size() );
@@ -127,13 +94,13 @@ void TextureSet::SetSampler( uint32_t index, SamplerPtr sampler )
     mSamplers.resize( index + 1 );
     for( uint32_t i = samplerCount; i<=index; ++i )
     {
-      mSamplers[i] = NULL;
+      mSamplers[i] = nullptr;
     }
   }
 
   mSamplers[index] = sampler;
 
-  Render::Sampler* renderSampler(0);
+  Render::Sampler* renderSampler(nullptr);
   if( sampler )
   {
     renderSampler = sampler->GetSamplerRenderObject();
@@ -144,7 +111,7 @@ void TextureSet::SetSampler( uint32_t index, SamplerPtr sampler )
 
 Sampler* TextureSet::GetSampler( uint32_t index ) const
 {
-  Sampler* result(0);
+  Sampler* result(nullptr);
   if( index < mSamplers.size() )
   {
     result = mSamplers[index].Get();
@@ -169,7 +136,7 @@ const SceneGraph::TextureSet* TextureSet::GetTextureSetSceneObject() const
 
 TextureSet::TextureSet()
 :mEventThreadServices( EventThreadServices::Get() ),
- mSceneObject( NULL )
+ mSceneObject( nullptr )
 {
 }