return mNativeWindow;
}
+void Adaptor::SetUseRemoteSurface(bool useRemoteSurface)
+{
+ mUseRemoteSurface = useRemoteSurface;
+}
+
void Adaptor::AddObserver( LifeCycleObserver& observer )
{
ObserverContainer::iterator match ( find(mObservers.begin(), mObservers.end(), &observer) );
// Start thread controller after the scene has been created
mThreadController->Start();
+
+ // process after surface is created (registering to remote surface provider if required)
+ SurfaceInitialized();
}
void Adaptor::NotifyLanguageChanged()
mTriggerEventFactory(),
mObjectProfiler( NULL ),
mSocketFactory(),
- mEnvironmentOptionsOwned( environmentOptions ? false : true /* If not provided then we own the object */ )
+ mEnvironmentOptionsOwned( environmentOptions ? false : true /* If not provided then we own the object */ ),
+ mUseRemoteSurface( false )
{
DALI_ASSERT_ALWAYS( !IsAvailable() && "Cannot create more than one Adaptor per thread" );
gThreadLocalAdaptor = this;
*/
Any GetNativeWindowHandle();
+ /**
+ * Sets use remote surface for eglSurface output
+ * @param[in] useRemoteSurface True if the remote surface is used
+ */
+ void SetUseRemoteSurface(bool useRemoteSurface);
+
public:
/**
void SetSurface(RenderSurface *surface);
/**
+ * called after surface is created
+ */
+ void SurfaceInitialized();
+
+ /**
* Sends an notification message from main loop idle handler
*/
void ProcessCoreEventsFromIdle();
ObjectProfiler* mObjectProfiler; ///< Tracks object lifetime for profiling
SocketFactory mSocketFactory; ///< Socket factory
const bool mEnvironmentOptionsOwned:1; ///< Whether we own the EnvironmentOptions (and thus, need to delete it)
+ bool mUseRemoteSurface; ///< whether the remoteSurface is used or not
public:
inline static Adaptor& GetImplementation(Dali::Adaptor& adaptor) {return *adaptor.mImpl;}
};
mCommandLineOptions = new CommandLineOptions(argc, argv);
mFramework = new Framework( *this, argc, argv, applicationType );
+ mUseRemoteSurface = (applicationType == Framework::WATCH);
}
Application::~Application()
mAdaptor = Dali::Internal::Adaptor::Adaptor::New( mWindow, mContextLossConfiguration, &mEnvironmentOptions );
mAdaptor->ResizedSignal().Connect( mSlotDelegate, &Application::OnResize );
+
+ Internal::Adaptor::Adaptor::GetImplementation( *mAdaptor ).SetUseRemoteSurface( mUseRemoteSurface );
}
void Application::MainLoop(Dali::Configuration::ContextLoss configuration)
std::string mName;
std::string mStylesheet;
EnvironmentOptions mEnvironmentOptions;
+ bool mUseRemoteSurface;
SlotDelegate< Application > mSlotDelegate;
};
#include <adaptor-impl.h>
// EXTERNAL INCLUDES
-#ifdef USE_APPFW
#include <app.h>
+#ifdef APPCORE_WATCH_AVAILABLE
+#include <aul_rsm_provider.h>
+#include <ecore-wl-render-surface.h>
#endif
namespace Dali
#endif
}
+void Adaptor::SurfaceInitialized()
+{
+#ifdef APPCORE_WATCH_AVAILABLE
+ if ( !mUseRemoteSurface )
+ {
+ return;
+ }
+ char *appId;
+ app_get_id(&appId);
+
+ Ecore_Wl_Window* ecoreWlWindow = AnyCast<Ecore_Wl_Window*>( mNativeWindow );
+ aul_rsm_provider_remote_enable(appId, ecore_wl_window_surface_get(ecoreWlWindow));
+#endif
+}
+
} // namespace Adaptor
} // namespace Internal
appId = "";
}
+void Adaptor::SurfaceInitialized()
+{
+}
+
} // namespace Adaptor
} // namespace Internal