/*
- * Copyright (c) 2018 Samsung Electronics Co., Ltd.
+ * Copyright (c) 2019 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.
#include <dali/integration-api/debug.h>
// INTERNAL INCLUDES
-#include <dali/integration-api/trigger-event-factory-interface.h>
-#include <dali/integration-api/thread-synchronization-interface.h>
-#include <dali/internal/graphics/gles/egl-implementation.h>
+#include <dali/integration-api/adaptor-framework/thread-synchronization-interface.h>
+#include <dali/integration-api/adaptor-framework/trigger-event-factory-interface.h>
#include <dali/internal/adaptor/common/adaptor-impl.h>
#include <dali/internal/adaptor/common/adaptor-internal-services.h>
+#include <dali/internal/graphics/gles/egl-graphics.h>
+#include <dali/internal/graphics/gles/egl-implementation.h>
#include <dali/internal/window-system/common/window-base.h>
#include <dali/internal/window-system/common/window-factory.h>
#include <dali/internal/window-system/common/window-system.h>
-#include <dali/internal/graphics/gles/egl-graphics.h>
-
+#include <dali/internal/system/common/environment-variables.h>
namespace Dali
{
mRotationSupported( false ),
mRotationFinished( true ),
mScreenRotationFinished( true ),
- mResizeFinished( true )
+ mResizeFinished( true ),
+ mDpiHorizontal( 0 ),
+ mDpiVertical( 0 )
{
DALI_LOG_INFO( gWindowRenderSurfaceLogFilter, Debug::Verbose, "Creating Window\n" );
Initialize( surface );
{
delete mRotationTrigger;
}
+
+ if ( mEGLSurface )
+ {
+ DestroySurface();
+ }
}
void WindowRenderSurface::Initialize( Any surface )
// Default window size == screen size
mPositionSize.x = 0;
mPositionSize.y = 0;
-
WindowSystem::GetScreenSize( mPositionSize.width, mPositionSize.height );
}
void WindowRenderSurface::GetDpi( unsigned int& dpiHorizontal, unsigned int& dpiVertical )
{
- mWindowBase->GetDpi( dpiHorizontal, dpiVertical );
+ if( mDpiHorizontal == 0 || mDpiVertical == 0 )
+ {
+ const char* environmentDpiHorizontal = std::getenv( DALI_ENV_DPI_HORIZONTAL );
+ mDpiHorizontal = environmentDpiHorizontal ? std::atoi( environmentDpiHorizontal ) : 0;
+
+ const char* environmentDpiVertical = std::getenv( DALI_ENV_DPI_VERTICAL );
+ mDpiVertical = environmentDpiVertical ? std::atoi( environmentDpiVertical ) : 0;
+
+ if( mDpiHorizontal == 0 || mDpiVertical == 0 )
+ {
+ mWindowBase->GetDpi( mDpiHorizontal, mDpiVertical );
+ }
+ }
+
+ dpiHorizontal = mDpiHorizontal;
+ dpiVertical = mDpiVertical;
}
void WindowRenderSurface::InitializeGraphics()
// Check rotation capability
mRotationSupported = mWindowBase->IsEglWindowRotationSupported();
- DALI_LOG_INFO( gWindowRenderSurfaceLogFilter, Debug::Verbose, "WindowRenderSurface::CreateSurface: w = %d h = %d angle = %d screen rotation = %d\n", mPositionSize.width, mPositionSize.height, mRotationAngle, mScreenRotationAngle );
+ DALI_LOG_RELEASE_INFO("WindowRenderSurface::CreateSurface: WinId (%d), w = %d h = %d angle = %d screen rotation = %d\n",
+ mWindowBase->GetNativeWindowId(), mPositionSize.width, mPositionSize.height, mRotationAngle, mScreenRotationAngle );
}
void WindowRenderSurface::DestroySurface()
auto eglGraphics = static_cast<EglGraphics *>(mGraphics);
+ DALI_LOG_RELEASE_INFO("WindowRenderSurface::DestroySurface: WinId (%d)\n", mWindowBase->GetNativeWindowId() );
+
Internal::Adaptor::EglImplementation& eglImpl = eglGraphics->GetEglImplementation();
eglImpl.DestroySurface( mEGLSurface );
if( resizingSurface )
{
-#ifdef OVER_TIZEN_VERSION_4
// Window rotate or screen rotate
if( !mRotationFinished || !mScreenRotationFinished )
{
{
mWindowBase->SetEglWindowTransform( mRotationAngle );
}
-#endif
// Resize case
if( !mResizeFinished )
{
if( !mRotationFinished )
{
- DALI_LOG_INFO( gWindowRenderSurfaceLogFilter, Debug::Verbose, "WindowRenderSurface::PostRender: Trigger rotation event\n" );
+ if( mThreadSynchronization )
+ {
+ // Enable PostRender flag
+ mThreadSynchronization->PostRenderStarted();
+ }
+
+ DALI_LOG_RELEASE_INFO("WindowRenderSurface::PostRender: Trigger rotation event\n" );
mRotationTrigger->Trigger();