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
Merge "fix linespacing calculation in TextLabel" into devel/master
[platform/core/uifw/dali-toolkit.git]
/
dali-toolkit
/
internal
/
text
/
rendering
/
text-backend-impl.cpp
diff --git
a/dali-toolkit/internal/text/rendering/text-backend-impl.cpp
b/dali-toolkit/internal/text/rendering/text-backend-impl.cpp
index
5653ebf
..
0e0d3a8
100644
(file)
--- a/
dali-toolkit/internal/text/rendering/text-backend-impl.cpp
+++ b/
dali-toolkit/internal/text/rendering/text-backend-impl.cpp
@@
-1,5
+1,5
@@
/*
/*
- * Copyright (c) 20
15
Samsung Electronics Co., Ltd.
+ * Copyright (c) 20
21
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.
@@
-19,33
+19,31
@@
#include <dali-toolkit/internal/text/rendering/text-backend-impl.h>
// EXTERNAL INCLUDES
#include <dali-toolkit/internal/text/rendering/text-backend-impl.h>
// EXTERNAL INCLUDES
-#include <dali/
public-api/adaptor-framework
/singleton-service.h>
+#include <dali/
devel-api/common
/singleton-service.h>
#include <dali/integration-api/debug.h>
// INTERNAL INCLUDES
#include <dali/integration-api/debug.h>
// INTERNAL INCLUDES
-#include <dali-toolkit/
public
-api/text/rendering-backend.h>
+#include <dali-toolkit/
devel
-api/text/rendering-backend.h>
#include <dali-toolkit/internal/text/rendering/atlas/text-atlas-renderer.h>
#include <dali-toolkit/internal/text/rendering/atlas/text-atlas-renderer.h>
-#include <dali-toolkit/internal/text/rendering/basic/text-basic-renderer.h>
+#ifdef ENABLE_VECTOR_BASED_TEXT_RENDERING
+#include <dali-toolkit/internal/text/rendering/vector-based/vector-based-renderer.h>
+#endif
namespace Dali
{
namespace Dali
{
-
namespace Toolkit
{
namespace Toolkit
{
-
namespace Text
{
namespace Text
{
-
namespace Internal
{
namespace Internal
{
-
struct Backend::Impl
{
int temp; // placeholder for future backend implemenations
};
Backend::Backend()
struct Backend::Impl
{
int temp; // placeholder for future backend implemenations
};
Backend::Backend()
-: mImpl(
NULL
)
+: mImpl(
NULL
)
{
mImpl = new Impl();
}
{
mImpl = new Impl();
}
@@
-59,48
+57,52
@@
Dali::Toolkit::Text::Backend Backend::Get()
{
Dali::Toolkit::Text::Backend backendHandle;
{
Dali::Toolkit::Text::Backend backendHandle;
- Dali::SingletonService service(
SingletonService::Get()
);
- if
( service
)
+ Dali::SingletonService service(
SingletonService::Get()
);
+ if
(service
)
{
// Check whether the singleton is already created
{
// Check whether the singleton is already created
- Dali::BaseHandle handle = service.GetSingleton(
typeid( Dali::Toolkit::Text::Backend )
);
+ Dali::BaseHandle handle = service.GetSingleton(
typeid(Dali::Toolkit::Text::Backend)
);
if(handle)
{
// If so, downcast the handle
if(handle)
{
// If so, downcast the handle
- Backend* impl = dynamic_cast<
Dali::Toolkit::Text::Internal::Backend* >( handle.GetObjectPtr()
);
- backendHandle = Dali::Toolkit::Text::Backend(
impl
);
+ Backend* impl = dynamic_cast<
Dali::Toolkit::Text::Internal::Backend*>(handle.GetObjectPtr()
);
+ backendHandle = Dali::Toolkit::Text::Backend(
impl
);
}
else // create and register the object
{
}
else // create and register the object
{
- backendHandle = Dali::Toolkit::Text::Backend(
new Backend
);
- service.Register(
typeid( backendHandle ), backendHandle
);
+ backendHandle = Dali::Toolkit::Text::Backend(
new Backend
);
+ service.Register(
typeid(backendHandle), backendHandle
);
}
}
return backendHandle;
}
}
}
return backendHandle;
}
-RendererPtr Backend::NewRenderer(
unsigned int renderingType
)
+RendererPtr Backend::NewRenderer(
unsigned int renderingType
)
{
RendererPtr renderer;
{
RendererPtr renderer;
- switch(
renderingType
)
+ switch(
renderingType
)
{
{
- case Dali::Toolkit::
Text::RENDERING_BASIC
:
+ case Dali::Toolkit::
DevelText::RENDERING_SHARED_ATLAS
:
{
{
- renderer = Dali::Toolkit::Text::
Basic
Renderer::New();
+ renderer = Dali::Toolkit::Text::
Atlas
Renderer::New();
}
break;
}
break;
- case Dali::Toolkit::
Text::RENDERING_SHARED_ATLAS
:
+ case Dali::Toolkit::
DevelText::RENDERING_VECTOR_BASED
:
{
{
- renderer = Dali::Toolkit::Text::AtlasRenderer::New();
+#ifdef ENABLE_VECTOR_BASED_TEXT_RENDERING
+ renderer = Dali::Toolkit::Text::VectorBasedRenderer::New();
+#else
+ renderer = Dali::Toolkit::Text::AtlasRenderer::New(); // Fallback to bitmap-based rendering
+#endif
}
break;
default:
{
}
break;
default:
{
- DALI_LOG_WARNING(
"Unknown renderer type: %d", renderingType
);
+ DALI_LOG_WARNING(
"Unknown renderer type: %d\n", renderingType
);
break;
}
}
break;
}
}