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() )
{
void Scene::Remove(Actor& actor)
{
mRootLayer->Remove( actor );
+ if( mSurface )
+ {
+ mRenderTaskList->GetTask( 0u )->GetFrameBuffer()->SetPartialUpdateEnabled( false );
+ }
}
Size Scene::GetSize() const
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 ) ); // 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 );
+ SetDefaultSurfaceOrientationMessage( updateManager, mSurfaceOrientation );
// set default render-task viewport parameters
RenderTaskPtr defaultRenderTask = mRenderTaskList->GetTask( 0u );
}
}
+bool Scene::EmitKeyEventGeneratedSignal(const KeyEvent& event)
+{
+ // Emit the KeyEventGenerated signal when KeyEvent is generated
+ return mKeyEventGeneratedSignal.Emit( event );
+}
+
void Scene::EmitEventProcessingFinishedSignal()
{
if ( !mEventProcessingFinishedSignal.Empty() )
return mKeyEventSignal;
}
+Integration::Scene::KeyEventGeneratedSignalType& Scene::KeyEventGeneratedSignal()
+{
+ return mKeyEventGeneratedSignal;
+}
+
Integration::Scene::EventProcessingFinishedSignalType& Scene::EventProcessingFinishedSignal()
{
return mEventProcessingFinishedSignal;