/*
- * Copyright (c) 2022 Samsung Electronics Co., Ltd.
+ * Copyright (c) 2024 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.
#include <dali/devel-api/text-abstraction/font-client.h>
#include <dali/integration-api/debug.h>
#include <dali/public-api/animation/constraints.h>
+#include <dali/public-api/math/math-utils.h>
#include <dali/public-api/rendering/geometry.h>
#include <dali/public-api/rendering/renderer.h>
#include <map>
if(!isOutline || (isOutline && !isColorGlyph))
{
// Retrieve the emoji's bitmap.
- TextAbstraction::FontClient::GlyphBufferData glyphBufferData;
+ TextAbstraction::GlyphBufferData glyphBufferData;
glyphBufferData.width = isColorGlyph ? glyph.width : 0; // Desired width and height.
glyphBufferData.height = isColorGlyph ? glyph.height : 0;
uint32_t glyphBufferSize = glyphBufferData.width * glyphBufferData.height * Pixel::GetBytesPerPixel(glyphBufferData.format);
// If glyph buffer data don't have ownership, Or if we need to decompress, create new memory and replace ownership.
- if(!glyphBufferData.isBufferOwned || glyphBufferData.compressionType != TextAbstraction::FontClient::GlyphBufferData::CompressionType::NO_COMPRESSION)
+ if(!glyphBufferData.isBufferOwned || glyphBufferData.compressionType != TextAbstraction::GlyphBufferData::CompressionType::NO_COMPRESSION)
{
uint8_t* newBuffer = (uint8_t*)malloc(glyphBufferSize);
if(DALI_LIKELY(newBuffer != nullptr))
{
- TextAbstraction::FontClient::GlyphBufferData::Decompress(glyphBufferData, newBuffer);
+ TextAbstraction::GlyphBufferData::Decompress(glyphBufferData, newBuffer);
if(glyphBufferData.isBufferOwned)
{
// Release previous buffer
}
glyphBufferData.isBufferOwned = true;
glyphBufferData.buffer = newBuffer;
- glyphBufferData.compressionType = TextAbstraction::FontClient::GlyphBufferData::CompressionType::NO_COMPRESSION;
+ glyphBufferData.compressionType = TextAbstraction::GlyphBufferData::CompressionType::NO_COMPRESSION;
}
}
thereAreStrikethroughGlyphs = thereAreStrikethroughGlyphs || isGlyphStrikethrough;
// No operation for white space
- if(glyph.width && glyph.height)
+ if(!Dali::EqualsZero(glyph.width) && !Dali::EqualsZero(glyph.height))
{
// Check and update decorative-lines informations
if(isGlyphUnderlined || isGlyphStrikethrough)
// The glyph is an emoji and is not a shadow.
if(!mShaderRgba)
{
- mShaderRgba = Shader::New(SHADER_TEXT_ATLAS_SHADER_VERT, SHADER_TEXT_ATLAS_RGBA_SHADER_FRAG);
+ mShaderRgba = Shader::New(SHADER_TEXT_ATLAS_SHADER_VERT, SHADER_TEXT_ATLAS_RGBA_SHADER_FRAG, Shader::Hint::NONE, "TEXT_ATLAS_RGBA");
}
shader = mShaderRgba;
}
// The glyph is text or a shadow.
if(!mShaderL8)
{
- mShaderL8 = Shader::New(SHADER_TEXT_ATLAS_SHADER_VERT, SHADER_TEXT_ATLAS_L8_SHADER_FRAG);
+ mShaderL8 = Shader::New(SHADER_TEXT_ATLAS_SHADER_VERT, SHADER_TEXT_ATLAS_L8_SHADER_FRAG, Shader::Hint::NONE, "TEXT_ATLAS_L8");
}
shader = mShaderL8;
}