/*
- * Copyright (c) 2019 Samsung Electronics Co., Ltd.
+ * Copyright (c) 2020 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.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 );
// Default window size == screen size
mPositionSize.x = 0;
mPositionSize.y = 0;
-
WindowSystem::GetScreenSize( mPositionSize.width, mPositionSize.height );
}
if( !mRotationTrigger )
{
- TriggerEventFactoryInterface& triggerFactory = Internal::Adaptor::Adaptor::GetImplementation( Adaptor::Get() ).GetTriggerEventFactoryInterface();
- mRotationTrigger = triggerFactory.CreateTriggerEvent( MakeCallback( this, &WindowRenderSurface::ProcessRotationRequest ), TriggerEventInterface::KEEP_ALIVE_AFTER_TRIGGER );
+ mRotationTrigger = TriggerEventFactory::CreateTriggerEvent( MakeCallback( this, &WindowRenderSurface::ProcessRotationRequest ), TriggerEventInterface::KEEP_ALIVE_AFTER_TRIGGER );
}
mPositionSize.width = width;
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();
- int screenWidth, screenHeight;
- WindowSystem::GetScreenSize( screenWidth, screenHeight );
- DALI_LOG_RELEASE_INFO("WindowRenderSurface::CreateSurface: w = %d h = %d screenWidth = %d screenHeight = %d angle = %d screen rotation = %d\n",
- mPositionSize.width, mPositionSize.height, screenWidth, screenHeight, 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( !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();
// Nothing to do.
}
-Integration::RenderSurface::Type WindowRenderSurface::GetSurfaceType()
+Dali::RenderSurfaceInterface::Type WindowRenderSurface::GetSurfaceType()
{
- return RenderSurface::WINDOW_RENDER_SURFACE;
+ return Dali::RenderSurfaceInterface::WINDOW_RENDER_SURFACE;
}
void WindowRenderSurface::MakeContextCurrent()