// 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);
-
- // tell core about the value
- mCore->SetDpi(dpiHor, dpiVer);
-#else
- mCore->SetDpi(mHDpi, mVDpi);
-#endif
+ if( mHDpi == 0 || mVDpi == 0 )
+ {
+ unsigned int dpiHor, dpiVer;
+ dpiHor = dpiVer = 0;
+ mSurface->GetDpi(dpiHor, dpiVer);
+
+ // tell core about the value
+ mCore->SetDpi(dpiHor, dpiVer);
+ }
+ else
+ {
+ mCore->SetDpi(mHDpi, mVDpi);
+ }
// Tell the core the size of the surface just before we start the render-thread
PositionSize size = mSurface->GetPositionSize();
namespace Adaptor
{
-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(
int* argc,
char **argv[],
void Application::CreateWindow()
{
-#ifndef __arm__
- PositionSize windowPosition(0, 0, DEFAULT_WINDOW_WIDTH, DEFAULT_WINDOW_HEIGHT);
-#else
- PositionSize windowPosition(0, 0, 0, 0); // this will use full screen
-#endif
- if (mCommandLineOptions->stageWidth > 0 && mCommandLineOptions->stageHeight > 0)
+ PositionSize windowPosition(0, 0, 0, 0); // this will use full screen
+
+ if( mCommandLineOptions->stageWidth > 0 && mCommandLineOptions->stageHeight > 0 )
{
// let the command line options over ride
- windowPosition = PositionSize(0,0,mCommandLineOptions->stageWidth,mCommandLineOptions->stageHeight);
+ windowPosition = PositionSize( 0, 0, mCommandLineOptions->stageWidth, mCommandLineOptions->stageHeight );
}
mWindow = Dali::Window::New( windowPosition, mName, mWindowMode == Dali::Application::TRANSPARENT );
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())
{
+ // Use DPI from command line.
+ unsigned int hDPI = 0;
+ unsigned int vDPI = 0;
+
sscanf(dpiStr.c_str(), "%ux%u", &hDPI, &vDPI);
+
+ Internal::Adaptor::Adaptor::GetImplementation( *mAdaptor ).SetDpi(hDPI, vDPI);
}
- Internal::Adaptor::Adaptor::GetImplementation( *mAdaptor ).SetDpi(hDPI, vDPI);
mAdaptor->ResizedSignal().Connect( mSlotDelegate, &Application::OnResize );
}