#define DALI_INTERNAL_SCENE_GRAPH_TEXTURE_SET_H
/*
- * 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 Internal
{
-class ResourceManager;
namespace Render
{
struct Sampler;
-class NewTexture;
+class Texture;
}
namespace SceneGraph
{
static TextureSet* New();
/**
- * Destructor
+ * Destructor. Not virtual as not a base class and not inheriting anything
*/
- virtual ~TextureSet();
+ ~TextureSet();
/**
* Overriden delete operator
* @param[in] index The index of the texture
* @param[in] sampler The sampler to be used by the texture
*/
- void SetSampler( size_t index, Render::Sampler* sampler );
+ void SetSampler( uint32_t index, Render::Sampler* sampler );
/**
* Set the texture at position "index"
* @param[in] index The index of the texture
* @param[in] texture The texture
*/
- void SetTexture( size_t index, Render::NewTexture* texture );
+ void SetTexture( uint32_t index, Render::Texture* texture );
/**
* Return whether any texture in the texture set has an alpha channel
* @param[in] index The index of the texture in the textures array
* @return the sampler used by the texture
*/
- Render::Sampler* GetTextureSampler( size_t index )
+ Render::Sampler* GetTextureSampler( uint32_t index )
{
return mSamplers[index];
}
/**
- * Get the number of NewTextures in the texture set
- * @return The number of NewTextures
+ * Get the number of Textures in the texture set
+ * @return The number of Textures
*/
- size_t GetNewTextureCount()
+ uint32_t GetTextureCount()
{
- return mTextures.Size();
+ return static_cast<uint32_t>( mTextures.Size() );
}
/**
- * Get the pointer to a NewTexture in the TextureSet
+ * Get the pointer to a Texture in the TextureSet
* @param[in] index The index of the texture in the textures array
- * @return the pointer to the NewTexture in that position
+ * @return the pointer to the Texture in that position
*/
- Render::NewTexture* GetNewTexture( size_t index )
+ Render::Texture* GetTexture( uint32_t index )
{
return mTextures[index];
}
private: // Data
- Vector< Render::Sampler* > mSamplers; ///< List of samplers used by each texture. Not owned
- Vector< Render::NewTexture* > mTextures; ///< List of NewTextures. Not owned
- Vector<Renderer*> mRenderers; ///< List of renderers using the TextureSet
- bool mHasAlpha; ///< if any of the textures has an alpha channel
+ Vector< Render::Sampler* > mSamplers; ///< List of samplers used by each texture. Not owned
+ Vector< Render::Texture* > mTextures; ///< List of Textures. Not owned
+ Vector<Renderer*> mRenderers; ///< List of renderers using the TextureSet
+ bool mHasAlpha; ///< if any of the textures has an alpha channel
};
-inline void SetTextureMessage( EventThreadServices& eventThreadServices, const TextureSet& textureSet, size_t index, Render::NewTexture* texture )
+inline void SetTextureMessage( EventThreadServices& eventThreadServices, const TextureSet& textureSet, uint32_t index, Render::Texture* texture )
{
- typedef MessageValue2< TextureSet, size_t, Render::NewTexture* > LocalType;
+ using LocalType = MessageValue2<TextureSet, uint32_t, Render::Texture*>;
// Reserve some memory inside the message queue
- unsigned int* slot = eventThreadServices.ReserveMessageSlot( sizeof( LocalType ) );
+ uint32_t* slot = eventThreadServices.ReserveMessageSlot( sizeof( LocalType ) );
// Construct message in the message queue memory; note that delete should not be called on the return value
new (slot) LocalType( &textureSet, &TextureSet::SetTexture, index, texture );
}
-inline void SetSamplerMessage( EventThreadServices& eventThreadServices, const TextureSet& textureSet, size_t index, Render::Sampler* sampler )
+inline void SetSamplerMessage( EventThreadServices& eventThreadServices, const TextureSet& textureSet, uint32_t index, Render::Sampler* sampler )
{
- typedef MessageValue2< TextureSet, size_t, Render::Sampler* > LocalType;
+ using LocalType = MessageValue2<TextureSet, uint32_t, Render::Sampler*>;
// Reserve some memory inside the message queue
- unsigned int* slot = eventThreadServices.ReserveMessageSlot( sizeof( LocalType ) );
+ uint32_t* slot = eventThreadServices.ReserveMessageSlot( sizeof( LocalType ) );
// Construct message in the message queue memory; note that delete should not be called on the return value
new (slot) LocalType( &textureSet, &TextureSet::SetSampler, index, sampler );