summary |
shortlog |
log |
commit | commitdiff |
tree
raw |
patch |
inline | side by side (from parent 1:
2ebb744)
* Every time the surface is resized the camera,
the root layer the system overlay and the default
render task are updated.
Change-Id: I9aebc544796ded5059661e885085d8ee50d11146
Signed-off-by: Victor Cebollada <v.cebollada@samsung.com>
(cherry picked from commit
fac1ab05d5ebbec145e8b34956c267768454f0f0)
mRootLayer->Remove( actor );
}
mRootLayer->Remove( actor );
}
-void Stage::SurfaceResized(float width, float height)
+void Stage::SurfaceResized( float width, float height )
- mSurfaceSize.width = width;
- mSurfaceSize.height = height;
-
- // Internally we want to report the actual size of the stage.
- mSize.width = width;
- mSize.height = height - mTopMargin;
+ if( ( fabs( width - mSurfaceSize.width ) > Math::MACHINE_EPSILON_1000 ) || ( fabs( height - mSurfaceSize.height ) > Math::MACHINE_EPSILON_1000 ) )
+ {
+ mSurfaceSize.width = width;
+ mSurfaceSize.height = height;
- // Calculates the aspect ratio, near and far clipping planes, field of view and camera Z position.
- mDefaultCamera->SetPerspectiveProjection( mSurfaceSize );
+ // Internally we want to report the actual size of the stage.
+ mSize.width = width;
+ mSize.height = height - mTopMargin;
- // Adjust the camera height to allow for top-margin
- SetDefaultCameraPosition();
+ // Calculates the aspect ratio, near and far clipping planes, field of view and camera Z position.
+ mDefaultCamera->SetPerspectiveProjection( mSurfaceSize );
- mRootLayer->SetSize( mSize.width, mSize.height );
+ // Adjust the camera height to allow for top-margin
+ SetDefaultCameraPosition();
- // Repeat for SystemOverlay actors
- if( mSystemOverlay )
- {
- // Note that the SystemOverlay has a separate camera, configured for the full surface-size.
- // This will remain unaffected by changes in SetDefaultCameraPosition()
- mSystemOverlay->GetImpl()->SetSize( width, height );
- }
+ mRootLayer->SetSize( mSize.width, mSize.height );
- SetDefaultSurfaceRectMessage( mUpdateManager, Rect<int>( 0, 0, width, height ) );
+ // Repeat for SystemOverlay actors
+ if( mSystemOverlay )
+ {
+ // Note that the SystemOverlay has a separate camera, configured for the full surface-size.
+ // This will remain unaffected by changes in SetDefaultCameraPosition()
+ mSystemOverlay->GetImpl()->SetSize( width, height );
+ }
- // if single render task to screen then set its viewport parameters
- if( 1 == mRenderTaskList->GetTaskCount() )
- {
- Dali::RenderTask mDefaultRenderTask = mRenderTaskList->GetTask(0);
+ SetDefaultSurfaceRectMessage( mUpdateManager, Rect<int>( 0, 0, width, height ) );
- if(!mDefaultRenderTask.GetTargetFrameBuffer())
+ // if single render task to screen then set its viewport parameters
+ if( 1 == mRenderTaskList->GetTaskCount() )
- mDefaultRenderTask.SetViewport( Viewport(0, 0, width, height) );
+ Dali::RenderTask mDefaultRenderTask = mRenderTaskList->GetTask( 0u );
+
+ if(!mDefaultRenderTask.GetTargetFrameBuffer())
+ {
+ mDefaultRenderTask.SetViewport( Viewport(0, 0, width, height) );
+ }
}
Vector2 Stage::GetSize() const
}
Vector2 Stage::GetSize() const