--- /dev/null
+/*
+ * Copyright (c) 2015 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 <base/display-connection.h>
+
+// EXTERNAL INCLUDES
+
+// INTERNAL INCLUDES
+#include <display-connection-impl.h>
+#include <egl-interface.h>
+
+namespace Dali
+{
+
+DisplayConnection* DisplayConnection::New()
+{
+ Internal::Adaptor::DisplayConnection* internal(Internal::Adaptor::DisplayConnection::New());
+
+ return new DisplayConnection(internal);
+}
+
+DisplayConnection::DisplayConnection()
+{
+}
+
+DisplayConnection::DisplayConnection(Internal::Adaptor::DisplayConnection* impl)
+: mImpl(impl)
+{
+}
+
+DisplayConnection::~DisplayConnection()
+{
+ if (mImpl)
+ {
+ delete mImpl;
+ mImpl = NULL;
+ }
+}
+
+Any DisplayConnection::GetDisplay()
+{
+ return mImpl->GetDisplay();
+}
+
+void DisplayConnection::GetDpi(unsigned int& dpiHorizontal, unsigned int& dpiVertical)
+{
+ Internal::Adaptor::DisplayConnection::GetDpi(dpiHorizontal, dpiVertical);
+}
+
+void DisplayConnection::ConsumeEvents()
+{
+ mImpl->ConsumeEvents();
+}
+
+bool DisplayConnection::InitializeEgl(EglInterface& egl)
+{
+ return mImpl->InitializeEgl(egl);
+}
+
+}
--- /dev/null
+#ifndef __DALI_DISPLAY_CONNECTION_H__
+#define __DALI_DISPLAY_CONNECTION_H__
+
+/*
+ * Copyright (c) 2015 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.
+ *
+ */
+
+// EXTERNAL INCLUDES
+#include <dali/public-api/object/any.h>
+
+// INTERNAL INCLUDES
+
+
+namespace Dali
+{
+
+class EglInterface;
+
+namespace Internal
+{
+ namespace Adaptor
+ {
+ class DisplayConnection;
+ }
+}
+
+class DisplayConnection
+{
+public:
+
+ /**
+ * @brief Create an initialized DisplayConnection.
+ *
+ * @return A handle to a newly allocated DisplayConnection resource.
+ */
+ static DisplayConnection* New();
+
+ /**
+ * @brief Create a DisplayConnection handle; this can be initialised with DisplayConnection::New().
+ *
+ * Calling member functions with an uninitialised handle is not allowed.
+ */
+ DisplayConnection();
+
+ /**
+ * @brief Destructor
+ *
+ * This is non-virtual since derived Handle types must not contain data or virtual methods.
+ */
+ ~DisplayConnection();
+
+ /**
+ * @brief Get display
+ *
+ * @return display
+ */
+ Any GetDisplay();
+
+ /**
+ * @brief Get DPI
+ * @param[out] dpiHorizontal set to the horizontal dpi
+ * @param[out] dpiVertical set to the vertical dpi
+ */
+ static void GetDpi(unsigned int& dpiHorizontal, unsigned int& dpiVertical);
+
+ /**
+ * @brief Consumes any possible events on the queue so that there is no leaking between frames
+ */
+ void ConsumeEvents();
+
+ /**
+ * @brief Initialize EGL display
+ *
+ * @param egl implementation to use for the creation
+ */
+ bool InitializeEgl(EglInterface& egl);
+
+public:
+
+ /**
+ * @brief This constructor is used by DisplayConnection New() methods.
+ *
+ * @param [in] handle A pointer to a newly allocated DisplayConnection resource
+ */
+ explicit DALI_INTERNAL DisplayConnection(Internal::Adaptor::DisplayConnection* impl);
+
+private:
+
+ Internal::Adaptor::DisplayConnection* mImpl;
+};
+
+}
+
+#endif // __DALI_DISPLAY_CONNECTION_H__
base_adaptor_src_files = \
$(base_adaptor_src_dir)/frame-time.cpp \
+ $(base_adaptor_src_dir)/display-connection.cpp \
$(base_adaptor_src_dir)/render-thread.cpp \
$(base_adaptor_src_dir)/update-thread.cpp \
$(base_adaptor_src_dir)/update-render-synchronization.cpp \
#include <dali/integration-api/gl-abstraction.h>
// INTERNAL INCLUDES
+#include <trigger-event-interface.h>
+#include <trigger-event-factory-interface.h>
#include <base/interfaces/egl-factory-interface.h>
-#include <base/interfaces/trigger-event-factory-interface.h>
#include <base/interfaces/socket-factory-interface.h>
#include <base/interfaces/performance-interface.h>
#include <base/interfaces/vsync-monitor-interface.h>
#include <base/interfaces/kernel-trace-interface.h>
-#include <render-surface-impl.h> // @todo move to base/interfaces
+#include <render-surface.h>
namespace Dali
namespace Dali
{
+
+class EglInterface;
+
namespace Internal
{
namespace Adaptor
{
-class EglInterface;
/**
* Factory interface for creating EGL implementation
// INTERNAL INCLUDES
#include <base/performance-logging/performance-marker.h>
-#include <base/interfaces/trigger-event-factory-interface.h>
+#include <trigger-event-factory-interface.h>
#include <base/performance-logging/networking/client-send-data-interface.h>
#include <base/interfaces/socket-factory-interface.h>
#include <base/interfaces/adaptor-internal-services.h>
#include <base/update-render-synchronization.h>
#include <base/environment-options.h>
-
+#include <base/display-connection.h>
namespace Dali
{
#endif
}
-
RenderRequest::RenderRequest(RenderRequest::Request type)
: mRequestType(type)
{
{
// set the initial values before render thread starts
mSurface = adaptorInterfaces.GetRenderSurfaceInterface();
+
+ mDisplayConnection = Dali::DisplayConnection::New();
}
RenderThread::~RenderThread()
{
+ if (mDisplayConnection)
+ {
+ delete mDisplayConnection;
+ mDisplayConnection = NULL;
+ }
+
DALI_ASSERT_ALWAYS( mThread == NULL && "RenderThread is still alive");
mEglFactory->Destroy();
}
DALI_LOG_INFO( gRenderLogFilter, Debug::Verbose, "RenderThread::Run. 2 - Process requests\n");
- // Consume any pending events
- ConsumeEvents();
+ // Consume any pending events to avoid memory leaks
+ mDisplayConnection->ConsumeEvents();
bool processRequests = true;
bool requestProcessed = false;
DALI_ASSERT_ALWAYS( mSurface && "NULL surface" );
// initialize egl & OpenGL
+ mDisplayConnection->InitializeEgl( *mEGL );
mSurface->InitializeEgl( *mEGL );
// create the OpenGL context
mEGL->CreateContext();
// create the OpenGL surface
- mSurface->CreateEglSurface( *mEGL );
+ mSurface->CreateEglSurface(*mEGL);
// Make it current
mEGL->MakeContextCurrent();
// set the initial sync mode
-
// tell core it has a context
mCore.ContextCreated();
}
-void RenderThread::ConsumeEvents()
-{
- // tell surface to consume any events to avoid memory leaks
- mSurface->ConsumeEvents();
-}
-
bool RenderThread::ProcessRequest( RenderRequest* request )
{
bool processedRequest = false;
// we need to delete the egl surface and renderable (pixmap / window)
// Then create a new pixmap/window and new egl surface
// If the new surface has a different display connection, then the context will be lost
- DALI_ASSERT_ALWAYS( newSurface && "NULL surface" );
+ DALI_ASSERT_ALWAYS(newSurface && "NULL surface");
- bool contextLost = newSurface->ReplaceEGLSurface( *mEGL );
+ mDisplayConnection->InitializeEgl(*mEGL);
+ bool contextLost = newSurface->ReplaceEGLSurface(*mEGL);
if( contextLost )
{
DALI_LOG_WARNING("Context lost\n");
mCore.ContextCreated();
}
- // if both new and old surface are using the same display, and the display
- // connection was created by Dali, then transfer
- // display owner ship to the new surface.
- mSurface->TransferDisplayOwner( *newSurface );
-
// use the new surface from now on
mSurface = newSurface;
mSurfaceReplaced = true;
mGLES.PostRender(timeDelta);
// Inform the surface that rendering this frame has finished.
- mSurface->PostRender( *mEGL, mGLES, timeDelta, mSurfaceReplaced );
+ mSurface->PostRender( *mEGL, mGLES, mDisplayConnection, timeDelta, mSurfaceReplaced );
mSurfaceReplaced = false;
}
#include <boost/thread.hpp>
// INTERNAL INCLUDES
-#include <base/interfaces/egl-interface.h>
-#include <render-surface-impl.h> // needed for Dali::Internal::Adaptor::RenderSurface
-
+#include <egl-interface.h>
+#include <render-surface.h> // needed for Dali::RenderSurface
namespace Dali
{
+class RenderSurface;
+class DisplayConnection;
+
namespace Integration
{
class GlAbstraction;
{
class AdaptorInternalServices;
-class RenderSurface;
class UpdateRenderSynchronization;
class EglFactoryInterface;
class EnvironmentOptions;
-
class RenderRequest
{
public:
* @param[in] sync update-render synchronization object
* @param[in] adaptorInterfaces base adaptor interface
* @param[in] environmentOptions environment options
-
*/
RenderThread( UpdateRenderSynchronization& sync,
AdaptorInternalServices& adaptorInterfaces,
const EnvironmentOptions& environmentOptions );
/**
- * Virtual Destructor
+ * Destructor
*/
- virtual ~RenderThread();
+ ~RenderThread();
public:
*/
void Stop();
- /**
- * Offscreen was posted to onscreen
- */
- void RenderSync();
-
private: // Render thread side helpers
/**
void InitializeEgl();
/**
- * Check if display has events
- * Called from render thread
- */
- void ConsumeEvents();
-
- /**
* Check if main thread made any requests, e.g. ReplaceSurface
* Called from render thread
* @return true if a request was processed, false otherwise.
EglInterface* mEGL; ///< Interface to EGL implementation
boost::thread* mThread; ///< render thread
RenderSurface* mSurface; ///< Current surface
+ Dali::DisplayConnection* mDisplayConnection; ///< Display connection
const EnvironmentOptions& mEnvironmentOptions; ///< Environment options
bool mSurfaceReplaced; ///< True when new surface has been initialzed.
};
#include <base/interfaces/adaptor-internal-services.h>
#include <base/environment-options.h>
-
namespace Dali
{
namespace Dali
{
+class RenderSurface;
+
namespace Internal
{
class RenderThread;
class VSyncNotifier;
class UpdateRenderSynchronization;
-class RenderSurface;
class AdaptorInternalServices;
class EnvironmentOptions;
// INTERNAL INCLUDES
#include <base/interfaces/performance-interface.h>
-#include <base/interfaces/trigger-event-interface.h>
+#include <trigger-event-interface.h>
#include <base/frame-time.h>
#include <base/render-thread.h>
namespace Dali
{
+class RenderSurface;
+
namespace Integration
{
{
class AdaptorInternalServices;
-class RenderSurface;
/**
* This object is used to synchronize the update, render and vsync threads.
#include <callback-manager.h>
#include <trigger-event.h>
-#include <window-render-surface.h>
-#include <render-surface-impl.h>
+#include <render-surface.h>
#include <tts-player-impl.h>
#include <accessibility-manager-impl.h>
#include <timer-impl.h>
#include <clipboard-impl.h>
#include <vsync-monitor.h>
#include <object-profiler.h>
+#include <base/display-connection.h>
#include <tizen-logging.h>
-
-
namespace Dali
{
} // unnamed namespace
-Dali::Adaptor* Adaptor::New( RenderSurface *surface, const DeviceLayout& baseLayout,
+Dali::Adaptor* Adaptor::New( Any nativeWindow, RenderSurface *surface, const DeviceLayout& baseLayout,
Dali::Configuration::ContextLoss configuration )
{
- DALI_ASSERT_ALWAYS( surface->GetType() != Dali::RenderSurface::NO_SURFACE && "No surface for adaptor" );
-
Dali::Adaptor* adaptor = new Dali::Adaptor;
- Adaptor* impl = new Adaptor( *adaptor, surface, baseLayout );
+ Adaptor* impl = new Adaptor( nativeWindow, *adaptor, surface, baseLayout );
adaptor->mImpl = impl;
impl->Initialize(configuration);
mDeferredRotationObserver = NULL;
}
- // guarantee map the surface before starting render-thread.
- mSurface->Map();
-
+ // NOTE: dpi must be set before starting the render thread
// use default or command line settings if not run on device
if( mHDpi == 0 || mVDpi == 0 )
{
unsigned int dpiHor, dpiVer;
dpiHor = dpiVer = 0;
- mSurface->GetDpi(dpiHor, dpiVer);
+ Dali::DisplayConnection::GetDpi(dpiHor, dpiVer);
// tell core about the value
mCore->SetDpi(dpiHor, dpiVer);
}
}
-void Adaptor::ReplaceSurface( Dali::RenderSurface& surface )
+void Adaptor::ReplaceSurface( Any nativeWindow, RenderSurface& surface )
{
- // adaptor implementation needs the implementation of
- RenderSurface* internalSurface = dynamic_cast<Internal::Adaptor::RenderSurface*>( &surface );
- DALI_ASSERT_ALWAYS( internalSurface && "Incorrect surface" );
-
- ECore::WindowRenderSurface* windowSurface = dynamic_cast<Internal::Adaptor::ECore::WindowRenderSurface*>( &surface);
- if( windowSurface != NULL )
- {
- windowSurface->Map();
- // @todo Restart event handler with new surface
- }
-
- mSurface = internalSurface;
+ mNativeWindow = nativeWindow;
+ mSurface = &surface;
- SurfaceSizeChanged( internalSurface->GetPositionSize() );
+ 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
mCore->GetContextNotifier()->NotifyContextLost(); // Inform stage
// this method blocks until the render thread has completed the replace.
- mUpdateRenderController->ReplaceSurface(internalSurface);
+ mUpdateRenderController->ReplaceSurface(mSurface);
// Inform core, so that texture resources can be reloaded
mCore->RecoverFromContextLoss();
mCore->GetContextNotifier()->NotifyContextRegained(); // Inform stage
}
-Dali::RenderSurface& Adaptor::GetSurface() const
+RenderSurface& Adaptor::GetSurface() const
{
return *mSurface;
}
{
return *mNotificationTrigger;
}
+
TriggerEventFactoryInterface& Adaptor::GetTriggerEventFactoryInterface()
{
return mTriggerEventFactory;
{
return mSurface;
}
+
VSyncMonitorInterface* Adaptor::GetVSyncMonitorInterface()
{
return mVSyncMonitor;
}
}
+Any Adaptor::GetNativeWindowHandle()
+{
+ return mNativeWindow;
+}
void Adaptor::AddObserver( LifeCycleObserver& observer )
{
mNotificationOnIdleInstalled = false;
}
-Adaptor::Adaptor(Dali::Adaptor& adaptor, RenderSurface* surface, const DeviceLayout& baseLayout)
+Adaptor::Adaptor(Any nativeWindow, Dali::Adaptor& adaptor, RenderSurface* surface, const DeviceLayout& baseLayout)
: mResizedSignal(),
mLanguageChangedSignal(),
mAdaptor(adaptor),
mVSyncMonitor(NULL),
mGLES( NULL ),
mEglFactory( NULL ),
+ mNativeWindow( nativeWindow ),
mSurface( surface ),
mPlatformAbstraction( NULL ),
mEventHandler( NULL ),
namespace Dali
{
+class RenderSurface;
+
namespace Integration
{
class Core;
class GestureManager;
class GlImplementation;
class GlSyncImplementation;
-class RenderSurface;
class UpdateRenderController;
class TriggerEvent;
class CallbackManager;
/**
* Creates a New Adaptor
- * @param[in] surface A render surface can be one of the following
- * - Pixmap, adaptor will use existing Pixmap to draw on to
- * - Window, adaptor will use existing Window to draw on to
- * @param[in] baseLayout The base layout that the application has been written for
+ * @param[in] nativeWindow native window handle
+ * @param[in] surface A render surface can be one of the following
+ * - Pixmap, adaptor will use existing Pixmap to draw on to
+ * - Window, adaptor will use existing Window to draw on to
+ * @param[in] baseLayout The base layout that the application has been written for
* @param[in] configuration The context loss configuration ( to choose resource discard policy )
*/
- static Dali::Adaptor* New( RenderSurface* surface,
+ static Dali::Adaptor* New( Any nativeWindow,
+ RenderSurface* surface,
const DeviceLayout& baseLayout,
Dali::Configuration::ContextLoss configuration );
/**
* @copydoc AdaptorInterface::ReplaceSurface()
*/
- virtual void ReplaceSurface( Dali::RenderSurface& surface );
+ virtual void ReplaceSurface( Any nativeWindow, RenderSurface& surface );
/**
* @copydoc Dali::Adaptor::GetSurface()
*/
- virtual Dali::RenderSurface& GetSurface() const;
+ virtual RenderSurface& GetSurface() const;
/**
* @copydoc Dali::Adaptor::ReleaseSurfaceLock()
*/
void SetMinimumPinchDistance(float distance);
+ /**
+ * Gets native window handle
+ *
+ * @return native window handle
+ */
+ Any GetNativeWindowHandle();
+
public:
/**
* Assigns the render surface to the adaptor
*
*/
- void SetSurface(Dali::RenderSurface *surface);
+ void SetSurface(RenderSurface *surface);
/**
* Sends an notification message from main loop idle handler
/**
* Constructor
- * @param[in] adaptor The public adaptor
- * @param[in] surface A render surface can be one of the following
- * - Pixmap, adaptor will use existing Pixmap to draw on to
- * - Window, adaptor will use existing Window to draw on to
- * @param[in] baseLayout The base layout that the application has been written for
+ * @param[in] nativeWindow native window handle
+ * @param[in] adaptor The public adaptor
+ * @param[in] surface A render surface can be one of the following
+ * - Pixmap, adaptor will use existing Pixmap to draw on to
+ * - Window, adaptor will use existing Window to draw on to
+ * @param[in] baseLayout The base layout that the application has been written for
*/
- Adaptor( Dali::Adaptor& adaptor, RenderSurface* surface, const DeviceLayout& baseLayout );
+ Adaptor( Any nativeWindow, Dali::Adaptor& adaptor, RenderSurface* surface, const DeviceLayout& baseLayout );
private: // Types
private: // Data
- AdaptorSignalType mResizedSignal; ///< Resized signal.
- AdaptorSignalType mLanguageChangedSignal; ///< Language changed signal.
+ AdaptorSignalType mResizedSignal; ///< Resized signal.
+ AdaptorSignalType mLanguageChangedSignal; ///< Language changed signal.
Dali::Adaptor& mAdaptor; ///< Reference to public adaptor instance.
State mState; ///< Current state of the adaptor
GlSyncImplementation* mGlSync; ///< GL Sync implementation
EglFactory* mEglFactory; ///< EGL Factory
+ Any mNativeWindow; ///< window identifier
RenderSurface* mSurface; ///< Current surface
TizenPlatform::TizenPlatformAbstraction* mPlatformAbstraction; ///< Platform abstraction
#include <imf-manager.h>
#include <style-monitor.h>
#include <window.h>
+#include <render-surface.h>
#include <adaptor-impl.h>
-#include <render-surface-impl.h>
#include <window-impl.h>
namespace Dali
Adaptor& Adaptor::New( Window window, const DeviceLayout& baseLayout, Configuration::ContextLoss configuration )
{
+ Any winId = window.GetNativeHandle();
+
Internal::Adaptor::Window& windowImpl = GetImplementation(window);
- Adaptor* adaptor = Internal::Adaptor::Adaptor::New( windowImpl.GetSurface(), baseLayout, configuration );
+ Adaptor* adaptor = Internal::Adaptor::Adaptor::New( winId, windowImpl.GetSurface(), baseLayout, configuration );
windowImpl.SetAdaptor(*adaptor);
return *adaptor;
}
+Adaptor& Adaptor::New( Any nativeWindow, const Dali::RenderSurface& surface )
+{
+ return New( nativeWindow, surface, DeviceLayout::DEFAULT_BASE_LAYOUT, Configuration::APPLICATION_DOES_NOT_HANDLE_CONTEXT_LOSS );
+}
+
+Adaptor& Adaptor::New( Any nativeWindow, const Dali::RenderSurface& surface, const DeviceLayout& baseLayout, Configuration::ContextLoss configuration )
+{
+ Dali::RenderSurface* pSurface = const_cast<Dali::RenderSurface *>(&surface);
+ Adaptor* adaptor = Internal::Adaptor::Adaptor::New( nativeWindow, pSurface, baseLayout, configuration );
+ return *adaptor;
+}
+
Adaptor::~Adaptor()
{
delete mImpl;
return mImpl->AddIdle( callback );
}
+void Adaptor::ReplaceSurface( Any nativeWindow, Dali::RenderSurface& surface )
+{
+ mImpl->ReplaceSurface(nativeWindow, surface);
+}
+
Adaptor::AdaptorSignalType& Adaptor::ResizedSignal()
{
return mImpl->ResizedSignal();
mImpl->SetMinimumPinchDistance(distance);
}
+void Adaptor::FeedTouchPoint( TouchPoint& point, int timeStamp )
+{
+ mImpl->FeedTouchPoint(point, timeStamp);
+}
+
+void Adaptor::FeedWheelEvent( MouseWheelEvent& wheelEvent )
+{
+ mImpl->FeedWheelEvent(wheelEvent);
+}
+
+void Adaptor::FeedKeyEvent( KeyEvent& keyEvent )
+{
+ mImpl->FeedKeyEvent(keyEvent);
+}
+
Adaptor::Adaptor()
: mImpl( NULL )
{
windowImpl.SetAdaptor(*mAdaptor);
newWindow.ShowIndicator(Dali::Window::INVISIBLE);
Dali::RenderSurface* renderSurface = windowImpl.GetSurface();
- Internal::Adaptor::Adaptor::GetImplementation( *mAdaptor ).ReplaceSurface(*renderSurface);
+
+ Any nativeWindow = newWindow.GetNativeHandle();
+ Internal::Adaptor::Adaptor::GetImplementation( *mAdaptor ).ReplaceSurface(nativeWindow, *renderSurface);
mWindow = newWindow;
}
namespace Dali
{
+class RenderSurface;
+
struct StyleChange;
namespace Internal
class CoreEventInterface;
class GestureManager;
-class RenderSurface;
class StyleMonitor;
/**
$(adaptor_common_dir)/orientation-impl.cpp \
$(adaptor_common_dir)/performance-logger-impl.cpp \
$(adaptor_common_dir)/physical-keyboard-impl.cpp \
- $(adaptor_common_dir)/render-surface-impl.cpp \
$(adaptor_common_dir)/server-connection.cpp \
$(adaptor_common_dir)/shared-file.cpp \
$(adaptor_common_dir)/singleton-service-impl.cpp \
// EXTERNAL INCLUDES
#include <EGL/egl.h>
#include <EGL/eglext.h>
-#include <boost/any.hpp>
#include <dali/public-api/common/dali-vector.h>
// INTERNAL INCLUDES
-#include <base/interfaces/egl-interface.h>
+#include <egl-interface.h>
namespace Dali
{
+
namespace Internal
{
namespace Adaptor
{
-enum ColorDepth
-{
- COLOR_DEPTH_24 = 24,
- COLOR_DEPTH_32 = 32
-};
-
/**
* EglImplementation class provides an EGL implementation.
*/
public:
- /**
+ /**
* (Called from ECoreX::RenderSurface, not RenderThread, so not in i/f, hence, not virtual)
* Initialize GL
* @param display The display
/**
* Replaces the render surface
* @param[in] window, the window to create the new surface on
- * @param[in] display, the display
* @return true if the context was lost due to a change in display
* between old surface and new surface
*/
- bool ReplaceSurfaceWindow( EGLNativeWindowType window, EGLNativeDisplayType display );
+ bool ReplaceSurfaceWindow( EGLNativeWindowType window );
/**
* Replaces the render surface
* @param[in] pixmap, the pixmap to create the new surface on
- * @param[in] display, the display
* @return true if the context was lost due to a change in x-display
* between old surface and new surface
*/
- bool ReplaceSurfacePixmap( EGLNativePixmapType pixmap, EGLNativeDisplayType display );
+ bool ReplaceSurfacePixmap( EGLNativePixmapType pixmap );
/**
* returns the display with which this object was initialized
+++ /dev/null
-/*
- * Copyright (c) 2014 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 "render-surface-impl.h"
-
-// EXTERNAL INCLUDES
-#include <dali/integration-api/debug.h>
-
-namespace Dali
-{
-
-namespace Internal
-{
-
-namespace Adaptor
-{
-
-RenderSurface::RenderSurface()
-{
-}
-
-RenderSurface::~RenderSurface()
-{
-}
-
-} // namespace Adaptor
-
-} // namespace Internal
-
-} // namespace Dali
+++ /dev/null
-#ifndef __DALI_INTERNAL_RENDER_SURFACE_H__
-#define __DALI_INTERNAL_RENDER_SURFACE_H__
-
-/*
- * Copyright (c) 2014 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.
- *
- */
-
-// EXTERNAL INCLUDES
-#include <dali/public-api/common/dali-common.h>
-#include <dali/public-api/common/view-mode.h>
-
-// INTERNAL INCLUDES
-#include <render-surface.h>
-#include <base/interfaces/egl-interface.h>
-
-namespace Dali
-{
-
-namespace Integration
-{
-
-class GlAbstraction;
-
-} // namespace Integration
-
-namespace Internal
-{
-
-namespace Adaptor
-{
-
-class EglInterface;
-
-/**
- * This is the internal RenderSurface API
- */
-class RenderSurface : public Dali::RenderSurface
-{
-public:
-
- /**
- * Constructor
- */
- RenderSurface();
-
- /**
- * Destructor
- */
- virtual ~RenderSurface();
-
-public: // API
-
- /**
- * Initialize EGL, RenderSurface should create egl display and initialize
- * @param egl implementation to use for the creation
- */
- virtual void InitializeEgl( EglInterface& egl ) = 0;
-
- /**
- * Creates EGL Surface
- * @param egl implementation to use for the creation
- */
- virtual void CreateEglSurface( EglInterface& egl ) = 0;
-
- /**
- * Destroys EGL Surface
- * @param egl implementation to use for the destruction
- */
- virtual void DestroyEglSurface( EglInterface& egl ) = 0;
-
- /**
- * Replace the EGL Surface
- * @param egl implementation to use for the creation
- * @return true if context was lost
- */
- virtual bool ReplaceEGLSurface( EglInterface& egl ) = 0;
-
- /**
- * Resizes the underlying surface.
- * Only available for x window
- */
- virtual void MoveResize( Dali::PositionSize positionSize ) = 0;
-
- /**
- * Get DPI
- * @param dpiHorizontal set to the horizontal dpi
- * @param dpiVertical set to the vertical dpi
- */
- virtual void GetDpi( unsigned int& dpiHorizontal, unsigned int& dpiVertical ) const = 0;
-
- /**
- * Call to map the surface (only works if surface is a window)
- */
- virtual void Map() = 0;
-
- /**
- * Transfers the ownership of a display
- * @param newSurface to transfer
- */
- virtual void TransferDisplayOwner( Internal::Adaptor::RenderSurface& newSurface ) = 0;
-
- /**
- * Consumes any possible events on the queue so that there is no leaking between frames
- */
- virtual void ConsumeEvents() = 0;
-
- /**
- * Set the stereoscopic 3D view mode
- * @param[in] viewMode The new view mode
- */
- virtual void SetViewMode( ViewMode viewMode ) = 0;
-
- /**
- * Called when Render thread has started
- */
- virtual void StartRender() = 0;
-
- /**
- * Invoked by render thread before Core::Render
- * If the operation fails, then Core::Render should not be called until there is
- * a surface to render onto.
- * @param[in] egl The Egl interface
- * @param[in] glAbstraction OpenGLES abstraction interface
- * @return True if the operation is successful, False if the operation failed
- */
- virtual bool PreRender( EglInterface& egl, Integration::GlAbstraction& glAbstraction ) = 0;
-
- /**
- * Invoked by render thread after Core::Render
- * @param[in] egl The Egl interface
- * @param[in] glAbstraction OpenGLES abstraction interface
- * @param[in] deltaTime Time (in microseconds) since PostRender was last called.
- * @param[in] replacingSurface True if the surface is being replaced.
- */
- virtual void PostRender( EglInterface& egl, Integration::GlAbstraction& glAbstraction, unsigned int deltaTime, bool replacingSurface ) = 0;
-
- /**
- * Invoked by render thread when the thread should be stop
- */
- virtual void StopRender() = 0;
-
- /**
- * Invoked by Event Thread when the compositor lock should be released and rendering should resume.
- */
- virtual void ReleaseLock() = 0;
-};
-
-} // namespace Adaptor
-
-} // namespace internal
-
-} // namespace Dali
-
-#endif // __DALI_INTERNAL_RENDER_SURFACE_H__
// INTERNAL INCLUDES
#include <trigger-event.h>
-
namespace Dali
{
-namespace Internal
-{
-
-namespace Adaptor
-{
-
-TriggerEventInterface* TriggerEventFactory::CreateTriggerEvent( CallbackBase* callback, TriggerEventInterface::Options options )
+TriggerEventInterface* TriggerEventFactory::CreateTriggerEvent( CallbackBase* callback, TriggerEventInterface::Options options )
{
- return new TriggerEvent( callback, options );
+ return new Internal::Adaptor::TriggerEvent( callback, options );
}
void TriggerEventFactory::DestroyTriggerEvent( TriggerEventInterface* triggerEventInterface )
{
- TriggerEvent* triggerEvent( static_cast< TriggerEvent* >( triggerEventInterface) );
+ Internal::Adaptor::TriggerEvent* triggerEvent( static_cast<Internal::Adaptor::TriggerEvent *>(triggerEventInterface) );
delete triggerEvent;
}
-
-} // namespace Internal
-
-} // namespace Adaptor
-
} // namespace Dali
#include <dali/public-api/signals/callback.h>
// INTERNAL INCLUDES
-#include <base/interfaces/trigger-event-interface.h>
+#include <trigger-event-interface.h>
namespace Dali
{
namespace Dali
{
class Adaptor;
+class RenderSurface;
namespace Integration
{
{
namespace Adaptor
{
-class RenderSurface;
class Indicator;
class Orientation;
-#ifndef __DALI_ADAPTOR_H__
-#define __DALI_ADAPTOR_H__
+#ifndef __DALI_INTEGRATION_ADAPTOR_H__
+#define __DALI_INTEGRATION_ADAPTOR_H__
/*
* Copyright (c) 2014 Samsung Electronics Co., Ltd.
// INTERNAL INCLUDES
#include "window.h"
#include "application-configuration.h"
-#include "tts-player.h"
-namespace Dali DALI_INTERNAL
+namespace Dali
{
struct DeviceLayout;
class RenderSurface;
-namespace Internal DALI_INTERNAL
+namespace Internal
{
namespace Adaptor
{
*
* @see RenderSurface
*/
-class Adaptor
+class DALI_IMPORT_API Adaptor
{
public:
static Adaptor& New( Window window, const DeviceLayout& baseLayout, Configuration::ContextLoss configuration );
/**
+ * @brief Create a new adaptor using render surface.
+ *
+ * @param[in] nativeWindow native window handle
+ * @param[in] surface The surface to draw onto
+ * @note The default base layout DeviceLayout::DEFAULT_BASE_LAYOUT will be used.
+ * @return a reference to the adaptor handle
+ */
+ static Adaptor& New( Any nativeWindow, const Dali::RenderSurface& surface );
+
+ /**
+ * @brief Create a new adaptor using render surface.
+ *
+ * @param[in] nativeWindow native window handle
+ * @param[in] surface The surface to draw onto
+ * @param[in] baseLayout The base layout that the application has been written for
+ * @param[in] configuration The context loss configuration.
+ * @return a reference to the adaptor handle
+ */
+ static Adaptor& New( Any nativeWindow, const Dali::RenderSurface& surface, const DeviceLayout& baseLayout, Configuration::ContextLoss configuration = Configuration::APPLICATION_DOES_NOT_HANDLE_CONTEXT_LOSS);
+
+ /**
* @brief Virtual Destructor.
*/
virtual ~Adaptor();
* void MyFunction();
* @endcode
*
- * @param[in] callBack The function to call.
+ * @param[in] callback The function to call.
* @return true if added successfully, false otherwise
*
* @note Ownership of the callback is passed onto this class.
bool AddIdle( CallbackBase* callback );
/**
+ * @brief Replaces the rendering surface
+ *
+ * @param[in] nativeWindow native window handle
+ * @param[in] surface to use
+ */
+ void ReplaceSurface( Any nativeWindow, Dali::RenderSurface& surface );
+
+ /**
* @brief Get the render surface the adaptor is using to render to.
*
* @return reference to current render surface
*/
void SetMinimumPinchDistance(float distance);
+ /**
+ * @brief Feed a touch point to the adaptor.
+ *
+ * @param[in] point touch point
+ * @param[in] timeStamp time value of event
+ */
+ void FeedTouchPoint( TouchPoint& point, int timeStamp );
+
+ /**
+ * @brief Feed a mouse wheel event to the adaptor.
+ *
+ * @param[in] wheelEvent mouse wheel event
+ */
+ void FeedWheelEvent( MouseWheelEvent& wheelEvent );
+
+ /**
+ * @brief Feed a key event to the adaptor.
+ *
+ * @param[in] keyEvent The key event holding the key information.
+ */
+ void FeedKeyEvent( KeyEvent& keyEvent );
+
public: // Signals
/**
} // namespace Dali
-#endif // __DALI_ADAPTOR_H__
+#endif // __DALI_INTEGRATION_ADAPTOR_H__
-#ifndef __DALI_INTERNAL_ADAPTOR_BASE_EGL_INTERFACE_H__
-#define __DALI_INTERNAL_ADAPTOR_BASE_EGL_INTERFACE_H__
+#ifndef __DALI_INTEGRATION_EGL_INTERFACE_H__
+#define __DALI_INTEGRATION_EGL_INTERFACE_H__
/*
* Copyright (c) 2014 Samsung Electronics Co., Ltd.
namespace Dali
{
-namespace Internal
-{
-namespace Adaptor
+
+enum ColorDepth
{
+ COLOR_DEPTH_24 = 24,
+ COLOR_DEPTH_32 = 32
+};
/**
* EglInterface provides an interface for managing EGL contexts
virtual ~EglInterface() {}
};
-} // namespace Adaptor
-
-} // namespace Internal
-
} // namespace Dali
-#endif // __DALI_INTERNAL_ADAPTOR_BASE_EGL_INTERFACE_H__
+#endif // __DALI_INTEGRATION_EGL_INTERFACE_H__
--- /dev/null
+adaptor_integration_api_header_files = \
+ $(adaptor_integration_api_dir)/adaptor.h \
+ $(adaptor_integration_api_dir)/egl-interface.h \
+ $(adaptor_integration_api_dir)/trigger-event-interface.h \
+ $(adaptor_integration_api_dir)/trigger-event-factory-interface.h \
+ $(adaptor_integration_api_dir)/trigger-event-factory.h \
+ $(adaptor_integration_api_dir)/pixmap-render-surface-factory.h
+
+adaptor_integration_wayland_api_header_files = \
+ $(adaptor_integration_api_dir)/wayland/ecore-wl-types.h \
+ $(adaptor_integration_api_dir)/wayland/ecore-wl-render-surface.h \
+ $(adaptor_integration_api_dir)/wayland/pixmap-render-surface.h
+
+adaptor_integration_x11_api_header_files = \
+ $(adaptor_integration_api_dir)/x11/ecore-x-types.h \
+ $(adaptor_integration_api_dir)/x11/ecore-x-render-surface.h \
+ $(adaptor_integration_api_dir)/x11/pixmap-render-surface.h
-#ifndef __DALI_INTERNAL_ADAPTOR_MOBILE_RENDER_SURFACE_FACTORY_H__
-#define __DALI_INTERNAL_ADAPTOR_MOBILE_RENDER_SURFACE_FACTORY_H__
+#ifndef __DALI_INTEGRATION_PIXMAP_RENDER_SURFACE_FACTORY_H__
+#define __DALI_INTEGRATION_PIXMAP_RENDER_SURFACE_FACTORY_H__
/*
* Copyright (c) 2014 Samsung Electronics Co., Ltd.
*/
// EXTERNAL INCLUDES
-#include <boost/any.hpp>
#include <string>
-#include <dali/public-api/math/rect.h>
+#include <dali/public-api/object/any.h>
#include <dali/public-api/common/dali-common.h>
// INTERNAL INCLUDES
-#include <native-buffer-pool.h>
namespace Dali
{
-namespace Internal
-{
-
-namespace Adaptor
-{
-
namespace ECore
{
-class RenderSurface;
+class PixmapRenderSurface;
/**
* Surface factory function for pixmap
* A pixmap surface is created.
*
- * @param [in] type the type of surface to create
* @param [in] positionSize the position and size of the surface to create
- * @param [in] display X Pixmap to use, or null for default.
- * @param [in] display X Display to use, or null for default.
+ * @param [in] surface X Pixmap to use, or null for default.
* @param [in] name Name of surface passed in
* @param [in] isTransparent Whether the surface has an alpha channel
*/
-RenderSurface* CreatePixmapSurface(
- PositionSize positionSize,
- Any surface,
- Any display,
- const std::string& name,
- bool isTransparent );
+PixmapRenderSurface* CreatePixmapSurface(PositionSize positionSize,
+ Any surface,
+ const std::string& name,
+ bool isTransparent);
} // namespace ECoreX
-} // namespace Adaptor
-
-} // namespace Internal
-
} // namespace Dali
-#endif // __DALI_INTERNAL_ADAPTOR_MOBILE_RENDER_SURFACE_FACTORY_H__
+#endif // __DALI_INTEGRATION_PIXMAP_RENDER_SURFACE_FACTORY_H__
-#ifndef __DALI_INTERNAL_BASE_TRIGGER_EVENT_FACTORY_INTERFACE_H__
-#define __DALI_INTERNAL_BASE_TRIGGER_EVENT_FACTORY_INTERFACE_H__
+#ifndef __DALI_INTEGRATION_TRIGGER_EVENT_FACTORY_INTERFACE_H__
+#define __DALI_INTEGRATION_TRIGGER_EVENT_FACTORY_INTERFACE_H__
/*
* Copyright (c) 2014 Samsung Electronics Co., Ltd.
#include <dali/public-api/signals/callback.h>
// INTERNAL INCLUDES
-#include <base/interfaces/trigger-event-interface.h>
+#include <trigger-event-interface.h>
namespace Dali
{
-namespace Internal
-{
-
-namespace Adaptor
-{
-
/**
* @brief Trigger interface factory class for creating a TriggerEvents
*
/**
* @brief Create a new concrete implementation of the event trigger interface.
* @param callback called when interface->Trigger() is called
+ * @param options TriggerEventInterface option
* @return pointer to a new trigger event
* @note Ownership of callback should be taken over by deriving classes
*/
TriggerEventInterface::Options options = TriggerEventInterface::NONE) = 0;
/**
* @brief destroy a trigger event
- * @param trigger event to destroy
+ * @param triggerEventInterface event to destroy
*/
virtual void DestroyTriggerEvent( TriggerEventInterface* triggerEventInterface ) = 0;
};
-
-} // namespace Internal
-
-} // namespace Adaptor
-
} // namespace Dali
-#endif // __DALI_INTERNAL_BASE_TRIGGER_EVENT_FACTORY_INTERFACE_H__
+#endif // __DALI_INTEGRATION_TRIGGER_EVENT_FACTORY_INTERFACE_H__
-#ifndef __DALI_INTERNAL_ADAPTOR_TRIGGER_EVENT_FACTORY_H__
-#define __DALI_INTERNAL_ADAPTOR_TRIGGER_EVENT_FACTORY_H__
+#ifndef __DALI_INTEGRATION_TRIGGER_EVENT_FACTORY_H__
+#define __DALI_INTEGRATION_TRIGGER_EVENT_FACTORY_H__
/*
* Copyright (c) 2014 Samsung Electronics Co., Ltd.
*/
// INTERNAL INCLUDES
-#include <base/interfaces/trigger-event-factory-interface.h>
+#include <trigger-event-factory-interface.h>
+#include <dali/public-api/common/dali-common.h>
namespace Dali
{
-namespace Internal
-{
-
-namespace Adaptor
-{
-
/**
* @brief Trigger interface factory class
*
*/
-class TriggerEventFactory : public TriggerEventFactoryInterface
+class DALI_IMPORT_API TriggerEventFactory : public TriggerEventFactoryInterface
{
public:
};
-} // namespace Internal
-
-} // namespace Adaptor
-
} // namespace Dali
-#endif // __DALI_INTERNAL_ADAPTOR_TRIGGER_EVENT_FACTORY_H__
+#endif // __DALI_INTEGRATION_TRIGGER_EVENT_FACTORY_H__
-#ifndef __DALI_INTERNAL_ADAPTOR_BASE_TRIGGER_EVENT_INTERFACE_H__
-#define __DALI_INTERNAL_ADAPTOR_BASE_TRIGGER_EVENT_INTERFACE_H__
+#ifndef __DALI_INTEGRATION_TRIGGER_EVENT_INTERFACE_H__
+#define __DALI_INTEGRATION_TRIGGER_EVENT_INTERFACE_H__
/*
* Copyright (c) 2014 Samsung Electronics Co., Ltd.
namespace Dali
{
-namespace Internal
-{
-
-namespace Adaptor
-{
-
/**
* @brief Interface for a trigger event class.
*
{
}
+public:
/**
* @brief Virtual destructor
*/
};
-} // namespace Adaptor
-
-} // namespace Internal
-
} // namespace Dali
-#endif // __DALI_INTERNAL_ADAPTOR_BASE_TRIGGER_EVENT_INTERFACE_H__
+#endif // __DALI_INTEGRATION_TRIGGER_EVENT_INTERFACE_H__
-#ifndef __DALI_INTERNAL_ECORE_WL_RENDER_SURFACE_H__
-#define __DALI_INTERNAL_ECORE_WL_RENDER_SURFACE_H__
+#ifndef __DALI_ECORE_WL_RENDER_SURFACE_H__
+#define __DALI_ECORE_WL_RENDER_SURFACE_H__
/*
* Copyright (c) 2014 Samsung Electronics Co., Ltd.
*/
// EXTERNAL INCLUDES
-#include <string>
-#include <boost/thread.hpp>
-#include <Ecore.h>
#include <Ecore_Wayland.h>
#include <dali/public-api/common/dali-common.h>
// INTERNAL INCLUDES
-#include <render-surface-impl.h>
-#include <ecore-wl-types.h>
-#include <gl/egl-implementation.h>
+#include <render-surface.h>
+#include <egl-interface.h>
namespace Dali
{
-namespace Internal
-{
-
-namespace Adaptor
-{
-class TriggerEvent;
+class TriggerEventInterface;
namespace ECore
{
* @todo change namespace to ECore_Wayland as the class
* is no longer pure Wayland.
*/
-class RenderSurface : public Internal::Adaptor::RenderSurface
+class DALI_IMPORT_API EcoreWlRenderSurface : public Dali::RenderSurface
{
public:
/**
* Uses an Wayland surface to render to.
- * @param [in] type the type of surface passed in
* @param [in] positionSize the position and size of the surface
* @param [in] surface can be a X-window or X-pixmap (type must be unsigned int).
- * @param [in] display connection to X-server if the surface is a X window or pixmap (type must be void * to X display struct)
* @param [in] name optional name of surface passed in
* @param [in] isTransparent if it is true, surface has 32 bit color depth, otherwise, 24 bit
*/
- RenderSurface( SurfaceType type,
- Dali::PositionSize positionSize,
- Any surface,
- Any display,
- const std::string& name,
- bool isTransparent = false);
+ EcoreWlRenderSurface(Dali::PositionSize positionSize,
+ Any surface,
+ const std::string& name,
+ bool isTransparent = false);
/**
* Destructor.
* Will delete the display, if it has ownership.
* Will delete the window/pixmap if it has owner ship
*/
- virtual ~RenderSurface();
+ virtual ~EcoreWlRenderSurface();
protected:
/**
public: // API
/**
- * @return the Ecore X window handle
- */
- Ecore_Wl_Window* GetWlWindow();
-
- /**
- * @return the Main X display
+ * @brief Sets the render notification trigger to call when render thread is completed a frame
+ *
+ * @param renderNotification to use
*/
- WlDisplay* GetMainDisplay();
+ void SetRenderNotification(TriggerEventInterface* renderNotification);
/**
- * Sets the render notification trigger to call when render thread is completed a frame
- * @param renderNotification to use
+ * @brief Get window handle
+ *
+ * @return the Ecore X window handle
*/
- void SetRenderNotification( TriggerEvent* renderNotification );
+ Ecore_Wl_Window* GetWlWindow();
/**
- * Get the surface as an Ecore_X_drawable
+ * Get the surface as an Ecore_Wl_Window
*/
virtual Ecore_Wl_Window* GetDrawable();
public: // from Dali::RenderSurface
/**
- * @copydoc Dali::RenderSurface::GetType()
- */
- virtual Dali::RenderSurface::SurfaceType GetType() = 0;
-
- /**
- * @copydoc Dali::RenderSurface::GetSurface()
- */
- virtual Any GetSurface() = 0;
-
- /**
- * @copydoc Dali::RenderSurface::GetDisplay()
- */
- virtual Any GetDisplay();
-
- /**
* @copydoc Dali::RenderSurface::GetPositionSize()
*/
virtual PositionSize GetPositionSize() const;
-public: // from Internal::Adaptor::RenderSurface
+ /**
+ * @copydoc Dali::RenderSurface::InitializeEgl()
+ */
+ virtual void InitializeEgl( EglInterface& egl ) = 0;
/**
- * @copydoc Dali::Internal::Adaptor::RenderSurface::CreateEglSurface()
+ * @copydoc Dali::RenderSurface::CreateEglSurface()
*/
virtual void CreateEglSurface( EglInterface& egl ) = 0;
/**
- * @copydoc Dali::Internal::Adaptor::RenderSurface::DestroyEglSurface()
+ * @copydoc Dali::RenderSurface::DestroyEglSurface()
*/
virtual void DestroyEglSurface( EglInterface& egl ) = 0;
/**
- * @copydoc Dali::Internal::Adaptor::RenderSurface::ReplaceEGLSurface()
+ * @copydoc Dali::RenderSurface::ReplaceEGLSurface()
*/
virtual bool ReplaceEGLSurface( EglInterface& egl ) = 0;
/**
- * @copydoc Dali::Internal::Adaptor::RenderSurface::MoveResize()
+ * @copydoc Dali::RenderSurface::MoveResize()
*/
virtual void MoveResize( Dali::PositionSize positionSize);
/**
- * @copydoc Dali::Internal::Adaptor::RenderSurface::GetDpi()
- */
- virtual void GetDpi( unsigned int& dpiHorizontal, unsigned int& dpiVertical ) const;
-
- /**
- * @copydoc Dali::Internal::Adaptor::RenderSurface::Map()
- */
- virtual void Map();
-
- /**
- * @copydoc Dali::Internal::Adaptor::RenderSurface::TransferDisplayOwner()
+ * @copydoc Dali::RenderSurface::SetViewMode()
*/
- virtual void TransferDisplayOwner( Internal::Adaptor::RenderSurface& newSurface );
+ void SetViewMode( ViewMode viewMode );
/**
- * @copydoc Dali::Internal::Adaptor::RenderSurface::ConsumeEvents()
+ * @copydoc Dali::RenderSurface::StartRender()
*/
- virtual void ConsumeEvents();
+ virtual void StartRender() = 0;
/**
- * @copydoc Dali::Internal::Adaptor::RenderSurface::SetViewMode()
+ * @copydoc Dali::RenderSurface::PreRender()
*/
- void SetViewMode( ViewMode );
+ virtual bool PreRender( EglInterface& egl, Integration::GlAbstraction& glAbstraction ) = 0;
/**
- * @copydoc Dali::Internal::Adaptor::RenderSurface::PreRender()
+ * @copydoc Dali::RenderSurface::PostRender()
*/
- virtual bool PreRender( EglInterface& egl, Integration::GlAbstraction& glAbstraction ) = 0;
+ virtual void PostRender( EglInterface& egl, Integration::GlAbstraction& glAbstraction, DisplayConnection* displayConnection, unsigned int deltaTime, bool replacingSurface ) = 0;
/**
- * @copydoc Dali::Internal::Adaptor::RenderSurface::PostRender()
+ * @copydoc Dali::RenderSurface::ReleaseLock()
*/
- virtual void PostRender( EglInterface& egl, Integration::GlAbstraction& glAbstraction, unsigned int timeDelta, bool replacingSurface ) = 0;
+ virtual void ReleaseLock() = 0;
private:
/**
- * Sets the display, if display parameter is empty it opens a new display
- * @param display
- */
- void SetDisplay( Any display );
-
- /**
* Get the surface id if the surface parameter is not empty
* @param surface Any containing a surface id, or can be empty
* @return surface id, or zero if surface is empty
protected: // Data
- WlDisplay* mMainDisplay; ///< Wayland-connection for rendering
- SurfaceType mType; ///< type of renderable
PositionSize mPosition; ///< Position
std::string mTitle; ///< Title of window which shows from "xinfo -topvwins" command
+ TriggerEventInterface* mRenderNotification; ///< Render notification trigger
ColorDepth mColorDepth; ///< Color depth of surface (32 bit or 24 bit)
- TriggerEvent* mRenderNotification; ///< Render notification trigger
-
bool mOwnSurface; ///< Whether we own the surface (responsible for deleting it)
- bool mOwnDisplay; ///< Whether we own the display (responsible for deleting it)
};
} // namespace ECore
-} // namespace Adaptor
-
-} // namespace internal
-
} // namespace Dali
-#endif // __DALI_INTERNAL_ECORE_WL_RENDER_SURFACE_H__
+#endif // __DALI_ECORE_WL_RENDER_SURFACE_H__
-#ifndef __DALI_INTERNAL_X11_TYPES_H__
-#define __DALI_INTERNAL_X11_TYPES_H__
+#ifndef __DALI_WL_TYPES_H__
+#define __DALI_WL_TYPES_H__
/*
* Copyright (c) 2014 Samsung Electronics Co., Ltd.
namespace Dali
{
-namespace Internal
-{
-
-namespace Adaptor
-{
-
typedef ::wl_display WlDisplay;
typedef ::wl_surface WlSurface;
-} // namespace Adaptor
-
-} // namespace Internal
-
} // namespace Dali
-#endif /* __DALI_INTERNAL_X11_TYPES_H__ */
+#endif /* __DALI_WL_TYPES_H__ */
-#ifndef __DALI_INTERNAL_ECORE_X_PIXMAP_RENDER_SURFACE_H__
-#define __DALI_INTERNAL_ECORE_X_PIXMAP_RENDER_SURFACE_H__
+#ifndef __DALI_ECORE_X_PIXMAP_RENDER_SURFACE_H__
+#define __DALI_ECORE_X_PIXMAP_RENDER_SURFACE_H__
/*
* Copyright (c) 2014 Samsung Electronics Co., Ltd.
namespace Dali
{
-namespace Internal
-{
-
-namespace Adaptor
-{
-class TriggerEvent;
-
namespace ECore
{
/**
* Ecore X11 implementation of render surface.
*/
-class PixmapRenderSurface : public RenderSurface
+class PixmapRenderSurface : public EcoreWlRenderSurface
{
public:
* Uses an Wayland surface to render to.
* @param [in] positionSize the position and size of the surface
* @param [in] surface can be a Wayland-window (type must be unsigned int).
- * @param [in] display connection to Wayland-server if the surface is a X window or pixmap (type must be void * to X display struct)
* @param [in] name optional name of surface passed in
* @param [in] isTransparent if it is true, surface has 32 bit color depth, otherwise, 24 bit
*/
PixmapRenderSurface( Dali::PositionSize positionSize,
Any surface,
- Any display,
const std::string& name,
bool isTransparent = false);
/**
- * @copydoc Dali::Internal::Adaptor::ECore::RenderSurface::~RenderSurface
+ * @copydoc Dali::RenderSurface::~RenderSurface
*/
virtual ~PixmapRenderSurface();
public: // API
-public: // from Dali::RenderSurface
-
/**
- * @copydoc Dali::RenderSurface::GetType()
+ * @copydoc Dali::ECore::EcoreWlRenderSurface::GetDrawable()
*/
- virtual Dali::RenderSurface::SurfaceType GetType();
+ virtual Ecore_Wl_Window* GetDrawable();
/**
- * @copydoc Dali::RenderSurface::GetSurface()
+ * @brief GetSurface
+ *
+ * @return pixmap
*/
virtual Any GetSurface();
-public: // from Internal::Adaptor::RenderSurface
+public: // from Dali::RenderSurface
/**
- * @copydoc Dali::Internal::Adaptor::RenderSurface::InitializeEgl()
+ * @copydoc Dali::RenderSurface::InitializeEgl()
*/
virtual void InitializeEgl( EglInterface& egl );
/**
- * @copydoc Dali::Internal::Adaptor::RenderSurface::CreateEglSurface()
+ * @copydoc Dali::RenderSurface::CreateEglSurface()
*/
virtual void CreateEglSurface( EglInterface& egl );
/**
- * @copydoc Dali::Internal::Adaptor::RenderSurface::DestroyEglSurface()
+ * @copydoc Dali::RenderSurface::DestroyEglSurface()
*/
virtual void DestroyEglSurface( EglInterface& egl );
/**
- * @copydoc Dali::Internal::Adaptor::RenderSurface::ReplaceEGLSurface()
+ * @copydoc Dali::RenderSurface::ReplaceEGLSurface()
*/
virtual bool ReplaceEGLSurface( EglInterface& egl );
/**
- * @copydoc Dali::Internal::Adaptor::RenderSurface::StartRender()
+ * @copydoc Dali::RenderSurface::StartRender()
*/
virtual void StartRender();
/**
- * @copydoc Dali::Internal::Adaptor::RenderSurface::PreRender()
+ * @copydoc Dali::RenderSurface::PreRender()
*/
virtual bool PreRender( EglInterface& egl, Integration::GlAbstraction& glAbstraction );
/**
- * @copydoc Dali::Internal::Adaptor::RenderSurface::PostRender()
+ * @copydoc Dali::RenderSurface::PostRender()
*/
- virtual void PostRender( EglInterface& egl, Integration::GlAbstraction& glAbstraction, unsigned int timeDelta, bool replacingSurface );
+ virtual void PostRender( EglInterface& egl, Integration::GlAbstraction& glAbstraction, DisplayConnection* displayConnection, unsigned int deltaTime, bool replacingSurface );
/**
- * @copydoc Dali::Internal::Adaptor::RenderSurface::StopRender()
+ * @copydoc Dali::RenderSurface::StopRender()
*/
virtual void StopRender();
SYNC_MODE_WAIT
};
+ /**
+ * Set the sync mode.
+ * @param[in] syncMode The sync mode
+ */
void SetSyncMode( SyncMode syncMode );
/**
} // namespace ECore
-} // namespace Adaptor
-
-} // namespace internal
-
} // namespace Dali
-#endif // __DALI_INTERNAL_ECORE_X_PIXMAP_RENDER_SURFACE_H__
+#endif // __DALI_ECORE_X_PIXMAP_RENDER_SURFACE_H__
-#ifndef __DALI_INTERNAL_ECORE_X_RENDER_SURFACE_H__
-#define __DALI_INTERNAL_ECORE_X_RENDER_SURFACE_H__
+#ifndef __DALI_ECORE_X_RENDER_SURFACE_H__
+#define __DALI_ECORE_X_RENDER_SURFACE_H__
/*
* Copyright (c) 2014 Samsung Electronics Co., Ltd.
*/
// EXTERNAL INCLUDES
-#include <string>
-#include <boost/thread.hpp>
#include <Ecore_X.h>
#include <dali/public-api/common/dali-common.h>
// INTERNAL INCLUDES
-#include <render-surface-impl.h>
+#include <render-surface.h>
#include <ecore-x-types.h>
-#include <gl/egl-implementation.h>
+#include <egl-interface.h>
namespace Dali
{
-namespace Internal
-{
-
-namespace Adaptor
-{
-class TriggerEvent;
+class TriggerEventInterface;
namespace ECore
{
* @todo change namespace to ECore_X11 as the class
* is no longer pure X11.
*/
-class RenderSurface : public Internal::Adaptor::RenderSurface
+class DALI_IMPORT_API EcoreXRenderSurface : public Dali::RenderSurface
{
public:
/**
* Uses an X11 surface to render to.
- * @param [in] type the type of surface passed in
* @param [in] positionSize the position and size of the surface
* @param [in] surface can be a X-window or X-pixmap (type must be unsigned int).
- * @param [in] display connection to X-server if the surface is a X window or pixmap (type must be void * to X display struct)
* @param [in] name optional name of surface passed in
* @param [in] isTransparent if it is true, surface has 32 bit color depth, otherwise, 24 bit
*/
- RenderSurface( SurfaceType type,
- Dali::PositionSize positionSize,
- Any surface,
- Any display,
- const std::string& name,
- bool isTransparent = false);
+ EcoreXRenderSurface(Dali::PositionSize positionSize,
+ Any surface,
+ const std::string& name,
+ bool isTransparent = false);
/**
* Destructor.
* Will delete the display, if it has ownership.
* Will delete the window/pixmap if it has owner ship
*/
- virtual ~RenderSurface();
+ virtual ~EcoreXRenderSurface();
protected:
/**
public: // API
/**
- * @return the Ecore X window handle
- */
- Ecore_X_Window GetXWindow();
-
- /**
- * @return the Main X display
+ * @brief Sets the render notification trigger to call when render thread is completed a frame
+ *
+ * @param renderNotification to use
*/
- XDisplay* GetMainDisplay();
+ void SetRenderNotification(TriggerEventInterface* renderNotification);
/**
- * Sets the render notification trigger to call when render thread is completed a frame
- * @param renderNotification to use
+ * @brief Get window handle
+ *
+ * @return the Ecore X window handle
*/
- void SetRenderNotification( TriggerEvent* renderNotification );
+ Ecore_X_Window GetXWindow();
/**
* Get the surface as an Ecore_X_drawable
*/
virtual Ecore_X_Drawable GetDrawable();
-public: // from Dali::RenderSurface
-
/**
- * @copydoc Dali::RenderSurface::GetType()
- */
- virtual Dali::RenderSurface::SurfaceType GetType() = 0;
-
- /**
- * @copydoc Dali::RenderSurface::GetSurface()
+ * @brief Get the render surface the adaptor is using to render to.
+ *
+ * @return reference to current render surface (eg, pixmap / window)
*/
virtual Any GetSurface() = 0;
- /**
- * @copydoc Dali::RenderSurface::GetDisplay()
- */
- virtual Any GetDisplay();
+public: // from Dali::RenderSurface
/**
* @copydoc Dali::RenderSurface::GetPositionSize()
*/
virtual PositionSize GetPositionSize() const;
-public: // from Internal::Adaptor::RenderSurface
+ /**
+ * @copydoc Dali::RenderSurface::InitializeEgl()
+ */
+ virtual void InitializeEgl( EglInterface& egl ) = 0;
/**
- * @copydoc Dali::Internal::Adaptor::RenderSurface::CreateEglSurface()
+ * @copydoc Dali::RenderSurface::CreateEglSurface()
*/
virtual void CreateEglSurface( EglInterface& egl ) = 0;
/**
- * @copydoc Dali::Internal::Adaptor::RenderSurface::DestroyEglSurface()
+ * @copydoc Dali::RenderSurface::DestroyEglSurface()
*/
virtual void DestroyEglSurface( EglInterface& egl ) = 0;
/**
- * @copydoc Dali::Internal::Adaptor::RenderSurface::ReplaceEGLSurface()
+ * @copydoc Dali::RenderSurface::ReplaceEGLSurface()
*/
virtual bool ReplaceEGLSurface( EglInterface& egl ) = 0;
/**
- * @copydoc Dali::Internal::Adaptor::RenderSurface::MoveResize()
+ * @copydoc Dali::RenderSurface::MoveResize()
*/
virtual void MoveResize( Dali::PositionSize positionSize);
/**
- * @copydoc Dali::Internal::Adaptor::RenderSurface::GetDpi()
- */
- virtual void GetDpi( unsigned int& dpiHorizontal, unsigned int& dpiVertical ) const;
-
- /**
- * @copydoc Dali::Internal::Adaptor::RenderSurface::Map()
- */
- virtual void Map();
-
- /**
- * @copydoc Dali::Internal::Adaptor::RenderSurface::TransferDisplayOwner()
+ * @copydoc Dali::RenderSurface::SetViewMode()
*/
- virtual void TransferDisplayOwner( Internal::Adaptor::RenderSurface& newSurface );
+ void SetViewMode( ViewMode viewMode );
/**
- * @copydoc Dali::Internal::Adaptor::RenderSurface::ConsumeEvents()
+ * @copydoc Dali::RenderSurface::StartRender()
*/
- virtual void ConsumeEvents();
+ virtual void StartRender() = 0;
/**
- * @copydoc Dali::Internal::Adaptor::RenderSurface::SetViewMode()
+ * @copydoc Dali::RenderSurface::PreRender()
*/
- void SetViewMode( ViewMode );
+ virtual bool PreRender( EglInterface& egl, Integration::GlAbstraction& glAbstraction ) = 0;
/**
- * @copydoc Dali::Internal::Adaptor::RenderSurface::PreRender()
+ * @copydoc Dali::RenderSurface::PostRender()
*/
- virtual bool PreRender( EglInterface& egl, Integration::GlAbstraction& glAbstraction ) = 0;
+ virtual void PostRender( EglInterface& egl, Integration::GlAbstraction& glAbstraction, DisplayConnection* displayConnection, unsigned int deltaTime, bool replacingSurface ) = 0;
/**
- * @copydoc Dali::Internal::Adaptor::RenderSurface::PostRender()
+ * @copydoc Dali::RenderSurface::ReleaseLock()
*/
- virtual void PostRender( EglInterface& egl, Integration::GlAbstraction& glAbstraction, unsigned int timeDelta, bool replacingSurface ) = 0;
+ virtual void ReleaseLock() = 0;
private:
/**
- * Sets the display, if display parameter is empty it opens a new display
- * @param display
- */
- void SetDisplay( Any display );
-
- /**
* Get the surface id if the surface parameter is not empty
* @param surface Any containing a surface id, or can be empty
* @return surface id, or zero if surface is empty
protected: // Data
- XDisplay* mMainDisplay; ///< X-connection for rendering
- SurfaceType mType; ///< type of renderable
PositionSize mPosition; ///< Position
std::string mTitle; ///< Title of window which shows from "xinfo -topvwins" command
+ TriggerEventInterface* mRenderNotification; ///< Render notification trigger
ColorDepth mColorDepth; ///< Color depth of surface (32 bit or 24 bit)
- TriggerEvent* mRenderNotification; ///< Render notification trigger
-
bool mOwnSurface; ///< Whether we own the surface (responsible for deleting it)
- bool mOwnDisplay; ///< Whether we own the display (responsible for deleting it)
};
} // namespace ECore
-} // namespace Adaptor
-
-} // namespace internal
-
} // namespace Dali
-#endif // __DALI_INTERNAL_ECORE_X_RENDER_SURFACE_H__
+#endif // __DALI_ECORE_X_RENDER_SURFACE_H__
-#ifndef __DALI_INTERNAL_X11_TYPES_H__
-#define __DALI_INTERNAL_X11_TYPES_H__
+#ifndef __DALI_X11_TYPES_H__
+#define __DALI_X11_TYPES_H__
/*
* Copyright (c) 2014 Samsung Electronics Co., Ltd.
namespace Dali
{
-namespace Internal
-{
-
-namespace Adaptor
-{
-
typedef ::Pixmap XPixmap;
typedef ::Window XWindow;
typedef ::Display XDisplay;
typedef ::Screen XScreen;
-} // namespace Adaptor
-
-} // namespace Internal
-
} // namespace Dali
-#endif /* __DALI_INTERNAL_X11_TYPES_H__ */
+#endif /* __DALI_X11_TYPES_H__ */
-#ifndef __DALI_INTERNAL_ECORE_X_PIXMAP_RENDER_SURFACE_H__
-#define __DALI_INTERNAL_ECORE_X_PIXMAP_RENDER_SURFACE_H__
+#ifndef __DALI_ECORE_X_PIXMAP_RENDER_SURFACE_H__
+#define __DALI_ECORE_X_PIXMAP_RENDER_SURFACE_H__
/*
* Copyright (c) 2014 Samsung Electronics Co., Ltd.
*
*/
+// EXTERNAL INCLUDES
+#include <boost/thread.hpp>
+
// INTERNAL INCLUDES
#include <ecore-x-render-surface.h>
namespace Dali
{
-namespace Internal
-{
-
-namespace Adaptor
-{
-class TriggerEvent;
-
namespace ECore
{
/**
* Ecore X11 implementation of render surface.
*/
-class PixmapRenderSurface : public RenderSurface
+class PixmapRenderSurface : public EcoreXRenderSurface
{
public:
* Uses an X11 surface to render to.
* @param [in] positionSize the position and size of the surface
* @param [in] surface can be a X-window or X-pixmap (type must be unsigned int).
- * @param [in] display connection to X-server if the surface is a X window or pixmap (type must be void * to X display struct)
* @param [in] name optional name of surface passed in
* @param [in] isTransparent if it is true, surface has 32 bit color depth, otherwise, 24 bit
*/
PixmapRenderSurface( Dali::PositionSize positionSize,
Any surface,
- Any display,
const std::string& name,
bool isTransparent = false);
/**
- * @copydoc Dali::Internal::Adaptor::ECore::RenderSurface::~RenderSurface
+ * @copydoc Dali::RenderSurface::~RenderSurface
*/
virtual ~PixmapRenderSurface();
public: // API
/**
- * @copydoc Dali::Internal::Adaptor::ECore::RenderSurface::GetDrawable()
+ * @copydoc Dali::ECore::EcoreXRenderSurface::GetDrawable()
*/
virtual Ecore_X_Drawable GetDrawable();
-public: // from Dali::RenderSurface
-
- /**
- * @copydoc Dali::RenderSurface::GetType()
- */
- virtual Dali::RenderSurface::SurfaceType GetType();
-
/**
- * @copydoc Dali::RenderSurface::GetSurface()
+ * @brief GetSurface
+ *
+ * @return pixmap
*/
virtual Any GetSurface();
-public: // from Internal::Adaptor::RenderSurface
+public: // from Dali::RenderSurface
/**
- * @copydoc Dali::Internal::Adaptor::RenderSurface::InitializeEgl()
+ * @copydoc Dali::RenderSurface::InitializeEgl()
*/
virtual void InitializeEgl( EglInterface& egl );
/**
- * @copydoc Dali::Internal::Adaptor::RenderSurface::CreateEglSurface()
+ * @copydoc Dali::RenderSurface::CreateEglSurface()
*/
virtual void CreateEglSurface( EglInterface& egl );
/**
- * @copydoc Dali::Internal::Adaptor::RenderSurface::DestroyEglSurface()
+ * @copydoc Dali::RenderSurface::DestroyEglSurface()
*/
virtual void DestroyEglSurface( EglInterface& egl );
/**
- * @copydoc Dali::Internal::Adaptor::RenderSurface::ReplaceEGLSurface()
+ * @copydoc Dali::RenderSurface::ReplaceEGLSurface()
*/
virtual bool ReplaceEGLSurface( EglInterface& egl );
/**
- * @copydoc Dali::Internal::Adaptor::RenderSurface::StartRender()
+ * @copydoc Dali::RenderSurface::StartRender()
*/
virtual void StartRender();
/**
- * @copydoc Dali::Internal::Adaptor::RenderSurface::PreRender()
+ * @copydoc Dali::RenderSurface::PreRender()
*/
virtual bool PreRender( EglInterface& egl, Integration::GlAbstraction& glAbstraction );
/**
- * @copydoc Dali::Internal::Adaptor::RenderSurface::PostRender()
+ * @copydoc Dali::RenderSurface::PostRender()
*/
- virtual void PostRender( EglInterface& egl, Integration::GlAbstraction& glAbstraction, unsigned int timeDelta, bool replacingSurface );
+ virtual void PostRender( EglInterface& egl, Integration::GlAbstraction& glAbstraction, DisplayConnection* displayConnection, unsigned int deltaTime, bool replacingSurface );
/**
- * @copydoc Dali::Internal::Adaptor::RenderSurface::StopRender()
+ * @copydoc Dali::RenderSurface::StopRender()
*/
virtual void StopRender();
* If sync mode is WAIT, then acquire a lock. This prevents render thread from
* continuing until the pixmap has been drawn by the compositor.
* It must be released for rendering to continue.
- * @param[in] syncMode The sync mode
+ * @param[in] syncMode The current sync mode
*/
void AcquireLock( SyncMode syncMode );
private: // Data
+ boost::condition_variable mSyncNotify; ///< condition to notify main thread that pixmap was flushed to onscreen
+ boost::mutex mSyncMutex; ///< mutex to lock during waiting sync
Ecore_X_Pixmap mX11Pixmap; ///< X-Pixmap
SyncMode mSyncMode; ///< Stores whether the post render should block waiting for compositor
- boost::mutex mSyncMutex; ///< mutex to lock during waiting sync
- boost::condition_variable mSyncNotify; ///< condition to notify main thread that pixmap was flushed to onscreen
bool mSyncReceived; ///< true, when a pixmap sync has occurred, (cleared after reading)
};
} // namespace ECore
-} // namespace Adaptor
-
-} // namespace internal
-
} // namespace Dali
-#endif // __DALI_INTERNAL_ECORE_X_PIXMAP_RENDER_SURFACE_H__
+#endif // __DALI_ECORE_X_PIXMAP_RENDER_SURFACE_H__
# mobile profile internal files
adaptor_common_internal_mobile_profile_src_files = \
- $(adaptor_mobile_dir)/mobile-render-surface-factory.cpp \
+ $(adaptor_mobile_dir)/pixmap-render-surface-factory.cpp \
$(adaptor_mobile_dir)/mobile-system-settings.cpp \
$(adaptor_mobile_dir)/mobile-color-controller-impl.cpp
namespace Dali
{
-namespace Internal
-{
-
-namespace Adaptor
-{
-
namespace ECore
{
-DALI_EXPORT_API RenderSurface* CreatePixmapSurface(
- PositionSize positionSize,
- Any surface,
- Any display,
- const std::string& name,
- bool isTransparent )
+DALI_EXPORT_API PixmapRenderSurface* CreatePixmapSurface(
+ PositionSize positionSize,
+ Any surface,
+ const std::string& name,
+ bool isTransparent)
{
- return new PixmapRenderSurface( positionSize, surface, display, name, isTransparent );
+ return new PixmapRenderSurface(positionSize, surface, name, isTransparent);
}
} // namespace ECoreX
-} // namespace Adaptor
-
-} // namespace Internal
-
} // namespace Dali
*/
// EXTERNAL INCLUDES
-#include <string>
#include <dali/public-api/math/rect.h>
#include <dali/public-api/object/any.h>
+#include <dali/public-api/common/dali-common.h>
+#include <dali/public-api/common/view-mode.h>
+
+// INTERNAL INCLUDES
namespace Dali
{
+class EglInterface;
+class DisplayConnection;
+
+namespace Integration
+{
+
+class GlAbstraction;
+
+} // namespace Integration
+
/**
* @brief The position and size of the render surface.
*/
* The implementation of the factory method below should choose an appropriate
* implementation of RenderSurface for the given platform
*/
+
class RenderSurface
{
public:
- /**
- * @brief enumeration of surface types
- */
- enum SurfaceType
- {
- NO_SURFACE, ///< not configured
- PIXMAP, ///< Pixmap
- WINDOW, ///< Window
- NATIVE_BUFFER ///< Native Buffer
- };
/**
* @brief Constructor
virtual ~RenderSurface() {}
/**
- * @brief returns the surface type.
- * @return the surface type
+ * @brief Return the size and position of the surface.
+ * @return The position and size
+ */
+ virtual PositionSize GetPositionSize() const = 0;
+
+ /**
+ * Initialize EGL, RenderSurface should create egl display and initialize
+ * @param egl implementation to use for the creation
*/
- virtual SurfaceType GetType() = 0;
+ virtual void InitializeEgl( EglInterface& egl ) = 0;
/**
- * @brief Returns the window or pixmap surface.
- * @return surface
+ * @brief Creates EGL Surface
+ * @param egl implementation to use for the creation
*/
- virtual Any GetSurface() = 0;
+ virtual void CreateEglSurface( EglInterface& egl ) = 0;
/**
- * @brief Returns the display.
- * @return display
+ * @brief Destroys EGL Surface
+ * @param egl implementation to use for the destruction
*/
- virtual Any GetDisplay() = 0;
+ virtual void DestroyEglSurface( EglInterface& egl ) = 0;
/**
- * @brief Return the size and position of the surface.
- * @return The position and size
+ * @brief Replace the EGL Surface
+ * @param egl implementation to use for the creation
+ * @return true if context was lost
*/
- virtual PositionSize GetPositionSize() const = 0;
+ virtual bool ReplaceEGLSurface( EglInterface& egl ) = 0;
+
+ /**
+ * @brief Resizes the underlying surface. Only available for x window
+ */
+ virtual void MoveResize( Dali::PositionSize positionSize ) = 0;
+
+ /**
+ * @brief Set the stereoscopic 3D view mode
+ * @param[in] viewMode The new view mode
+ */
+ virtual void SetViewMode( ViewMode viewMode ) = 0;
+
+ /**
+ * @brief Called when Render thread has started
+ */
+ virtual void StartRender() = 0;
+
+ /**
+ * @brief Invoked by render thread before Core::Render
+ * If the operation fails, then Core::Render should not be called until there is
+ * a surface to render onto.
+ * @param[in] egl The Egl interface
+ * @param[in] glAbstraction OpenGLES abstraction interface
+ * @return True if the operation is successful, False if the operation failed
+ */
+ virtual bool PreRender( EglInterface& egl, Integration::GlAbstraction& glAbstraction ) = 0;
+
+ /**
+ * @brief Invoked by render thread after Core::Render
+ * @param[in] egl The Egl interface
+ * @param[in] glAbstraction OpenGLES abstraction interface
+ * @param[in] displayConnection display connection
+ * @param[in] deltaTime Time (in microseconds) since PostRender was last called.
+ * @param[in] replacingSurface True if the surface is being replaced.
+ */
+ virtual void PostRender( EglInterface& egl, Integration::GlAbstraction& glAbstraction, DisplayConnection* displayConnection, unsigned int deltaTime, bool replacingSurface ) = 0;
+
+ /**
+ * @brief Invoked by render thread when the thread should be stop
+ */
+ virtual void StopRender() = 0;
+
+ /**
+ * @brief Invoked by Event Thread when the compositor lock should be released and rendering should resume.
+ */
+ virtual void ReleaseLock() = 0;
private:
* @brief Undefined assignment operator. RenderSurface cannot be copied
*/
RenderSurface& operator=( const RenderSurface& rhs );
-
};
} // namespace Dali
{
}
+SingletonService SingletonService::New()
+{
+ return Internal::Adaptor::SingletonService::New();
+}
+
SingletonService SingletonService::Get()
{
return Internal::Adaptor::SingletonService::Get();
SingletonService();
/**
+ * Create a SingletonService.
+ * This should only be called once by the Application class.
+ * @return A newly created SingletonService.
+ */
+ static Dali::SingletonService New();
+
+ /**
* @brief Retrieves a handle to the SingletonService.
*
* @return A handle to the SingletonService if it is available. This will be an empty handle if
namespace Dali
{
-namespace Internal
-{
-
-namespace Adaptor
-{
-
namespace ECore
{
-DALI_EXPORT_API RenderSurface* CreatePixmapSurface(
+DALI_EXPORT_API PixmapRenderSurface* CreatePixmapSurface(
PositionSize positionSize,
Any surface,
- Any display,
const std::string& name,
bool isTransparent )
{
- return new PixmapRenderSurface( positionSize, surface, display, name, isTransparent );
+ return new PixmapRenderSurface( positionSize, surface, name, isTransparent );
}
} // namespace ECoreX
-} // namespace Adaptor
-
-} // namespace Internal
-
} // namespace Dali
--- /dev/null
+/*
+ * Copyright (c) 2015 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 "display-connection-impl.h"
+
+// EXTERNAL_HEADERS
+#include <Ecore_Wayland.h>
+#include <dali/integration-api/debug.h>
+
+// INTERNAL HEADERS
+#include <pixmap-render-surface.h>
+
+namespace Dali
+{
+
+namespace Internal
+{
+
+namespace Adaptor
+{
+
+DisplayConnection* DisplayConnection::New()
+{
+ DisplayConnection* pDisplayConnection(new DisplayConnection());
+
+ return pDisplayConnection;
+}
+
+DisplayConnection::DisplayConnection()
+: mDisplay(NULL)
+{
+ //FIXME
+}
+
+DisplayConnection::~DisplayConnection()
+{
+ //FIXME
+}
+
+Any DisplayConnection::GetDisplay()
+{
+ return Any(mDisplay);
+}
+
+void DisplayConnection::ConsumeEvents()
+{
+}
+
+bool DisplayConnection::InitializeEgl(EglInterface& egl)
+{
+ EglImplementation& eglImpl = static_cast<EglImplementation&>(egl);
+
+ if (!eglImpl.InitializeGles(reinterpret_cast<EGLNativeDisplayType>(mDisplay)))
+ {
+ DALI_LOG_ERROR("Failed to initialize GLES.");
+ return false;
+ }
+
+ return true;
+}
+
+void DisplayConnection::GetDpi(unsigned int& dpiHorizontal, unsigned int& dpiVertical)
+{
+ // calculate DPI
+ float xres, yres;
+
+ // 1 inch = 25.4 millimeters
+ xres = ecore_wl_dpi_get();
+ yres = ecore_wl_dpi_get();
+
+ dpiHorizontal = int(xres + 0.5f); // rounding
+ dpiVertical = int(yres + 0.5f);
+}
+
+} // namespace Adaptor
+
+} // namespace Internal
+
+} // namespace Dali
--- /dev/null
+#ifndef __DALI_INTERNAL_ECORE_X_DIPLAY_CONNECTION_H__
+#define __DALI_INTERNAL_ECORE_X_DIPLAY_CONNECTION_H__
+
+/*
+ * Copyright (c) 2015 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.
+ *
+ */
+
+// EXTERNAL INCLUDES
+#include <wayland-egl.h>
+#include <Ecore_Wayland.h>
+#include <ecore-wl-types.h>
+
+// INTERNAL INCLUDES
+#include <base/display-connection.h>
+#include <dali/public-api/object/base-object.h>
+#include <gl/egl-implementation.h>
+
+namespace Dali
+{
+
+class RenderSurface;
+class DisplayConnection;
+
+namespace Internal
+{
+
+namespace Adaptor
+{
+
+/**
+ * DisplayConnection implementation
+ */
+class DisplayConnection : public Dali::BaseObject
+{
+public:
+
+ /**
+ * @brief Default constructor
+ */
+ DisplayConnection();
+
+ /**
+ * @brief Create an initialized DisplayConnection.
+ *
+ * @return A handle to a newly allocated DisplayConnection resource.
+ */
+ static DisplayConnection* New();
+
+public:
+
+ /**
+ * @copydoc Dali::DisplayConnection::GetDisplay
+ */
+ Any GetDisplay();
+
+ /**
+ * @copydoc Dali::DisplayConnection::GetDpi
+ */
+ static void GetDpi(unsigned int& dpiHorizontal, unsigned int& dpiVertical);
+
+ /**
+ * @copydoc Dali::DisplayConnection::ConsumeEvents
+ */
+ void ConsumeEvents();
+
+ /**
+ * @copydoc Dali::DisplayConnection::InitializeEgl
+ */
+ bool InitializeEgl(EglInterface& egl);
+
+public:
+
+ /**
+ * Destructor
+ */
+ virtual ~DisplayConnection();
+
+protected:
+
+ // Undefined
+ DisplayConnection(const DisplayConnection&);
+
+ // Undefined
+ DisplayConnection& operator=(const DisplayConnection& rhs);
+
+private:
+ WlDisplay* mDisplay; ///< Wayland-display for rendering
+};
+
+} // namespace Adaptor
+
+} // namespace internal
+
+} // namespace Dali
+
+#endif // __DALI_INTERNAL_ECORE_X_DIPLAY_CONNECTION_H__
// INTERNAL INCLUDES
#include <ecore-wl-types.h>
#include <trigger-event.h>
+#include <gl/egl-implementation.h>
namespace Dali
{
-namespace Internal
-{
-
-namespace Adaptor
-{
-
#if defined(DEBUG_ENABLED)
Debug::Filter* gRenderSurfaceLogFilter = Debug::Filter::New(Debug::Verbose, false, "LOG_ECORE_X_RENDER_SURFACE");
#endif
namespace ECore
{
-namespace
-{
-
-static bool gWlInitThreadsCalled = false; ///< global to say whether WlInitThreads has been called in this process
-
-} // unnamed namespace
-
-RenderSurface::RenderSurface( SurfaceType type,
- Dali::PositionSize positionSize,
- Any surface,
- Any display,
- const std::string& name,
- bool isTransparent)
-: mMainDisplay(NULL),
- mType(type),
- mPosition(positionSize),
+EcoreWlRenderSurface::EcoreWlRenderSurface(Dali::PositionSize positionSize,
+ Any surface,
+ const std::string& name,
+ bool isTransparent)
+: mPosition(positionSize),
mTitle(name),
+ mRenderNotification(NULL),
mColorDepth(isTransparent ? COLOR_DEPTH_32 : COLOR_DEPTH_24),
- mRenderNotification( NULL ),
- mOwnSurface(false),
- mOwnDisplay(false)
+ mOwnSurface(false)
{
- // see if there is a display in Any display
- SetDisplay( display );
}
-void RenderSurface::Init( Any surface )
+void EcoreWlRenderSurface::Init( Any surface )
{
// see if there is a surface in Any surface
unsigned int surfaceId = GetSurfaceId( surface );
// if the surface is empty, create a new one.
if ( surfaceId == 0 )
{
- if ( !gWlInitThreadsCalled )
- {
- ecore_wl_init(NULL);
- mMainDisplay = ecore_wl_display_get();
- mOwnDisplay = true;
- gWlInitThreadsCalled = true;
- }
-
// we own the surface about to created
mOwnSurface = true;
CreateWlRenderable();
}
#ifdef DEBUG_ENABLED
- // prints out 'INFO: DALI: new RenderSurface, created display xx, used existing surface xx
+ // prints out 'INFO: DALI: new EcoreWlRenderSurface, created display xx, used existing surface xx
// we can not use LOG_INFO because the surface can be created before Dali Core is created.
- printf( "INFO: DALI: new RenderSurface, %s display %p, %s %s surface %X \n",
- mOwnDisplay?"created":"used existing",mMainDisplay,
- mOwnSurface?"created":"used existing",
- Dali::RenderSurface::PIXMAP==mType?" pixmap" :"window",
- GetDrawable() );
+ printf( "INFO: DALI: new EcoreWlRenderSurface, %s %s surface %X \n",
+ mOwnSurface?"created":"used existing",
+ Dali::RenderSurface::PIXMAP==mType?" pixmap" :"window",
+ GetDrawable() );
#endif
}
-RenderSurface::~RenderSurface()
+EcoreWlRenderSurface::~EcoreWlRenderSurface()
{
- // release the display connection if we use our own
- if( mOwnDisplay )
- {
- if( mMainDisplay )
- {
- // NOTE, on 64bit desktop with some NVidia driver versions this crashes
- }
- }
}
-Ecore_Wl_Window* RenderSurface::GetWlWindow()
-{
- return 0;
-}
-
-WlDisplay* RenderSurface::GetMainDisplay()
-{
- return mMainDisplay;
-}
-
-void RenderSurface::SetRenderNotification( TriggerEvent* renderNotification )
+void EcoreWlRenderSurface::SetRenderNotification(TriggerEventInterface* renderNotification)
{
mRenderNotification = renderNotification;
}
-Ecore_Wl_Window* RenderSurface::GetDrawable()
+Ecore_Wl_Window* EcoreWlRenderSurface::GetWlWindow()
{
return 0;
}
-Any RenderSurface::GetDisplay()
+Ecore_Wl_Window* EcoreWlRenderSurface::GetDrawable()
{
- // this getter is used by main thread so we need to return the main thread version of the display
- return Any( ecore_wl_display_get() );
+ return 0;
}
-PositionSize RenderSurface::GetPositionSize() const
+PositionSize EcoreWlRenderSurface::GetPositionSize() const
{
return mPosition;
}
-void RenderSurface::MoveResize( Dali::PositionSize positionSize )
+void EcoreWlRenderSurface::MoveResize( Dali::PositionSize positionSize )
{
// nothing to do in base class
}
-void RenderSurface::GetDpi( unsigned int& dpiHorizontal, unsigned int& dpiVertical ) const
-{
- // calculate DPI
- float xres, yres;
-
- // 1 inch = 25.4 millimeters
- xres = ecore_wl_dpi_get();
- yres = ecore_wl_dpi_get();
-
- dpiHorizontal = int(xres + 0.5f); // rounding
- dpiVertical = int(yres + 0.5f);
-}
-
-void RenderSurface::Map()
+void EcoreWlRenderSurface::SetViewMode( ViewMode viewMode )
{
}
-void RenderSurface::TransferDisplayOwner( Internal::Adaptor::RenderSurface& newSurface )
-{
- // if we don't own the display return
- if( mOwnDisplay == false )
- {
- return;
- }
-
- RenderSurface* other = dynamic_cast< RenderSurface* >( &newSurface );
- if( other )
- {
- // if both surfaces share the same display, and this surface owns it,
- // then transfer the ownership to the new surface
- if( other->mMainDisplay == mMainDisplay )
- {
- mOwnDisplay = false;
- other->mOwnDisplay = true;
- }
- }
-}
-
-void RenderSurface::ConsumeEvents()
-{
-}
-
-void RenderSurface::SetViewMode( ViewMode )
-{
-}
-
-void RenderSurface::SetDisplay( Any display )
-{
- // the render surface can be passed either EFL e-core types, or x11 types
- // we use boost any to determine at run time which type
-
- if ( display.Empty() == false )
- {
- // check we have a valid type
- DALI_ASSERT_ALWAYS( ( display.GetType() == typeid (WlDisplay *) )
- &&
- "Display type is invalid" );
-
- mOwnDisplay = false;
-
- mMainDisplay = AnyCast< WlDisplay* >( display );
- }
-}
-
-unsigned int RenderSurface::GetSurfaceId( Any surface ) const
+unsigned int EcoreWlRenderSurface::GetSurfaceId( Any surface ) const
{
unsigned int surfaceId = 0;
} // namespace ECore
-} // namespace Adaptor
-
-} // namespace Internal
-
} // namespace Dali
// CLASS HEADER
+#include <wayland-egl.h>
#include <gl/egl-implementation.h>
// EXTERNAL INCLUDES
eglQueryString(mEglDisplay, EGL_VERSION),
eglQueryString(mEglDisplay, EGL_CLIENT_APIS),
eglQueryString(mEglDisplay, EGL_EXTENSIONS));
-
}
void EglImplementation::MakeContextNull()
{
case EGL_BAD_DISPLAY:
{
- DALI_LOG_ERROR("Display is not an EGL display connection");
+ DALI_LOG_ERROR("Display is not an EGL display connection\n");
break;
}
case EGL_BAD_ATTRIBUTE:
{
- DALI_LOG_ERROR("The parameter confirAttribs contains an invalid frame buffer configuration attribute or an attribute value that is unrecognized or out of range");
+ DALI_LOG_ERROR("The parameter configAttribs contains an invalid frame buffer configuration attribute or an attribute value that is unrecognized or out of range\n");
break;
}
case EGL_NOT_INITIALIZED:
{
- DALI_LOG_ERROR("Display has not been initialized");
+ DALI_LOG_ERROR("Display has not been initialized\n");
break;
}
case EGL_BAD_PARAMETER:
{
- DALI_LOG_ERROR("The parameter numConfig is NULL");
+ DALI_LOG_ERROR("The parameter numConfig is NULL\n");
break;
}
default:
{
- DALI_LOG_ERROR("Unknown error");
+ DALI_LOG_ERROR("Unknown error.\n");
}
}
DALI_ASSERT_ALWAYS(false && "eglChooseConfig failed!");
if ( numConfigs != 1 )
{
- DALI_LOG_ERROR("No configurations found.");
+ DALI_LOG_ERROR("No configurations found.\n");
TEST_EGL_ERROR("eglChooseConfig");
}
}
-
void EglImplementation::CreateSurfaceWindow( EGLNativeWindowType window, ColorDepth depth )
{
DALI_ASSERT_ALWAYS( ( mEglSurface == 0 ) && "EGL surface already exists" );
DALI_ASSERT_ALWAYS( mEglSurface && "Create pixmap surface failed" );
}
-bool EglImplementation::ReplaceSurfaceWindow( EGLNativeWindowType window, EGLNativeDisplayType display )
+bool EglImplementation::ReplaceSurfaceWindow( EGLNativeWindowType window )
{
bool contextLost = false;
+ // display connection has not changed, then we can just create a new surface
// the surface is bound to the context, so set the context to null
MakeContextNull();
// destroy the surface
DestroySurface();
- // If the display has not changed, then we can just create a new surface
- if ( display == mEglNativeDisplay )
- {
- // create the EGL surface
- CreateSurfaceWindow( window, mColorDepth );
-
- // set the context to be current with the new surface
- MakeContextCurrent();
- }
- else // the display has changed, we need to start egl with a new x-connection
- {
- // Note! this code path is untested
-
- // this will release all EGL specific resources
- eglTerminate( mEglDisplay );
-
- mGlesInitialized = false;
-
- // let the adaptor know that all resources have been lost
- contextLost = true;
-
- // re-initialise GLES with the new connection
- InitializeGles( display );
-
- // create the EGL surface
- CreateSurfaceWindow( window, mColorDepth );
+ // create the EGL surface
+ CreateSurfaceWindow( window, mColorDepth );
- // create the OpenGL context
- CreateContext();
-
- // Make it current
- MakeContextCurrent();
- }
+ // set the context to be current with the new surface
+ MakeContextCurrent();
return contextLost;
}
-bool EglImplementation::ReplaceSurfacePixmap( EGLNativePixmapType pixmap, EGLNativeDisplayType display )
+bool EglImplementation::ReplaceSurfacePixmap( EGLNativePixmapType pixmap )
{
bool contextLost = false;
// destroy the surface
DestroySurface();
- // If the display has not changed, then we can just create a new surface
- if ( display == mEglNativeDisplay )
- {
- // create the EGL surface
- CreateSurfacePixmap( pixmap, mColorDepth );
+ // display connection has not changed, then we can just create a new surface
+ // create the EGL surface
+ CreateSurfacePixmap( pixmap, mColorDepth );
- // set the context to be current with the new surface
- MakeContextCurrent();
- }
- else // the display has changed, we need to start egl with a new x-connection
- {
- // Note! this code path is untested
-
- // this will release all EGL specific resources
- eglTerminate( mEglDisplay );
+ // set the context to be current with the new surface
+ MakeContextCurrent();
- mGlesInitialized = false;
-
- // let the adaptor know that all resources have been lost
- contextLost = true;
-
- // re-initialise GLES with the new connection
- InitializeGles( display );
-
- // create the EGL surface
- CreateSurfacePixmap( pixmap, mColorDepth );
-
- // create the OpenGL context
- CreateContext();
-
- // Make it current
- MakeContextCurrent();
- }
return contextLost;
}
{
Ecore_Wl_Window* window = 0;
- if( surface->GetType() == Dali::RenderSurface::WINDOW )
+ // this code only works with the Ecore RenderSurface so need to downcast
+ ECore::WindowRenderSurface* ecoreSurface = dynamic_cast< ECore::WindowRenderSurface* >( surface );
+ if( ecoreSurface )
{
- // this code only works with the Ecore RenderSurface so need to downcast
- ECore::WindowRenderSurface* ecoreSurface = dynamic_cast< ECore::WindowRenderSurface* >( surface );
- if( ecoreSurface )
- {
- window = ecoreSurface->GetWlWindow();
- }
+ window = ecoreSurface->GetWlWindow();
}
mImpl = new Impl(this, window);
adaptor_wayland_tizen_internal_src_files = \
$(adaptor_wayland_dir)/accessibility-manager-impl-wl.cpp \
$(adaptor_wayland_dir)/clipboard-impl-wl.cpp \
+ $(adaptor_wayland_dir)/display-connection-impl-wl.cpp \
$(adaptor_wayland_dir)/framework-wl.cpp \
$(adaptor_wayland_dir)/imf-manager-impl-wl.cpp \
$(adaptor_wayland_dir)/pixmap-image-impl-wl.cpp \
namespace Dali
{
+class RenderSurface;
+
namespace Internal
{
namespace Adaptor
{
-class RenderSurface;
-
class ImfManager : public Dali::BaseObject
{
public:
// INTERNAL INCLUDES
#include <ecore-wl-types.h>
#include <trigger-event.h>
+#include <gl/egl-implementation.h>
+#include <base/display-connection.h>
namespace Dali
{
-namespace Internal
-{
-
-namespace Adaptor
-{
-
#if defined(DEBUG_ENABLED)
extern Debug::Filter* gRenderSurfaceLogFilter;
#endif
namespace ECore
{
-PixmapRenderSurface::PixmapRenderSurface( Dali::PositionSize positionSize,
- Any surface,
- Any display,
- const std::string& name,
- bool isTransparent)
-: RenderSurface( Dali::RenderSurface::PIXMAP, positionSize, surface, display, name, isTransparent )
+PixmapRenderSurface::PixmapRenderSurface(Dali::PositionSize positionSize,
+ Any surface,
+ const std::string& name,
+ bool isTransparent)
+: EcoreWlRenderSurface( positionSize, surface, name, isTransparent )
{
Init( surface );
}
}
}
-Dali::RenderSurface::SurfaceType PixmapRenderSurface::GetType()
+Ecore_Wl_Window* PixmapRenderSurface::GetDrawable()
{
- return Dali::RenderSurface::PIXMAP;
+ return NULL;
}
Any PixmapRenderSurface::GetSurface()
return Any( NULL );
}
-void PixmapRenderSurface::InitializeEgl( EglInterface& eglIf )
+void PixmapRenderSurface::InitializeEgl( EglInterface& egl )
{
DALI_LOG_TRACE_METHOD( gRenderSurfaceLogFilter );
- EglImplementation& eglImpl = static_cast<EglImplementation&>( eglIf );
- eglImpl.InitializeGles( reinterpret_cast< EGLNativeDisplayType >( mMainDisplay ) );
+ Internal::Adaptor::EglImplementation& eglImpl = static_cast<Internal::Adaptor::EglImplementation&>( egl );
eglImpl.ChooseConfig(false, mColorDepth);
}
-void PixmapRenderSurface::CreateEglSurface( EglInterface& eglIf )
+void PixmapRenderSurface::CreateEglSurface( EglInterface& egl )
{
DALI_LOG_TRACE_METHOD( gRenderSurfaceLogFilter );
- //EglImplementation& eglImpl = static_cast<EglImplementation&>( eglIf );
-
// create the EGL surface
// need to cast to X handle as in 64bit system ECore handle is 32 bit whereas EGLnative and XWindow are 64 bit
// FIXME
}
-void PixmapRenderSurface::DestroyEglSurface( EglInterface& eglIf )
+void PixmapRenderSurface::DestroyEglSurface( EglInterface& egl )
{
DALI_LOG_TRACE_METHOD( gRenderSurfaceLogFilter );
- EglImplementation& eglImpl = static_cast<EglImplementation&>( eglIf );
+ Internal::Adaptor::EglImplementation& eglImpl = static_cast<Internal::Adaptor::EglImplementation&>( egl );
eglImpl.DestroySurface();
}
-bool PixmapRenderSurface::ReplaceEGLSurface( EglInterface& eglIf )
+bool PixmapRenderSurface::ReplaceEGLSurface( EglInterface& egl )
{
DALI_LOG_TRACE_METHOD( gRenderSurfaceLogFilter );
- EglImplementation& eglImpl = static_cast<EglImplementation&>( eglIf );
- eglImpl.InitializeGles( reinterpret_cast< EGLNativeDisplayType >( mMainDisplay ) );
-
// a new surface for the new pixmap
// need to cast to X handle as in 64bit system ECore handle is 32 bit whereas EGLnative and XWindow are 64 bit
// FIXME
void PixmapRenderSurface::StartRender()
{
+ // FIXME
}
bool PixmapRenderSurface::PreRender( EglInterface&, Integration::GlAbstraction& )
return true;
}
-void PixmapRenderSurface::PostRender( EglInterface& egl, Integration::GlAbstraction& glAbstraction, unsigned int timeDelta, bool replacingSurface )
+void PixmapRenderSurface::PostRender( EglInterface& egl, Integration::GlAbstraction& glAbstraction, DisplayConnection* displayConnection, unsigned int deltaTime, bool replacingSurface )
{
// flush gl instruction queue
glAbstraction.Flush();
- // create damage for client applications which wish to know the update timing
+ // create damage for client applications which wish to know the update timing
if( mRenderNotification )
{
// use notification trigger
}
else
{
- // as a fallback, send damage event. This is needed until livebox is fixed to
- // stop using damage events for render
// FIXME
}
void PixmapRenderSurface::StopRender()
{
+ // FIXME
}
void PixmapRenderSurface::CreateWlRenderable()
void PixmapRenderSurface::UseExistingRenderable( unsigned int surfaceId )
{
+ // FIXME
}
void PixmapRenderSurface::SetSyncMode( SyncMode syncMode )
{
+ // FIXME
}
void PixmapRenderSurface::AcquireLock( SyncMode syncMode )
{
+ // FIXME
}
void PixmapRenderSurface::ReleaseLock()
{
+ // FIXME
}
} // namespace ECore
-} // namespace Adaptor
-
-} // namespace Internal
-
} // namespace Dali
{
// create an Wayland window by default
Any surface;
- Any display;
- mSurface = new ECore::WindowRenderSurface( windowPosition, surface, display, name, mIsTransparent );
+ ECore::WindowRenderSurface* windowSurface = new ECore::WindowRenderSurface( windowPosition, surface, name, mIsTransparent );
+ windowSurface->Map();
+
+ mSurface = windowSurface;
+
mOrientation = Orientation::New(this);
// create event handler for Wayland window
// INTERNAL INCLUDES
#include <ecore-wl-types.h>
#include <trigger-event.h>
+#include <gl/egl-implementation.h>
+#include <base/display-connection.h>
namespace Dali
{
-namespace Internal
-{
-
-namespace Adaptor
-{
-
#if defined(DEBUG_ENABLED)
extern Debug::Filter* gRenderSurfaceLogFilter;
#endif
WindowRenderSurface::WindowRenderSurface( Dali::PositionSize positionSize,
Any surface,
- Any display,
const std::string& name,
bool isTransparent)
-: RenderSurface( Dali::RenderSurface::WINDOW, positionSize, surface, display, name, isTransparent ),
+: EcoreWlRenderSurface( positionSize, surface, name, isTransparent ),
mNeedToApproveDeiconify(false)
{
DALI_LOG_INFO( gRenderSurfaceLogFilter, Debug::Verbose, "Creating Window\n" );
return mWlWindow;
}
-Dali::RenderSurface::SurfaceType WindowRenderSurface::GetType()
-{
- return Dali::RenderSurface::WINDOW;
-}
-
Any WindowRenderSurface::GetSurface()
{
// already an e-core type
{
DALI_LOG_TRACE_METHOD( gRenderSurfaceLogFilter );
- EglImplementation& eglImpl = static_cast<EglImplementation&>( eglIf );
- eglImpl.InitializeGles( reinterpret_cast< EGLNativeDisplayType >( mMainDisplay ) );
+ Internal::Adaptor::EglImplementation& eglImpl = static_cast<Internal::Adaptor::EglImplementation&>( eglIf );
eglImpl.ChooseConfig(true, mColorDepth);
}
{
DALI_LOG_TRACE_METHOD( gRenderSurfaceLogFilter );
- EglImplementation& eglImpl = static_cast<EglImplementation&>( eglIf );
+ Internal::Adaptor::EglImplementation& eglImpl = static_cast<Internal::Adaptor::EglImplementation&>( eglIf );
// create the EGL surface
ecore_wl_window_surface_create(mWlWindow);
{
DALI_LOG_TRACE_METHOD( gRenderSurfaceLogFilter );
- EglImplementation& eglImpl = static_cast<EglImplementation&>( eglIf );
+ Internal::Adaptor::EglImplementation& eglImpl = static_cast<Internal::Adaptor::EglImplementation&>( eglIf );
eglImpl.DestroySurface();
wl_egl_window_destroy(mEglWindow);
mEglWindow = NULL;
}
-bool WindowRenderSurface::ReplaceEGLSurface( EglInterface& eglIf )
+bool WindowRenderSurface::ReplaceEGLSurface( EglInterface& egl )
{
DALI_LOG_TRACE_METHOD( gRenderSurfaceLogFilter );
- EglImplementation& egl = static_cast<EglImplementation&>( eglIf );
- egl.InitializeGles( reinterpret_cast< EGLNativeDisplayType >( mMainDisplay ) );
-
wl_egl_window_destroy(mEglWindow);
mEglWindow = wl_egl_window_create(ecore_wl_window_surface_get(mWlWindow), mPosition.width, mPosition.height);
- return egl.ReplaceSurfaceWindow( (EGLNativeWindowType)mEglWindow, // reinterpret_cast does not compile
- reinterpret_cast< EGLNativeDisplayType >( mMainDisplay ) );
+
+ Internal::Adaptor::EglImplementation& eglImpl = static_cast<Internal::Adaptor::EglImplementation&>( egl );
+ return eglImpl.ReplaceSurfaceWindow( (EGLNativeWindowType)mEglWindow ); // reinterpret_cast does not compile
}
void WindowRenderSurface::MoveResize( Dali::PositionSize positionSize )
return true;
}
-void WindowRenderSurface::PostRender( EglInterface& egl, Integration::GlAbstraction& glAbstraction, unsigned int, bool )
+void WindowRenderSurface::PostRender( EglInterface& egl, Integration::GlAbstraction& glAbstraction, DisplayConnection* displayConnection, unsigned int deltaTime, bool replacingSurface )
{
- EglImplementation& eglImpl = static_cast<EglImplementation&>( egl );
+ Internal::Adaptor::EglImplementation& eglImpl = static_cast<Internal::Adaptor::EglImplementation&>( egl );
eglImpl.SwapBuffers();
// When the window is deiconified, it approves the deiconify operation to window manager after rendering
// SwapBuffer is desychronized. So make sure to sychronize when window is deiconified.
glAbstraction.Finish();
+ //FIXME
+
mNeedToApproveDeiconify = false;
}
}
void WindowRenderSurface::SetViewMode( ViewMode viewMode )
{
+ //FIXME
}
void WindowRenderSurface::CreateWlRenderable()
{
DALI_ASSERT_ALWAYS(0 && "Failed to create X window");
}
+
+ //FIXME
}
void WindowRenderSurface::UseExistingRenderable( unsigned int surfaceId )
} // namespace ECore
-} // namespace Adaptor
-
-} // namespace Internal
-
} // namespace Dali
namespace Dali
{
-namespace Internal
-{
-
-namespace Adaptor
-{
-
namespace ECore
{
/**
- * @copydoc Dali::Internal::Adaptor::ECore::RenderSurface.
+ * @copydoc Dali::ECore::EcoreWlRenderSurface.
* Window specialization.
*/
-class WindowRenderSurface : public RenderSurface
+class WindowRenderSurface : public EcoreWlRenderSurface
{
public:
* Uses an Wayland surface to render to.
* @param [in] positionSize the position and size of the surface
* @param [in] surface can be a Wayland-window or Wayland-pixmap (type must be unsigned int).
- * @param [in] display connection to Wayland-server if the surface is a X window or pixmap (type must be void * to X display struct)
* @param [in] name optional name of surface passed in
* @param [in] isTransparent if it is true, surface has 32 bit color depth, otherwise, 24 bit
*/
WindowRenderSurface( Dali::PositionSize positionSize,
Any surface,
- Any display,
const std::string& name,
bool isTransparent = false );
/**
- * @copydoc Dali::Internal::Adaptor::ECore::RenderSurface::~RenderSurface
+ * @copydoc Dali::ECore::EcoreWlRenderSurface::~EcoreWlRenderSurface
*/
virtual ~WindowRenderSurface();
*/
void RequestToApproveDeiconify();
-public: // from Dali::RenderSurface
-
/**
- * @copydoc Dali::RenderSurface::GetType()
+ * Map window
*/
- virtual Dali::RenderSurface::SurfaceType GetType();
+ virtual void Map();
/**
- * @copydoc Dali::RenderSurface::GetSurface()
+ * @copydoc Dali::ECore::EcoreWlRenderSurface::GetSurface()
*/
virtual Any GetSurface();
/**
- * @copydoc Dali::RenderSurface::GetDrawable()
+ * @copydoc Dali::ECore::EcoreWlRenderSurface::GetWlWindow()
*/
virtual Ecore_Wl_Window* GetWlWindow();
-public: // from Internal::Adaptor::RenderSurface
+public: // from Dali::RenderSurface
/**
- * @copydoc Dali::Internal::Adaptor::RenderSurface::InitializeEgl()
+ * @copydoc Dali::RenderSurface::InitializeEgl()
*/
virtual void InitializeEgl( EglInterface& egl );
/**
- * @copydoc Dali::Internal::Adaptor::RenderSurface::CreateEglSurface()
+ * @copydoc Dali::RenderSurface::CreateEglSurface()
*/
virtual void CreateEglSurface( EglInterface& egl );
/**
- * @copydoc Dali::Internal::Adaptor::RenderSurface::DestroyEglSurface()
+ * @copydoc Dali::RenderSurface::DestroyEglSurface()
*/
virtual void DestroyEglSurface( EglInterface& egl );
/**
- * @copydoc Dali::Internal::Adaptor::RenderSurface::ReplaceEGLSurface()
+ * @copydoc Dali::RenderSurface::ReplaceEGLSurface()
*/
virtual bool ReplaceEGLSurface( EglInterface& egl );
/**
- * @copydoc Dali::Internal::Adaptor::RenderSurface::MoveResize()
+ * @copydoc Dali::RenderSurface::MoveResize()
*/
virtual void MoveResize( Dali::PositionSize positionSize);
/**
- * @copydoc Dali::Internal::Adaptor::RenderSurface::Map()
+ * @copydoc Dali::RenderSurface::SetViewMode()
*/
- virtual void Map();
+ void SetViewMode( ViewMode viewMode );
/**
- * @copydoc Dali::Internal::Adaptor::RenderSurface::StartRender()
+ * @copydoc Dali::RenderSurface::StartRender()
*/
virtual void StartRender();
/**
- * @copydoc Dali::Internal::Adaptor::RenderSurface::PreRender()
+ * @copydoc Dali::RenderSurface::PreRender()
*/
virtual bool PreRender( EglInterface& egl, Integration::GlAbstraction& glAbstraction );
/**
- * @copydoc Dali::Internal::Adaptor::RenderSurface::PostRender()
+ * @copydoc Dali::RenderSurface::PostRender()
*/
- virtual void PostRender( EglInterface& egl, Integration::GlAbstraction& glAbstraction, unsigned int timeDelta, bool replacingSurface );
+ virtual void PostRender( EglInterface& egl, Integration::GlAbstraction& glAbstraction, DisplayConnection* displayConnection, unsigned int deltaTime, bool replacingSurface );
/**
- * @copydoc Dali::Internal::Adaptor::RenderSurface::StopRender()
+ * @copydoc Dali::RenderSurface::StopRender()
*/
virtual void StopRender();
/**
- * @copydoc Dali::Internal::Adaptor::RenderSurface::SetViewMode()
- */
- void SetViewMode( ViewMode viewMode );
-
- /**
- * @copydoc Dali::Internal::Adaptor::RenderSurface::ReleaseLock()
+ * @copydoc Dali::RenderSurface::ReleaseLock()
*/
virtual void ReleaseLock();
virtual void CreateWlRenderable();
/**
- * @copydoc Dali::Internal::Adaptor::ECoreX::RenderSurface::UseExistingRenderable
+ * @copydoc Dali::Internal::Adaptor::ECore::EcoreWlRenderSurface::UseExistingRenderable
*/
virtual void UseExistingRenderable( unsigned int surfaceId );
} // namespace ECore
-} // namespace Adaptor
-
-} // namespace internal
-
} // namespace Dali
#endif // __DALI_INTERNAL_ECORE_X_WINDOW_RENDER_SURFACE_H__
if ( service )
{
Adaptor& adaptorImpl( Adaptor::GetImplementation( Adaptor::Get() ) );
+ Any nativewindow = adaptorImpl.GetNativeWindowHandle();
// The Ecore_X_Window needs to use the Clipboard.
// Only when the render surface is window, we can get the Ecore_X_Window.
- Ecore_X_Window ecoreXwin( 0 );
- Dali::RenderSurface& surface( adaptorImpl.GetSurface() );
- if( surface.GetType() == Dali::RenderSurface::WINDOW )
+ Ecore_X_Window ecoreXwin( AnyCast<Ecore_X_Window>(nativewindow) );
+ if (ecoreXwin)
{
- ecoreXwin = AnyCast< Ecore_X_Window >( adaptorImpl.GetSurface().GetSurface() );
+ // If we fail to get Ecore_X_Window, we can't use the Clipboard correctly.
+ // Thus you have to call "ecore_imf_context_client_window_set" somewhere.
+ // In EvasPlugIn, this function is called in EvasPlugin::ConnectEcoreEvent().
+ Dali::Clipboard clipboard = Dali::Clipboard( new Clipboard( ecoreXwin ) );
+ service.Register( typeid( clipboard ), clipboard );
+ handle = clipboard;
+ }
+ else
+ {
+ DALI_LOG_ERROR("Failed to get native window handle");
}
-
- // If we fail to get Ecore_X_Window, we can't use the Clipboard correctly.
- // Thus you have to call "ecore_imf_context_client_window_set" somewhere.
- // In EvasPlugIn, this function is called in EvasPlugin::ConnectEcoreEvent().
- Dali::Clipboard clipboard = Dali::Clipboard( new Clipboard( ecoreXwin ) );
- service.Register( typeid( clipboard ), clipboard );
- handle = clipboard;
}
}
--- /dev/null
+/*
+ * Copyright (c) 2015 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 "display-connection-impl.h"
+
+// EXTERNAL_HEADERS
+#include <Ecore_X.h>
+#include <dali/integration-api/debug.h>
+
+// INTERNAL HEADERS
+#include <pixmap-render-surface.h>
+
+namespace Dali
+{
+
+namespace Internal
+{
+
+namespace Adaptor
+{
+
+DisplayConnection* DisplayConnection::New()
+{
+ DisplayConnection* pDisplayConnection(new DisplayConnection());
+
+ return pDisplayConnection;
+}
+
+DisplayConnection::DisplayConnection()
+: mDisplay(NULL)
+{
+ // Because of DDK issue, we need to use separated x display instead of ecore default display
+ mDisplay = XOpenDisplay(0);
+}
+
+DisplayConnection::~DisplayConnection()
+{
+ if(mDisplay)
+ {
+ XCloseDisplay(mDisplay);
+ }
+}
+
+Any DisplayConnection::GetDisplay()
+{
+ return Any(mDisplay);
+}
+
+void DisplayConnection::ConsumeEvents()
+{
+ // check events so that we can flush the queue and avoid any potential memory leaks in X
+ // looping if events remain
+ int events(0);
+ do
+ {
+ // Check if there are any events in the queue
+ events = XEventsQueued(mDisplay, QueuedAfterFlush);
+
+ if (events > 0)
+ {
+ // Just flush event to prevent memory leak from event queue as the events get built up in
+ // memory but are only deleted when we retrieve them
+ XEvent ev;
+ XNextEvent(mDisplay, &ev);
+ }
+ }
+ while (events > 0);
+}
+
+bool DisplayConnection::InitializeEgl(EglInterface& egl)
+{
+ EglImplementation& eglImpl = static_cast<EglImplementation&>(egl);
+
+ if (!eglImpl.InitializeGles(reinterpret_cast<EGLNativeDisplayType>(mDisplay)))
+ {
+ DALI_LOG_ERROR("Failed to initialize GLES.");
+ return false;
+ }
+
+ return true;
+}
+
+void DisplayConnection::GetDpi(unsigned int& dpiHorizontal, unsigned int& dpiVertical)
+{
+ // calculate DPI
+ float xres, yres;
+
+ // 1 inch = 25.4 millimeters
+ xres = ecore_x_dpi_get();
+ yres = ecore_x_dpi_get();
+
+ dpiHorizontal = int(xres + 0.5f); // rounding
+ dpiVertical = int(yres + 0.5f);
+}
+
+} // namespace Adaptor
+
+} // namespace Internal
+
+} // namespace Dali
--- /dev/null
+#ifndef __DALI_INTERNAL_ECORE_X_DIPLAY_CONNECTION_H__
+#define __DALI_INTERNAL_ECORE_X_DIPLAY_CONNECTION_H__
+
+/*
+ * Copyright (c) 2015 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.
+ *
+ */
+
+// EXTERNAL INCLUDES
+#include <Ecore_X.h>
+#include <ecore-x-types.h>
+
+// INTERNAL INCLUDES
+#include <base/display-connection.h>
+#include <dali/public-api/object/base-object.h>
+#include <gl/egl-implementation.h>
+
+namespace Dali
+{
+
+class RenderSurface;
+class DisplayConnection;
+
+namespace Internal
+{
+
+namespace Adaptor
+{
+
+/**
+ * DisplayConnection implementation
+ */
+class DisplayConnection : public Dali::BaseObject
+{
+public:
+
+ /**
+ * @brief Default constructor
+ */
+ DisplayConnection();
+
+ /**
+ * @brief Create an initialized DisplayConnection.
+ *
+ * @return A handle to a newly allocated DisplayConnection resource.
+ */
+ static DisplayConnection* New();
+
+public:
+
+ /**
+ * @copydoc Dali::DisplayConnection::GetDisplay
+ */
+ Any GetDisplay();
+
+ /**
+ * @copydoc Dali::DisplayConnection::GetDpi
+ */
+ static void GetDpi(unsigned int& dpiHorizontal, unsigned int& dpiVertical);
+
+ /**
+ * @copydoc Dali::DisplayConnection::ConsumeEvents
+ */
+ void ConsumeEvents();
+
+ /**
+ * @copydoc Dali::DisplayConnection::InitializeEgl
+ */
+ bool InitializeEgl(EglInterface& egl);
+
+public:
+
+ /**
+ * Destructor
+ */
+ virtual ~DisplayConnection();
+
+protected:
+
+ // Undefined
+ DisplayConnection(const DisplayConnection&);
+
+ // Undefined
+ DisplayConnection& operator=(const DisplayConnection& rhs);
+
+private:
+ XDisplay* mDisplay; ///< X-display for rendering
+};
+
+} // namespace Adaptor
+
+} // namespace internal
+
+} // namespace Dali
+
+#endif // __DALI_INTERNAL_ECORE_X_DIPLAY_CONNECTION_H__
*/
// INTERNAL INCLUDES
-#include "pixmap-render-surface.h"
+#include <pixmap-render-surface.h>
namespace Dali
{
-namespace Internal
-{
-
-namespace Adaptor
-{
-
namespace ECore
{
-DALI_EXPORT_API RenderSurface* CreatePixmapSurface(
+DALI_EXPORT_API PixmapRenderSurface* CreatePixmapSurface(
PositionSize positionSize,
Any surface,
- Any display,
const std::string& name,
- bool isTransparent )
+ bool isTransparent)
{
- return new PixmapRenderSurface( positionSize, surface, display, name, isTransparent );
+ return new PixmapRenderSurface(positionSize, surface, name, isTransparent);
}
-} // namespace ECore
-
-} // namespace Adaptor
-} // namespace Internal
+} // namespace ECore
} // namespace Dali
// INTERNAL INCLUDES
#include <ecore-x-types.h>
#include <trigger-event.h>
+#include <gl/egl-implementation.h>
namespace Dali
{
-namespace Internal
-{
-
-namespace Adaptor
-{
-
#if defined(DEBUG_ENABLED)
Debug::Filter* gRenderSurfaceLogFilter = Debug::Filter::New(Debug::Verbose, false, "LOG_ECORE_X_RENDER_SURFACE");
#endif
namespace ECore
{
-namespace
-{
-
-static bool gXInitThreadsCalled = false; ///< global to say whether XInitThreads has been called in this process
-
-} // unnamed namespace
-
-RenderSurface::RenderSurface( SurfaceType type,
- Dali::PositionSize positionSize,
- Any surface,
- Any display,
- const std::string& name,
- bool isTransparent)
-: mMainDisplay(NULL),
- mType(type),
- mPosition(positionSize),
+EcoreXRenderSurface::EcoreXRenderSurface(Dali::PositionSize positionSize,
+ Any surface,
+ const std::string& name,
+ bool isTransparent)
+: mPosition(positionSize),
mTitle(name),
+ mRenderNotification(NULL),
mColorDepth(isTransparent ? COLOR_DEPTH_32 : COLOR_DEPTH_24),
- mRenderNotification( NULL ),
- mOwnSurface(false),
- mOwnDisplay(false)
+ mOwnSurface(false)
{
- // see if there is a display in Any display
- SetDisplay( display );
}
-void RenderSurface::Init( Any surface )
+void EcoreXRenderSurface::Init( Any surface )
{
// see if there is a surface in Any surface
unsigned int surfaceId = GetSurfaceId( surface );
// if the surface is empty, create a new one.
if ( surfaceId == 0 )
{
- // make sure XInitThreads is called
- if ( !gXInitThreadsCalled )
- {
- XInitThreads();
- gXInitThreadsCalled = true;
- }
-
// we own the surface about to created
mOwnSurface = true;
CreateXRenderable();
}
#ifdef DEBUG_ENABLED
- // prints out 'INFO: DALI: new RenderSurface, created display xx, used existing surface xx
+ // prints out 'INFO: DALI: new EcoreXRenderSurface, used existing surface xx
// we can not use LOG_INFO because the surface can be created before Dali Core is created.
- printf( "INFO: DALI: new RenderSurface, %s display %p, %s %s surface %X \n",
- mOwnDisplay?"created":"used existing",mMainDisplay,
- mOwnSurface?"created":"used existing",
- Dali::RenderSurface::PIXMAP==mType?" pixmap" :"window",
- GetDrawable() );
+ printf( "INFO: DALI: new EcoreXRenderSurface, %s surface %X \n",
+ mOwnSurface?"created":"used existing",
+ GetDrawable() );
#endif
}
-RenderSurface::~RenderSurface()
+EcoreXRenderSurface::~EcoreXRenderSurface()
{
- // release the display connection if we use our own
- if( mOwnDisplay )
- {
- if( mMainDisplay )
- {
- // NOTE, on 64bit desktop with some NVidia driver versions this crashes
-#ifdef _ARCH_ARM_
- XCloseDisplay( mMainDisplay );
-#endif
- }
- }
}
-Ecore_X_Window RenderSurface::GetXWindow()
-{
- return 0;
-}
-
-XDisplay* RenderSurface::GetMainDisplay()
-{
- return mMainDisplay;
-}
-
-void RenderSurface::SetRenderNotification( TriggerEvent* renderNotification )
+void EcoreXRenderSurface::SetRenderNotification(TriggerEventInterface* renderNotification)
{
mRenderNotification = renderNotification;
}
-Ecore_X_Drawable RenderSurface::GetDrawable()
+Ecore_X_Window EcoreXRenderSurface::GetXWindow()
{
return 0;
}
-Any RenderSurface::GetDisplay()
+Ecore_X_Drawable EcoreXRenderSurface::GetDrawable()
{
- // this getter is used by main thread so we need to return the main thread version of the display
- return Any( ecore_x_display_get() );
+ return 0;
}
-PositionSize RenderSurface::GetPositionSize() const
+PositionSize EcoreXRenderSurface::GetPositionSize() const
{
return mPosition;
}
-void RenderSurface::MoveResize( Dali::PositionSize positionSize )
+void EcoreXRenderSurface::MoveResize( Dali::PositionSize positionSize )
{
// nothing to do in base class
}
-void RenderSurface::GetDpi( unsigned int& dpiHorizontal, unsigned int& dpiVertical ) const
+void EcoreXRenderSurface::SetViewMode( ViewMode viewMode )
{
- // calculate DPI
- float xres, yres;
-
- // 1 inch = 25.4 millimeters
- xres = ecore_x_dpi_get();
- yres = ecore_x_dpi_get();
-
- dpiHorizontal = int(xres + 0.5f); // rounding
- dpiVertical = int(yres + 0.5f);
}
-void RenderSurface::Map()
-{
-}
-
-void RenderSurface::TransferDisplayOwner( Internal::Adaptor::RenderSurface& newSurface )
-{
- // if we don't own the display return
- if( mOwnDisplay == false )
- {
- return;
- }
-
- RenderSurface* other = dynamic_cast< RenderSurface* >( &newSurface );
- if( other )
- {
- // if both surfaces share the same display, and this surface owns it,
- // then transfer the ownership to the new surface
- if( other->mMainDisplay == mMainDisplay )
- {
- mOwnDisplay = false;
- other->mOwnDisplay = true;
- }
- }
-}
-
-void RenderSurface::ConsumeEvents()
-{
- // if the render surface has own display, check events so that we can flush the queue and avoid
- // any potential memory leaks in X
- if( mOwnDisplay )
- {
- // looping if events remain
- int events( 0 );
- do
- {
- // Check if there are any events in the queue
- events = XEventsQueued( mMainDisplay, QueuedAfterFlush );
-
- if ( events > 0 )
- {
- // Just flush event to prevent memory leak from event queue as the events get built up in
- // memory but are only deleted when we retrieve them
- XEvent ev;
- XNextEvent( mMainDisplay, &ev );
- }
- }
- while( events > 0 );
- }
-}
-
-void RenderSurface::SetViewMode( ViewMode )
-{
-}
-
-void RenderSurface::SetDisplay( Any display )
-{
- // the render surface can be passed either EFL e-core types, or x11 types
- // we use boost any to determine at run time which type
-
- if ( display.Empty() == false )
- {
- // check we have a valid type
- DALI_ASSERT_ALWAYS( ( ( display.GetType() == typeid (Ecore_X_Display *)) ||
- ( display.GetType() == typeid (XDisplay *) ) )
- &&
- "Display type is invalid" );
-
- mOwnDisplay = false;
-
- // display may point to EcoreXDisplay so may need to cast
- if( display.GetType() == typeid (Ecore_X_Display*) )
- {
- mMainDisplay = static_cast< XDisplay* >( AnyCast< Ecore_X_Display* >( display ) );
- }
- else
- {
- mMainDisplay = AnyCast< XDisplay* >( display );
- }
- }
- else
- {
- mOwnDisplay = true;
- // mMainDisplay = (XDisplay*)ecore_x_display_get();
- // Because of DDK issue, we need to use separated x display instead of ecore default display
- mMainDisplay = XOpenDisplay(0);
- }
-}
-
-unsigned int RenderSurface::GetSurfaceId( Any surface ) const
+unsigned int EcoreXRenderSurface::GetSurfaceId( Any surface ) const
{
unsigned int surfaceId = 0;
} // namespace ECore
-} // namespace Adaptor
-
-} // namespace Internal
-
} // namespace Dali
}
}
-
void EglImplementation::CreateSurfaceWindow( EGLNativeWindowType window, ColorDepth depth )
{
DALI_ASSERT_ALWAYS( ( mEglSurface == 0 ) && "EGL surface already exists" );
DALI_ASSERT_ALWAYS( mEglSurface && "Create pixmap surface failed" );
}
-bool EglImplementation::ReplaceSurfaceWindow( EGLNativeWindowType window, EGLNativeDisplayType display )
+bool EglImplementation::ReplaceSurfaceWindow( EGLNativeWindowType window )
{
bool contextLost = false;
- // If the display connection has not changed, then we can just create a new surface
- if ( display == mEglNativeDisplay )
- {
- // the surface is bound to the context, so set the context to null
- MakeContextNull();
-
- // destroy the surface
- DestroySurface();
-
- // create the EGL surface
- CreateSurfaceWindow( window, mColorDepth );
-
- // set the context to be current with the new surface
- MakeContextCurrent();
- }
- else // the display connection has changed, we need to start egl with a new x-connection
- {
- TerminateGles();
-
- // let the adaptor know that all resources have been lost
- contextLost = true;
-
- // re-initialise GLES with the new connection
- InitializeGles( display );
+ // display connection has not changed, then we can just create a new surface
+ // the surface is bound to the context, so set the context to null
+ MakeContextNull();
- // create the EGL surface
- CreateSurfaceWindow( window, mColorDepth );
+ // destroy the surface
+ DestroySurface();
- // create the OpenGL context
- CreateContext();
+ // create the EGL surface
+ CreateSurfaceWindow( window, mColorDepth );
- // Make it current
- MakeContextCurrent();
- }
+ // set the context to be current with the new surface
+ MakeContextCurrent();
return contextLost;
}
-bool EglImplementation::ReplaceSurfacePixmap( EGLNativePixmapType pixmap, EGLNativeDisplayType display )
+bool EglImplementation::ReplaceSurfacePixmap( EGLNativePixmapType pixmap )
{
bool contextLost = false;
// destroy the surface
DestroySurface();
- // If the display has not changed, then we can just create a new surface
- if ( display == mEglNativeDisplay )
- {
- // create the EGL surface
- CreateSurfacePixmap( pixmap, mColorDepth );
+ // display connection has not changed, then we can just create a new surface
+ // create the EGL surface
+ CreateSurfacePixmap( pixmap, mColorDepth );
- // set the context to be current with the new surface
- MakeContextCurrent();
- }
- else // the display has changed, we need to start egl with a new x-connection
- {
- // Note! this code path is untested
-
- // this will release all EGL specific resources
- eglTerminate( mEglDisplay );
+ // set the context to be current with the new surface
+ MakeContextCurrent();
- mGlesInitialized = false;
-
- // let the adaptor know that all resources have been lost
- contextLost = true;
-
- // re-initialise GLES with the new connection
- InitializeGles( display );
-
- // create the EGL surface
- CreateSurfacePixmap( pixmap, mColorDepth );
-
- // create the OpenGL context
- CreateContext();
-
- // Make it current
- MakeContextCurrent();
- }
return contextLost;
}
{
Ecore_X_Window window = 0;
- if( surface->GetType() == Dali::RenderSurface::WINDOW )
+ // this code only works with the EcoreX11 RenderSurface so need to downcast
+ ECore::WindowRenderSurface* ecoreSurface = dynamic_cast< ECore::WindowRenderSurface* >( surface );
+ if( ecoreSurface )
{
- // this code only works with the EcoreX11 RenderSurface so need to downcast
- ECore::WindowRenderSurface* ecoreSurface = dynamic_cast< ECore::WindowRenderSurface* >( surface );
- if( ecoreSurface )
- {
- // enable multi touch
- window = ecoreSurface->GetXWindow();
- ecore_x_input_multi_select( window );
- }
+ // enable multi touch
+ window = ecoreSurface->GetXWindow();
}
mImpl = new Impl(this, window);
_adaptor_x11_internal_src_files = \
$(adaptor_x11_dir)/clipboard-impl-x.cpp \
+ $(adaptor_x11_dir)/display-connection-impl-x.cpp \
$(adaptor_x11_dir)/imf-manager-impl-x.cpp \
$(adaptor_x11_dir)/pixmap-image-impl-x.cpp \
$(adaptor_x11_dir)/server-connection-x.cpp \
// Create instance and register singleton only if the adaptor is available
Adaptor& adaptorImpl( Adaptor::GetImplementation( Adaptor::Get() ) );
+ Any nativeWindow = adaptorImpl.GetNativeWindowHandle();
// The Ecore_X_Window needs to use the ImfManager.
// Only when the render surface is window, we can get the Ecore_X_Window.
- Ecore_X_Window ecoreXwin( 0 );
- Dali::RenderSurface& surface( adaptorImpl.GetSurface() );
- if( surface.GetType() == Dali::RenderSurface::WINDOW )
+ Ecore_X_Window ecoreXwin( AnyCast<Ecore_X_Window>(nativeWindow) );
+ if (ecoreXwin)
{
- ecoreXwin = AnyCast< Ecore_X_Window >( adaptorImpl.GetSurface().GetSurface() );
- }
-
- // If we fail to get Ecore_X_Window, we can't use the ImfManager correctly.
- // Thus you have to call "ecore_imf_context_client_window_set" somewhere.
- // In EvasPlugIn, this function is called in EvasPlugin::ConnectEcoreEvent().
+ // If we fail to get Ecore_X_Window, we can't use the ImfManager correctly.
+ // Thus you have to call "ecore_imf_context_client_window_set" somewhere.
+ // In EvasPlugIn, this function is called in EvasPlugin::ConnectEcoreEvent().
- manager = Dali::ImfManager( new ImfManager( ecoreXwin ) );
- service.Register( typeid( manager ), manager );
+ manager = Dali::ImfManager( new ImfManager( ecoreXwin ) );
+ service.Register( typeid( manager ), manager );
+ }
+ else
+ {
+ DALI_LOG_ERROR("Failed to get native window handle");
+ }
}
}
namespace Dali
{
+class RenderSurface;
+
namespace Internal
{
namespace Adaptor
{
-class RenderSurface;
-
class ImfManager : public Dali::BaseObject
{
public:
#include <dali/integration-api/debug.h>
// INTERNAL INCLUDES
+
#include <ecore-x-types.h>
#include <trigger-event.h>
+#include <gl/egl-implementation.h>
+#include <base/display-connection.h>
namespace Dali
{
-namespace Internal
-{
-
-namespace Adaptor
-{
-
#if defined(DEBUG_ENABLED)
extern Debug::Filter* gRenderSurfaceLogFilter;
#endif
namespace ECore
{
-PixmapRenderSurface::PixmapRenderSurface( Dali::PositionSize positionSize,
- Any surface,
- Any display,
- const std::string& name,
- bool isTransparent)
-: RenderSurface( Dali::RenderSurface::PIXMAP, positionSize, surface, display, name, isTransparent ),
+PixmapRenderSurface::PixmapRenderSurface(Dali::PositionSize positionSize,
+ Any surface,
+ const std::string& name,
+ bool isTransparent)
+: EcoreXRenderSurface( positionSize, surface, name, isTransparent ),
mSyncMode(SYNC_MODE_NONE),
mSyncReceived(false)
{
Ecore_X_Drawable PixmapRenderSurface::GetDrawable()
{
- return (Ecore_X_Drawable)mX11Pixmap;
-}
-
-Dali::RenderSurface::SurfaceType PixmapRenderSurface::GetType()
-{
- return Dali::RenderSurface::PIXMAP;
+ return (Ecore_X_Drawable) mX11Pixmap;
}
Any PixmapRenderSurface::GetSurface()
return Any( mX11Pixmap );
}
-void PixmapRenderSurface::InitializeEgl( EglInterface& eglIf )
+void PixmapRenderSurface::InitializeEgl( EglInterface& egl )
{
DALI_LOG_TRACE_METHOD( gRenderSurfaceLogFilter );
- EglImplementation& eglImpl = static_cast<EglImplementation&>( eglIf );
- eglImpl.InitializeGles( reinterpret_cast< EGLNativeDisplayType >( mMainDisplay ) );
+ Internal::Adaptor::EglImplementation& eglImpl = static_cast<Internal::Adaptor::EglImplementation&>( egl );
eglImpl.ChooseConfig(false, mColorDepth);
}
-void PixmapRenderSurface::CreateEglSurface( EglInterface& eglIf )
+void PixmapRenderSurface::CreateEglSurface( EglInterface& egl )
{
DALI_LOG_TRACE_METHOD( gRenderSurfaceLogFilter );
- EglImplementation& eglImpl = static_cast<EglImplementation&>( eglIf );
+ Internal::Adaptor::EglImplementation& eglImpl = static_cast<Internal::Adaptor::EglImplementation&>( egl );
// create the EGL surface
// need to cast to X handle as in 64bit system ECore handle is 32 bit whereas EGLnative and XWindow are 64 bit
- XPixmap pixmap = static_cast< XPixmap>( mX11Pixmap );
+ XPixmap pixmap = static_cast<XPixmap>( mX11Pixmap );
eglImpl.CreateSurfacePixmap( (EGLNativePixmapType)pixmap, mColorDepth ); // reinterpret_cast does not compile
}
-void PixmapRenderSurface::DestroyEglSurface( EglInterface& eglIf )
+void PixmapRenderSurface::DestroyEglSurface( EglInterface& egl )
{
DALI_LOG_TRACE_METHOD( gRenderSurfaceLogFilter );
- EglImplementation& eglImpl = static_cast<EglImplementation&>( eglIf );
+ Internal::Adaptor::EglImplementation& eglImpl = static_cast<Internal::Adaptor::EglImplementation&>( egl );
eglImpl.DestroySurface();
}
-bool PixmapRenderSurface::ReplaceEGLSurface( EglInterface& eglIf )
+bool PixmapRenderSurface::ReplaceEGLSurface( EglInterface& egl )
{
DALI_LOG_TRACE_METHOD( gRenderSurfaceLogFilter );
- EglImplementation& eglImpl = static_cast<EglImplementation&>( eglIf );
- eglImpl.InitializeGles( reinterpret_cast< EGLNativeDisplayType >( mMainDisplay ) );
-
// a new surface for the new pixmap
// need to cast to X handle as in 64bit system ECore handle is 32 bit whereas EGLnative and XWindow are 64 bit
- XPixmap pixmap = static_cast< XPixmap>( mX11Pixmap );
- return eglImpl.ReplaceSurfacePixmap( (EGLNativePixmapType)pixmap, // reinterpret_cast does not compile
- reinterpret_cast< EGLNativeDisplayType >( mMainDisplay ) );
+ XPixmap pixmap = static_cast<XPixmap>( mX11Pixmap );
+ Internal::Adaptor::EglImplementation& eglImpl = static_cast<Internal::Adaptor::EglImplementation&>( egl );
+
+ return eglImpl.ReplaceSurfacePixmap( (EGLNativePixmapType)pixmap ); // reinterpret_cast does not compile
+
}
void PixmapRenderSurface::StartRender()
return true;
}
-void PixmapRenderSurface::PostRender( EglInterface& egl, Integration::GlAbstraction& glAbstraction, unsigned int timeDelta, bool replacingSurface )
+void PixmapRenderSurface::PostRender( EglInterface& egl, Integration::GlAbstraction& glAbstraction, DisplayConnection* displayConnection, unsigned int deltaTime, bool replacingSurface )
{
// flush gl instruction queue
glAbstraction.Flush();
}
else
{
- // as a fallback, send damage event. This is needed until livebox is fixed to
- // stop using damage events for render
+ // as a fallback, send damage event.
Ecore_X_Drawable drawable = GetDrawable();
if( drawable )
rect.width = mPosition.width;
rect.height = mPosition.height;
+ XDisplay* display = AnyCast<XDisplay*>(displayConnection->GetDisplay());
+
// make a fixes region as updated area
- region = XFixesCreateRegion( mMainDisplay, &rect, 1 );
+ region = XFixesCreateRegion( display, &rect, 1 );
// add damage event to updated drawable
- XDamageAdd( mMainDisplay, (Drawable)drawable, region );
- XFixesDestroyRegion( mMainDisplay, region );
+ XDamageAdd( display, (Drawable)drawable, region );
+ XFixesDestroyRegion( display, region );
- XFlush( mMainDisplay );
+ XFlush( display );
}
}
mSyncNotify.notify_all();
}
-
} // namespace ECore
-} // namespace Adaptor
-
-} // namespace Internal
-
} // namespace Dali
ECORE_X_ATOM_E_DEICONIFY_APPROVE,
&tmp, 1);
#endif // DALI_PROFILE_UBUNTU
+
+ ecore_x_input_multi_select( mEcoreWindow );
}
/**
{
// create an X11 window by default
Any surface;
- Any display;
- mSurface = new ECore::WindowRenderSurface( windowPosition, surface, display, name, mIsTransparent );
+ ECore::WindowRenderSurface* windowSurface = new ECore::WindowRenderSurface( windowPosition, surface, name, mIsTransparent );
+ windowSurface->Map();
+
+ mSurface = windowSurface;
+
mOrientation = Orientation::New(this);
// create event handler for X11 window
#include <dali/integration-api/debug.h>
// INTERNAL INCLUDES
+
#include <ecore-x-types.h>
#include <trigger-event.h>
+#include <gl/egl-implementation.h>
+#include <base/display-connection.h>
namespace Dali
{
-namespace Internal
-{
-
-namespace Adaptor
-{
-
#if defined(DEBUG_ENABLED)
extern Debug::Filter* gRenderSurfaceLogFilter;
#endif
WindowRenderSurface::WindowRenderSurface( Dali::PositionSize positionSize,
Any surface,
- Any display,
const std::string& name,
bool isTransparent)
-: RenderSurface( Dali::RenderSurface::WINDOW, positionSize, surface, display, name, isTransparent ),
+: EcoreXRenderSurface( positionSize, surface, name, isTransparent ),
mNeedToApproveDeiconify(false)
{
DALI_LOG_INFO( gRenderSurfaceLogFilter, Debug::Verbose, "Creating Window\n" );
return (Ecore_X_Drawable)mX11Window;
}
-Dali::RenderSurface::SurfaceType WindowRenderSurface::GetType()
-{
- return Dali::RenderSurface::WINDOW;
-}
-
Any WindowRenderSurface::GetSurface()
{
// already an e-core type
{
DALI_LOG_TRACE_METHOD( gRenderSurfaceLogFilter );
- EglImplementation& eglImpl = static_cast<EglImplementation&>( eglIf );
- eglImpl.InitializeGles( reinterpret_cast< EGLNativeDisplayType >( mMainDisplay ) );
+ Internal::Adaptor::EglImplementation& eglImpl = static_cast<Internal::Adaptor::EglImplementation&>( eglIf );
eglImpl.ChooseConfig(true, mColorDepth);
}
{
DALI_LOG_TRACE_METHOD( gRenderSurfaceLogFilter );
- EglImplementation& eglImpl = static_cast<EglImplementation&>( eglIf );
+ Internal::Adaptor::EglImplementation& eglImpl = static_cast<Internal::Adaptor::EglImplementation&>( eglIf );
// create the EGL surface
// need to cast to X handle as in 64bit system ECore handle is 32 bit whereas EGLnative and XWindow are 64 bit
{
DALI_LOG_TRACE_METHOD( gRenderSurfaceLogFilter );
- EglImplementation& eglImpl = static_cast<EglImplementation&>( eglIf );
+ Internal::Adaptor::EglImplementation& eglImpl = static_cast<Internal::Adaptor::EglImplementation&>( eglIf );
eglImpl.DestroySurface();
}
-bool WindowRenderSurface::ReplaceEGLSurface( EglInterface& eglIf )
+bool WindowRenderSurface::ReplaceEGLSurface( EglInterface& egl )
{
DALI_LOG_TRACE_METHOD( gRenderSurfaceLogFilter );
- EglImplementation& egl = static_cast<EglImplementation&>( eglIf );
- egl.InitializeGles( reinterpret_cast< EGLNativeDisplayType >( mMainDisplay ) );
-
// need to cast to X handle as in 64bit system ECore handle is 32 bit whereas EGLnative and XWindow are 64 bit
XWindow window = static_cast< XWindow >( mX11Window );
- return egl.ReplaceSurfaceWindow( (EGLNativeWindowType)window, // reinterpret_cast does not compile
- reinterpret_cast< EGLNativeDisplayType >( mMainDisplay ) );
+ Internal::Adaptor::EglImplementation& eglImpl = static_cast<Internal::Adaptor::EglImplementation&>( egl );
+
+ return eglImpl.ReplaceSurfaceWindow( (EGLNativeWindowType)window ); // reinterpret_cast does not compile
}
void WindowRenderSurface::MoveResize( Dali::PositionSize positionSize )
return true;
}
-void WindowRenderSurface::PostRender( EglInterface& egl, Integration::GlAbstraction& glAbstraction, unsigned int, bool )
+void WindowRenderSurface::PostRender( EglInterface& egl, Integration::GlAbstraction& glAbstraction, DisplayConnection* displayConnection, unsigned int deltaTime, bool replacingSurface )
{
- EglImplementation& eglImpl = static_cast<EglImplementation&>( egl );
+ Internal::Adaptor::EglImplementation& eglImpl = static_cast<Internal::Adaptor::EglImplementation&>( egl );
eglImpl.SwapBuffers();
// When the window is deiconified, it approves the deiconify operation to window manager after rendering
// SwapBuffer is desychronized. So make sure to sychronize when window is deiconified.
glAbstraction.Finish();
+ XDisplay* display = AnyCast<XDisplay *>(displayConnection->GetDisplay());
+
#ifndef DALI_PROFILE_UBUNTU
/* client sends immediately reply message using value 1 */
- ecore_x_client_message32_send(mX11Window,
- ECORE_X_ATOM_E_DEICONIFY_APPROVE,
- ECORE_X_EVENT_MASK_WINDOW_CONFIGURE,
- mX11Window, 1,
- 0, 0, 0);
+ XEvent xev;
+
+ xev.xclient.window = mX11Window;
+ xev.xclient.type = ClientMessage;
+ xev.xclient.message_type = ECORE_X_ATOM_E_DEICONIFY_APPROVE;
+ xev.xclient.format = 32;
+ xev.xclient.data.l[0] = mX11Window;
+ xev.xclient.data.l[1] = 1;
+ xev.xclient.data.l[2] = 0;
+ xev.xclient.data.l[3] = 0;
+ xev.xclient.data.l[4] = 0;
+
+ XSendEvent(display, mX11Window, false, ECORE_X_EVENT_MASK_WINDOW_CONFIGURE, &xev);
#endif // DALI_PROFILE_UBUNTU
- ecore_x_sync();
+ XSync(display, false);
mNeedToApproveDeiconify = false;
}
} // namespace ECore
-} // namespace Adaptor
-
-} // namespace Internal
-
} // namespace Dali
namespace Dali
{
-namespace Internal
-{
-
-namespace Adaptor
-{
-
namespace ECore
{
/**
- * @copydoc Dali::Internal::Adaptor::ECore::RenderSurface.
+ * @copydoc Dali::ECore::EcoreXRenderSurface.
* Window specialization.
*/
-class WindowRenderSurface : public RenderSurface
+class WindowRenderSurface : public EcoreXRenderSurface
{
public:
* Uses an X11 surface to render to.
* @param [in] positionSize the position and size of the surface
* @param [in] surface can be a X-window or X-pixmap (type must be unsigned int).
- * @param [in] display connection to X-server if the surface is a X window or pixmap (type must be void * to X display struct)
* @param [in] name optional name of surface passed in
* @param [in] isTransparent if it is true, surface has 32 bit color depth, otherwise, 24 bit
*/
WindowRenderSurface( Dali::PositionSize positionSize,
Any surface,
- Any display,
const std::string& name,
bool isTransparent = false );
/**
- * @copydoc Dali::Internal::Adaptor::ECore::RenderSurface::~RenderSurface
+ * @copydoc Dali::ECore::EcoreXRenderSurface::~EcoreXRenderSurface
*/
virtual ~WindowRenderSurface();
*/
void RequestToApproveDeiconify();
-public: // from Dali::RenderSurface
-
/**
- * @copydoc Dali::RenderSurface::GetType()
+ * Map window
*/
- virtual Dali::RenderSurface::SurfaceType GetType();
+ virtual void Map();
/**
- * @copydoc Dali::RenderSurface::GetSurface()
+ * @copydoc Dali::ECore::EcoreXRenderSurface::GetSurface()
*/
virtual Any GetSurface();
/**
- * @copydoc Dali::RenderSurface::GetDrawable()
+ * @copydoc Dali::ECore::EcoreXRenderSurface::GetXWindow()
*/
virtual Ecore_X_Window GetXWindow();
-public: // from Internal::Adaptor::RenderSurface
+public: // from Dali::RenderSurface
/**
- * @copydoc Dali::Internal::Adaptor::RenderSurface::InitializeEgl()
+ * @copydoc Dali::RenderSurface::InitializeEgl()
*/
virtual void InitializeEgl( EglInterface& egl );
/**
- * @copydoc Dali::Internal::Adaptor::RenderSurface::CreateEglSurface()
+ * @copydoc Dali::RenderSurface::CreateEglSurface()
*/
virtual void CreateEglSurface( EglInterface& egl );
/**
- * @copydoc Dali::Internal::Adaptor::RenderSurface::DestroyEglSurface()
+ * @copydoc Dali::RenderSurface::DestroyEglSurface()
*/
virtual void DestroyEglSurface( EglInterface& egl );
/**
- * @copydoc Dali::Internal::Adaptor::RenderSurface::ReplaceEGLSurface()
+ * @copydoc Dali::RenderSurface::ReplaceEGLSurface()
*/
virtual bool ReplaceEGLSurface( EglInterface& egl );
/**
- * @copydoc Dali::Internal::Adaptor::RenderSurface::MoveResize()
+ * @copydoc Dali::RenderSurface::MoveResize()
*/
virtual void MoveResize( Dali::PositionSize positionSize);
/**
- * @copydoc Dali::Internal::Adaptor::RenderSurface::Map()
+ * @copydoc Dali::RenderSurface::SetViewMode()
*/
- virtual void Map();
+ void SetViewMode( ViewMode viewMode );
/**
- * @copydoc Dali::Internal::Adaptor::RenderSurface::StartRender()
+ * @copydoc Dali::RenderSurface::StartRender()
*/
virtual void StartRender();
/**
- * @copydoc Dali::Internal::Adaptor::RenderSurface::PreRender()
+ * @copydoc Dali::RenderSurface::PreRender()
*/
virtual bool PreRender( EglInterface& egl, Integration::GlAbstraction& glAbstraction );
/**
- * @copydoc Dali::Internal::Adaptor::RenderSurface::PostRender()
+ * @copydoc Dali::RenderSurface::PostRender()
*/
- virtual void PostRender( EglInterface& egl, Integration::GlAbstraction& glAbstraction, unsigned int timeDelta, bool replacingSurface );
+ virtual void PostRender( EglInterface& egl, Integration::GlAbstraction& glAbstraction, DisplayConnection* displayConnection, unsigned int deltaTime, bool replacingSurface );
/**
- * @copydoc Dali::Internal::Adaptor::RenderSurface::StopRender()
+ * @copydoc Dali::RenderSurface::StopRender()
*/
virtual void StopRender();
/**
- * @copydoc Dali::Internal::Adaptor::RenderSurface::SetViewMode()
- */
- void SetViewMode( ViewMode viewMode );
-
- /**
- * @copydoc Dali::Internal::Adaptor::RenderSurface::ReleaseLock()
+ * @copydoc Dali::RenderSurface::ReleaseLock()
*/
virtual void ReleaseLock();
virtual void CreateXRenderable();
/**
- * @copydoc Dali::Internal::Adaptor::ECore::RenderSurface::UseExistingRenderable
+ * @copydoc Dali::Internal::Adaptor::ECore::EcoreXRenderSurface::UseExistingRenderable
*/
virtual void UseExistingRenderable( unsigned int surfaceId );
} // namespace ECore
-} // namespace Adaptor
-
-} // namespace internal
-
} // namespace Dali
#endif // __DALI_INTERNAL_ECORE_X_WINDOW_RENDER_SURFACE_H__
portable_platform_abstraction_src_dir = ../../../platform-abstractions/portable
include ../../../platform-abstractions/tizen/file.list
+# Integration
+adaptor_integration_api_dir = ../../../adaptors/integration-api
+include ../../../adaptors/integration-api/file.list
+
# Internal Common
adaptor_common_dir = ../../../adaptors/common
include ../../../adaptors/common/file.list
endif
+pkgconfigdir = $(libdir)/pkgconfig
+pkgconfig_DATA = dali-adaptor-integration.pc
+
# Feedback Plugin
if USE_FEEDBACK
plugin_themes_dir = ../../../adaptors/common/feedback
-I../../../platform-abstractions/portable \
-I../../../platform-abstractions/ \
-I../../../adaptors/public-api \
+ -I../../../adaptors/integration-api \
-I../../../adaptors/public-api/adaptor-framework \
-I../../../adaptors/common \
+ -I../../../adaptors/base/interfaces \
-I../../../adaptors/
if WAYLAND
libdali_adaptor_la_includes += \
- -I../../../adaptors/wayland
+ -I../../../adaptors/wayland \
+ -I../../../adaptors/integration-api/wayland
else
libdali_adaptor_la_includes += \
- -I../../../adaptors/x11
+ -I../../../adaptors/x11 \
+ -I../../../adaptors/integration-api/x11
endif
if UBUNTU_PROFILE
tizenadaptorpublicapidir = $(devincludepath)/dali/public-api
tizenadaptorpublicapi_HEADERS = $(public_api_header_files)
+tizenadaptorintegrationapidir = $(devincludepath)/dali/integration-api/adaptors
+tizenadaptorintegrationapi_HEADERS = $(adaptor_integration_api_header_files)
+
+if WAYLAND
+tizenadaptorintegrationwaylandapidir = $(devincludepath)/dali/integration-api/adaptors
+tizenadaptorintegrationwaylandapi_HEADERS = $(adaptor_integration_wayland_api_header_files)
+else
+tizenadaptorintegrationx11apidir = $(devincludepath)/dali/integration-api/adaptors
+tizenadaptorintegrationx11api_HEADERS = $(adaptor_integration_x11_api_header_files)
+endif
+
tizenadaptorframeworkpublicapidir = $(tizenadaptorpublicapidir)/adaptor-framework
tizenadaptorframeworkpublicapi_HEADERS = $(public_api_adaptor_framework_header_files)
linker_test_CXXFLAGS = \
-I../../../adaptors/common \
-I../../../adaptors/public-api \
+ -I../../../adaptors/integration-api \
+ -I../../../adaptors/base/interfaces \
-I../../../adaptors/public-api/adaptor-framework \
$(DALI_ADAPTOR_CFLAGS) \
$(DALICORE_CFLAGS) \
$(DALIX11_CFLAGS) \
-Werror -Wall
+if WAYLAND
+linker_test_CXXFLAGS += \
+ -I../../../adaptors/integration-api/wayland
+else
+
+linker_test_CXXFLAGS += \
+ -I../../../adaptors/integration-api/x11
+endif
+
+
linker_test_DEPENDENCIES = libdali-adaptor.la
linker_test_LDADD = \
$(DALICORE_LIBS) \
--- /dev/null
+prefix=@prefix@
+exec_prefix=@exec_prefix@
+apiversion=@DALI_ADAPTOR_VERSION@
+libdir=@libdir@
+includedir=@devincludepath@
+
+Name: Samsung OpenGLES Adaptor Integration
+Description: Adaptor integration layer for 3D Canvas using OpenGLES
+Version: ${apiversion}
+Requires: dali
+Libs: -L${libdir}
+Cflags: -I${includedir}/dali/public-api/adaptor-framework/ -I${includedir}/dali/integration-api/adaptors/
Makefile
adaptor/Makefile
dali.pc
+ adaptor/dali-adaptor-integration.pc
])
AM_CONDITIONAL([USE_PLUGIN], [test x$enable_feedback = xyes || test x$enable_bullet = xyes])
$(DALI_PROFILE_CFLAGS) \
$(DALI_ADAPTOR_CFLAGS) \
-I../../../adaptors/public-api \
+ -I../../../adaptors/integration-api \
-I../../../adaptors/public-api/adaptor-framework \
-Werror -Wall
Summary: Development components for the DALi Tizen Adaptor
Group: Development/Building
Requires: %{name} = %{version}-%{release}
+Requires: %{name}-integration-devel = %{version}-%{release}
%description devel
Development components for the DALi Tizen Adaptor - public headers and package configs
##############################
+# integration-devel
+##############################
+%package integration-devel
+Summary: Integration development package for the Adaptor
+Group: Development/Building
+Requires: %{name} = %{version}-%{release}
+
+%description integration-devel
+Integration development package for the Adaptor - headers for integrating with an adaptor library.
+
+##############################
# Dali Feedback Plugin
##############################
%package dali-feedback-plugin
%files devel
%defattr(-,root,root,-)
-%{dev_include_path}/dali/*
-%{_libdir}/pkgconfig/dali*.pc
+%{dev_include_path}/dali/dali.h
+%{dev_include_path}/dali/public-api/*
+%{_libdir}/pkgconfig/dali.pc
+
+%files integration-devel
+%defattr(-,root,root,-)
+%{dev_include_path}/dali/integration-api/adaptors/*
+%{_libdir}/pkgconfig/dali-adaptor-integration.pc
%if 0%{?dali_feedback_plugin}
%files dali-feedback-plugin
%define dali_bullet_plugin 0
%define dali_assimp_plugin 0
%define over_tizen_2_2 0
+
%define shaderbincache_flag DISABLE
%endif
Summary: Development components for the DALi Tizen Adaptor
Group: Development/Building
Requires: %{name} = %{version}-%{release}
+Requires: %{name}-integration-devel = %{version}-%{release}
%description devel
Development components for the DALi Tizen Adaptor - public headers and package configs
##############################
+# integration-devel
+##############################
+%package integration-devel
+Summary: Integration development package for the Adaptor
+Group: Development/Building
+Requires: %{name} = %{version}-%{release}
+
+%description integration-devel
+Integration development package for the Adaptor - headers for integrating with an adaptor library.
+
+##############################
# Dali Feedback Plugin
##############################
%package dali-feedback-plugin
%files devel
%defattr(-,root,root,-)
-%{dev_include_path}/dali/*
-%{_libdir}/pkgconfig/dali*.pc
+%{dev_include_path}/dali/dali.h
+%{dev_include_path}/dali/public-api/*
+%{_libdir}/pkgconfig/dali.pc
+
+%files integration-devel
+%defattr(-,root,root,-)
+%{dev_include_path}/dali/integration-api/adaptors/*
+%{_libdir}/pkgconfig/dali-adaptor-integration.pc
%if 0%{?dali_feedback_plugin}
%files dali-feedback-plugin