[Tizen] Add IsUploaded devel api in Texture
[platform/core/uifw/dali-core.git] / dali / internal / render / renderers / render-texture.h
old mode 100755 (executable)
new mode 100644 (file)
index 771fca0..35421eb
@@ -2,7 +2,7 @@
 #define DALI_INTERNAL_RENDER_TEXTURE_H
 
 /*
- * Copyright (c) 2017 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.
@@ -19,6 +19,7 @@
 
 // EXTERNAL INCLUDES
 #include <string>
+#include <cstdint> // uint16_t, uint32_t
 
 // INTERNAL INCLUDES
 #include <dali/public-api/images/image-operations.h> // Dali::ImageDimensions
@@ -40,8 +41,7 @@ struct Sampler;
 class Texture
 {
 public:
-
-  typedef Dali::TextureType::Type Type;
+  using Type = Dali::TextureType::Type;
 
   /**
    * Constructor
@@ -95,7 +95,7 @@ public:
    * @param[in] sampler The sampler to be used with the texture
    * @return true if the bind succeeded, false otherwise
    */
-  bool Bind( Context& context, unsigned int textureUnit, Render::Sampler* sampler );
+  bool Bind( Context& context, uint32_t textureUnit, Render::Sampler* sampler );
 
   /**
    * Auto generates mipmaps for the texture
@@ -107,18 +107,27 @@ public:
    * Retrieve wheter the texture has an alpha channel
    * @return True if the texture has alpha channel, false otherwise
    */
-  bool HasAlphaChannel();
+  bool HasAlphaChannel() const;
 
   /**
    * Get the id of the texture
    * @return Id of the texture
    */
-  GLuint GetId()
+  GLuint GetId() const
   {
     return mId;
   }
 
   /**
+   * Get the target to which the texture is bound
+   * @return target to which the texture is bound
+   */
+  GLuint GetTarget() const
+  {
+    return mTarget;
+  }
+
+  /**
    * Get the type of the texture
    * @return Type of the texture
    */
@@ -136,6 +145,11 @@ public:
     return mNativeImage;
   }
 
+  bool IsUploaded() const
+  {
+    return mIsUploaded;
+  }
+
 private:
 
   /**
@@ -158,6 +172,7 @@ private:
   Type mType:3;                         ///< Type of the texture
   bool mHasAlpha : 1;                   ///< Whether the format has an alpha channel
   bool mIsCompressed : 1;               ///< Whether the format is compressed
+  bool mIsUploaded : 1;
 
 };