Merge "(Partial Update) Mark as not rendered if the node is transparent or culled...
[platform/core/uifw/dali-core.git] / dali / internal / render / renderers / render-texture.h
index cbf0e2b..ea8cd13 100644 (file)
@@ -30,9 +30,7 @@
 #include <dali/graphics-api/graphics-texture-create-info.h>
 #include <dali/graphics-api/graphics-texture.h>
 #include <dali/graphics-api/graphics-types.h>
-#include <dali/integration-api/gl-defines.h>
 #include <dali/internal/event/rendering/texture-impl.h>
-#include <dali/internal/render/gl-resources/context.h>
 #include <dali/internal/render/renderers/render-sampler.h>
 
 namespace Dali
@@ -60,7 +58,7 @@ public:
    * Constructor from native image
    * @param[in] nativeImageInterface The native image
    */
-  Texture(NativeImageInterfacePtr nativeImageInterface);
+  explicit Texture(NativeImageInterfacePtr nativeImageInterface);
 
   /**
    * Destructor
@@ -100,12 +98,6 @@ public:
   void Upload(PixelDataPtr pixelData, const Internal::Texture::UploadParams& params);
 
   /**
-   * Called when the texture is about to be used for drawing.
-   * Allows native textures to be set up appropriately.
-   */
-  void Prepare();
-
-  /**
    * Auto generates mipmaps for the texture
    */
   void GenerateMipmaps();
@@ -114,18 +106,18 @@ public:
    * Retrieve whether the texture has an alpha channel
    * @return True if the texture has alpha channel, false otherwise
    */
-  bool HasAlphaChannel() const;
+  [[nodiscard]] bool HasAlphaChannel() const;
 
   /**
    * Get the graphics object associated with this texture
    */
-  Graphics::Texture* GetGraphicsObject() const;
+  [[nodiscard]] Graphics::Texture* GetGraphicsObject() const;
 
   /**
    * Get the type of the texture
    * @return Type of the texture
    */
-  Type GetType() const
+  [[nodiscard]] Type GetType() const
   {
     return mType;
   }
@@ -134,15 +126,14 @@ public:
    * Check if the texture is a native image
    * @return if the texture is a native image
    */
-  bool IsNativeImage() const
+  [[nodiscard]] bool IsNativeImage() const
   {
-    return mNativeImage;
+    return static_cast<bool>(mNativeImage);
   }
 
 private:
   /**
    * Helper method to apply a sampler to the texture
-   * @param[in] context The GL context
    * @param[in] sampler The sampler
    */
   void ApplySampler(Render::Sampler* sampler);
@@ -154,12 +145,11 @@ private:
   NativeImageInterfacePtr mNativeImage; ///< Pointer to native image
   Render::Sampler         mSampler;     ///< The current sampler state
 
-  Pixel::Format mPixelFormat;    ///< Pixel format of the texture
-  uint16_t      mWidth;          ///< Width of the texture
-  uint16_t      mHeight;         ///< Height of the texture
-  uint16_t      mMaxMipMapLevel; ///< Maximum mipmap level
-  Type          mType : 3;       ///< Type of the texture
-  bool          mHasAlpha : 1;   ///< Whether the format has an alpha channel
+  Pixel::Format mPixelFormat;  ///< Pixel format of the texture
+  uint16_t      mWidth;        ///< Width of the texture
+  uint16_t      mHeight;       ///< Height of the texture
+  Type          mType : 3;     ///< Type of the texture
+  bool          mHasAlpha : 1; ///< Whether the format has an alpha channel
 };
 
 } // namespace Render