projects
/
platform
/
core
/
uifw
/
dali-toolkit.git
/ blobdiff
commit
grep
author
committer
pickaxe
?
search:
re
summary
|
shortlog
|
log
|
commit
|
commitdiff
|
tree
raw
|
inline
| side by side
Convert more shaders in dali-toolkit and dali-scene-loader to use shader compilation...
[platform/core/uifw/dali-toolkit.git]
/
dali-toolkit
/
internal
/
text
/
rendering
/
atlas
/
atlas-glyph-manager-impl.cpp
diff --git
a/dali-toolkit/internal/text/rendering/atlas/atlas-glyph-manager-impl.cpp
b/dali-toolkit/internal/text/rendering/atlas/atlas-glyph-manager-impl.cpp
old mode 100644
(file)
new mode 100755
(executable)
index
957fd8e
..
a3f7efd
--- a/
dali-toolkit/internal/text/rendering/atlas/atlas-glyph-manager-impl.cpp
+++ b/
dali-toolkit/internal/text/rendering/atlas/atlas-glyph-manager-impl.cpp
@@
-1,5
+1,5
@@
/*
/*
- * Copyright (c) 201
5
Samsung Electronics Co., Ltd.
+ * Copyright (c) 201
9
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.
*
* Licensed under the Apache License, Version 2.0 (the "License");
* you may not use this file except in compliance with the License.
@@
-41,10
+41,12
@@
namespace Internal
AtlasGlyphManager::AtlasGlyphManager()
{
mAtlasManager = Dali::Toolkit::AtlasManager::New();
AtlasGlyphManager::AtlasGlyphManager()
{
mAtlasManager = Dali::Toolkit::AtlasManager::New();
+ mSampler = Sampler::New();
+ mSampler.SetFilterMode( FilterMode::LINEAR, FilterMode::LINEAR );
}
void AtlasGlyphManager::Add( const Text::GlyphInfo& glyph,
}
void AtlasGlyphManager::Add( const Text::GlyphInfo& glyph,
- const
uint32_t outlineWidth
,
+ const
Toolkit::AtlasGlyphManager::GlyphStyle& style
,
const PixelData& bitmap,
Dali::Toolkit::AtlasManager::AtlasSlot& slot )
{
const PixelData& bitmap,
Dali::Toolkit::AtlasManager::AtlasSlot& slot )
{
@@
-58,14
+60,17
@@
void AtlasGlyphManager::Add( const Text::GlyphInfo& glyph,
Dali::Texture atlas = mAtlasManager.GetAtlasContainer( slot.mAtlasId );
TextureSet textureSet = TextureSet::New();
textureSet.SetTexture( 0u, atlas );
Dali::Texture atlas = mAtlasManager.GetAtlasContainer( slot.mAtlasId );
TextureSet textureSet = TextureSet::New();
textureSet.SetTexture( 0u, atlas );
+ textureSet.SetSampler( 0u, mSampler);
mAtlasManager.SetTextures( slot.mAtlasId, textureSet );
}
GlyphRecordEntry record;
record.mIndex = glyph.index;
mAtlasManager.SetTextures( slot.mAtlasId, textureSet );
}
GlyphRecordEntry record;
record.mIndex = glyph.index;
- record.mOutlineWidth = outlineWidth;
record.mImageId = slot.mImageId;
record.mCount = 1;
record.mImageId = slot.mImageId;
record.mCount = 1;
+ record.mOutlineWidth = style.outline;
+ record.isItalic = style.isItalic;
+ record.isBold = style.isBold;
// Have glyph records been created for this fontId ?
bool foundGlyph = false;
// Have glyph records been created for this fontId ?
bool foundGlyph = false;
@@
-99,9
+104,9
@@
void AtlasGlyphManager::GenerateMeshData( uint32_t imageId,
}
bool AtlasGlyphManager::IsCached( Text::FontId fontId,
}
bool AtlasGlyphManager::IsCached( Text::FontId fontId,
- Text::GlyphIndex index,
-
uint32_t outlineWidth
,
- Dali::Toolkit::AtlasManager::AtlasSlot& slot )
+
Text::GlyphIndex index,
+
const Toolkit::AtlasGlyphManager::GlyphStyle& style
,
+
Dali::Toolkit::AtlasManager::AtlasSlot& slot )
{
for ( std::vector< FontGlyphRecord >::iterator fontGlyphRecordIt = mFontGlyphRecords.begin();
fontGlyphRecordIt != mFontGlyphRecords.end();
{
for ( std::vector< FontGlyphRecord >::iterator fontGlyphRecordIt = mFontGlyphRecords.begin();
fontGlyphRecordIt != mFontGlyphRecords.end();
@@
-113,7
+118,10
@@
bool AtlasGlyphManager::IsCached( Text::FontId fontId,
glyphRecordIt != fontGlyphRecordIt->mGlyphRecords.End();
++glyphRecordIt )
{
glyphRecordIt != fontGlyphRecordIt->mGlyphRecords.End();
++glyphRecordIt )
{
- if ( glyphRecordIt->mIndex == index && glyphRecordIt->mOutlineWidth == outlineWidth )
+ if ( ( glyphRecordIt->mIndex == index ) &&
+ ( glyphRecordIt->mOutlineWidth == style.outline ) &&
+ ( glyphRecordIt->isItalic == style.isItalic ) &&
+ ( glyphRecordIt->isBold == style.isBold ) )
{
slot.mImageId = glyphRecordIt->mImageId;
slot.mAtlasId = mAtlasManager.GetAtlas( slot.mImageId );
{
slot.mImageId = glyphRecordIt->mImageId;
slot.mAtlasId = mAtlasManager.GetAtlas( slot.mImageId );
@@
-174,7
+182,7
@@
const Toolkit::AtlasGlyphManager::Metrics& AtlasGlyphManager::GetMetrics()
return mMetrics;
}
return mMetrics;
}
-void AtlasGlyphManager::AdjustReferenceCount( Text::FontId fontId, Text::GlyphIndex index,
uint32_t outlineWidth
, int32_t delta )
+void AtlasGlyphManager::AdjustReferenceCount( Text::FontId fontId, Text::GlyphIndex index,
const Toolkit::AtlasGlyphManager::GlyphStyle& style
, int32_t delta )
{
if( 0 != delta )
{
{
if( 0 != delta )
{
@@
-190,7
+198,10
@@
void AtlasGlyphManager::AdjustReferenceCount( Text::FontId fontId, Text::GlyphIn
glyphRecordIt != fontGlyphRecordIt->mGlyphRecords.End();
++glyphRecordIt )
{
glyphRecordIt != fontGlyphRecordIt->mGlyphRecords.End();
++glyphRecordIt )
{
- if ( glyphRecordIt->mIndex == index && glyphRecordIt->mOutlineWidth == outlineWidth )
+ if ( ( glyphRecordIt->mIndex == index ) &&
+ ( glyphRecordIt->mOutlineWidth == style.outline ) &&
+ ( glyphRecordIt->isItalic == style.isItalic ) &&
+ ( glyphRecordIt->isBold == style.isBold ) )
{
glyphRecordIt->mCount += delta;
DALI_ASSERT_DEBUG( glyphRecordIt->mCount >= 0 && "Glyph ref-count should not be negative" );
{
glyphRecordIt->mCount += delta;
DALI_ASSERT_DEBUG( glyphRecordIt->mCount >= 0 && "Glyph ref-count should not be negative" );