+ if(!mKeyEventSignal.Empty())
+ {
+ Dali::Integration::Scene handle(this);
+ mKeyEventSignal.Emit(event);
+ }
+}
+
+void Scene::SurfaceRotated(float width, float height, int32_t windowOrientation, int32_t screenOrientation)
+{
+ ChangedSurface(width, height, windowOrientation, screenOrientation);
+}
+
+int32_t Scene::GetCurrentSurfaceOrientation() const
+{
+ return mSceneObject->GetSurfaceOrientation();
+}
+
+int32_t Scene::GetCurrentScreenOrientation() const
+{
+ return mSceneObject->GetScreenOrientation();
+}
+
+const Rect<int32_t>& Scene::GetCurrentSurfaceRect() const
+{
+ return mSceneObject->GetSurfaceRect();
+}
+
+void Scene::ChangedSurface(float width, float height, int32_t windowOrientation, int32_t screenOrientation)
+{
+ bool changedOrientation = false;
+ Rect<int32_t> newSize(0, 0, static_cast<int32_t>(width), static_cast<int32_t>(height)); // truncated
+ mSize.width = width;
+ mSize.height = height;
+
+ if(mSurfaceOrientation != windowOrientation || mScreenOrientation != screenOrientation)
+ {
+ changedOrientation = true;
+ }
+
+ mSurfaceOrientation = windowOrientation;
+ mScreenOrientation = screenOrientation;
+
+ // Calculates the aspect ratio, near and far clipping planes, field of view and camera Z position.
+ mDefaultCamera->SetPerspectiveProjection(mSize);
+ // Set the surface orientation to Default camera for window/screen rotation
+ if(changedOrientation)
+ {
+ int32_t orientation = (windowOrientation + screenOrientation) % 360;
+ mDefaultCamera->RotateProjection(orientation);
+ }
+
+ mRootLayer->SetSize(width, height);
+
+ // Send the surface rectangle/orientation to SceneGraph::Scene for calculating glViewport/Scissor
+ ThreadLocalStorage* tls = ThreadLocalStorage::GetInternal();
+ DALI_LOG_RELEASE_INFO("Send Surface Rect Message, width[%d], height[%d]\n", newSize.width, newSize.height);
+ SetSurfaceRectMessage(tls->GetEventThreadServices(), *mSceneObject, newSize);
+ if(changedOrientation)