*/
// INTERNAL INCLUDES
-#include <dali/internal/event/text/atlas/atlas.h>
+#include <dali/internal/event/text/atlas/texture-atlas.h>
#include <dali/internal/event/text/atlas/atlas-ranking.h>
#include <dali/internal/event/text/glyph-status/glyph-status.h>
#include <dali/internal/event/text/glyph-status/glyph-status-container.h>
GlyphRequestList mRequestList; ///< list of GlyphResourceRequest objects
GlyphStatusContainer mGlyphContainer; ///< Glyph status container
- Atlas mAtlas; ///< has block allocation algorithm
+ TextureAtlas mAtlas; ///< has block allocation algorithm
unsigned int mTextureId; ///< texture id
TextureIdList mTextureIdOfReplacedAtlases; ///< list of previously replaced atlases
*/
// CLASS HEADER
-#include <dali/internal/event/text/atlas/atlas.h>
+#include <dali/internal/event/text/atlas/texture-atlas.h>
// INTERNAL INCLUDES
#include <dali/public-api/common/dali-common.h>
} // un-named namespace
-Atlas::Atlas(const unsigned int atlasSize,
- const unsigned int blockSize)
+TextureAtlas::TextureAtlas(const unsigned int atlasSize,
+ const unsigned int blockSize)
: mSize(atlasSize),
mBlockSize(blockSize)
{
mFreeBlocks.resize( bitMaskBytes ); // contents auto-initialised to zero
}
-Atlas::~Atlas()
+TextureAtlas::~TextureAtlas()
{
}
-void Atlas::CloneContents( Atlas* clone )
+void TextureAtlas::CloneContents( TextureAtlas* clone )
{
// Internally atlas allocation is done using a 1 dimensional array.
// A single bit set in the array represents an allocation.
#endif
}
-bool Atlas::Insert( unsigned int id)
+bool TextureAtlas::Insert( unsigned int id)
{
unsigned int blockNum(0);
return true;
}
-void Atlas::Remove(unsigned int id)
+void TextureAtlas::Remove(unsigned int id)
{
BlockLookup::const_iterator iter = mBlockLookup.find( id );
mBlockLookup.erase( id );
}
-unsigned int Atlas::GetSize() const
+unsigned int TextureAtlas::GetSize() const
{
return mSize;
}
-void Atlas::GetXYPosition( unsigned int id, unsigned int& xPos, unsigned int& yPos ) const
+void TextureAtlas::GetXYPosition( unsigned int id, unsigned int& xPos, unsigned int& yPos ) const
{
AtlasItem item;
yPos = item.yPos;
}
-UvRect Atlas::GetUvCoordinates( unsigned int id ) const
+UvRect TextureAtlas::GetUvCoordinates( unsigned int id ) const
{
AtlasItem item;
return item.uv;
}
-Atlas::Atlas()
+TextureAtlas::TextureAtlas()
:mSize( 0 ),
mBlockSize( 0 )
{
}
-bool Atlas::AllocateBlock( unsigned int& blockNum )
+bool TextureAtlas::AllocateBlock( unsigned int& blockNum )
{
// scan the bitmask for a free block
// each byte is a bitmask for 8 blocks, so 0000 0011, means blocks 1 and 2 are allocated
return false;
}
-void Atlas::DeAllocateBlock( unsigned int blockNum )
+void TextureAtlas::DeAllocateBlock( unsigned int blockNum )
{
unsigned int bytePos,bitPos;
}
-void Atlas::FillAtlasItem( unsigned int blockNum, AtlasItem& atlasItem, UvMode mode ) const
+void TextureAtlas::FillAtlasItem( unsigned int blockNum, AtlasItem& atlasItem, UvMode mode ) const
{
UvRect& uv(atlasItem.uv);
}
-unsigned int Atlas::GetBlockNumber( unsigned int id) const
+unsigned int TextureAtlas::GetBlockNumber( unsigned int id) const
{
BlockLookup::const_iterator iter = mBlockLookup.find( id );
return (*iter).second;
}
-unsigned int Atlas::GetBlocksPerRow() const
+unsigned int TextureAtlas::GetBlocksPerRow() const
{
return mSize / mBlockSize;
}
-void Atlas::GetPositionOfBlock( unsigned int block1dPos, unsigned int& row, unsigned int& column )
+void TextureAtlas::GetPositionOfBlock( unsigned int block1dPos, unsigned int& row, unsigned int& column )
{
column = 0;
if( block1dPos > 0)
GetByteAndBitPosition( block1dPos, bytePos, bitPos );
}
-unsigned int Atlas::AllocateBlock( unsigned int row, unsigned int column )
+unsigned int TextureAtlas::AllocateBlock( unsigned int row, unsigned int column )
{
unsigned int blockNum = (row * GetBlocksPerRow()) + column;
-#ifndef __DALI_INTERNAL_ATLAS_H__
-#define __DALI_INTERNAL_ATLAS_H__
+#ifndef __DALI_INTERNAL_TEXTURE_ATLAS_H__
+#define __DALI_INTERNAL_TEXTURE_ATLAS_H__
/*
* Copyright (c) 2014 Samsung Electronics Co., Ltd.
* To debug the class, enable DEBUG_ATLAS in atlas-debug.h
*
*/
-class Atlas : public AtlasUvInterface
+class TextureAtlas : public AtlasUvInterface
{
public:
* @param[in] atlasSize The width / height of the atlas (only square atlases are supported)
* @param[in] blockSize The width / height of each block in the atlas
*/
- Atlas( const unsigned int atlasSize, const unsigned int blockSize );
+ TextureAtlas( const unsigned int atlasSize, const unsigned int blockSize );
/**
* Destructor
*/
- virtual ~Atlas();
+ virtual ~TextureAtlas();
/**
* Clone the contents of the atlas passed as a parameter into this atlas
* @param clone the atlas to clone
*/
- void CloneContents( Atlas* clone );
+ void CloneContents( TextureAtlas* clone );
/**
* Inserts a block in to the atlas.
/**
* Default constructor
*/
- Atlas();
+ TextureAtlas();
// Undefined copy constructor.
- Atlas( const Atlas& );
+ TextureAtlas( const TextureAtlas& );
// Undefined assignment operator.
- Atlas& operator=( const Atlas& );
+ TextureAtlas& operator=( const TextureAtlas& );
/**
* Allocate a block in the atlas
unsigned int GetBlockNumber( unsigned int id) const;
/**
- * Gets the blocks per row. E.g. a 4 x 4 Atlas will return 4.
+ * Gets the blocks per row. E.g. a 4 x 4 TextureAtlas will return 4.
* @return the number of blocks per row.
*/
unsigned int GetBlocksPerRow( ) const;
/**
* Gets a position of the block within the atlas.
- * E.g. In a 8 x 8 Atlas, block 8 (zero based) with have row = 1, col = 0.
+ * E.g. In a 8 x 8 TextureAtlas, block 8 (zero based) with have row = 1, col = 0.
*
* @param[in] block1dPos block id
* @param[out] row atlas row
unsigned int mBlockSize; ///< The block size
FreeBlocks mFreeBlocks; ///< Bitmask of free blocks
BlockLookup mBlockLookup; ///< lookup between block number and unique id given by user
-
-
-}; // class Atlas
+};
} // namespace Internal
} // namespace Dali
-#endif // __DALI_INTERNAL_ATLAS_H__
+#endif // __DALI_INTERNAL_TEXTURE_ATLAS_H__
$(internal_src_dir)/event/text/glyph-status/glyph-status.cpp \
$(internal_src_dir)/event/text/glyph-status/glyph-status-container.cpp \
$(internal_src_dir)/event/text/glyph-status/debug/glyph-status-container-debug.cpp \
- $(internal_src_dir)/event/text/atlas/atlas.cpp \
+ $(internal_src_dir)/event/text/atlas/texture-atlas.cpp \
$(internal_src_dir)/event/text/atlas/atlas-size.cpp \
$(internal_src_dir)/event/text/atlas/atlas-ranking.cpp \
$(internal_src_dir)/event/text/atlas/atlas-rank-generator.cpp \