2 * Copyright (c) 2017 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.
19 #include "thread-controller.h"
22 #include <base/environment-options.h>
23 #include <base/thread-controller-interface.h>
24 #include <base/combined-update-render/combined-update-render-controller.h>
35 ThreadController::ThreadController( AdaptorInternalServices& adaptorInterfaces, const EnvironmentOptions& environmentOptions )
36 : mThreadControllerInterface( NULL )
38 switch( environmentOptions.GetThreadingMode() )
40 case ThreadingMode::COMBINED_UPDATE_RENDER:
42 mThreadControllerInterface = new CombinedUpdateRenderController( adaptorInterfaces, environmentOptions );
48 ThreadController::~ThreadController()
50 delete mThreadControllerInterface;
53 void ThreadController::Initialize()
55 mThreadControllerInterface->Initialize();
58 void ThreadController::Start()
60 mThreadControllerInterface->Start();
63 void ThreadController::Pause()
65 mThreadControllerInterface->Pause();
68 void ThreadController::Resume()
70 mThreadControllerInterface->Resume();
73 void ThreadController::Stop()
75 mThreadControllerInterface->Stop();
78 void ThreadController::RequestUpdate()
80 mThreadControllerInterface->RequestUpdate();
83 void ThreadController::RequestUpdateOnce()
85 mThreadControllerInterface->RequestUpdateOnce();
88 void ThreadController::ReplaceSurface( RenderSurface* newSurface )
90 mThreadControllerInterface->ReplaceSurface( newSurface );
93 void ThreadController::ResizeSurface()
95 mThreadControllerInterface->ResizeSurface();
98 void ThreadController::SetRenderRefreshRate(unsigned int numberOfVSyncsPerRender )
100 mThreadControllerInterface->SetRenderRefreshRate( numberOfVSyncsPerRender );
103 } // namespace Adaptor
105 } // namespace Internal