summary |
shortlog |
log |
commit | commitdiff |
tree
raw |
patch |
inline | side by side (from parent 1:
e3da9a7)
Change-Id: I431e6bdc4efee3f62a36be739b7da6d32e91a4f1
-#include <boost/thread/mutex.hpp>
-
#include <dali/integration-api/debug.h>
// INTERNAL INCLUDES
#include <dali/integration-api/debug.h>
// INTERNAL INCLUDES
-// EXTERNAL INCLUDES
-#include <boost/thread.hpp>
-
// INTERNAL INCLUDES
#include <ecore-x-render-surface.h>
// INTERNAL INCLUDES
#include <ecore-x-render-surface.h>
- 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
- bool mSyncReceived; ///< true, when a pixmap sync has occurred, (cleared after reading)
+ struct Impl;
+ Impl* mImpl;
-#include <boost/any.hpp>
#include <string>
#include <dali/public-api/math/rect.h>
#include <dali/public-api/common/dali-common.h>
#include <string>
#include <dali/public-api/math/rect.h>
#include <dali/public-api/common/dali-common.h>
-#include <boost/any.hpp>
#include <string>
#include <dali/public-api/math/rect.h>
#include <dali/public-api/common/dali-common.h>
#include <string>
#include <dali/public-api/math/rect.h>
#include <dali/public-api/common/dali-common.h>
#include <dali/integration-api/gl-abstraction.h>
#include <dali/integration-api/debug.h>
#include <dali/integration-api/gl-abstraction.h>
#include <dali/integration-api/debug.h>
+#include <dali/devel-api/common/mutex.h>
#include <trigger-event.h>
#include <gl/egl-implementation.h>
#include <base/display-connection.h>
#include <trigger-event.h>
#include <gl/egl-implementation.h>
#include <base/display-connection.h>
+#include <base/conditional-wait.h>
+
+
+struct PixmapRenderSurface::Impl
+{
+ Internal::Adaptor::ConditionalWait mSyncNotify; ///< condition to notify main thread that pixmap was flushed to onscreen
+ Dali::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
+ bool mSyncReceived; ///< true, when a pixmap sync has occurred, (cleared after reading)
+};
+
PixmapRenderSurface::PixmapRenderSurface(Dali::PositionSize positionSize,
Any surface,
const std::string& name,
bool isTransparent)
: EcoreXRenderSurface( positionSize, surface, 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)
+ mImpl->mSyncMode = SYNC_MODE_NONE;
+ mImpl->mSyncReceived = false;
if( mOwnSurface )
{
// if we did create the pixmap, delete the pixmap
if( mOwnSurface )
{
// if we did create the pixmap, delete the pixmap
- DALI_LOG_INFO( gRenderSurfaceLogFilter, Debug::General, "Own pixmap (%x) freed\n", mX11Pixmap );
- ecore_x_pixmap_free( mX11Pixmap );
+ DALI_LOG_INFO( gRenderSurfaceLogFilter, Debug::General, "Own pixmap (%x) freed\n", mImpl->mX11Pixmap );
+ ecore_x_pixmap_free( mImpl->mX11Pixmap );
}
Ecore_X_Drawable PixmapRenderSurface::GetDrawable()
{
}
Ecore_X_Drawable PixmapRenderSurface::GetDrawable()
{
- return (Ecore_X_Drawable) mX11Pixmap;
+ return (Ecore_X_Drawable) mImpl->mX11Pixmap;
}
Any PixmapRenderSurface::GetSurface()
{
}
Any PixmapRenderSurface::GetSurface()
{
- return Any( mX11Pixmap );
+ return Any( mImpl->mX11Pixmap );
}
void PixmapRenderSurface::InitializeEgl( EglInterface& egl )
}
void PixmapRenderSurface::InitializeEgl( EglInterface& 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
// 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>( mImpl->mX11Pixmap );
eglImpl.CreateSurfacePixmap( (EGLNativePixmapType)pixmap, mColorDepth ); // reinterpret_cast does not compile
}
eglImpl.CreateSurfacePixmap( (EGLNativePixmapType)pixmap, mColorDepth ); // reinterpret_cast does not compile
}
// 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
// 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 );
+ XPixmap pixmap = static_cast<XPixmap>( mImpl->mX11Pixmap );
Internal::Adaptor::EglImplementation& eglImpl = static_cast<Internal::Adaptor::EglImplementation&>( egl );
return eglImpl.ReplaceSurfacePixmap( (EGLNativePixmapType)pixmap ); // reinterpret_cast does not compile
Internal::Adaptor::EglImplementation& eglImpl = static_cast<Internal::Adaptor::EglImplementation&>( egl );
return eglImpl.ReplaceSurfacePixmap( (EGLNativePixmapType)pixmap ); // reinterpret_cast does not compile
void PixmapRenderSurface::StartRender()
{
void PixmapRenderSurface::StartRender()
{
- mSyncMode = SYNC_MODE_WAIT;
+ mImpl->mSyncMode = SYNC_MODE_WAIT;
}
bool PixmapRenderSurface::PreRender( EglInterface&, Integration::GlAbstraction& )
}
bool PixmapRenderSurface::PreRender( EglInterface&, Integration::GlAbstraction& )
DALI_ASSERT_ALWAYS( mPosition.width > 0 && mPosition.height > 0 && "Pixmap size is invalid" );
// create the pixmap
DALI_ASSERT_ALWAYS( mPosition.width > 0 && mPosition.height > 0 && "Pixmap size is invalid" );
// create the pixmap
- mX11Pixmap = ecore_x_pixmap_new(0, mPosition.width, mPosition.height, mColorDepth);
+ mImpl->mX11Pixmap = ecore_x_pixmap_new(0, mPosition.width, mPosition.height, mColorDepth);
// clear the pixmap
unsigned int foreground;
Ecore_X_GC gc;
foreground = 0;
// clear the pixmap
unsigned int foreground;
Ecore_X_GC gc;
foreground = 0;
- gc = ecore_x_gc_new( mX11Pixmap,
+ gc = ecore_x_gc_new( mImpl->mX11Pixmap,
ECORE_X_GC_VALUE_MASK_FOREGROUND,
&foreground );
DALI_ASSERT_ALWAYS( gc && "CreateXRenderable(): failed to get gc" );
ECORE_X_GC_VALUE_MASK_FOREGROUND,
&foreground );
DALI_ASSERT_ALWAYS( gc && "CreateXRenderable(): failed to get gc" );
- ecore_x_drawable_rectangle_fill( mX11Pixmap, gc, 0, 0, mPosition.width, mPosition.height );
+ ecore_x_drawable_rectangle_fill( mImpl->mX11Pixmap, gc, 0, 0, mPosition.width, mPosition.height );
- DALI_ASSERT_ALWAYS( mX11Pixmap && "Failed to create X pixmap" );
+ DALI_ASSERT_ALWAYS( mImpl->mX11Pixmap && "Failed to create X pixmap" );
// we SHOULD guarantee the xpixmap/x11 window was created in x server.
ecore_x_sync();
// we SHOULD guarantee the xpixmap/x11 window was created in x server.
ecore_x_sync();
void PixmapRenderSurface::UseExistingRenderable( unsigned int surfaceId )
{
void PixmapRenderSurface::UseExistingRenderable( unsigned int surfaceId )
{
- mX11Pixmap = static_cast< Ecore_X_Pixmap >( surfaceId );
+ mImpl->mX11Pixmap = static_cast< Ecore_X_Pixmap >( surfaceId );
}
void PixmapRenderSurface::SetSyncMode( SyncMode syncMode )
{
}
void PixmapRenderSurface::SetSyncMode( SyncMode syncMode )
{
+ mImpl->mSyncMode = syncMode;
}
void PixmapRenderSurface::AcquireLock( SyncMode syncMode )
{
}
void PixmapRenderSurface::AcquireLock( SyncMode syncMode )
{
- boost::unique_lock< boost::mutex > lock( mSyncMutex );
+ Dali::Mutex::ScopedLock lock( mImpl->mSyncMutex );
// wait for sync
if( syncMode != SYNC_MODE_NONE &&
// wait for sync
if( syncMode != SYNC_MODE_NONE &&
- mSyncMode != SYNC_MODE_NONE &&
- !mSyncReceived )
+ mImpl->mSyncMode != SYNC_MODE_NONE &&
+ !mImpl->mSyncReceived )
- mSyncNotify.wait( lock );
+ mImpl->mSyncNotify.Wait( );
+ mImpl->mSyncReceived = false;
}
void PixmapRenderSurface::ReleaseLock()
{
{
}
void PixmapRenderSurface::ReleaseLock()
{
{
- boost::unique_lock< boost::mutex > lock( mSyncMutex );
- mSyncReceived = true;
+ Dali::Mutex::ScopedLock lock( mImpl->mSyncMutex );
+ mImpl->mSyncReceived = true;
}
// wake render thread if it was waiting for the notify
}
// wake render thread if it was waiting for the notify
- mSyncNotify.notify_all();
+ mImpl->mSyncNotify.Notify();