Removed the DPI hacks 37/35937/2
authorPaul Wisbey <p.wisbey@samsung.com>
Thu, 26 Feb 2015 09:18:51 +0000 (09:18 +0000)
committerPaul Wisbey <p.wisbey@samsung.com>
Thu, 26 Feb 2015 09:40:53 +0000 (09:40 +0000)
Change-Id: Icbd4283419cc554e87b2a124c558944247d542d8

adaptors/common/adaptor-impl.cpp
adaptors/common/adaptor-impl.h
adaptors/common/application-impl.cpp

index d12bb01..b3b1cc7 100644 (file)
@@ -34,6 +34,8 @@
 #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
 {
@@ -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(),
index a3ce04c..22b79cb 100644 (file)
@@ -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
index 6b288b5..d114b39 100644 (file)
@@ -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 );
 }