From: Paul Wisbey
Date: Thu, 26 Feb 2015 09:18:51 +0000 (+0000)
Subject: Removed the DPI hacks
X-Git-Tag: new_text_0.1~13
X-Git-Url: http://review.tizen.org/git/?a=commitdiff_plain;h=refs%2Fchanges%2F37%2F35937%2F2;p=platform%2Fcore%2Fuifw%2Fdali-adaptor.git
Removed the DPI hacks
Change-Id: Icbd4283419cc554e87b2a124c558944247d542d8
---
diff --git a/adaptors/common/adaptor-impl.cpp b/adaptors/common/adaptor-impl.cpp
index d12bb01..b3b1cc7 100644
--- a/adaptors/common/adaptor-impl.cpp
+++ b/adaptors/common/adaptor-impl.cpp
@@ -34,6 +34,8 @@
#include
#include
+#include
+
#include
#include
#include
@@ -54,10 +56,9 @@
#include
#include
#include
-
#include
-
+using Dali::TextAbstraction::FontClient;
namespace Dali
{
@@ -360,19 +361,16 @@ void Adaptor::Start()
// 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();
@@ -645,12 +643,6 @@ void Adaptor::SetUseHardwareVSync( bool useHardware )
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" );
@@ -899,8 +891,6 @@ Adaptor::Adaptor(Dali::Adaptor& adaptor, RenderSurface* surface, const DeviceLay
mNotificationOnIdleInstalled( false ),
mNotificationTrigger(NULL),
mGestureManager(NULL),
- mHDpi( 0 ),
- mVDpi( 0 ),
mDaliFeedbackPlugin(NULL),
mFeedbackController(NULL),
mObservers(),
diff --git a/adaptors/common/adaptor-impl.h b/adaptors/common/adaptor-impl.h
index a3ce04c..22b79cb 100644
--- a/adaptors/common/adaptor-impl.h
+++ b/adaptors/common/adaptor-impl.h
@@ -218,14 +218,6 @@ public:
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;
@@ -507,8 +499,6 @@ private: // Data
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
diff --git a/adaptors/common/application-impl.cpp b/adaptors/common/application-impl.cpp
index 6b288b5..d114b39 100644
--- a/adaptors/common/application-impl.cpp
+++ b/adaptors/common/application-impl.cpp
@@ -52,8 +52,6 @@ namespace
// 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(
@@ -124,17 +122,6 @@ void Application::CreateAdaptor()
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 );
}