#include <base/performance-logging/performance-interface-factory.h>
#include <base/lifecycle-observer.h>
+#include <dali/public-api/text-abstraction/font-client.h>
+
#include <callback-manager.h>
#include <trigger-event.h>
#include <window-render-surface.h>
#include <clipboard-impl.h>
#include <vsync-monitor.h>
#include <object-profiler.h>
-
#include <slp-logging.h>
-
+using Dali::TextAbstraction::FontClient;
namespace Dali
{
// guarantee map the surface before starting render-thread.
mSurface->Map();
- // NOTE: dpi must be set before starting the render thread
- // use default or command line settings if not run on device
-#ifdef __arm__
- // set the DPI value for font rendering
- unsigned int dpiHor, dpiVer;
- dpiHor = dpiVer = 0;
- mSurface->GetDpi(dpiHor, dpiVer);
+ unsigned int dpiHor(0);
+ unsigned int dpiVer(0);
+ mSurface->GetDpi( dpiHor, dpiVer );
- // tell core about the value
+ // tell core about the DPI value
mCore->SetDpi(dpiHor, dpiVer);
-#else
- mCore->SetDpi(mHDpi, mVDpi);
-#endif
+
+ // set the DPI value for font rendering
+ FontClient fontClient = FontClient::Get();
+ fontClient.SetDpi( dpiHor, dpiVer );
// Tell the core the size of the surface just before we start the render-thread
PositionSize size = mSurface->GetPositionSize();
mVSyncMonitor->SetUseHardwareVSync( useHardware );
}
-void Adaptor::SetDpi(size_t hDpi, size_t vDpi)
-{
- mHDpi = hDpi;
- mVDpi = vDpi;
-}
-
EglFactory& Adaptor::GetEGLFactory() const
{
DALI_ASSERT_DEBUG( mEglFactory && "EGL Factory not created" );
mNotificationOnIdleInstalled( false ),
mNotificationTrigger(NULL),
mGestureManager(NULL),
- mHDpi( 0 ),
- mVDpi( 0 ),
mDaliFeedbackPlugin(NULL),
mFeedbackController(NULL),
mObservers(),
void SetUseHardwareVSync(bool useHardware);
/**
- * Overrides DPI.
- * Primarily for host/simulation testing
- * @param[in] hDpi The Horizontal DPI
- * @param[in] vDpi The Vertical DPI
- */
- void SetDpi(size_t hDpi, size_t vDpi);
-
- /**
* @return reference to EglFactory class
*/
EglFactory& GetEGLFactory() const;
bool mNotificationOnIdleInstalled; ///< whether the idle handler is installed to send an notification event
TriggerEvent* mNotificationTrigger; ///< Notification event trigger
GestureManager* mGestureManager; ///< Gesture manager
- size_t mHDpi; ///< Override horizontal DPI
- size_t mVDpi; ///< Override vertical DPI
FeedbackPluginProxy* mDaliFeedbackPlugin; ///< Used to access feedback support
FeedbackController* mFeedbackController; ///< Plays feedback effects for Dali-Toolkit UI Controls.
Dali::TtsPlayer mTtsPlayers[Dali::TtsPlayer::MODE_NUM]; ///< Provides TTS support
// Defaults taken from H2 device
const unsigned int DEFAULT_WINDOW_WIDTH = 480;
const unsigned int DEFAULT_WINDOW_HEIGHT = 800;
-const float DEFAULT_HORIZONTAL_DPI = 220;
-const float DEFAULT_VERTICAL_DPI = 217;
}
ApplicationPtr Application::New(
mAdaptor = &Dali::Adaptor::New( mWindow, mBaseLayout, mContextLossConfiguration );
- // Allow DPI to be overridden from command line.
- unsigned int hDPI=DEFAULT_HORIZONTAL_DPI;
- unsigned int vDPI=DEFAULT_VERTICAL_DPI;
-
- std::string dpiStr = mCommandLineOptions->stageDPI;
- if(!dpiStr.empty())
- {
- sscanf(dpiStr.c_str(), "%ux%u", &hDPI, &vDPI);
- }
- Internal::Adaptor::Adaptor::GetImplementation( *mAdaptor ).SetDpi(hDPI, vDPI);
-
mAdaptor->ResizedSignal().Connect( mSlotDelegate, &Application::OnResize );
}