projects
/
platform
/
core
/
uifw
/
dali-core.git
/ blobdiff
commit
grep
author
committer
pickaxe
?
search:
re
summary
|
shortlog
|
log
|
commit
|
commitdiff
|
tree
raw
|
inline
| side by side
Revert "[Tizen] Implement partial update"
[platform/core/uifw/dali-core.git]
/
dali
/
internal
/
common
/
core-impl.cpp
diff --git
a/dali/internal/common/core-impl.cpp
b/dali/internal/common/core-impl.cpp
index
1a09947
..
43f2a2a
100644
(file)
--- a/
dali/internal/common/core-impl.cpp
+++ b/
dali/internal/common/core-impl.cpp
@@
-1,5
+1,5
@@
/*
/*
- * Copyright (c) 20
19
Samsung Electronics Co., Ltd.
+ * Copyright (c) 20
20
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.
*
* Licensed under the Apache License, Version 2.0 (the "License");
* you may not use this file except in compliance with the License.
@@
-23,6
+23,7
@@
#include <dali/integration-api/debug.h>
#include <dali/integration-api/events/event.h>
#include <dali/integration-api/gl-sync-abstraction.h>
#include <dali/integration-api/debug.h>
#include <dali/integration-api/events/event.h>
#include <dali/integration-api/gl-sync-abstraction.h>
+#include <dali/integration-api/gl-context-helper-abstraction.h>
#include <dali/integration-api/platform-abstraction.h>
#include <dali/integration-api/processor-interface.h>
#include <dali/integration-api/render-controller.h>
#include <dali/integration-api/platform-abstraction.h>
#include <dali/integration-api/processor-interface.h>
#include <dali/integration-api/render-controller.h>
@@
-75,6
+76,7
@@
using Integration::RenderController;
using Integration::PlatformAbstraction;
using Integration::GlSyncAbstraction;
using Integration::GlAbstraction;
using Integration::PlatformAbstraction;
using Integration::GlSyncAbstraction;
using Integration::GlAbstraction;
+using Integration::GlContextHelperAbstraction;
using Integration::Event;
using Integration::UpdateStatus;
using Integration::RenderStatus;
using Integration::Event;
using Integration::UpdateStatus;
using Integration::RenderStatus;
@@
-83,7
+85,7
@@
Core::Core( RenderController& renderController,
PlatformAbstraction& platform,
GlAbstraction& glAbstraction,
GlSyncAbstraction& glSyncAbstraction,
PlatformAbstraction& platform,
GlAbstraction& glAbstraction,
GlSyncAbstraction& glSyncAbstraction,
-
ResourcePolicy::DataRetention dataRetentionPolicy
,
+
GlContextHelperAbstraction& glContextHelperAbstraction
,
Integration::RenderToFrameBuffer renderToFboEnabled,
Integration::DepthBufferAvailable depthBufferAvailable,
Integration::StencilBufferAvailable stencilBufferAvailable )
Integration::RenderToFrameBuffer renderToFboEnabled,
Integration::DepthBufferAvailable depthBufferAvailable,
Integration::StencilBufferAvailable stencilBufferAvailable )
@@
-106,7
+108,7
@@
Core::Core( RenderController& renderController,
mRenderTaskProcessor = new SceneGraph::RenderTaskProcessor();
mRenderTaskProcessor = new SceneGraph::RenderTaskProcessor();
- mRenderManager = RenderManager::New( glAbstraction, glSyncAbstraction, depthBufferAvailable, stencilBufferAvailable );
+ mRenderManager = RenderManager::New( glAbstraction, glSyncAbstraction,
glContextHelperAbstraction,
depthBufferAvailable, stencilBufferAvailable );
RenderQueue& renderQueue = mRenderManager->GetRenderQueue();
RenderQueue& renderQueue = mRenderManager->GetRenderQueue();
@@
-151,7
+153,7
@@
Core::~Core()
if( tls )
{
tls->Remove();
if( tls )
{
tls->Remove();
-
delete tls
;
+
tls->Unreference()
;
}
mObjectRegistry.Reset();
}
mObjectRegistry.Reset();
@@
-191,13
+193,14
@@
void Core::ContextDestroyed()
mRenderManager->ContextDestroyed();
}
mRenderManager->ContextDestroyed();
}
-void Core::Surface
Resiz
ed( Integration::RenderSurface* surface )
+void Core::Surface
Delet
ed( Integration::RenderSurface* surface )
{
{
- for( auto
iter = mScenes.begin(); iter != mScenes.end(); ++iter
)
+ for( auto
scene : mScenes
)
{
{
- if(
(*iter)
->GetSurface() == surface )
+ if(
scene
->GetSurface() == surface )
{
{
- (*iter)->SetSurface( *surface );
+ scene->SurfaceDeleted();
+ break;
}
}
}
}
}
}
@@
-226,9
+229,9
@@
void Core::Update( float elapsedSeconds, uint32_t lastVSyncTimeMilliseconds, uin
// Any message to update will wake it up anyways
}
// Any message to update will wake it up anyways
}
-void Core::Render( RenderStatus& status, bool forceClear )
+void Core::Render( RenderStatus& status, bool forceClear
, bool uploadOnly
)
{
{
- mRenderManager->Render( status, forceClear );
+ mRenderManager->Render( status, forceClear
, uploadOnly
);
}
void Core::SceneCreated()
}
void Core::SceneCreated()
@@
-268,18
+271,22
@@
void Core::ProcessEvents()
// Signal that any messages received will be flushed soon
mUpdateManager->EventProcessingStarted();
// Signal that any messages received will be flushed soon
mUpdateManager->EventProcessingStarted();
+ // Scene could be added or removed while processing the events
+ // Copy the Scene container locally to avoid possibly invalid iterator
+ SceneContainer scenes = mScenes;
+
// process events in all scenes
// process events in all scenes
- for( auto
iter = mScenes.begin(); iter != mScenes.end(); ++iter
)
+ for( auto
scene : scenes
)
{
{
-
(*iter)
->ProcessEvents();
+
scene
->ProcessEvents();
}
mNotificationManager->ProcessMessages();
// Emit signal here to inform listeners that event processing has finished.
}
mNotificationManager->ProcessMessages();
// Emit signal here to inform listeners that event processing has finished.
- for( auto
iter = mScenes.begin(); iter != mScenes.end(); ++iter
)
+ for( auto
scene : scenes
)
{
{
-
(*iter)
->EmitEventProcessingFinishedSignal();
+
scene
->EmitEventProcessingFinishedSignal();
}
// Run any registered processors
}
// Run any registered processors
@@
-289,9
+296,9
@@
void Core::ProcessEvents()
mRelayoutController->Relayout();
// Rebuild depth tree after event processing has finished
mRelayoutController->Relayout();
// Rebuild depth tree after event processing has finished
- for( auto
iter = mScenes.begin(); iter != mScenes.end(); ++iter
)
+ for( auto
scene : scenes
)
{
{
-
(*iter)
->RebuildDepthTree();
+
scene
->RebuildDepthTree();
}
// Flush any queued messages for the update-thread
}
// Flush any queued messages for the update-thread
@@
-425,7
+432,8
@@
void Core::CreateThreadLocalStorage()
{
// a pointer to the ThreadLocalStorage object will be stored in TLS
// The ThreadLocalStorage object should be deleted by the Core destructor
{
// a pointer to the ThreadLocalStorage object will be stored in TLS
// The ThreadLocalStorage object should be deleted by the Core destructor
- new ThreadLocalStorage(this);
+ ThreadLocalStorage* tls = new ThreadLocalStorage(this);
+ tls->Reference();
}
void Core::RegisterObject( Dali::BaseObject* object )
}
void Core::RegisterObject( Dali::BaseObject* object )