X-Git-Url: http://review.tizen.org/git/?a=blobdiff_plain;f=dali%2Finternal%2Fevent%2Factors%2Fcamera-actor-impl.cpp;h=715781e2b621322896ecacc5b59d64003d8035c8;hb=779d85a983817171b05c865f5a609340347beab0;hp=3d2138389d9f0a5e915e1d87beb1078f0ec4bd39;hpb=fa05bc1478e8734fa836b3816ff3eb557df10e5a;p=platform%2Fcore%2Fuifw%2Fdali-core.git diff --git a/dali/internal/event/actors/camera-actor-impl.cpp b/dali/internal/event/actors/camera-actor-impl.cpp index 3d21383..715781e 100644 --- a/dali/internal/event/actors/camera-actor-impl.cpp +++ b/dali/internal/event/actors/camera-actor-impl.cpp @@ -1,5 +1,5 @@ /* - * Copyright (c) 2018 Samsung Electronics Co., Ltd. + * Copyright (c) 2019 Samsung Electronics Co., Ltd. * * Licensed under the Apache License, Version 2.0 (the "License"); * you may not use this file except in compliance with the License. @@ -28,9 +28,11 @@ #include #include #include +#include #include #include #include +#include #include namespace Dali @@ -368,30 +370,18 @@ bool CameraActor::GetInvertYAxis() const return mInvertYAxis; } -void CameraActor::SetPerspectiveProjection( const Size& size, const Vector2& stereoBias /* = Vector2::ZERO */ ) +void CameraActor::SetPerspectiveProjection( const Size& size ) { - float width = size.width; - float height = size.height; - - if( Size::ZERO == size ) - { - StagePtr stage = Stage::GetCurrent(); - if( stage ) - { - const Size& stageSize = stage->GetSize(); - - width = stageSize.width; - height = stageSize.height; - } - } - - if( ( width < Math::MACHINE_EPSILON_1000 ) || ( height < Math::MACHINE_EPSILON_1000 ) ) + if( ( size.width < Math::MACHINE_EPSILON_1000 ) || ( size.height < Math::MACHINE_EPSILON_1000 ) ) { - // On the stage initialization this method is called but the size has not been set. - // There is no point to set any value if width or height is zero. + // Not allowed to set the canvas size to be 0. + DALI_LOG_ERROR( "Canvas size can not be 0\n" ); return; } + float width = size.width; + float height = size.height; + float nearClippingPlane; float farClippingPlane; float cameraZ; @@ -512,6 +502,12 @@ const SceneGraph::Camera* CameraActor::GetCamera() const return mSceneObject; } +void CameraActor::RotateProjection( int rotationAngle ) +{ + // sceneObject is being used in a separate thread; queue a message to set + RotateProjectionMessage( GetEventThreadServices(), *mSceneObject, rotationAngle ); +} + void CameraActor::SetDefaultProperty( Property::Index index, const Property::Value& propertyValue ) { if(index < DEFAULT_ACTOR_PROPERTY_MAX_COUNT)