From 9121236fe6e8343119c89bff3af304d8f988808a Mon Sep 17 00:00:00 2001
From: Paul Wisbey
Date: Mon, 19 Jan 2015 11:34:55 +0000
Subject: [PATCH] Renamed Atlas to avoid name clash with new version
Change-Id: Ieb1f8ecc20f77646bc45722f043ebd7278bd330b
---
dali/internal/event/text/atlas/glyph-atlas.h | 4 +--
.../text/atlas/{atlas.cpp => texture-atlas.cpp} | 36 +++++++++++-----------
.../event/text/atlas/{atlas.h => texture-atlas.h} | 28 ++++++++---------
dali/internal/file.list | 2 +-
4 files changed, 34 insertions(+), 36 deletions(-)
rename dali/internal/event/text/atlas/{atlas.cpp => texture-atlas.cpp} (87%)
rename dali/internal/event/text/atlas/{atlas.h => texture-atlas.h} (91%)
diff --git a/dali/internal/event/text/atlas/glyph-atlas.h b/dali/internal/event/text/atlas/glyph-atlas.h
index f804d7a..14af43d 100644
--- a/dali/internal/event/text/atlas/glyph-atlas.h
+++ b/dali/internal/event/text/atlas/glyph-atlas.h
@@ -19,7 +19,7 @@
*/
// INTERNAL INCLUDES
-#include
+#include
#include
#include
#include
@@ -272,7 +272,7 @@ private:
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
diff --git a/dali/internal/event/text/atlas/atlas.cpp b/dali/internal/event/text/atlas/texture-atlas.cpp
similarity index 87%
rename from dali/internal/event/text/atlas/atlas.cpp
rename to dali/internal/event/text/atlas/texture-atlas.cpp
index 03f3574..9538f86 100644
--- a/dali/internal/event/text/atlas/atlas.cpp
+++ b/dali/internal/event/text/atlas/texture-atlas.cpp
@@ -16,7 +16,7 @@
*/
// CLASS HEADER
-#include
+#include
// INTERNAL INCLUDES
#include
@@ -60,8 +60,8 @@ void GetByteAndBitPosition( unsigned int blockNum, unsigned int& bytePos, unsign
} // 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)
{
@@ -80,12 +80,12 @@ Atlas::Atlas(const unsigned int atlasSize,
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.
@@ -137,7 +137,7 @@ void Atlas::CloneContents( Atlas* clone )
#endif
}
-bool Atlas::Insert( unsigned int id)
+bool TextureAtlas::Insert( unsigned int id)
{
unsigned int blockNum(0);
@@ -162,7 +162,7 @@ bool Atlas::Insert( unsigned int id)
return true;
}
-void Atlas::Remove(unsigned int id)
+void TextureAtlas::Remove(unsigned int id)
{
BlockLookup::const_iterator iter = mBlockLookup.find( id );
@@ -174,12 +174,12 @@ void Atlas::Remove(unsigned int 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;
@@ -190,7 +190,7 @@ void Atlas::GetXYPosition( unsigned int id, unsigned int& xPos, unsigned int& yP
yPos = item.yPos;
}
-UvRect Atlas::GetUvCoordinates( unsigned int id ) const
+UvRect TextureAtlas::GetUvCoordinates( unsigned int id ) const
{
AtlasItem item;
@@ -200,14 +200,14 @@ UvRect Atlas::GetUvCoordinates( unsigned int id ) const
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
@@ -236,7 +236,7 @@ bool Atlas::AllocateBlock( unsigned int& blockNum )
return false;
}
-void Atlas::DeAllocateBlock( unsigned int blockNum )
+void TextureAtlas::DeAllocateBlock( unsigned int blockNum )
{
unsigned int bytePos,bitPos;
@@ -254,7 +254,7 @@ void Atlas::DeAllocateBlock( unsigned int blockNum )
}
-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);
@@ -279,7 +279,7 @@ void Atlas::FillAtlasItem( unsigned int blockNum, AtlasItem& atlasItem, UvMode m
}
-unsigned int Atlas::GetBlockNumber( unsigned int id) const
+unsigned int TextureAtlas::GetBlockNumber( unsigned int id) const
{
BlockLookup::const_iterator iter = mBlockLookup.find( id );
@@ -288,12 +288,12 @@ unsigned int Atlas::GetBlockNumber( unsigned int id) const
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)
@@ -307,7 +307,7 @@ void Atlas::GetPositionOfBlock( unsigned int block1dPos, unsigned int& row, unsi
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;
diff --git a/dali/internal/event/text/atlas/atlas.h b/dali/internal/event/text/atlas/texture-atlas.h
similarity index 91%
rename from dali/internal/event/text/atlas/atlas.h
rename to dali/internal/event/text/atlas/texture-atlas.h
index dd2bc2d..3819626 100644
--- a/dali/internal/event/text/atlas/atlas.h
+++ b/dali/internal/event/text/atlas/texture-atlas.h
@@ -1,5 +1,5 @@
-#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.
@@ -59,7 +59,7 @@ namespace Internal
* To debug the class, enable DEBUG_ATLAS in atlas-debug.h
*
*/
-class Atlas : public AtlasUvInterface
+class TextureAtlas : public AtlasUvInterface
{
public:
@@ -69,18 +69,18 @@ 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.
@@ -123,13 +123,13 @@ private:
/**
* 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
@@ -196,7 +196,7 @@ private:
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;
@@ -212,7 +212,7 @@ private:
/**
* 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
@@ -242,12 +242,10 @@ private:
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__
diff --git a/dali/internal/file.list b/dali/internal/file.list
index 709fabd..904d7b6 100644
--- a/dali/internal/file.list
+++ b/dali/internal/file.list
@@ -112,7 +112,7 @@ internal_src_files = \
$(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 \
--
2.7.4