DALI_TEST_ASSERT(e, assertstring, TEST_LOCATION); \
}
+/**
+ * Test that given piece of code triggers an exception
+ * Fails the test if the exception didn't occur.
+ * Turns off logging during the execution of the code to avoid excessive false positive log output from the assertions
+ * @param expressions code to execute
+ * @param except the exception expected in the assert
+ */
+#define DALI_TEST_THROWS(expressions, except) \
+ try \
+ { \
+ TestApplication::EnableLogging(false); \
+ expressions; \
+ TestApplication::EnableLogging(true); \
+ fprintf(stderr, "Test failed in %s, expected exception: '%s' didn't occur\n", __FILELINE__, #except); \
+ tet_result(TET_FAIL); \
+ throw("TET_FAIL"); \
+ } \
+ catch(except &) \
+ { \
+ tet_result(TET_PASS); \
+ } \
+ catch(...) \
+ { \
+ fprintf(stderr, "Test failed in %s, unexpected exception\n", __FILELINE__); \
+ tet_result(TET_FAIL); \
+ throw; \
+ }
+
// Functor to test whether an Applied signal is emitted
struct ConstraintAppliedCheck
{
#include <dali/public-api/object/base-handle.h>
#include <dali/public-api/signals/dali-signal.h>
+// INTERNAL INCLUDES
+#include <dali/public-api/dali-adaptor-common.h>
+
namespace Dali
{
/**
* @brief Appliations can draw UI on offscreen surface with the OffscreenApplication.
* When you use a OffscreenApplication, you don't have to create a Window.
*/
-class DALI_IMPORT_API OffscreenApplication : public Dali::BaseHandle
+class DALI_ADAPTOR_API OffscreenApplication : public Dali::BaseHandle
{
public:
using OffscreenApplicationSignalType = Signal<void(void)>;
#include <dali/public-api/object/any.h>
#include <dali/public-api/signals/dali-signal.h>
+// INTERNAL INCLUDES
+#include <dali/public-api/dali-adaptor-common.h>
+
namespace Dali
{
/**
class OffscreenWindow;
}
-class DALI_IMPORT_API OffscreenWindow : public Dali::BaseHandle
+class DALI_ADAPTOR_API OffscreenWindow : public Dali::BaseHandle
{
public:
using WindowSize = Uint16Pair;
virtual void GetDpi(unsigned int& dpiHorizontal, unsigned int& dpiVertical) = 0;
/**
+ * @brief Return the orientation of the surface.
+ * @return The orientation
+ */
+ virtual int GetOrientation() const = 0;
+
+ /**
* @brief InitializeGraphics the platform specific graphics surface interfaces
*/
virtual void InitializeGraphics() = 0;
// Create the scene
PositionSize surfacePositionSize = mSurface->GetPositionSize();
- mScene = Dali::Integration::Scene::New(Size(static_cast<float>(surfacePositionSize.width), static_cast<float>(surfacePositionSize.height)));
+ int orientation = mSurface->GetOrientation();
+ mScene = Dali::Integration::Scene::New(Size(static_cast<float>(surfacePositionSize.width), static_cast<float>(surfacePositionSize.height)), orientation);
Internal::Adaptor::Adaptor& adaptorImpl = Internal::Adaptor::Adaptor::GetImplementation(adaptor);
mAdaptor = &adaptorImpl;
OnResume();
}
+void SceneHolder::SurfaceRotated(float width, float height, int orientation)
+{
+ mScene.SurfaceRotated(width, height, orientation);
+}
+
void SceneHolder::FeedTouchPoint(Dali::Integration::Point& point, int timeStamp)
{
if(timeStamp < 1)
{
mScene.AddFrameRenderedCallback(std::move(callback), frameId);
- DALI_LOG_INFO(gSceneHolderLogFilter, Debug::General, "SceneHolder::AddFrameRenderedCallback:: Added [%d]\n", frameId);
+ DALI_LOG_RELEASE_INFO("SceneHolder::AddFrameRenderedCallback:: Added [%d]\n", frameId);
}
void SceneHolder::AddFramePresentedCallback(std::unique_ptr<CallbackBase> callback, int32_t frameId)
{
mScene.AddFramePresentedCallback(std::move(callback), frameId);
- DALI_LOG_INFO(gSceneHolderLogFilter, Debug::General, "SceneHolder::AddFramePresentedCallback:: Added [%d]\n", frameId);
+ DALI_LOG_RELEASE_INFO("SceneHolder::AddFramePresentedCallback:: Added [%d]\n", frameId);
}
Dali::Integration::SceneHolder SceneHolder::Get(Dali::Actor actor)
}
/**
+ * @brief Informs the scene that the set surface has been rotated.
+ *
+ * @param[in] width The width of rotated surface
+ * @param[in] height The height of rotated surface
+ * @param[in] orientation The orientation of rotated surface
+ */
+ void SurfaceRotated(float width, float height, int orientation);
+
+ /**
* @copydoc Dali::Integration::SceneHolder::FeedTouchPoint
*/
void FeedTouchPoint(Dali::Integration::Point& point, int timeStamp);
return success;
}
- uint32_t size = bufferDescription.stride * bufferDescription.height;
- pixbuf.resize( size );
- memcpy( pixbuf.data(), buffer, size );
+ uint32_t pixelBytes = GetBytesPerPixel(pixelFormat);
+ if ( bufferDescription.stride < (pixelBytes * bufferDescription.width) )
+ {
+ //On Android device, bufferDescription.stride doesn't seem to mean (width * pixelbytes)
+ //in an actual case, (AHardwareBuffer_Desc) bufferDescription = (width = 1080, height = 1060, layers = 1, format = 1, usage = 306, stride = 1088, rfu0 = 0, rfu1 = 0)
+ //deal with situation
+ uint32_t dstStride = pixelBytes * bufferDescription.width;
+ uint32_t srcStride = pixelBytes * bufferDescription.stride;
+ uint32_t size = dstStride * bufferDescription.height;
+ pixbuf.resize( size );
+ //copy each row over
+ const unsigned char* ptrSrc = reinterpret_cast<const unsigned char*>(buffer);
+ unsigned char* ptrDst = pixbuf.data();
+ for (int y=0; y < bufferDescription.height; y++, ptrSrc += srcStride, ptrDst += dstStride )
+ {
+ memcpy( ptrDst, ptrSrc, dstStride );
+ }
+ }
+ else
+ {
+ uint32_t size = bufferDescription.stride * bufferDescription.height;
+ pixbuf.resize( size );
+ memcpy( pixbuf.data(), buffer, size );
+ }
ret = AHardwareBuffer_unlock( mPixmap, NULL );
if( ret != 0 )
return -1;
}
+int WindowBaseAndroid::GetOrientation() const
+{
+ return 0;
+}
+
} // namespace Adaptor
} // namespace Internal
*/
int CreateFramePresentedSyncFence() override;
+ /**
+ * @copydoc Dali::Internal::Adaptor::WindowBase::GetOrientation()
+ */
+ int GetOrientation() const override;
+
private:
/**
virtual void GetDpi( unsigned int& dpiHorizontal, unsigned int& dpiVertical ) = 0;
/**
+ * @brief Return the orientation of the surface.
+ * @return The orientation
+ */
+ virtual int GetOrientation() const = 0;
+
+ /**
* @brief Get the screen rotation angle of the window
*/
virtual int GetScreenRotationAngle() = 0;
}
Window::Window()
-: mWindowSurface( nullptr ),
+: mWindowSurface(nullptr),
mWindowBase(),
mIsTransparent( false ),
mIsFocusAcceptable( true ),
mType( WindowType::NORMAL ),
mParentWindow( NULL ),
mPreferredAngle( static_cast< int >( WindowOrientation::NO_ORIENTATION_PREFERENCE ) ),
- mRotationAngle( -1 ),
+ mRotationAngle( 0 ),
mWindowWidth( 0 ),
mWindowHeight( 0 ),
mOrientationMode( Internal::Adaptor::Window::OrientationMode::PORTRAIT ),
void Window::OnOutputTransformed()
{
PositionSize positionSize = mSurface->GetPositionSize();
- SurfaceResized();
- mAdaptor->SurfaceResizePrepare( mSurface.get(), Adaptor::SurfaceSize( positionSize.width, positionSize.height ) );
- mAdaptor->SurfaceResizeComplete( mSurface.get(), Adaptor::SurfaceSize( positionSize.width, positionSize.height ) );
+
+ int orientation = (mRotationAngle + mWindowBase->GetScreenRotationAngle()) % 360;
+ SurfaceRotated(static_cast<float>(positionSize.width), static_cast<float>(positionSize.height), orientation);
+
+ mAdaptor->SurfaceResizePrepare(mSurface.get(), Adaptor::SurfaceSize(positionSize.width, positionSize.height));
+ mAdaptor->SurfaceResizeComplete(mSurface.get(), Adaptor::SurfaceSize(positionSize.width, positionSize.height));
}
void Window::OnDeleteRequest()
FeedKeyEvent( keyEvent );
}
-void Window::OnRotation( const RotationEvent& rotation )
+void Window::OnRotation(const RotationEvent& rotation)
{
mRotationAngle = rotation.angle;
- mWindowWidth = rotation.width;
- mWindowHeight = rotation.height;
+ mWindowWidth = rotation.width;
+ mWindowHeight = rotation.height;
// Notify that the orientation is changed
- mOrientation->OnOrientationChange( rotation );
+ mOrientation->OnOrientationChange(rotation);
- mWindowSurface->RequestRotation( mRotationAngle, mWindowWidth, mWindowHeight );
+ mWindowSurface->RequestRotation(mRotationAngle, mWindowWidth, mWindowHeight);
- SurfaceResized();
+ int orientation = (mRotationAngle + mWindowBase->GetScreenRotationAngle()) % 360;
+ SurfaceRotated(mWindowWidth, mWindowHeight, orientation);
- mAdaptor->SurfaceResizePrepare( mSurface.get(), Adaptor::SurfaceSize( mWindowWidth, mWindowHeight ) );
+ mAdaptor->SurfaceResizePrepare(mSurface.get(), Adaptor::SurfaceSize(mWindowWidth, mWindowHeight));
- DALI_LOG_RELEASE_INFO( "Window (%p), WinId (%d), OnRotation(): resize signal emit [%d x %d]\n", this, mNativeWindowId, mWindowWidth, mWindowHeight );
+ DALI_LOG_RELEASE_INFO("Window (%p), WinId (%d), OnRotation(): resize signal emit [%d x %d]\n", this, mNativeWindowId, mWindowWidth, mWindowHeight);
// Emit signal
- Dali::Window handle( this );
- mResizeSignal.Emit( handle, Dali::Window::WindowSize( mWindowWidth, mWindowHeight ) );
+ Dali::Window handle(this);
+ mResizeSignal.Emit(handle, Dali::Window::WindowSize(mWindowWidth, mWindowHeight));
- mAdaptor->SurfaceResizeComplete( mSurface.get(), Adaptor::SurfaceSize( mWindowWidth, mWindowHeight ) );
+ mAdaptor->SurfaceResizeComplete(mSurface.get(), Adaptor::SurfaceSize(mWindowWidth, mWindowHeight));
}
void Window::OnPause()
} // unnamed namespace
-WindowRenderSurface::WindowRenderSurface( Dali::PositionSize positionSize, Any surface, bool isTransparent )
-: mEGL( nullptr ),
- mDisplayConnection( nullptr ),
- mPositionSize( positionSize ),
+WindowRenderSurface::WindowRenderSurface(Dali::PositionSize positionSize, Any surface, bool isTransparent)
+: mEGL(nullptr),
+ mDisplayConnection(nullptr),
+ mPositionSize(positionSize),
mWindowBase(),
- mThreadSynchronization( NULL ),
- mRenderNotification( NULL ),
- mRotationTrigger( NULL ),
+ mThreadSynchronization(nullptr),
+ mRenderNotification(nullptr),
+ mRotationTrigger(nullptr),
mFrameRenderedTrigger(),
- mGraphics( nullptr ),
- mEGLSurface( nullptr ),
- mEGLContext( nullptr ),
- mColorDepth( isTransparent ? COLOR_DEPTH_32 : COLOR_DEPTH_24 ),
+ mGraphics(nullptr),
+ mEGLSurface(nullptr),
+ mEGLContext(nullptr),
+ mColorDepth(isTransparent ? COLOR_DEPTH_32 : COLOR_DEPTH_24),
mOutputTransformedSignal(),
mFrameCallbackInfoContainer(),
mBufferDamagedRects(),
mMutex(),
- mRotationAngle( 0 ),
- mScreenRotationAngle( 0 ),
- mDpiHorizontal( 0 ),
- mDpiVertical( 0 ),
- mOwnSurface( false ),
- mRotationSupported( false ),
- mRotationFinished( true ),
- mScreenRotationFinished( true ),
- mResizeFinished( true )
+ mWindowRotationAngle(0),
+ mScreenRotationAngle(0),
+ mDpiHorizontal(0),
+ mDpiVertical(0),
+ mOwnSurface(false),
+ mWindowRotationFinished(true),
+ mScreenRotationFinished(true),
+ mResizeFinished(true),
+ mDefaultScreenRotationAvailable(false)
{
DALI_LOG_INFO( gWindowRenderSurfaceLogFilter, Debug::Verbose, "Creating Window\n" );
Initialize( surface );
if( mScreenRotationAngle != 0 )
{
mScreenRotationFinished = false;
+ mResizeFinished = false;
+ mDefaultScreenRotationAvailable = true;
+ DALI_LOG_RELEASE_INFO("WindowRenderSurface::Initialize, screen rotation is enabled, screen rotation angle:[%d]\n", mScreenRotationAngle );
}
}
mWindowBase->SetTransparency( transparent );
}
-void WindowRenderSurface::RequestRotation( int angle, int width, int height )
+void WindowRenderSurface::RequestRotation(int angle, int width, int height)
{
- if( !mRotationSupported )
+ if(!mRotationTrigger)
{
- DALI_LOG_INFO( gWindowRenderSurfaceLogFilter, Debug::Verbose, "WindowRenderSurface::Rotate: Rotation is not supported!\n" );
- return;
+ mRotationTrigger = TriggerEventFactory::CreateTriggerEvent(MakeCallback(this, &WindowRenderSurface::ProcessRotationRequest), TriggerEventInterface::KEEP_ALIVE_AFTER_TRIGGER);
}
- if( !mRotationTrigger )
- {
- mRotationTrigger = TriggerEventFactory::CreateTriggerEvent( MakeCallback( this, &WindowRenderSurface::ProcessRotationRequest ), TriggerEventInterface::KEEP_ALIVE_AFTER_TRIGGER );
- }
-
- mPositionSize.width = width;
+ mPositionSize.width = width;
mPositionSize.height = height;
- mRotationAngle = angle;
- mRotationFinished = false;
+ mWindowRotationAngle = angle;
+ mWindowRotationFinished = false;
- mWindowBase->SetWindowRotationAngle( mRotationAngle );
+ mWindowBase->SetWindowRotationAngle(mWindowRotationAngle);
- DALI_LOG_INFO( gWindowRenderSurfaceLogFilter, Debug::Verbose, "WindowRenderSurface::Rotate: angle = %d screen rotation = %d\n", mRotationAngle, mScreenRotationAngle );
+ DALI_LOG_INFO(gWindowRenderSurfaceLogFilter, Debug::Verbose, "WindowRenderSurface::Rotate: angle = %d screen rotation = %d\n", mWindowRotationAngle, mScreenRotationAngle);
}
WindowBase* WindowRenderSurface::GetWindowBase()
dpiVertical = mDpiVertical;
}
+int WindowRenderSurface::GetOrientation() const
+{
+ return mWindowBase->GetOrientation();
+}
+
void WindowRenderSurface::InitializeGraphics()
{
mGraphics = &mAdaptor->GetGraphicsInterface();
void WindowRenderSurface::CreateSurface()
{
- DALI_LOG_TRACE_METHOD( gWindowRenderSurfaceLogFilter );
+ DALI_LOG_TRACE_METHOD(gWindowRenderSurfaceLogFilter);
int width, height;
- if( mScreenRotationAngle == 0 || mScreenRotationAngle == 180 )
+ if(mScreenRotationAngle == 0 || mScreenRotationAngle == 180)
{
- width = mPositionSize.width;
+ width = mPositionSize.width;
height = mPositionSize.height;
}
else
{
- width = mPositionSize.height;
+ width = mPositionSize.height;
height = mPositionSize.width;
}
// Create the EGL window
- EGLNativeWindowType window = mWindowBase->CreateEglWindow( width, height );
+ EGLNativeWindowType window = mWindowBase->CreateEglWindow(width, height);
- auto eglGraphics = static_cast<EglGraphics *>(mGraphics);
+ auto eglGraphics = static_cast<EglGraphics*>(mGraphics);
Internal::Adaptor::EglImplementation& eglImpl = eglGraphics->GetEglImplementation();
- mEGLSurface = eglImpl.CreateSurfaceWindow( window, mColorDepth );
-
- // Check rotation capability
- mRotationSupported = mWindowBase->IsEglWindowRotationSupported();
+ mEGLSurface = eglImpl.CreateSurfaceWindow(window, mColorDepth);
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 );
+ mWindowBase->GetNativeWindowId(),
+ mPositionSize.width,
+ mPositionSize.height,
+ mWindowRotationAngle,
+ mScreenRotationAngle);
}
void WindowRenderSurface::DestroySurface()
{
}
-bool WindowRenderSurface::PreRender( bool resizingSurface, const std::vector<Rect<int>>& damagedRects, Rect<int>& clippingRect )
+bool WindowRenderSurface::PreRender(bool resizingSurface, const std::vector<Rect<int>>& damagedRects, Rect<int>& clippingRect)
{
Dali::Integration::Scene::FrameCallbackContainer callbacks;
Dali::Integration::Scene scene = mScene.GetHandle();
- if( scene )
+ if(scene)
{
bool needFrameRenderedTrigger = false;
- scene.GetFrameRenderedCallback( callbacks );
- if( !callbacks.empty() )
+ scene.GetFrameRenderedCallback(callbacks);
+ if(!callbacks.empty())
{
int frameRenderedSync = mWindowBase->CreateFrameRenderedSyncFence();
- if( frameRenderedSync != -1 )
+ if(frameRenderedSync != -1)
{
- Dali::Mutex::ScopedLock lock( mMutex );
+ Dali::Mutex::ScopedLock lock(mMutex);
- DALI_LOG_INFO( gWindowRenderSurfaceLogFilter, Debug::Verbose, "WindowRenderSurface::PreRender: CreateFrameRenderedSyncFence [%d]\n", frameRenderedSync );
+ DALI_LOG_RELEASE_INFO( "WindowRenderSurface::PreRender: CreateFrameRenderedSyncFence [%d]\n", frameRenderedSync );
- mFrameCallbackInfoContainer.push_back( std::unique_ptr< FrameCallbackInfo >( new FrameCallbackInfo( callbacks, frameRenderedSync ) ) );
+ mFrameCallbackInfoContainer.push_back(std::unique_ptr<FrameCallbackInfo>(new FrameCallbackInfo(callbacks, frameRenderedSync)));
needFrameRenderedTrigger = true;
}
else
{
- DALI_LOG_ERROR( "WindowRenderSurface::PreRender: CreateFrameRenderedSyncFence is failed\n" );
+ DALI_LOG_ERROR("WindowRenderSurface::PreRender: CreateFrameRenderedSyncFence is failed\n");
}
// Clear callbacks
callbacks.clear();
}
- scene.GetFramePresentedCallback( callbacks );
- if( !callbacks.empty() )
+ scene.GetFramePresentedCallback(callbacks);
+ if(!callbacks.empty())
{
int framePresentedSync = mWindowBase->CreateFramePresentedSyncFence();
- if( framePresentedSync != -1 )
+ if(framePresentedSync != -1)
{
- Dali::Mutex::ScopedLock lock( mMutex );
+ Dali::Mutex::ScopedLock lock(mMutex);
- DALI_LOG_INFO( gWindowRenderSurfaceLogFilter, Debug::Verbose, "WindowRenderSurface::PreRender: CreateFramePresentedSyncFence [%d]\n", framePresentedSync );
+ DALI_LOG_RELEASE_INFO( "WindowRenderSurface::PreRender: CreateFramePresentedSyncFence [%d]\n", framePresentedSync );
- mFrameCallbackInfoContainer.push_back( std::unique_ptr< FrameCallbackInfo >( new FrameCallbackInfo( callbacks, framePresentedSync ) ) );
+ mFrameCallbackInfoContainer.push_back(std::unique_ptr<FrameCallbackInfo>(new FrameCallbackInfo(callbacks, framePresentedSync)));
needFrameRenderedTrigger = true;
}
else
{
- DALI_LOG_ERROR( "WindowRenderSurface::PreRender: CreateFramePresentedSyncFence is failed\n" );
+ DALI_LOG_ERROR("WindowRenderSurface::PreRender: CreateFramePresentedSyncFence is failed\n");
}
// Clear callbacks
callbacks.clear();
}
- if( needFrameRenderedTrigger )
+ if(needFrameRenderedTrigger)
{
- if( !mFrameRenderedTrigger )
+ if(!mFrameRenderedTrigger)
{
- mFrameRenderedTrigger = std::unique_ptr< TriggerEventInterface >( TriggerEventFactory::CreateTriggerEvent( MakeCallback( this, &WindowRenderSurface::ProcessFrameCallback ),
- TriggerEventInterface::KEEP_ALIVE_AFTER_TRIGGER ) );
+ mFrameRenderedTrigger = std::unique_ptr<TriggerEventInterface>(TriggerEventFactory::CreateTriggerEvent(MakeCallback(this, &WindowRenderSurface::ProcessFrameCallback),
+ TriggerEventInterface::KEEP_ALIVE_AFTER_TRIGGER));
}
mFrameRenderedTrigger->Trigger();
}
MakeContextCurrent();
- if( resizingSurface )
+ /**
+ * wl_egl_window_tizen_set_rotation(SetEglWindowRotation) -> PreRotation
+ * wl_egl_window_tizen_set_buffer_transform(SetEglWindowBufferTransform) -> Screen Rotation
+ * wl_egl_window_tizen_set_window_transform(SetEglWindowTransform) -> Window Rotation
+ * These function should be called before calling first drawing gl Function.
+ * Notice : PreRotation is not used in the latest tizen,
+ * because output transform event should be occured before egl window is not created.
+ */
+
+ if(resizingSurface || mDefaultScreenRotationAvailable)
{
+ int totalAngle = (mWindowRotationAngle + mScreenRotationAngle) % 360;
+
// Window rotate or screen rotate
- if( !mRotationFinished || !mScreenRotationFinished )
+ if(!mWindowRotationFinished || !mScreenRotationFinished)
{
- int totalAngle = (mRotationAngle + mScreenRotationAngle) % 360;
-
- mWindowBase->SetEglWindowRotation( totalAngle );
- mWindowBase->SetEglWindowBufferTransform( totalAngle );
+ mWindowBase->SetEglWindowBufferTransform(totalAngle);
// Reset only screen rotation flag
mScreenRotationFinished = true;
- DALI_LOG_INFO( gWindowRenderSurfaceLogFilter, Debug::Verbose, "WindowRenderSurface::PreRender: Set rotation [%d] [%d]\n", mRotationAngle, mScreenRotationAngle );
+ DALI_LOG_RELEASE_INFO("WindowRenderSurface::PreRender: Set rotation [%d] [%d]\n", mWindowRotationAngle, mScreenRotationAngle);
}
// Only window rotate
- if( !mRotationFinished )
+ if(!mWindowRotationFinished)
{
- mWindowBase->SetEglWindowTransform( mRotationAngle );
+ mWindowBase->SetEglWindowTransform(mWindowRotationAngle);
}
// Resize case
- if( !mResizeFinished )
+ if(!mResizeFinished)
{
- mWindowBase->ResizeEglWindow( mPositionSize );
+ Dali::PositionSize positionSize;
+ positionSize.x = mPositionSize.x;
+ positionSize.y = mPositionSize.y;
+ if(totalAngle == 0 || totalAngle == 180)
+ {
+ positionSize.width = mPositionSize.width;
+ positionSize.height = mPositionSize.height;
+ }
+ else
+ {
+ positionSize.width = mPositionSize.height;
+ positionSize.height = mPositionSize.width;
+ }
+ mWindowBase->ResizeEglWindow(positionSize);
mResizeFinished = true;
- DALI_LOG_INFO( gWindowRenderSurfaceLogFilter, Debug::Verbose, "WindowRenderSurface::PreRender: Set resize\n" );
+ DALI_LOG_RELEASE_INFO("WindowRenderSurface::PreRender: Set resize\n");
}
SetFullSwapNextFrame();
+ mDefaultScreenRotationAvailable = false;
}
- SetBufferDamagedRects( damagedRects, clippingRect );
+ SetBufferDamagedRects(damagedRects, clippingRect);
return true;
}
-void WindowRenderSurface::PostRender( bool renderToFbo, bool replacingSurface, bool resizingSurface, const std::vector<Rect<int>>& damagedRects )
+void WindowRenderSurface::PostRender(bool renderToFbo, bool replacingSurface, bool resizingSurface, const std::vector<Rect<int>>& damagedRects)
{
// Inform the gl implementation that rendering has finished before informing the surface
- auto eglGraphics = static_cast<EglGraphics *>(mGraphics);
- if ( eglGraphics )
+ auto eglGraphics = static_cast<EglGraphics*>(mGraphics);
+ if(eglGraphics)
{
GlImplementation& mGLES = eglGraphics->GetGlesInterface();
mGLES.PostRender();
- if( renderToFbo )
+ if(renderToFbo)
{
mGLES.Flush();
mGLES.Finish();
}
else
{
- if( resizingSurface )
+ if(resizingSurface)
{
- if( !mRotationFinished )
+ if(!mWindowRotationFinished)
{
- if( mThreadSynchronization )
+ if(mThreadSynchronization)
{
// Enable PostRender flag
mThreadSynchronization->PostRenderStarted();
}
- DALI_LOG_RELEASE_INFO("WindowRenderSurface::PostRender: Trigger rotation event\n" );
+ DALI_LOG_RELEASE_INFO("WindowRenderSurface::PostRender: Trigger rotation event\n");
mRotationTrigger->Trigger();
- if( mThreadSynchronization )
+ if(mThreadSynchronization)
{
// Wait until the event-thread complete the rotation event processing
mThreadSynchronization->PostRenderWaitForCompletion();
}
}
- SwapBuffers( damagedRects );
+ SwapBuffers(damagedRects);
- if( mRenderNotification )
+ if(mRenderNotification)
{
mRenderNotification->Trigger();
}
{
int screenRotationAngle = mWindowBase->GetScreenRotationAngle();
- if( mScreenRotationAngle != screenRotationAngle )
+ if(mScreenRotationAngle != screenRotationAngle)
{
- mScreenRotationAngle = screenRotationAngle;
+ mScreenRotationAngle = screenRotationAngle;
mScreenRotationFinished = false;
+ mResizeFinished = false;
mOutputTransformedSignal.Emit();
- DALI_LOG_INFO( gWindowRenderSurfaceLogFilter, Debug::Verbose, "WindowRenderSurface::OutputTransformed: angle = %d screen rotation = %d\n", mRotationAngle, mScreenRotationAngle );
+ DALI_LOG_RELEASE_INFO("WindowRenderSurface::OutputTransformed: window = %d screen = %d\n", mWindowRotationAngle, mScreenRotationAngle);
}
else
{
- DALI_LOG_INFO( gWindowRenderSurfaceLogFilter, Debug::Verbose, "WindowRenderSurface::OutputTransformed: Ignore output transform [%d]\n", mScreenRotationAngle );
+ DALI_LOG_RELEASE_INFO("WindowRenderSurface::OutputTransformed: Ignore output transform [%d]\n", mScreenRotationAngle);
}
}
void WindowRenderSurface::ProcessRotationRequest()
{
- mRotationFinished = true;
+ mWindowRotationFinished = true;
- mWindowBase->WindowRotationCompleted( mRotationAngle, mPositionSize.width, mPositionSize.height );
+ mWindowBase->WindowRotationCompleted(mWindowRotationAngle, mPositionSize.width, mPositionSize.height);
- DALI_LOG_INFO( gWindowRenderSurfaceLogFilter, Debug::Verbose, "WindowRenderSurface::ProcessRotationRequest: Rotation Done\n" );
+ DALI_LOG_INFO(gWindowRenderSurfaceLogFilter, Debug::Verbose, "WindowRenderSurface::ProcessRotationRequest: Rotation Done\n");
- if( mThreadSynchronization )
+ if(mThreadSynchronization)
{
mThreadSynchronization->PostRenderComplete();
}
iter->fileDescriptorMonitor = std::unique_ptr< FileDescriptorMonitor >( new FileDescriptorMonitor( iter->fileDescriptor,
MakeCallback( this, &WindowRenderSurface::OnFileDescriptorEventDispatched ), FileDescriptorMonitor::FD_READABLE ) );
- DALI_LOG_INFO( gWindowRenderSurfaceLogFilter, Debug::Verbose, "WindowRenderSurface::ProcessFrameCallback: Add handler [%d]\n", iter->fileDescriptor );
+ DALI_LOG_RELEASE_INFO( "WindowRenderSurface::ProcessFrameCallback: Add handler [%d]\n", iter->fileDescriptor );
}
}
}
return;
}
- DALI_LOG_INFO( gWindowRenderSurfaceLogFilter, Debug::Verbose, "WindowRenderSurface::OnFileDescriptorEventDispatched: Frame rendered [%d]\n", fileDescriptor );
+ DALI_LOG_RELEASE_INFO( "WindowRenderSurface::OnFileDescriptorEventDispatched: Frame rendered [%d]\n", fileDescriptor );
std::unique_ptr< FrameCallbackInfo > callbackInfo;
{
void GetDpi( unsigned int& dpiHorizontal, unsigned int& dpiVertical ) override;
/**
+ * @copydoc Dali::RenderSurfaceInterface::GetOrientation()
+ */
+ int GetOrientation() const override;
+
+ /**
* @copydoc Dali::RenderSurfaceInterface::InitializeGraphics()
*/
void InitializeGraphics() override;
FrameCallbackInfoContainer mFrameCallbackInfoContainer;
DamagedRectsContainer mBufferDamagedRects;
Dali::Mutex mMutex;
- int mRotationAngle;
+ int mWindowRotationAngle;
int mScreenRotationAngle;
uint32_t mDpiHorizontal;
uint32_t mDpiVertical;
bool mOwnSurface; ///< Whether we own the surface (responsible for deleting it)
- bool mRotationSupported;
- bool mRotationFinished;
+ bool mWindowRotationFinished;
bool mScreenRotationFinished;
bool mResizeFinished;
+ bool mDefaultScreenRotationAvailable;
}; // class WindowRenderSurface
} // unnamed namespace
-WindowBaseEcoreWl::WindowBaseEcoreWl( Dali::PositionSize positionSize, Any surface, bool isTransparent )
+WindowBaseEcoreWl::WindowBaseEcoreWl(Dali::PositionSize positionSize, Any surface, bool isTransparent)
: mEcoreEventHandler(),
- mEcoreWindow( NULL ),
- mWlSurface( NULL ),
- mEglWindow( NULL ),
- mDisplay( NULL ),
- mEventQueue( NULL ),
- mTizenPolicy( NULL ),
- mTizenDisplayPolicy( NULL ),
+ mEcoreWindow(nullptr),
+ mWlSurface(nullptr),
+ mEglWindow(nullptr),
+ mDisplay(nullptr),
+ mEventQueue(nullptr),
+ mTizenPolicy(nullptr),
+ mTizenDisplayPolicy(nullptr),
mSupportedAuxiliaryHints(),
mAuxiliaryHints(),
- mNotificationLevel( -1 ),
- mNotificationChangeState( 0 ),
- mNotificationLevelChangeDone( true ),
- mScreenOffMode( 0 ),
- mScreenOffModeChangeState( 0 ),
- mScreenOffModeChangeDone( true ),
- mBrightness( 0 ),
- mBrightnessChangeState( 0 ),
- mBrightnessChangeDone( true ),
- mOwnSurface( false )
+ mNotificationLevel(-1),
+ mNotificationChangeState(0),
+ mNotificationLevelChangeDone(true),
+ mScreenOffMode(0),
+ mScreenOffModeChangeState(0),
+ mScreenOffModeChangeDone(true),
+ mBrightness(0),
+ mBrightnessChangeState(0),
+ mBrightnessChangeDone(true),
+ mOwnSurface(false),
+ mWindowRotationAngle(0),
+ mScreenRotationAngle(0),
+ mSupportedPreProtation(0)
#ifdef DALI_ELDBUS_AVAILABLE
- , mSystemConnection( NULL )
+ ,
+ mSystemConnection(NULL)
#endif
{
- Initialize( positionSize, surface, isTransparent );
+ Initialize(positionSize, surface, isTransparent);
}
WindowBaseEcoreWl::~WindowBaseEcoreWl()
wl_egl_window_capability capability = static_cast< wl_egl_window_capability >( wl_egl_window_get_capabilities( mEglWindow ) );
if( capability == WL_EGL_WINDOW_CAPABILITY_ROTATION_SUPPORTED )
{
+ mSupportedPreProtation = true;
return true;
}
-
+ mSupportedPreProtation = false;
return false;
}
dpiVertical = int( yres + 0.5f );
}
+int WindowBaseEcoreWl::GetOrientation() const
+{
+ int orientation = (mScreenRotationAngle + mWindowRotationAngle) % 360;
+ if(mSupportedPreProtation)
+ {
+ orientation = 0;
+ }
+ return orientation;
+}
+
int WindowBaseEcoreWl::GetScreenRotationAngle()
{
int transform = 0;
transform = ecore_wl_output_transform_get( ecore_wl_window_output_find( mEcoreWindow ) );
}
- return transform * 90;
+ mScreenRotationAngle = transform * 90;
+ return mScreenRotationAngle;
}
void WindowBaseEcoreWl::SetWindowRotationAngle( int degree )
{
+ mWindowRotationAngle = degree;
ecore_wl_window_rotation_set( mEcoreWindow, degree );
}
void GetDpi( unsigned int& dpiHorizontal, unsigned int& dpiVertical ) override;
/**
+ * @copydoc Dali::Internal::Adaptor::WindowBase::GetOrientation()
+ */
+ int GetOrientation() const override;
+
+ /**
* @copydoc Dali::Internal::Adaptor::WindowBase::GetScreenRotationAngle()
*/
int GetScreenRotationAngle() override;
bool mOwnSurface;
+ int mWindowRotationAngle;
+ int mScreenRotationAngle;
+ int mSupportedPreProtation;
#ifdef DALI_ELDBUS_AVAILABLE
Eldbus_Connection* mSystemConnection;
#endif // DALI_ELDBUS_AVAILABLE
} // unnamed namespace
-WindowBaseEcoreWl2::WindowBaseEcoreWl2( Dali::PositionSize positionSize, Any surface, bool isTransparent )
+WindowBaseEcoreWl2::WindowBaseEcoreWl2(Dali::PositionSize positionSize, Any surface, bool isTransparent)
: mEcoreEventHandler(),
- mEcoreWindow( NULL ),
- mWlSurface( NULL ),
- mEglWindow( NULL ),
- mDisplay( NULL ),
- mEventQueue( NULL ),
- mTizenPolicy( NULL ),
- mTizenDisplayPolicy( NULL ),
- mKeyMap( NULL ),
+ mEcoreWindow(nullptr),
+ mWlSurface(nullptr),
+ mEglWindow(nullptr),
+ mDisplay(nullptr),
+ mEventQueue(nullptr),
+ mTizenPolicy(nullptr),
+ mTizenDisplayPolicy(nullptr),
+ mKeyMap(nullptr),
mSupportedAuxiliaryHints(),
mAuxiliaryHints(),
- mNotificationLevel( -1 ),
- mNotificationChangeState( 0 ),
- mNotificationLevelChangeDone( true ),
- mScreenOffMode( 0 ),
- mScreenOffModeChangeState( 0 ),
- mScreenOffModeChangeDone( true ),
- mBrightness( 0 ),
- mBrightnessChangeState( 0 ),
- mBrightnessChangeDone( true ),
- mVisible( true ),
- mWindowPositionSize( positionSize ),
- mOwnSurface( false ),
- mMoveResizeSerial( 0 ),
- mLastSubmittedMoveResizeSerial( 0 )
+ mNotificationLevel(-1),
+ mNotificationChangeState(0),
+ mNotificationLevelChangeDone(true),
+ mScreenOffMode(0),
+ mScreenOffModeChangeState(0),
+ mScreenOffModeChangeDone(true),
+ mBrightness(0),
+ mBrightnessChangeState(0),
+ mBrightnessChangeDone(true),
+ mVisible(true),
+ mWindowPositionSize(positionSize),
+ mOwnSurface(false),
+ mMoveResizeSerial(0),
+ mLastSubmittedMoveResizeSerial(0),
+ mWindowRotationAngle(0),
+ mScreenRotationAngle(0),
+ mSupportedPreProtation(0)
#ifdef DALI_ELDBUS_AVAILABLE
- , mSystemConnection( NULL )
+ ,
+ mSystemConnection(NULL)
#endif
{
- Initialize( positionSize, surface, isTransparent );
+ Initialize(positionSize, surface, isTransparent);
}
WindowBaseEcoreWl2::~WindowBaseEcoreWl2()
{
DALI_LOG_INFO( gWindowBaseLogFilter, Debug::General, "Window (%p) EcoreEventOutputTransform\n", mEcoreWindow );
+ mScreenRotationAngle = GetScreenRotationAngle();
+
mOutputTransformedSignal.Emit();
}
{
DALI_LOG_INFO( gWindowBaseLogFilter, Debug::General, "Window (%p) EcoreEventIgnoreOutputTransform\n", mEcoreWindow );
+ mScreenRotationAngle = GetScreenRotationAngle();
+
mOutputTransformedSignal.Emit();
}
return ECORE_CALLBACK_PASS_ON;
}
-void WindowBaseEcoreWl2::OnRotation( void* data, int type, void* event )
+void WindowBaseEcoreWl2::OnRotation(void* data, int type, void* event)
{
- Ecore_Wl2_Event_Window_Rotation* ev( static_cast< Ecore_Wl2_Event_Window_Rotation* >( event ) );
+ Ecore_Wl2_Event_Window_Rotation* ev(static_cast<Ecore_Wl2_Event_Window_Rotation*>(event));
- if( ev->win == static_cast< unsigned int >( ecore_wl2_window_id_get( mEcoreWindow ) ) )
+ if(ev->win == static_cast<unsigned int>(ecore_wl2_window_id_get(mEcoreWindow)))
{
- DALI_LOG_RELEASE_INFO( "WindowBaseEcoreWl2::OnRotation, angle: %d, width: %d, height: %d\n", ev->angle, ev->w, ev->h );
+ DALI_LOG_RELEASE_INFO("WindowBaseEcoreWl2::OnRotation, angle: %d, width: %d, height: %d\n", ev->angle, ev->w, ev->h);
RotationEvent rotationEvent;
- rotationEvent.angle = ev->angle;
+ rotationEvent.angle = ev->angle;
rotationEvent.winResize = 0;
+ mWindowRotationAngle = ev->angle;
- if( ev->angle == 0 || ev->angle == 180 )
+ if(ev->angle == 0 || ev->angle == 180)
{
- rotationEvent.width = ev->w;
+ rotationEvent.width = ev->w;
rotationEvent.height = ev->h;
}
else
{
- rotationEvent.width = ev->h;
+ rotationEvent.width = ev->h;
rotationEvent.height = ev->w;
}
- mWindowPositionSize.width = rotationEvent.width;
+ mWindowPositionSize.width = rotationEvent.width;
mWindowPositionSize.height = rotationEvent.height;
- mRotationSignal.Emit( rotationEvent );
+ mRotationSignal.Emit(rotationEvent);
}
}
mTouchEventSignal.Emit( point, touchEvent->timestamp );
- DALI_LOG_INFO( gWindowBaseLogFilter, Debug::General, "WindowBaseEcoreWl::OnMouseButtonCancel\n" );
+ DALI_LOG_INFO( gWindowBaseLogFilter, Debug::General, "WindowBaseEcoreWl2::OnMouseButtonCancel\n" );
}
}
if( mouseWheelEvent->window == static_cast< unsigned int >( ecore_wl2_window_id_get( mEcoreWindow ) ) )
{
- DALI_LOG_INFO( gWindowBaseLogFilter, Debug::General, "WindowBaseEcoreWl::OnMouseWheel: direction: %d, modifiers: %d, x: %d, y: %d, z: %d\n", mouseWheelEvent->direction, mouseWheelEvent->modifiers, mouseWheelEvent->x, mouseWheelEvent->y, mouseWheelEvent->z );
+ DALI_LOG_INFO( gWindowBaseLogFilter, Debug::General, "WindowBaseEcoreWl2::OnMouseWheel: direction: %d, modifiers: %d, x: %d, y: %d, z: %d\n", mouseWheelEvent->direction, mouseWheelEvent->modifiers, mouseWheelEvent->x, mouseWheelEvent->y, mouseWheelEvent->z );
Integration::WheelEvent wheelEvent( Integration::WheelEvent::MOUSE_WHEEL, mouseWheelEvent->direction, mouseWheelEvent->modifiers, Vector2( mouseWheelEvent->x, mouseWheelEvent->y ), mouseWheelEvent->z, mouseWheelEvent->timestamp );
{
Ecore_Event_Detent_Rotate* detentEvent = static_cast< Ecore_Event_Detent_Rotate* >( event );
- DALI_LOG_INFO( gWindowBaseLogFilter, Debug::Concise, "WindowBaseEcoreWl::OnDetentRotation\n" );
+ DALI_LOG_INFO( gWindowBaseLogFilter, Debug::Concise, "WindowBaseEcoreWl2::OnDetentRotation\n" );
int direction = ( detentEvent->direction == ECORE_DETENT_DIRECTION_CLOCKWISE ) ? 1 : -1;
int timeStamp = detentEvent->timestamp;
if( keyEvent->window == static_cast< unsigned int >( ecore_wl2_window_id_get( mEcoreWindow ) ) )
{
- DALI_LOG_INFO( gWindowBaseLogFilter, Debug::General, "WindowBaseEcoreWl::OnKeyDown\n" );
+ DALI_LOG_INFO( gWindowBaseLogFilter, Debug::General, "WindowBaseEcoreWl2::OnKeyDown\n" );
std::string keyName( keyEvent->keyname );
std::string logicalKey( "" );
if( keyEvent->window == static_cast< unsigned int >( ecore_wl2_window_id_get( mEcoreWindow ) ) )
{
- DALI_LOG_INFO( gWindowBaseLogFilter, Debug::General, "WindowBaseEcoreWl::OnKeyUp\n" );
+ DALI_LOG_INFO( gWindowBaseLogFilter, Debug::General, "WindowBaseEcoreWl2::OnKeyUp\n" );
#if defined(ECORE_VERSION_MAJOR) && (ECORE_VERSION_MAJOR >= 1) && defined(ECORE_VERSION_MINOR) && (ECORE_VERSION_MINOR >= 23)
// Cancel processing flag is sent because this key event will combine with the previous key. So, the event should not actually perform anything.
return ecore_wl2_window_id_get( mEcoreWindow );
}
-EGLNativeWindowType WindowBaseEcoreWl2::CreateEglWindow( int width, int height )
+EGLNativeWindowType WindowBaseEcoreWl2::CreateEglWindow(int width, int height)
{
- mEglWindow = wl_egl_window_create( mWlSurface, width, height );
+ int totalAngle = (mWindowRotationAngle + mScreenRotationAngle) % 360;
+ if(totalAngle == 90 || totalAngle == 270)
+ {
+ mEglWindow = wl_egl_window_create(mWlSurface, height, width);
+ }
+ else
+ {
+ mEglWindow = wl_egl_window_create(mWlSurface, width, height);
+ }
- return static_cast< EGLNativeWindowType >( mEglWindow );
+ return static_cast<EGLNativeWindowType>(mEglWindow);
}
void WindowBaseEcoreWl2::DestroyEglWindow()
bool WindowBaseEcoreWl2::IsEglWindowRotationSupported()
{
// Check capability
- wl_egl_window_tizen_capability capability = static_cast< wl_egl_window_tizen_capability >( wl_egl_window_tizen_get_capabilities( mEglWindow ) );
- if( capability == WL_EGL_WINDOW_TIZEN_CAPABILITY_ROTATION_SUPPORTED )
+ wl_egl_window_tizen_capability capability = static_cast<wl_egl_window_tizen_capability>(wl_egl_window_tizen_get_capabilities(mEglWindow));
+ if(capability == WL_EGL_WINDOW_TIZEN_CAPABILITY_ROTATION_SUPPORTED)
{
+ mSupportedPreProtation = true;
return true;
}
-
+ mSupportedPreProtation = false;
return false;
}
ecore_wl2_window_activate( mEcoreWindow );
}
-void WindowBaseEcoreWl2::SetAvailableAnlges( const std::vector< int >& angles )
+void WindowBaseEcoreWl2::SetAvailableAnlges(const std::vector<int>& angles)
{
- int rotations[4] = { 0 };
- DALI_LOG_RELEASE_INFO( "WindowBaseEcoreWl2::SetAvailableAnlges, angle's count: %d, angles\n", angles.size() );
- for( std::size_t i = 0; i < angles.size(); ++i )
+ int rotations[4] = {0};
+ DALI_LOG_RELEASE_INFO("WindowBaseEcoreWl2::SetAvailableAnlges, angle's count: %d, angles\n", angles.size());
+ for(std::size_t i = 0; i < angles.size(); ++i)
{
- rotations[i] = static_cast< int >( angles[i] );
- DALI_LOG_RELEASE_INFO( "%d ", rotations[i] );
+ rotations[i] = static_cast<int>(angles[i]);
+ DALI_LOG_RELEASE_INFO("%d ", rotations[i]);
}
- ecore_wl2_window_available_rotations_set( mEcoreWindow, rotations, angles.size() );
+ ecore_wl2_window_available_rotations_set(mEcoreWindow, rotations, angles.size());
}
void WindowBaseEcoreWl2::SetPreferredAngle( int angle )
{
+ DALI_LOG_RELEASE_INFO( "WindowBaseEcoreWl2::SetPreferredAngle, angle: %d\n", angle );
ecore_wl2_window_preferred_rotation_set( mEcoreWindow, angle );
}
dpiVertical = int( yres + 0.5f );
}
+int WindowBaseEcoreWl2::GetOrientation() const
+{
+ int orientation = (mScreenRotationAngle + mWindowRotationAngle) % 360;
+ if(mSupportedPreProtation)
+ {
+ orientation = 0;
+ }
+ return orientation;
+}
+
int WindowBaseEcoreWl2::GetScreenRotationAngle()
{
int transform = 0;
- if( ecore_wl2_window_ignore_output_transform_get( mEcoreWindow ) )
+ if(ecore_wl2_window_ignore_output_transform_get(mEcoreWindow))
{
transform = 0;
}
else
{
- transform = ecore_wl2_output_transform_get( ecore_wl2_window_output_find( mEcoreWindow ) );
+ transform = ecore_wl2_output_transform_get(ecore_wl2_window_output_find(mEcoreWindow));
}
-
- return transform * 90;
+ mScreenRotationAngle = transform * 90;
+ return mScreenRotationAngle;
}
-void WindowBaseEcoreWl2::SetWindowRotationAngle( int degree )
+void WindowBaseEcoreWl2::SetWindowRotationAngle(int degree)
{
- ecore_wl2_window_rotation_set( mEcoreWindow, degree );
+ mWindowRotationAngle = degree;
+ ecore_wl2_window_rotation_set(mEcoreWindow, degree);
}
-void WindowBaseEcoreWl2::WindowRotationCompleted( int degree, int width, int height )
+void WindowBaseEcoreWl2::WindowRotationCompleted(int degree, int width, int height)
{
- ecore_wl2_window_rotation_change_done_send( mEcoreWindow, degree, width, height );
+ ecore_wl2_window_rotation_change_done_send(mEcoreWindow, degree, width, height);
}
void WindowBaseEcoreWl2::SetTransparency( bool transparent )
void GetDpi( unsigned int& dpiHorizontal, unsigned int& dpiVertical ) override;
/**
+ * @copydoc Dali::Internal::Adaptor::WindowBase::GetOrientation()
+ */
+ int GetOrientation() const override;
+
+ /**
* @copydoc Dali::Internal::Adaptor::WindowBase::GetScreenRotationAngle()
*/
int GetScreenRotationAngle() override;
volatile uint32_t mMoveResizeSerial;
uint32_t mLastSubmittedMoveResizeSerial;
+ int mWindowRotationAngle;
+ int mScreenRotationAngle;
+ int mSupportedPreProtation;
#ifdef DALI_ELDBUS_AVAILABLE
Eldbus_Connection* mSystemConnection;
#endif // DALI_ELDBUS_AVAILABLE
dpiVertical = int( yres + 0.5f );
}
+int NativeRenderSurfaceEcoreWl::GetOrientation() const
+{
+ return 0;
+}
+
void NativeRenderSurfaceEcoreWl::InitializeGraphics()
{
DALI_LOG_TRACE_METHOD( gNativeSurfaceLogFilter );
void GetDpi( unsigned int& dpiHorizontal, unsigned int& dpiVertical ) override;
/**
+ * @copydoc Dali::RenderSurfaceInterface::GetOrientation()
+ */
+ int GetOrientation() const override;
+
+ /**
* @copydoc Dali::RenderSurfaceInterface::InitializeGraphics()
*/
void InitializeGraphics() override;
dpiVertical = int( yres + 0.5f );
}
+int PixmapRenderSurfaceEcoreX::GetOrientation() const
+{
+ return 0;
+}
+
void PixmapRenderSurfaceEcoreX::InitializeGraphics()
{
mGraphics = &mAdaptor->GetGraphicsInterface();
void GetDpi( unsigned int& dpiHorizontal, unsigned int& dpiVertical ) override;
/**
+ * @copydoc Dali::Internal::Adaptor::WindowBase::GetOrientation()
+ */
+ int GetOrientation() const override;
+
+ /**
* @copydoc Dali::RenderSurfaceInterface::InitializeGraphics()
*/
void InitializeGraphics() override;
} // unnamed namespace
-WindowBaseEcoreX::WindowBaseEcoreX( Dali::PositionSize positionSize, Any surface, bool isTransparent )
+WindowBaseEcoreX::WindowBaseEcoreX(Dali::PositionSize positionSize, Any surface, bool isTransparent)
: mEcoreEventHandler(),
- mEcoreWindow( 0 ),
- mOwnSurface( false ),
- mIsTransparent( false ), // Should only be set to true once we actually create a transparent window regardless of what isTransparent is.
- mRotationAppSet( false )
+ mEcoreWindow(0),
+ mOwnSurface(false),
+ mIsTransparent(false), // Should only be set to true once we actually create a transparent window regardless of what isTransparent is.
+ mRotationAppSet(false),
+ mWindowRotationAngle(0)
{
- Initialize( positionSize, surface, isTransparent );
+ Initialize(positionSize, surface, isTransparent);
}
WindowBaseEcoreX::~WindowBaseEcoreX()
dpiVertical = ecore_x_dpi_get();
}
+int WindowBaseEcoreX::GetOrientation() const
+{
+ return 0;
+}
+
int WindowBaseEcoreX::GetScreenRotationAngle()
{
return 0;
void WindowBaseEcoreX::SetWindowRotationAngle( int degree )
{
+ mWindowRotationAngle = degree;
}
void WindowBaseEcoreX::WindowRotationCompleted( int degree, int width, int height )
void GetDpi( unsigned int& dpiHorizontal, unsigned int& dpiVertical ) override;
/**
+ * @copydoc Dali::Internal::Adaptor::WindowBase::GetOrientation()
+ */
+ int GetOrientation() const override;
+
+ /**
* @copydoc Dali::Internal::Adaptor::WindowBase::GetScreenRotationAngle()
*/
int GetScreenRotationAngle() override;
bool mOwnSurface:1; ///< Whether we own the surface (responsible for deleting it)
bool mIsTransparent; ///< Whether the window is transparent (32 bit or 24 bit)
bool mRotationAppSet:1;
+ int mWindowRotationAngle;
};
} // namespace Adaptor
delete info;
}
-const char* GetKeyName( int keyCode )
+std::string GetKeyName( int keyCode )
{
switch( keyCode )
{
}
default:
{
+ if (keyCode > 0 && keyCode < 128)
+ {
+ return std::string(1u, static_cast<char>(keyCode));
+ }
break;
}
}
\r
// EXTERNAL_HEADERS\r
#include <stdint.h>\r
+#include <string>\r
#include <dali/public-api/signals/callback.h>\r
\r
typedef uintptr_t WinWindowHandle;\r
\r
void KillTimer(intptr_t id);\r
\r
-const char* GetKeyName( int keyCode );\r
+std::string GetKeyName( int keyCode );\r
\r
uint64_t GetCurrentThreadId();\r
\r
{
}
+int WindowBaseWin::GetOrientation() const
+{
+ return 0;
+}
+
uintptr_t WindowBaseWin::GetSurfaceId( Any surface ) const
{
uintptr_t surfaceId = 0;
void SetTransparency( bool transparent ) override;
/**
+ * @copydoc Dali::Internal::Adaptor::WindowBase::GetOrientation()
+ */
+ int GetOrientation() const override;
+
+ /**
* @copydoc Dali::Internal::Adaptor::WindowBase::SetParent()
*/
void SetParent( WindowBase* parentWinBase ) override;
{
const unsigned int ADAPTOR_MAJOR_VERSION = 2;
const unsigned int ADAPTOR_MINOR_VERSION = 0;
-const unsigned int ADAPTOR_MICRO_VERSION = 1;
+const unsigned int ADAPTOR_MICRO_VERSION = 2;
const char* const ADAPTOR_BUILD_DATE = __DATE__ " " __TIME__;
#ifdef DEBUG_ENABLED
Name: dali2-adaptor
Summary: The DALi Tizen Adaptor
-Version: 2.0.1
+Version: 2.0.2
Release: 1
Group: System/Libraries
License: Apache-2.0 and BSD-3-Clause and MIT