X-Git-Url: http://review.tizen.org/git/?a=blobdiff_plain;f=dali%2Finternal%2Fevent%2Fcommon%2Fscene-impl.cpp;h=0b8607dd571b1f0a8e086ee43d021136aabbee14;hb=b067b6f30c7b8cfdaea9c39f7d2375ccb4e7fa81;hp=2cc2cdcd404a3b384903bf4742c0bb418b06ad00;hpb=48078a32dedfa8d7ab942b7da26e03569eeb72fd;p=platform%2Fcore%2Fuifw%2Fdali-core.git diff --git a/dali/internal/event/common/scene-impl.cpp b/dali/internal/event/common/scene-impl.cpp index 2cc2cdc..0b8607d 100644 --- a/dali/internal/event/common/scene-impl.cpp +++ b/dali/internal/event/common/scene-impl.cpp @@ -64,6 +64,7 @@ Scene::Scene() mSize(), // Don't set the proper value here, this will be set when the surface is set later mDpi(), mBackgroundColor( DEFAULT_BACKGROUND_COLOR ), + mSurfaceOrientation( 0 ), mDepthTreeDirty( false ), mEventProcessor( *this, ThreadLocalStorage::GetInternal()->GetGestureEventProcessor() ) { @@ -136,7 +137,7 @@ void Scene::Initialize( Size size ) // Create the default render-task mRenderTaskList->CreateTask( mRootLayer.Get(), mDefaultCamera.Get() ); - SurfaceResized( size.width, size.height ); + SurfaceResized( size.width, size.height, mSurfaceOrientation, false ); // Create scene graph object mSceneObject = new SceneGraph::Scene(); @@ -204,23 +205,27 @@ Actor& Scene::GetDefaultRootActor() return *mRootLayer; } -void Scene::SurfaceResized( float width, float height ) +void Scene::SurfaceResized( float width, float height, int orientation, bool forceUpdate ) { - if( ( fabsf( mSize.width - width ) > Math::MACHINE_EPSILON_1 ) || ( fabsf( mSize.height - height ) > Math::MACHINE_EPSILON_1 ) ) + if( ( fabsf( mSize.width - width ) > Math::MACHINE_EPSILON_1 ) || ( fabsf( mSize.height - height ) > Math::MACHINE_EPSILON_1 ) + || ( orientation != mSurfaceOrientation ) || ( forceUpdate ) ) { Rect< int32_t > newSize( 0, 0, static_cast< int32_t >( width ), static_cast< int32_t >( height ) ); // truncated mSize.width = width; mSize.height = height; + mSurfaceOrientation = orientation; // Calculates the aspect ratio, near and far clipping planes, field of view and camera Z position. mDefaultCamera->SetPerspectiveProjection( mSize ); + mDefaultCamera->RotateProjection( mSurfaceOrientation ); mRootLayer->SetSize( mSize.width, mSize.height ); ThreadLocalStorage* tls = ThreadLocalStorage::GetInternal(); SceneGraph::UpdateManager& updateManager = tls->GetUpdateManager(); SetDefaultSurfaceRectMessage( updateManager, newSize ); + SetDefaultSurfaceOrientationMessage( updateManager, mSurfaceOrientation ); // set default render-task viewport parameters RenderTaskPtr defaultRenderTask = mRenderTaskList->GetTask( 0u );