mOpaqueState(false),
mResizeEnabled(false),
mVisible(false),
- mIsRotated(false),
mIsWindowRotated(false),
mIsTouched(false),
mIsEGLInitialized(false),
mWindowBase = windowFactory->CreateWindowBase(mPositionSize, surface, (mIsTransparent ? true : false));
mWindowBase->IconifyChangedSignal().Connect(this, &GlWindow::OnIconifyChanged);
mWindowBase->FocusChangedSignal().Connect(this, &GlWindow::OnFocusChanged);
+ mWindowBase->OutputTransformedSignal().Connect(this, &GlWindow::OnOutputTransformed);
if(Dali::Adaptor::IsAvailable())
{
}
// If window's size or position is changed, the signal will be emitted to user.
- if((needToMove) || (needToResize))
+ if(needToMove || needToResize)
{
Uint16Pair newSize(mPositionSize.width, mPositionSize.height);
Dali::GlWindow handle(this);
mResizeSignal.Emit(newSize);
+
+ if(mGlWindowRenderThread)
+ {
+ mGlWindowRenderThread->RequestWindowResize(mPositionSize.width, mPositionSize.height);
+ }
}
}
void GlWindow::OnOutputTransformed()
{
- int screenRotationAngle = mWindowBase->GetScreenRotationAngle();
- if(screenRotationAngle != mScreenRotationAngle)
- {
- mScreenRotationAngle = screenRotationAngle;
- mTotalRotationAngle = (mWindowRotationAngle + mScreenRotationAngle) % 360;
-
- if(mTotalRotationAngle == 90 || mTotalRotationAngle == 270)
- {
- mWindowWidth = mPositionSize.height;
- mWindowHeight = mPositionSize.width;
- }
- else
- {
- mWindowWidth = mPositionSize.width;
- mWindowHeight = mPositionSize.height;
- }
+ int newScreenRotationAngle = mWindowBase->GetScreenRotationAngle();
+ DALI_LOG_RELEASE_INFO("GlWindow::OnOutputTransformed(), screen rotation occurs, old[%d], new[%d\n", mScreenRotationAngle, newScreenRotationAngle);
- // Emit Resize signal
- Dali::GlWindow handle(this);
- mResizeSignal.Emit(Dali::Uint16Pair(mWindowWidth, mWindowHeight));
+ if(newScreenRotationAngle != mScreenRotationAngle)
+ {
+ UpdateScreenRotation(newScreenRotationAngle);
}
}
mWindowHeight = mPositionSize.height;
}
- mIsRotated = true;
- mIsWindowRotated = true;
DALI_LOG_RELEASE_INFO("Window (%p), WinId (%d), OnRotation(): resize signal emit [%d x %d]\n", this, mNativeWindowId, mWindowWidth, mWindowHeight);
// Emit Resize signal
Dali::GlWindow handle(this);
mResizeSignal.Emit(Dali::Uint16Pair(mWindowWidth, mWindowHeight));
+
+ if(mGlWindowRenderThread)
+ {
+ mGlWindowRenderThread->RequestWindowRotate(mWindowRotationAngle);
+ }
}
void GlWindow::RecalculateTouchPosition(Integration::Point& point)
mGlWindowRenderThread->SetOnDemandRenderMode(onDemand);
mIsEGLInitialized = true;
+
+ // Check screen rotation
+ int newScreenRotationAngle = mWindowBase->GetScreenRotationAngle();
+ DALI_LOG_RELEASE_INFO("GlWindow::InitializeGraphics(), GetScreenRotationAngle(): %d\n", mScreenRotationAngle);
+ if(newScreenRotationAngle != 0)
+ {
+ UpdateScreenRotation(newScreenRotationAngle);
+ }
}
}
{
}
+void GlWindow::UpdateScreenRotation(int newAngle)
+{
+ mScreenRotationAngle = newAngle;
+ mTotalRotationAngle = (mWindowRotationAngle + mScreenRotationAngle) % 360;
+
+ if(mTotalRotationAngle == 90 || mTotalRotationAngle == 270)
+ {
+ mWindowWidth = mPositionSize.height;
+ mWindowHeight = mPositionSize.width;
+ }
+ else
+ {
+ mWindowWidth = mPositionSize.width;
+ mWindowHeight = mPositionSize.height;
+ }
+
+ // Emit Resize signal
+ Dali::GlWindow handle(this);
+ mResizeSignal.Emit(Dali::Uint16Pair(mWindowWidth, mWindowHeight));
+
+ if(mGlWindowRenderThread)
+ {
+ DALI_LOG_RELEASE_INFO("GlWindow::UpdateScreenRotation(), RequestScreenRotatem(), mScreenRotationAngle: %d\n", mScreenRotationAngle);
+ mGlWindowRenderThread->RequestScreenRotate(mScreenRotationAngle);
+ }
+}
+
} // namespace Adaptor
} // namespace Internal