Making DALi public API typesafe using guaranteed types; uint8_t, uint32_t
[platform/core/uifw/dali-core.git] / dali / public-api / rendering / texture.cpp
index 1f6325c..f23a3f2 100644 (file)
@@ -1,5 +1,5 @@
 /*
- * Copyright (c) 2016 Samsung Electronics Co., Ltd.
+ * Copyright (c) 2018 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.
 namespace Dali
 {
 
-Texture Texture::New( TextureType::Type type, Pixel::Format format, unsigned int width, unsigned int height )
+Texture Texture::New( TextureType::Type type, Pixel::Format format, uint32_t width, uint32_t height )
 {
-  Internal::NewTexturePtr texture = Internal::NewTexture::New(type, format, width, height );
+  Internal::TexturePtr texture = Internal::Texture::New(type, format, width, height );
   return Texture( texture.Get() );
 }
 
 Texture Texture::New( NativeImageInterface& nativeImageInterface )
 {
-  Internal::NewTexturePtr texture = Internal::NewTexture::New( nativeImageInterface );
+  Internal::TexturePtr texture = Internal::Texture::New( nativeImageInterface );
   return Texture( texture.Get() );
 }
 
@@ -53,7 +53,7 @@ Texture::Texture( const Texture& handle )
 
 Texture Texture::DownCast( BaseHandle handle )
 {
-  return Texture( dynamic_cast<Dali::Internal::NewTexture*>(handle.GetObjectPtr()));
+  return Texture( dynamic_cast<Dali::Internal::Texture*>(handle.GetObjectPtr()));
 }
 
 Texture& Texture::operator=( const Texture& handle )
@@ -69,9 +69,9 @@ bool Texture::Upload( PixelData pixelData )
 }
 
 bool Texture::Upload( PixelData pixelData,
-               unsigned int layer, unsigned int mipmap,
-               unsigned int xOffset, unsigned int yOffset,
-               unsigned int width, unsigned int height )
+               uint32_t layer, uint32_t mipmap,
+               uint32_t xOffset, uint32_t yOffset,
+               uint32_t width, uint32_t height )
 {
   Internal::PixelData& internalPixelData = GetImplementation( pixelData );
   return GetImplementation(*this).Upload( &internalPixelData, layer, mipmap, xOffset, yOffset, width, height );
@@ -82,17 +82,17 @@ void Texture::GenerateMipmaps()
   return GetImplementation(*this).GenerateMipmaps();
 }
 
-unsigned int Texture::GetWidth() const
+uint32_t Texture::GetWidth() const
 {
   return GetImplementation(*this).GetWidth();
 }
 
-unsigned int Texture::GetHeight() const
+uint32_t Texture::GetHeight() const
 {
   return GetImplementation(*this).GetHeight();
 }
 
-Texture::Texture( Internal::NewTexture* pointer )
+Texture::Texture( Internal::Texture* pointer )
 : BaseHandle( pointer )
 {
 }