[3.0] Modify native render surface for sync. with replace surface
[platform/core/uifw/dali-adaptor.git] / adaptors / common / adaptor-impl.cpp
index 57d01a0..a24c54c 100644 (file)
@@ -1,5 +1,5 @@
 /*
- * Copyright (c) 2015 Samsung Electronics Co., Ltd.
+ * Copyright (c) 2016 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.
@@ -29,7 +29,7 @@
 
 // INTERNAL INCLUDES
 #include <base/thread-controller.h>
-#include <base/performance-logging/performance-interface-factory.h>
+#  include <base/performance-logging/performance-interface-factory.h>
 #include <base/lifecycle-observer.h>
 
 #include <dali/devel-api/text-abstraction/font-client.h>
@@ -300,9 +300,6 @@ void Adaptor::Resume()
   // Only resume the adaptor if we are in the suspended state.
   if( PAUSED == mState )
   {
-    // Resume core first
-    mCore->Resume();
-
     mState = RUNNING;
 
     // Reset the event handler when adaptor resumed
@@ -317,9 +314,10 @@ void Adaptor::Resume()
       (*iter)->OnResume();
     }
 
-    ProcessCoreEvents(); // Ensure any outstanding messages are processed
+    // Resume core so it processes any requests as well
+    mCore->Resume();
 
-    // Ensure our first update includes the processed messages
+    // Do at end to ensure our first update/render after resumption includes the processed messages as well
     mThreadController->Resume();
   }
 }
@@ -425,8 +423,6 @@ void Adaptor::ReplaceSurface( Any nativeWindow, RenderSurface& surface )
   mNativeWindow = nativeWindow;
   mSurface = &surface;
 
-  SurfaceSizeChanged(mSurface->GetPositionSize());
-
   // flush the event queue to give update and render threads chance
   // to start processing messages for new camera setup etc as soon as possible
   ProcessCoreEvents();
@@ -469,6 +465,10 @@ bool Adaptor::AddIdle( CallbackBase* callback )
   return idleAdded;
 }
 
+void Adaptor::RemoveIdle( CallbackBase* callback )
+{
+  mCallbackManager->RemoveIdleCallback( callback );
+}
 
 Dali::Adaptor& Adaptor::Get()
 {
@@ -717,7 +717,7 @@ void Adaptor::OnDamaged( const DamageArea& area )
   RequestUpdate();
 }
 
-void Adaptor::SurfaceSizeChanged(const PositionSize& positionSize)
+void Adaptor::SurfaceSizeChanged( const PositionSize& positionSize )
 {
   // let the core know the surface size has changed
   mCore->SurfaceResized(positionSize.width, positionSize.height);
@@ -760,12 +760,13 @@ void Adaptor::ProcessCoreEventsFromIdle()
 Adaptor::Adaptor(Any nativeWindow, Dali::Adaptor& adaptor, RenderSurface* surface, EnvironmentOptions* environmentOptions)
 : mResizedSignal(),
   mLanguageChangedSignal(),
-  mAdaptor(adaptor),
-  mState(READY),
-  mCore(NULL),
-  mThreadController(NULL),
-  mVSyncMonitor(NULL),
+  mAdaptor( adaptor ),
+  mState( READY ),
+  mCore( NULL ),
+  mThreadController( NULL ),
+  mVSyncMonitor( NULL ),
   mGLES( NULL ),
+  mGlSync( NULL ),
   mEglFactory( NULL ),
   mNativeWindow( nativeWindow ),
   mSurface( surface ),
@@ -773,14 +774,21 @@ Adaptor::Adaptor(Any nativeWindow, Dali::Adaptor& adaptor, RenderSurface* surfac
   mEventHandler( NULL ),
   mCallbackManager( NULL ),
   mNotificationOnIdleInstalled( false ),
-  mNotificationTrigger(NULL),
-  mGestureManager(NULL),
+  mNotificationTrigger( NULL ),
+  mGestureManager( NULL ),
+  mDaliFeedbackPlugin(),
+  mFeedbackController( NULL ),
+  mTtsPlayers(),
   mObservers(),
   mDragAndDropDetector(),
-  mDeferredRotationObserver(NULL),
+  mDeferredRotationObserver( NULL ),
   mEnvironmentOptions( environmentOptions ? environmentOptions : new EnvironmentOptions /* Create the options if not provided */),
-  mPerformanceInterface(NULL),
-  mObjectProfiler(NULL),
+  mPerformanceInterface( NULL ),
+  mKernelTracer(),
+  mSystemTracer(),
+  mTriggerEventFactory(),
+  mObjectProfiler( NULL ),
+  mSocketFactory(),
   mEnvironmentOptionsOwned( environmentOptions ? false : true /* If not provided then we own the object */ )
 {
   DALI_ASSERT_ALWAYS( !IsAvailable() && "Cannot create more than one Adaptor per thread" );