#define DALI_INTERNAL_TEXTURE_SET_H
/*
- * Copyright (c) 2016 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.
// INTERNAL INCLUDES
#include <dali/public-api/common/dali-common.h> // DALI_ASSERT_ALWAYS
#include <dali/public-api/common/intrusive-ptr.h> // Dali::IntrusivePtr
-#include <dali/devel-api/rendering/texture-set.h> // Dali::TextureSet
-#include <dali/internal/event/common/connectable.h> // Dali::Internal::Connectable
-#include <dali/internal/event/common/object-connector.h> // Dali::Internal::ObjectConnector
+#include <dali/public-api/rendering/texture-set.h> // Dali::TextureSet
#include <dali/internal/event/common/object-impl.h> // Dali::Internal::Object
-#include <dali/internal/event/common/property-buffer-impl.h> // Dali::Internal::PropertyBuffer
#include <dali/internal/event/rendering/sampler-impl.h> // Dali::Internal::Sampler
#include <dali/internal/event/rendering/shader-impl.h> // Dali::Internal::Shader
+#include <dali/internal/event/rendering/texture-impl.h> // Dali::Internal::Texture
+
namespace Dali
{
class TextureSet;
-typedef IntrusivePtr<TextureSet> TextureSetPtr;
+using TextureSetPtr = IntrusivePtr<TextureSet>;
/**
* TextureSet is an object that holds all the textures used by a renderer
*/
-class TextureSet : public BaseObject, public Connectable
+class TextureSet : public BaseObject
{
public:
static TextureSetPtr New();
/**
- * @copydoc Dali::TextureSet::SetImage()
+ * @copydoc Dali::TextureSet::SetTexture()
*/
- void SetImage( size_t index, ImagePtr image );
+ void SetTexture( uint32_t index, TexturePtr texture );
/**
- * @copydoc Dali::TextureSet::GetImage()
+ * @copydoc Dali::TextureSet::GetTexture()
*/
- Image* GetImage( size_t index ) const;
+ Texture* GetTexture( uint32_t index ) const;
/**
* @copydoc Dali::TextureSet::SetSampler()
*/
- void SetSampler( size_t index, SamplerPtr sampler );
+ void SetSampler( uint32_t index, SamplerPtr sampler );
/**
* @copydoc Dali::TextureSet::GetSampler()
*/
- Sampler* GetSampler( size_t index ) const;
+ Sampler* GetSampler( uint32_t index ) const;
/**
* @copydoc Dali::TextureSet::GetTextureCount()
*/
- size_t GetTextureCount() const;
+ uint32_t GetTextureCount() const;
/**
* @brief Get the TextureSet scene object
*/
const SceneGraph::TextureSet* GetTextureSetSceneObject() const;
-public: // Functions from Connectable
- /**
- * @copydoc Dali::Internal::Connectable::OnStage()
- */
- virtual bool OnStage() const;
-
- /**
- * @copydoc Dali::Internal::Connectable::Connect()
- */
- virtual void Connect();
-
- /**
- * @copydoc Dali::Internal::Connectable::Disconnect()
- */
- virtual void Disconnect();
-
private: // implementation
- struct Texture
- {
- Texture()
- :image(NULL),
- sampler( NULL )
- {}
-
- ImagePtr image;
- SamplerPtr sampler;
- };
-
TextureSet();
/**
private: // Data
EventThreadServices& mEventThreadServices; ///<Used to send messages to the update thread
SceneGraph::TextureSet* mSceneObject;
- std::vector<Texture> mTextures;
- bool mOnStage;
-
+ std::vector<SamplerPtr> mSamplers;
+ std::vector<TexturePtr> mTextures;
};
} // namespace Internal