X-Git-Url: http://review.tizen.org/git/?a=blobdiff_plain;f=dali%2Finternal%2Fevent%2Fcommon%2Fscene-impl.cpp;h=82f519604aca66dc5eb6f132c64677478d7c785d;hb=b43741a90b40ca9dfbd33d6a9d390d3c09230e89;hp=6055dc685c8639ff0d33c24bfc9630afeb19e20e;hpb=8d9fe3c6d4790b864bcbb32714cd70d3de03e44a;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 old mode 100644 new mode 100755 index 6055dc6..82f5196 --- a/dali/internal/event/common/scene-impl.cpp +++ b/dali/internal/event/common/scene-impl.cpp @@ -63,6 +63,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() ) { @@ -148,6 +149,10 @@ void Scene::Add(Actor& actor) void Scene::Remove(Actor& actor) { mRootLayer->Remove( actor ); + if( mSurface ) + { + mRenderTaskList->GetTask( 0u )->GetFrameBuffer()->SetPartialUpdateEnabled( false ); + } } Size Scene::GetSize() const @@ -211,45 +216,43 @@ void Scene::SetSurface( Integration::RenderSurface& surface ) mFrameBuffer = Dali::Internal::FrameBuffer::New( surface, Dali::FrameBuffer::Attachment::NONE ); defaultRenderTask->SetFrameBuffer( mFrameBuffer ); - SurfaceResized(); + SurfaceResized( false ); } } -void Scene::SurfaceResized() +void Scene::SurfaceResized( bool forceUpdate ) { if( mSurface ) { const PositionSize surfacePositionSize = mSurface->GetPositionSize(); const float fWidth = static_cast< float >( surfacePositionSize.width ); const float fHeight = static_cast< float >( surfacePositionSize.height ); + const int orientation = mSurface->GetOrientation(); - if( ( fabsf( mSize.width - fWidth ) > Math::MACHINE_EPSILON_1 ) || ( fabsf( mSize.height - fHeight ) > Math::MACHINE_EPSILON_1 ) ) + if( ( ( fabsf( mSize.width - fWidth ) > Math::MACHINE_EPSILON_1 ) || ( fabsf( mSize.height - fHeight ) > Math::MACHINE_EPSILON_1 ) ) + || ( orientation != mSurfaceOrientation ) + || ( forceUpdate ) ) { - Rect< int32_t > newSize( 0, 0, static_cast< int32_t >( surfacePositionSize.width ), static_cast< int32_t >( surfacePositionSize.height ) ); + Rect< int32_t > newSize( 0, 0, static_cast< int32_t >( surfacePositionSize.width ), static_cast< int32_t >( surfacePositionSize.height ) ); // truncated mSize.width = fWidth; mSize.height = fHeight; + 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 ); // truncated + SetDefaultSurfaceRectMessage( updateManager, newSize ); + SetDefaultSurfaceOrientationMessage( updateManager, mSurfaceOrientation ); + // set default render-task viewport parameters RenderTaskPtr defaultRenderTask = mRenderTaskList->GetTask( 0u ); - - // if single render task to screen then set its viewport parameters - if( 1 == mRenderTaskList->GetTaskCount() ) - { - if( !defaultRenderTask->GetTargetFrameBuffer() ) - { - defaultRenderTask->SetViewport( newSize ); // truncated - } - } - + defaultRenderTask->SetViewport( newSize ); defaultRenderTask->GetFrameBuffer()->SetSize( static_cast( newSize.width ), static_cast( newSize.height ) ); } } @@ -329,6 +332,12 @@ void Scene::EmitKeyEventSignal(const KeyEvent& event) } } +bool Scene::EmitKeyEventGeneratedSignal(const KeyEvent& event) +{ + // Emit the KeyEventGenerated signal when KeyEvent is generated + return mKeyEventGeneratedSignal.Emit( event ); +} + void Scene::EmitEventProcessingFinishedSignal() { if ( !mEventProcessingFinishedSignal.Empty() ) @@ -365,6 +374,11 @@ Integration::Scene::KeyEventSignalType& Scene::KeyEventSignal() return mKeyEventSignal; } +Integration::Scene::KeyEventGeneratedSignalType& Scene::KeyEventGeneratedSignal() +{ + return mKeyEventGeneratedSignal; +} + Integration::Scene::EventProcessingFinishedSignalType& Scene::EventProcessingFinishedSignal() { return mEventProcessingFinishedSignal;