2 * Copyright (c) 2020 Samsung Electronics Co., Ltd.
4 * Licensed under the Apache License, Version 2.0 (the "License");
5 * you may not use this file except in compliance with the License.
6 * You may obtain a copy of the License at
8 * http://www.apache.org/licenses/LICENSE-2.0
10 * Unless required by applicable law or agreed to in writing, software
11 * distributed under the License is distributed on an "AS IS" BASIS,
12 * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
13 * See the License for the specific language governing permissions and
14 * limitations under the License.
18 #include <dali/internal/update/common/scene-graph-scene.h>
21 #include <dali/internal/update/render-tasks/scene-graph-render-task-list.h>
22 #include <dali/internal/render/gl-resources/context.h>
32 : mContext( nullptr ),
33 mFrameRenderedCallbacks(),
34 mFramePresentedCallbacks(),
35 mSurfaceOrientation( 0 )
41 mFrameRenderedCallbacks.clear();
42 mFramePresentedCallbacks.clear();
45 void Scene::Initialize( Context& context )
50 Context* Scene::GetContext()
55 RenderInstructionContainer& Scene::GetRenderInstructions()
60 void Scene::AddFrameRenderedCallback( CallbackBase* callback, int32_t frameId )
62 mFrameRenderedCallbacks.push_back( std::make_pair( std::unique_ptr< CallbackBase >( callback ), frameId ) );
65 void Scene::AddFramePresentedCallback( CallbackBase* callback, int32_t frameId )
67 mFramePresentedCallbacks.push_back( std::make_pair( std::unique_ptr< CallbackBase >( callback ), frameId ) );
70 void Scene::GetFrameRenderedCallback( Dali::Integration::Scene::FrameCallbackContainer& callbacks )
72 // Transfer owership of the callbacks
73 for( auto&& iter : mFrameRenderedCallbacks )
75 callbacks.push_back( std::make_pair( std::move( iter.first ), iter.second ) );
78 mFrameRenderedCallbacks.clear();
81 void Scene::GetFramePresentedCallback( Dali::Integration::Scene::FrameCallbackContainer& callbacks )
83 // Transfer owership of the callbacks
84 for( auto&& iter : mFramePresentedCallbacks )
86 callbacks.push_back( std::make_pair( std::move( iter.first ), iter.second ) );
89 mFramePresentedCallbacks.clear();
92 void Scene::SetSurfaceOrientation( int orientation )
94 mSurfaceOrientation = orientation;
97 int Scene::GetSurfaceOrientation() const
99 return mSurfaceOrientation;