X-Git-Url: http://review.tizen.org/git/?a=blobdiff_plain;f=dali%2Fintegration-api%2Fcore.cpp;h=f3bb7ad6b4d9209a1dc378d911b4629511df4fb6;hb=55827866fcb8c7ee47581ac4335a3390472090e8;hp=a6c13f68d57f23378a75598b80f0ecabe5975515;hpb=8f2c5571c924479b6a07a2c2187dedd9c685baf0;p=platform%2Fcore%2Fuifw%2Fdali-core.git diff --git a/dali/integration-api/core.cpp b/dali/integration-api/core.cpp old mode 100644 new mode 100755 index a6c13f6..f3bb7ad --- a/dali/integration-api/core.cpp +++ b/dali/integration-api/core.cpp @@ -1,30 +1,32 @@ -// -// Copyright (c) 2014 Samsung Electronics Co., Ltd. -// -// Licensed under the Flora License, Version 1.0 (the License); -// you may not use this file except in compliance with the License. -// You may obtain a copy of the License at -// -// http://floralicense.org/license/ -// -// Unless required by applicable law or agreed to in writing, software -// distributed under the License is distributed on an AS IS BASIS, -// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. -// See the License for the specific language governing permissions and -// limitations under the License. -// +/* + * 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. + * You may obtain a copy of the License at + * + * http://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an "AS IS" BASIS, + * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * See the License for the specific language governing permissions and + * limitations under the License. + * + */ // CLASS HEADER #include - -// EXTERNAL INCLUDES -#include -#include +#include // INTERNAL INCLUDES #include +#include +#include #include #include +#include +#include #include namespace Dali @@ -33,28 +35,28 @@ namespace Dali namespace Integration { -namespace KeepUpdating -{ - -const unsigned int NOT_REQUESTED = 0x00; ///< Zero means that no further updates are required - -// Bit-field values -const unsigned int STAGE_KEEP_RENDERING = 0x01; ///< Stage::KeepRendering() is being used -const unsigned int INCOMING_MESSAGES = 0x02; ///< Event-thread is sending messages to update-thread -const unsigned int ANIMATIONS_RUNNING = 0x04; ///< Animations are ongoing -const unsigned int DYNAMICS_CHANGED = 0x08; ///< A dynamics simulation is running -const unsigned int LOADING_RESOURCES = 0x10; ///< Resources are being loaded -const unsigned int NOTIFICATIONS_PENDING = 0x20; ///< Notifications are pending for the event-thread -const unsigned int MONITORING_PERFORMANCE = 0x40; ///< The --enable-performance-monitor option is being used -const unsigned int RENDER_TASK_SYNC = 0x80; ///< The refresh once render task is waiting for render sync - -} // namespace KeepUpdating - -Core* Core::New(RenderController& renderController, PlatformAbstraction& platformAbstraction, - GlAbstraction& glAbstraction, GlSyncAbstraction& glSyncAbstraction, GestureManager& gestureManager) +Core* Core::New( RenderController& renderController, + PlatformAbstraction& platformAbstraction, + GlAbstraction& glAbstraction, + GlSyncAbstraction& glSyncAbstraction, + GlContextHelperAbstraction& glContextHelperAbstraction, + ResourcePolicy::DataRetention policy, + RenderToFrameBuffer renderToFboEnabled, + DepthBufferAvailable depthBufferAvailable, + StencilBufferAvailable stencilBufferAvailable, + PartialUpdateAvailable partialUpdateAvailable ) { Core* instance = new Core; - instance->mImpl = new Internal::Core( renderController, platformAbstraction, glAbstraction, glSyncAbstraction, gestureManager ); + instance->mImpl = new Internal::Core( renderController, + platformAbstraction, + glAbstraction, + glSyncAbstraction, + glContextHelperAbstraction, + policy, + renderToFboEnabled, + depthBufferAvailable, + stencilBufferAvailable, + partialUpdateAvailable ); return instance; } @@ -64,39 +66,39 @@ Core::~Core() delete mImpl; } -void Core::ContextCreated() +void Core::Initialize() { - mImpl->ContextCreated(); + mImpl->Initialize(); } -void Core::ContextToBeDestroyed() +ContextNotifierInterface* Core::GetContextNotifier() { - mImpl->ContextToBeDestroyed(); + return mImpl->GetContextNotifier(); } -void Core::SurfaceResized(unsigned int width, unsigned int height) +void Core::ContextCreated() { - mImpl->SurfaceResized(width, height); + mImpl->ContextCreated(); } -void Core::SetDpi(unsigned int dpiHorizontal, unsigned int dpiVertical) +void Core::ContextDestroyed() { - mImpl->SetDpi(dpiHorizontal, dpiVertical); + mImpl->ContextDestroyed(); } -void Core::SetMinimumFrameTimeInterval(unsigned int interval) +void Core::RecoverFromContextLoss() { - mImpl->SetMinimumFrameTimeInterval(interval); + mImpl->RecoverFromContextLoss(); } -void Core::Suspend() +void Core::SurfaceDeleted( Integration::RenderSurface* surface ) { - mImpl->Suspend(); + mImpl->SurfaceDeleted(surface); } -void Core::Resume() +void Core::SceneCreated() { - mImpl->Resume(); + mImpl->SceneCreated(); } void Core::QueueEvent(const Event& event) @@ -109,64 +111,29 @@ void Core::ProcessEvents() mImpl->ProcessEvents(); } -void Core::UpdateTouchData(const TouchData& touch) -{ - mImpl->UpdateTouchData(touch); -} - -unsigned int Core::GetMaximumUpdateCount() const +uint32_t Core::GetMaximumUpdateCount() const { return mImpl->GetMaximumUpdateCount(); } -void Core::Update( UpdateStatus& status ) -{ - mImpl->Update( status ); -} - -void Core::Render( RenderStatus& status ) -{ - mImpl->Render( status ); -} - -void Core::Sleep() -{ - mImpl->Sleep(); -} - -void Core::WakeUp() -{ - mImpl->WakeUp(); -} - -void Core::VSync( unsigned int frameNumber, unsigned int seconds, unsigned int microseconds ) -{ - mImpl->VSync( frameNumber, seconds, microseconds ); -} - -SystemOverlay& Core::GetSystemOverlay() -{ - return mImpl->GetSystemOverlay(); -} - -void Core::SetViewMode( ViewMode viewMode ) +void Core::Update( float elapsedSeconds, uint32_t lastVSyncTimeMilliseconds, uint32_t nextVSyncTimeMilliseconds, UpdateStatus& status, bool renderToFboEnabled, bool isRenderingToFbo ) { - mImpl->SetViewMode( viewMode ); + mImpl->Update( elapsedSeconds, lastVSyncTimeMilliseconds, nextVSyncTimeMilliseconds, status, renderToFboEnabled, isRenderingToFbo ); } -ViewMode Core::GetViewMode() const +void Core::Render( RenderStatus& status, bool forceClear ) { - return mImpl->GetViewMode(); + mImpl->Render( status, forceClear ); } -void Core::SetStereoBase( float stereoBase ) +void Core::RegisterProcessor( Processor& processor ) { - mImpl->SetStereoBase( stereoBase ); + mImpl->RegisterProcessor( processor ); } -float Core::GetStereoBase() const +void Core::UnregisterProcessor( Processor& processor ) { - return mImpl->GetStereoBase(); + mImpl->UnregisterProcessor( processor ); } Core::Core()