From 26117d407b8ff8da1854f0b8cc85c14625fe1595 Mon Sep 17 00:00:00 2001 From: taeyoon Date: Thu, 19 Nov 2015 22:00:09 +0900 Subject: [PATCH] [3.0] NativeImageSource with tbm_surface for tizen 3.0 wayland Conflicts: adaptors/ecore/wayland/native-image-source-impl-ecore-wl.cpp adaptors/ecore/wayland/native-image-source-impl.h adaptors/tizen/native-image-source-impl.h adaptors/wayland/file.list adaptors/wayland/native-image-source-impl.h build/tizen/adaptor/Makefile.am Conflicts: adaptors/tizen/file.list build/tizen/adaptor/Makefile.am build/tizen/configure.ac packaging/dali-adaptor.spec Change-Id: I4a0477c09765aae5769f5c4960242a9272a057bd --- adaptors/common/file.list | 4 +- adaptors/common/gl/egl-image-extensions.cpp | 4 +- adaptors/common/gl/egl-image-extensions.h | 4 +- adaptors/ecore/wayland/file.list | 1 - .../wayland/native-image-source-impl-ecore-wl.cpp | 152 ------ .../adaptor-framework/native-image-source.cpp | 10 + .../adaptor-framework/native-image-source.h | 20 +- adaptors/tizen/file.list | 6 + adaptors/tizen/gl/egl-image-extensions-tizen.cpp | 242 +++++++++ adaptors/tizen/native-image-source-impl-tizen.cpp | 391 +++++++++++++++ .../wayland => tizen}/native-image-source-impl.h | 41 +- adaptors/wayland/file.list | 3 +- .../native-image/native-image-source-impl-wl.cpp | 83 ---- .../native-image/native-image-source-impl.h | 131 ----- adaptors/x11/native-image-source-impl-x.cpp | 14 + adaptors/x11/native-image-source-impl.h | 13 + build/tizen/adaptor-uv/Makefile.am | 547 +++++++++++++++++++++ build/tizen/adaptor-uv/configure.ac | 373 ++++++++++++++ build/tizen/adaptor/Makefile.am | 48 +- build/tizen/adaptor/configure.ac | 348 +++++++++++++ build/tizen/configure.ac | 4 +- packaging/dali-adaptor.spec | 7 + 22 files changed, 2044 insertions(+), 402 deletions(-) delete mode 100644 adaptors/ecore/wayland/native-image-source-impl-ecore-wl.cpp create mode 100644 adaptors/tizen/gl/egl-image-extensions-tizen.cpp create mode 100644 adaptors/tizen/native-image-source-impl-tizen.cpp rename adaptors/{ecore/wayland => tizen}/native-image-source-impl.h (80%) delete mode 100644 adaptors/wayland/native-image/native-image-source-impl-wl.cpp delete mode 100644 adaptors/wayland/native-image/native-image-source-impl.h create mode 100644 build/tizen/adaptor-uv/Makefile.am create mode 100644 build/tizen/adaptor-uv/configure.ac create mode 100644 build/tizen/adaptor/configure.ac diff --git a/adaptors/common/file.list b/adaptors/common/file.list index a3aebac..a2532dc 100644 --- a/adaptors/common/file.list +++ b/adaptors/common/file.list @@ -43,7 +43,6 @@ adaptor_common_internal_src_files = \ $(adaptor_common_dir)/feedback/feedback-plugin-proxy.cpp \ \ $(adaptor_common_dir)/gl/egl-factory.cpp \ - $(adaptor_common_dir)/gl/egl-image-extensions.cpp \ $(adaptor_common_dir)/gl/egl-implementation.cpp \ $(adaptor_common_dir)/gl/egl-sync-implementation.cpp \ $(adaptor_common_dir)/gl/egl-debug.cpp \ @@ -64,3 +63,6 @@ adaptor_common_internal_uv_src_files = \ adaptor_common_internal_default_profile_src_files = \ $(adaptor_common_dir)/color-controller-impl.cpp \ $(adaptor_common_dir)/system-settings.cpp + +adaptor_common_internal_egl_extension_src_files = \ + $(adaptor_common_dir)/gl/egl-image-extensions.cpp diff --git a/adaptors/common/gl/egl-image-extensions.cpp b/adaptors/common/gl/egl-image-extensions.cpp index 5c47fe0..e6323e2 100644 --- a/adaptors/common/gl/egl-image-extensions.cpp +++ b/adaptors/common/gl/egl-image-extensions.cpp @@ -68,7 +68,7 @@ EglImageExtensions::~EglImageExtensions() { } -void* EglImageExtensions::CreateImageKHR(EGLClientBuffer pixmap) +void* EglImageExtensions::CreateImageKHR(EGLClientBuffer clientBuffer) { if (mImageKHRInitialized == false) { @@ -90,7 +90,7 @@ void* EglImageExtensions::CreateImageKHR(EGLClientBuffer pixmap) EGLImageKHR eglImage = eglCreateImageKHR( mEglImplementation->GetDisplay(), EGL_NO_CONTEXT, EGL_NATIVE_PIXMAP_KHR, - pixmap, + clientBuffer, attribs ); DALI_ASSERT_DEBUG( EGL_NO_IMAGE_KHR != eglImage && "X11Image::GlExtensionCreate eglCreateImageKHR failed!\n"); diff --git a/adaptors/common/gl/egl-image-extensions.h b/adaptors/common/gl/egl-image-extensions.h index 4bb85c2..bd0e93e 100644 --- a/adaptors/common/gl/egl-image-extensions.h +++ b/adaptors/common/gl/egl-image-extensions.h @@ -53,10 +53,10 @@ public: // EGLImageKHR extension support /** * If the EGL Image extension is available this function returns a * EGLImageKHR - * @param pixmap The pixmap + * @param clientBuffer Client buffer to use for image creation * @return an object that holds a EGLImageKHR */ - void* CreateImageKHR(EGLClientBuffer pixmap); + void* CreateImageKHR(EGLClientBuffer clientBuffer); /** * If the EGL Image extension is available this function diff --git a/adaptors/ecore/wayland/file.list b/adaptors/ecore/wayland/file.list index ac83e4d..44f23ba 100644 --- a/adaptors/ecore/wayland/file.list +++ b/adaptors/ecore/wayland/file.list @@ -7,7 +7,6 @@ adaptor_ecore_wayland_tizen_internal_src_files = \ $(adaptor_ecore_wayland_dir)/framework-ecore-wl.cpp \ $(adaptor_ecore_wayland_dir)/imf-manager-impl-ecore-wl.cpp \ $(adaptor_ecore_wayland_dir)/key-mapping-ecore-wl.cpp \ - $(adaptor_ecore_wayland_dir)/native-image-source-impl-ecore-wl.cpp \ $(adaptor_ecore_wayland_dir)/pixmap-render-surface-ecore-wl.cpp \ $(adaptor_ecore_wayland_dir)/render-surface-ecore-wl.cpp \ $(adaptor_ecore_wayland_dir)/virtual-keyboard-impl-ecore-wl.cpp \ diff --git a/adaptors/ecore/wayland/native-image-source-impl-ecore-wl.cpp b/adaptors/ecore/wayland/native-image-source-impl-ecore-wl.cpp deleted file mode 100644 index e32aec9..0000000 --- a/adaptors/ecore/wayland/native-image-source-impl-ecore-wl.cpp +++ /dev/null @@ -1,152 +0,0 @@ -/* - * 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 "native-image-source-impl.h" - -// EXTERNAL INCLUDES -#include - -// INTERNAL INCLUDES -#include -#include -#include -#include - -// Allow this to be encoded and saved: -#include -#include - -namespace Dali -{ - -namespace Internal -{ - -namespace Adaptor -{ -using Dali::Integration::PixelBuffer; - -NativeImageSource* NativeImageSource::New(unsigned int width, unsigned int height, Dali::NativeImageSource::ColorDepth depth, Any nativeImageSource ) -{ - NativeImageSource* image = new NativeImageSource( width, height, depth, nativeImageSource ); - DALI_ASSERT_DEBUG( image && "NativeImageSource allocation failed." ); - - // 2nd phase construction - if(image) //< Defensive in case we ever compile without exceptions. - { - image->Initialize(); - } - - return image; -} - -NativeImageSource::NativeImageSource( unsigned int width, unsigned int height, Dali::NativeImageSource::ColorDepth depth, Any nativeImageSource ) -: mWidth( width ), - mHeight( height ), - mOwnPixmap( true ), - mColorDepth( depth ), - mEglImageKHR( NULL ), - mEglImageExtensions( NULL ) -{ - DALI_ASSERT_ALWAYS( Adaptor::IsAvailable() ); - EglFactory& eglFactory = Adaptor::GetImplementation( Adaptor::Get() ).GetEGLFactory(); - mEglImageExtensions = eglFactory.GetImageExtensions(); - SetBlending( mColorDepth ); - - DALI_ASSERT_DEBUG( mEglImageExtensions ); -} - -void NativeImageSource::Initialize() -{ -} - -NativeImageSource::~NativeImageSource() -{ -} - -Any NativeImageSource::GetNativeImageSource() const -{ - DALI_ASSERT_ALWAYS( false && "NativeImageSource::GetNativeImageSource() is not supported for Wayland." ); - return Any(); -} - -bool NativeImageSource::GetPixels(std::vector& pixbuf, unsigned& width, unsigned& height, Pixel::Format& pixelFormat) const -{ - return false; -} - -bool NativeImageSource::EncodeToFile(const std::string& filename) const -{ - std::vector< unsigned char > pixbuf; - unsigned int width(0), height(0); - Pixel::Format pixelFormat; - - if(GetPixels(pixbuf, width, height, pixelFormat)) - { - return Dali::EncodeToFile(&pixbuf[0], filename, pixelFormat, width, height); - } - return false; -} - -bool NativeImageSource::GlExtensionCreate() -{ - return false; -} - -void NativeImageSource::GlExtensionDestroy() -{ - mEglImageExtensions->DestroyImageKHR(mEglImageKHR); - - mEglImageKHR = NULL; -} - -unsigned int NativeImageSource::TargetTexture() -{ - mEglImageExtensions->TargetTextureKHR(mEglImageKHR); - - return 0; -} - -void NativeImageSource::SetBlending(Dali::NativeImageSource::ColorDepth depth) -{ - switch (depth) - { - case Dali::NativeImageSource::COLOR_DEPTH_16: //Pixel::RGB565 - case Dali::NativeImageSource::COLOR_DEPTH_24: // Pixel::RGB888 - { - mBlendingRequired = false; - break; - } - case Dali::NativeImageSource::COLOR_DEPTH_8: //Pixel::A8 - case Dali::NativeImageSource::COLOR_DEPTH_32: // Pixel::RGBA8888 - { - mBlendingRequired = true; - break; - } - default: - { - DALI_ASSERT_DEBUG(0 && "unknown color enum"); - } - } -} - -} // namespace Adaptor - -} // namespace internal - -} // namespace Dali diff --git a/adaptors/public-api/adaptor-framework/native-image-source.cpp b/adaptors/public-api/adaptor-framework/native-image-source.cpp index ba9a914..9efc7d3 100644 --- a/adaptors/public-api/adaptor-framework/native-image-source.cpp +++ b/adaptors/public-api/adaptor-framework/native-image-source.cpp @@ -55,6 +55,11 @@ bool NativeImageSource::EncodeToFile(const std::string& filename) const return mImpl->EncodeToFile(filename); } +void NativeImageSource::SetNativeImageSource( Any nativeImageSource ) +{ + mImpl->SetNativeImageSource( nativeImageSource ); +} + bool NativeImageSource::GlExtensionCreate() { return mImpl->GlExtensionCreate(); @@ -90,6 +95,11 @@ bool NativeImageSource::RequiresBlending() const return mImpl->RequiresBlending(); } +NativeImageInterface::Extension* NativeImageSource::GetExtension() +{ + return mImpl->GetNativeImageInterfaceExtension(); +} + NativeImageSource::NativeImageSource( unsigned int width, unsigned int height, ColorDepth depth, Any nativeImageSource ) { mImpl = Internal::Adaptor::NativeImageSource::New( width, height, depth, nativeImageSource ); diff --git a/adaptors/public-api/adaptor-framework/native-image-source.h b/adaptors/public-api/adaptor-framework/native-image-source.h index dea2a14..b81514d 100644 --- a/adaptors/public-api/adaptor-framework/native-image-source.h +++ b/adaptors/public-api/adaptor-framework/native-image-source.h @@ -50,8 +50,8 @@ typedef IntrusivePtr NativeImageSourcePtr; /** * @brief Used for displaying native images. * - * The native image source can be created internally or - * externally by X11 or ECORE-X11. + * NativeImageSource can be created internally or + * externally by native image source. * * @since DALi 1.1.4 */ @@ -83,7 +83,7 @@ public: static NativeImageSourcePtr New( unsigned int width, unsigned int height, ColorDepth depth ); /** - * @brief Create a new NativeImageSource from an existing native image. + * @brief Create a new NativeImageSource from an existing native image source. * * @param[in] nativeImageSource must be a X11 pixmap or a Ecore_X_Pixmap * @return A smart-pointer to a newly allocated image. @@ -121,6 +121,13 @@ public: */ bool EncodeToFile(const std::string& filename) const; + /** + * @brief Set an existing native image source + * + * @param[in] source Any handle with native image source + */ + void SetNativeImageSource( Any source ); + private: // native image /** @@ -158,6 +165,11 @@ private: // native image */ virtual bool RequiresBlending() const; + /** + * @copydoc Dali::NativeImageInterface::GetExtension() + */ + NativeImageInterface::Extension* GetExtension(); + private: /** @@ -165,7 +177,7 @@ private: * @param[in] width The width of the image. * @param[in] height The height of the image. * @param[in] depth color depth of the image. - * @param[in] nativeImageSource contains either: pixmap of type X11 Pixmap , a Ecore_X_Pixmap or is empty + * @param[in] nativeImageSource contains either: native image source or is empty */ DALI_INTERNAL NativeImageSource( unsigned int width, unsigned int height, ColorDepth depth, Any nativeImageSource ); diff --git a/adaptors/tizen/file.list b/adaptors/tizen/file.list index ed2d658..7b46e50 100644 --- a/adaptors/tizen/file.list +++ b/adaptors/tizen/file.list @@ -14,3 +14,9 @@ adaptor_tizen_framework_efl_src_files = $(adaptor_tizen_dir)/framework-tizen.cpp public_api_adaptor_tizen_header_files = \ $(adaptor_tizen_dir)/key-grab.h + +adaptor_tizen_internal_egl_extension_src_files = \ + $(adaptor_tizen_dir)/gl/egl-image-extensions-tizen.cpp + +adaptor_tizen_internal_native_image_src_files = \ + $(adaptor_tizen_dir)/native-image-source-impl-tizen.cpp diff --git a/adaptors/tizen/gl/egl-image-extensions-tizen.cpp b/adaptors/tizen/gl/egl-image-extensions-tizen.cpp new file mode 100644 index 0000000..88ee62d --- /dev/null +++ b/adaptors/tizen/gl/egl-image-extensions-tizen.cpp @@ -0,0 +1,242 @@ +/* + * 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 + +// EXTERNAL INCLUDES +#if DALI_GLES_VERSION >= 30 +#include +#include + +#else +#include +#endif // DALI_GLES_VERSION >= 30 + +#include + +#include + +#include + +// INTERNAL INCLUDES +#include + +// TBM surface support +#ifndef EGL_NATIVE_SURFACE_TIZEN +#define EGL_NATIVE_SURFACE_TIZEN 0x32A1 +#endif + +namespace +{ +// function pointers assigned in InitializeEglImageKHR +PFNEGLCREATEIMAGEKHRPROC eglCreateImageKHR = 0; +PFNEGLDESTROYIMAGEKHRPROC eglDestroyImageKHR = 0; +PFNGLEGLIMAGETARGETTEXTURE2DOESPROC glEGLImageTargetTexture2DOES = 0; +} // unnamed namespace + + +namespace Dali +{ + +namespace Internal +{ + +namespace Adaptor +{ + +EglImageExtensions::EglImageExtensions(EglImplementation* eglImpl) +: mEglImplementation(eglImpl), + mImageKHRInitialized(false), + mImageKHRInitializeFailed(false) +{ + DALI_ASSERT_ALWAYS( eglImpl && "EGL Implementation not instantiated" ); +} + +EglImageExtensions::~EglImageExtensions() +{ +} + +void* EglImageExtensions::CreateImageKHR(EGLClientBuffer clientBuffer) +{ + if (mImageKHRInitialized == false) + { + InitializeEglImageKHR(); + } + + if (mImageKHRInitialized == false) + { + return NULL; + } + + // Use the EGL image extension + const EGLint attribs[] = + { + EGL_IMAGE_PRESERVED_KHR, EGL_TRUE, + EGL_NONE + }; + + EGLImageKHR eglImage = eglCreateImageKHR( mEglImplementation->GetDisplay(), + EGL_NO_CONTEXT, + EGL_NATIVE_SURFACE_TIZEN, + clientBuffer, + attribs ); + + DALI_ASSERT_DEBUG( EGL_NO_IMAGE_KHR != eglImage && "X11Image::GlExtensionCreate eglCreateImageKHR failed!\n"); + if( EGL_NO_IMAGE_KHR == eglImage ) + { + switch( eglGetError() ) + { + case EGL_SUCCESS : + { + break; + } + case EGL_BAD_DISPLAY: + { + DALI_LOG_ERROR( "EGL_BAD_DISPLAY: Invalid EGLDisplay object" ); + break; + } + case EGL_BAD_CONTEXT: + { + DALI_LOG_ERROR( "EGL_BAD_CONTEXT: Invalid EGLContext object" ); + break; + } + case EGL_BAD_PARAMETER: + { + DALI_LOG_ERROR( "EGL_BAD_PARAMETER: Invalid target parameter or attribute in attrib_list" ); + break; + } + case EGL_BAD_MATCH: + { + DALI_LOG_ERROR( "EGL_BAD_MATCH: attrib_list does not match target" ); + break; + } + case EGL_BAD_ACCESS: + { + DALI_LOG_ERROR( "EGL_BAD_ACCESS: Previously bound off-screen, or EGLImage sibling error" ); + break; + } + case EGL_BAD_ALLOC: + { + DALI_LOG_ERROR( "EGL_BAD_ALLOC: Insufficient memory is available" ); + break; + } + default: + { + break; + } + } + } + + return (void*)eglImage; +} + +void EglImageExtensions::DestroyImageKHR(void* eglImageKHR) +{ + DALI_ASSERT_DEBUG( mImageKHRInitialized ); + + if( ! mImageKHRInitialized ) + { + return; + } + + if( eglImageKHR == NULL ) + { + return; + } + + EGLImageKHR eglImage = static_cast(eglImageKHR); + + EGLBoolean result = eglDestroyImageKHR(mEglImplementation->GetDisplay(), eglImage); + + if( EGL_FALSE == result ) + { + switch( eglGetError() ) + { + case EGL_BAD_DISPLAY: + { + DALI_LOG_ERROR( "EGL_BAD_DISPLAY: Invalid EGLDisplay object" ); + break; + } + case EGL_BAD_PARAMETER: + { + DALI_LOG_ERROR( "EGL_BAD_PARAMETER: eglImage is not a valid EGLImageKHR object created with respect to EGLDisplay" ); + break; + } + case EGL_BAD_ACCESS: + { + DALI_LOG_ERROR( "EGL_BAD_ACCESS: EGLImage sibling error" ); + break; + } + default: + { + break; + } + } + } +} + +void EglImageExtensions::TargetTextureKHR(void* eglImageKHR) +{ + DALI_ASSERT_DEBUG( mImageKHRInitialized ); + + if( eglImageKHR != NULL ) + { + EGLImageKHR eglImage = static_cast(eglImageKHR); + +#ifdef EGL_ERROR_CHECKING + GLint glError = glGetError(); +#endif + + glEGLImageTargetTexture2DOES(GL_TEXTURE_EXTERNAL_OES, (GLeglImageOES)eglImage); + +#ifdef EGL_ERROR_CHECKING + glError = glGetError(); + if( GL_NO_ERROR != glError ) + { + DALI_LOG_ERROR(" glEGLImageTargetTexture2DOES returned error %0x04x\n", glError ); + } +#endif + } +} + +void EglImageExtensions::InitializeEglImageKHR() +{ + // avoid trying to reload extended KHR functions, if it fails the first time + if( ! mImageKHRInitializeFailed ) + { + eglCreateImageKHR = (PFNEGLCREATEIMAGEKHRPROC) eglGetProcAddress("eglCreateImageKHR"); /* parasoft-suppress MISRA2004-11_1_DMC "Using EGL defined functions." */ + eglDestroyImageKHR = (PFNEGLDESTROYIMAGEKHRPROC) eglGetProcAddress("eglDestroyImageKHR"); /* parasoft-suppress MISRA2004-11_1_DMC "Using EGL defined functions." */ + glEGLImageTargetTexture2DOES = (PFNGLEGLIMAGETARGETTEXTURE2DOESPROC) eglGetProcAddress("glEGLImageTargetTexture2DOES"); /* parasoft-suppress MISRA2004-11_1_DMC "Using EGL defined functions." */ + } + + if (eglCreateImageKHR && eglDestroyImageKHR && glEGLImageTargetTexture2DOES) + { + mImageKHRInitialized = true; + } + else + { + mImageKHRInitializeFailed = true; + } +} + +} // namespace Adaptor + +} // namespace Internal + +} // namespace Dali diff --git a/adaptors/tizen/native-image-source-impl-tizen.cpp b/adaptors/tizen/native-image-source-impl-tizen.cpp new file mode 100644 index 0000000..4ebed37 --- /dev/null +++ b/adaptors/tizen/native-image-source-impl-tizen.cpp @@ -0,0 +1,391 @@ +/* + * 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 "native-image-source-impl.h" + +// EXTERNAL INCLUDES +#include +#include + +// INTERNAL INCLUDES +#include +#include +#include +#include + +// Allow this to be encoded and saved: +#include +#include + +namespace Dali +{ + +namespace Internal +{ + +namespace Adaptor +{ + +namespace +{ +const char* FRAGMENT_PREFIX = "#extension GL_OES_EGL_image_external:require\n"; +const char* SAMPLER_TYPE = "samplerExternalOES"; +} + +using Dali::Integration::PixelBuffer; + +NativeImageSource* NativeImageSource::New(unsigned int width, unsigned int height, Dali::NativeImageSource::ColorDepth depth, Any nativeImageSource ) +{ + NativeImageSource* image = new NativeImageSource( width, height, depth, nativeImageSource ); + DALI_ASSERT_DEBUG( image && "NativeImageSource allocation failed." ); + + if( image ) + { + image->Initialize(); + } + + return image; +} + +NativeImageSource::NativeImageSource( unsigned int width, unsigned int height, Dali::NativeImageSource::ColorDepth depth, Any nativeImageSource ) +: mWidth( width ), + mHeight( height ), + mOwnTbmsurface( true ), + mTbmsurface( NULL ), + mBlendingRequired( false ), + mColorDepth( depth ), + mEglImageKHR( NULL ), + mEglImageExtensions( NULL ) +{ + DALI_ASSERT_ALWAYS( Adaptor::IsAvailable() ); + EglFactory& eglFactory = Adaptor::GetImplementation( Adaptor::Get() ).GetEGLFactory(); + mEglImageExtensions = eglFactory.GetImageExtensions(); + DALI_ASSERT_DEBUG( mEglImageExtensions ); + + mTbmsurface = GetSurfaceFromAny( nativeImageSource ); + + if( mTbmsurface != NULL ) + { + mWidth = tbm_surface_get_width( mTbmsurface ); + mHeight = tbm_surface_get_height( mTbmsurface ); + } +} + +void NativeImageSource::Initialize() +{ + if( mTbmsurface != NULL ) + { + mOwnTbmsurface = false; + return; + } + + tbm_format format = TBM_FORMAT_RGB888; + int depth = 0; + + switch( mColorDepth ) + { + case Dali::NativeImageSource::COLOR_DEPTH_DEFAULT: + { + format = TBM_FORMAT_RGBA8888; + depth = 32; + break; + } + case Dali::NativeImageSource::COLOR_DEPTH_8: + { + format = TBM_FORMAT_C8; + depth = 8; + break; + } + case Dali::NativeImageSource::COLOR_DEPTH_16: + { + format = TBM_FORMAT_RGB565; + depth = 16; + break; + } + case Dali::NativeImageSource::COLOR_DEPTH_24: + { + format = TBM_FORMAT_RGB888; + depth = 24; + break; + } + case Dali::NativeImageSource::COLOR_DEPTH_32: + { + format = TBM_FORMAT_RGBA8888; + depth = 32; + break; + } + default: + { + DALI_LOG_WARNING( "Wrong color depth." ); + return; + } + } + + // set whether blending is required according to pixel format based on the depth + /* default pixel format is RGB888 + If depth = 8, Pixel::A8; + If depth = 16, Pixel::RGB565; + If depth = 32, Pixel::RGBA8888 */ + mBlendingRequired = ( depth == 32 || depth == 8 ); + + mTbmsurface = tbm_surface_create( mWidth, mHeight, format ); +} + +tbm_surface_h NativeImageSource::GetSurfaceFromAny( Any source ) const +{ + if( source.Empty() ) + { + return NULL; + } + + if( source.GetType() == typeid( tbm_surface_h ) ) + { + return AnyCast< tbm_surface_h >( source ); + } + else + { + return NULL; + } +} + +NativeImageSource::~NativeImageSource() +{ + if( mOwnTbmsurface && mTbmsurface != NULL ) + { + if( tbm_surface_destroy( mTbmsurface ) != TBM_SURFACE_ERROR_NONE ) + { + DALI_LOG_ERROR( "Failed to destroy tbm_surface" ); + } + } +} + +Any NativeImageSource::GetNativeImageSource() const +{ + return Any( mTbmsurface ); +} + +bool NativeImageSource::GetPixels(std::vector& pixbuf, unsigned& width, unsigned& height, Pixel::Format& pixelFormat) const +{ + if( mTbmsurface != NULL ) + { + tbm_surface_info_s surface_info; + + if( tbm_surface_map( mTbmsurface, TBM_SURF_OPTION_READ, &surface_info) != TBM_SURFACE_ERROR_NONE ) + { + DALI_LOG_ERROR( "Fail to map tbm_surface" ); + + width = 0; + height = 0; + + return false; + } + + tbm_format format = surface_info.format; + uint32_t stride = surface_info.planes[0].stride; + unsigned char* ptr = surface_info.planes[0].ptr; + + width = mWidth; + height = mHeight; + size_t lineSize; + size_t offset; + size_t cOffset; + + switch( format ) + { + case TBM_FORMAT_RGB888: + { + lineSize = width*3; + pixelFormat = Pixel::RGB888; + pixbuf.resize( lineSize*height ); + unsigned char* bufptr = &pixbuf[0]; + + for( unsigned int r = 0; r < height; ++r, bufptr += lineSize ) + { + for( unsigned int c = 0; c < width; ++c ) + { + cOffset = c*3; + offset = cOffset + r*stride; + *(bufptr) = ptr[offset+2]; + *(bufptr+cOffset+1) = ptr[offset+1]; + *(bufptr+cOffset+2) = ptr[offset]; + } + } + break; + } + case TBM_FORMAT_RGBA8888: + { + lineSize = width*4; + pixelFormat = Pixel::RGBA8888; + pixbuf.resize( lineSize*height ); + unsigned char* bufptr = &pixbuf[0]; + + for( unsigned int r = 0; r < height; ++r, bufptr += lineSize ) + { + for( unsigned int c = 0; c < width; ++c ) + { + cOffset = c*4; + offset = cOffset + r*stride; + *(bufptr) = ptr[offset+3]; + *(bufptr+cOffset+1) = ptr[offset+2]; + *(bufptr+cOffset+2) = ptr[offset+1]; + *(bufptr+cOffset+3) = ptr[offset]; + } + } + break; + } + default: + { + DALI_LOG_WARNING( "Tbm surface has unsupported pixel format." ); + + pixbuf.resize( 0 ); + width = 0; + height = 0; + + return false; + } + } + + if( tbm_surface_unmap( mTbmsurface ) != TBM_SURFACE_ERROR_NONE ) + { + DALI_LOG_ERROR( "Fail to unmap tbm_surface" ); + } + + return true; + } + + DALI_LOG_WARNING( "TBM surface does not exist." ); + + width = 0; + height = 0; + + return false; +} + +bool NativeImageSource::EncodeToFile(const std::string& filename) const +{ + std::vector< unsigned char > pixbuf; + unsigned int width(0), height(0); + Pixel::Format pixelFormat; + + if(GetPixels(pixbuf, width, height, pixelFormat)) + { + return Dali::EncodeToFile(&pixbuf[0], filename, pixelFormat, width, height); + } + return false; +} + +void NativeImageSource::SetNativeImageSource( Any nativeImageSource ) +{ + if( mOwnTbmsurface && mTbmsurface != NULL ) + { + if( tbm_surface_destroy( mTbmsurface ) != TBM_SURFACE_ERROR_NONE ) + { + DALI_LOG_ERROR( "Failed to destroy tbm_surface" ); + } + + mTbmsurface = NULL; + } + + mTbmsurface = GetSurfaceFromAny( nativeImageSource ); + mOwnTbmsurface = false; + + if( mTbmsurface != NULL ) + { + mWidth = tbm_surface_get_width( mTbmsurface ); + mHeight = tbm_surface_get_height( mTbmsurface ); + } +} + +bool NativeImageSource::GlExtensionCreate() +{ + if( mEglImageKHR != NULL ) + { + GlExtensionDestroy(); + } + + // casting from an unsigned int to a void *, which should then be cast back + // to an unsigned int in the driver. + EGLClientBuffer eglBuffer = reinterpret_cast< EGLClientBuffer > (mTbmsurface); + + mEglImageKHR = mEglImageExtensions->CreateImageKHR( eglBuffer ); + + return mEglImageKHR != NULL; +} + +void NativeImageSource::GlExtensionDestroy() +{ + mEglImageExtensions->DestroyImageKHR(mEglImageKHR); + + mEglImageKHR = NULL; +} + +unsigned int NativeImageSource::TargetTexture() +{ + mEglImageExtensions->TargetTextureKHR(mEglImageKHR); + + return 0; +} + +int NativeImageSource::GetPixelDepth(Dali::NativeImageSource::ColorDepth depth) const +{ + switch (depth) + { + case Dali::NativeImageSource::COLOR_DEPTH_DEFAULT: + { + // ToDo: Get the default screen depth + return 32; + } + case Dali::NativeImageSource::COLOR_DEPTH_8: + { + return 8; + } + case Dali::NativeImageSource::COLOR_DEPTH_16: + { + return 16; + } + case Dali::NativeImageSource::COLOR_DEPTH_24: + { + return 24; + } + case Dali::NativeImageSource::COLOR_DEPTH_32: + { + return 32; + } + default: + { + DALI_ASSERT_DEBUG(0 && "unknown color enum"); + return 0; + } + } +} + +const char* NativeImageSource::GetCustomFragmentPreFix() +{ + return FRAGMENT_PREFIX; +} + +const char* NativeImageSource::GetCustomSamplerTypename() +{ + return SAMPLER_TYPE; +} + +} // namespace Adaptor + +} // namespace internal + +} // namespace Dali diff --git a/adaptors/ecore/wayland/native-image-source-impl.h b/adaptors/tizen/native-image-source-impl.h similarity index 80% rename from adaptors/ecore/wayland/native-image-source-impl.h rename to adaptors/tizen/native-image-source-impl.h index 3870416..0317047 100644 --- a/adaptors/ecore/wayland/native-image-source-impl.h +++ b/adaptors/tizen/native-image-source-impl.h @@ -19,6 +19,8 @@ */ // EXTERNAL INCLUDES +#include +#include // INTERNAL INCLUDES #include @@ -36,7 +38,7 @@ class EglImageExtensions; /** * Dali internal NativeImageSource. */ -class NativeImageSource +class NativeImageSource: public NativeImageInterface::Extension { public: @@ -70,6 +72,11 @@ public: bool EncodeToFile(const std::string& filename) const; /** + * @copydoc Dali::NativeImageSource::SetNativeImageSource( Any nativeImageSource ) + */ + void SetNativeImageSource( Any nativeImageSource ); + + /** * destructor */ ~NativeImageSource(); @@ -113,6 +120,24 @@ public: return mBlendingRequired; } + /** + * @copydoc Dali::NativeImageInterface::GetExtension() + */ + NativeImageInterface::Extension* GetNativeImageInterfaceExtension() + { + return this; + } + + /** + * @copydoc Dali::NativeImageInterface::Extension::GetCustomFragmentPreFix() + */ + const char* GetCustomFragmentPreFix(); + + /** + * @copydoc Dali::NativeImageInterface::Extension::GetCustomSamplerTypename() + */ + const char* GetCustomSamplerTypename(); + private: /** @@ -127,22 +152,18 @@ private: Dali::NativeImageSource::ColorDepth depth, Any nativeImageSource); - /** - * 2nd phase construction. - */ void Initialize(); - /** - * Decide whether blending is required based on the color depth. - * @param depth the PixelImage depth enum - */ - void SetBlending(Dali::NativeImageSource::ColorDepth depth); + int GetPixelDepth(Dali::NativeImageSource::ColorDepth depth) const; + + tbm_surface_h GetSurfaceFromAny( Any source ) const; private: unsigned int mWidth; ///< image width unsigned int mHeight; ///< image heights - bool mOwnPixmap; ///< Whether we created pixmap or not + bool mOwnTbmsurface; ///< Whether we created pixmap or not + tbm_surface_h mTbmsurface; bool mBlendingRequired; ///< Whether blending is required Dali::NativeImageSource::ColorDepth mColorDepth; ///< color depth of image void* mEglImageKHR; ///< From EGL extension diff --git a/adaptors/wayland/file.list b/adaptors/wayland/file.list index 5541fbb..0584374 100644 --- a/adaptors/wayland/file.list +++ b/adaptors/wayland/file.list @@ -12,5 +12,4 @@ adaptor_wayland_tizen_internal_src_files = \ $(adaptor_wayland_dir)/input/key-mapping-wl.cpp \ $(adaptor_wayland_dir)/render-surface/render-surface-wl.cpp \ $(adaptor_wayland_dir)/clipboard/clipboard-impl-wl.cpp \ - $(adaptor_wayland_dir)/imf/imf-manager-impl-wl.cpp \ - $(adaptor_wayland_dir)/native-image/native-image-source-impl-wl.cpp + $(adaptor_wayland_dir)/imf/imf-manager-impl-wl.cpp diff --git a/adaptors/wayland/native-image/native-image-source-impl-wl.cpp b/adaptors/wayland/native-image/native-image-source-impl-wl.cpp deleted file mode 100644 index 25b7998..0000000 --- a/adaptors/wayland/native-image/native-image-source-impl-wl.cpp +++ /dev/null @@ -1,83 +0,0 @@ -/* - * 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 "native-image-source-impl.h" - -// EXTERNAL INCLUDES -#include - - - - -namespace Dali -{ - -namespace Internal -{ - -namespace Adaptor -{ - - -NativeImageSource* NativeImageSource::New(unsigned int width, unsigned int height, Dali::NativeImageSource::ColorDepth depth, Any nativeImageSource ) -{ - return NULL; -} - -NativeImageSource::~NativeImageSource() -{ - -} - -Any NativeImageSource::GetNativeImageSource() const -{ - DALI_ASSERT_ALWAYS( false && "NativeImageSource::GetNativeImageSource() is not supported for Wayland." ); - return Any(); -} - -bool NativeImageSource::GetPixels(std::vector& pixbuf, unsigned& width, unsigned& height, Pixel::Format& pixelFormat) const -{ - return false; -} - -bool NativeImageSource::EncodeToFile(const std::string& filename) const -{ - return false; -} - -bool NativeImageSource::GlExtensionCreate() -{ - return false; -} - -void NativeImageSource::GlExtensionDestroy() -{ -} - -unsigned int NativeImageSource::TargetTexture() -{ - return 0; -} - - - -} // namespace Adaptor - -} // namespace internal - -} // namespace Dali diff --git a/adaptors/wayland/native-image/native-image-source-impl.h b/adaptors/wayland/native-image/native-image-source-impl.h deleted file mode 100644 index 5aec4f2..0000000 --- a/adaptors/wayland/native-image/native-image-source-impl.h +++ /dev/null @@ -1,131 +0,0 @@ -#ifndef __DALI_INTERNAL_NATIVE_IMAGE_SOURCE_H__ -#define __DALI_INTERNAL_NATIVE_IMAGE_SOURCE_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 - -// INTERNAL INCLUDES -#include - -namespace Dali -{ - -namespace Internal -{ - -namespace Adaptor -{ -class EglImageExtensions; - -/** - * Dali internal NativeImageSource. - */ -class NativeImageSource -{ -public: - - /** - * Create a new NativeImageSource internally. - * Depending on hardware the width and height may have to be a power of two. - * @param[in] width The width of the image. - * @param[in] height The height of the image. - * @param[in] depth color depth of the image. - * @param[in] nativeImageSource contains either: pixmap of type X11 Pixmap , a Ecore_X_Pixmap or is empty - * @return A smart-pointer to a newly allocated image. - */ - static NativeImageSource* New(unsigned int width, - unsigned int height, - Dali::NativeImageSource::ColorDepth depth, - Any nativeImageSource); - - /** - * @copydoc Dali::NativeImageSource::GetNativeImageSource() - */ - Any GetNativeImageSource() const; - - /** - * @copydoc Dali::NativeImageSource::GetPixels() - */ - bool GetPixels(std::vector &pixbuf, unsigned int &width, unsigned int &height, Pixel::Format& pixelFormat ) const; - - /** - * @copydoc Dali::NativeImageSource::EncodeToFile(const std::string& ) - */ - bool EncodeToFile(const std::string& filename) const; - - /** - * destructor - */ - ~NativeImageSource(); - - /** - * @copydoc Dali::NativeImageSource::GlExtensionCreate() - */ - bool GlExtensionCreate(); - - /** - * @copydoc Dali::NativeImageSource::GlExtensionDestroy() - */ - void GlExtensionDestroy(); - - /** - * @copydoc Dali::NativeImageSource::TargetTexture() - */ - unsigned int TargetTexture(); - - /** - * @copydoc Dali::NativeImageSource::GetWidth() - */ - unsigned int GetWidth() const - { - return 0; - } - - /** - * @copydoc Dali::NativeImageSource::GetHeight() - */ - unsigned int GetHeight() const - { - return 0; - } - - /** - * @copydoc Dali::NativeImageSource::RequiresBlending() - */ - bool RequiresBlending() const - { - return false; - } - -protected: - - /** - * @brief constructor - */ - NativeImageSource() {} - -}; - -} // namespace Adaptor - -} // namespace Internal - -} // namespace Dali - -#endif // __DALI_INTERNAL_NATIVE_IMAGE_SOURCE_H__ diff --git a/adaptors/x11/native-image-source-impl-x.cpp b/adaptors/x11/native-image-source-impl-x.cpp index b58057b..84d7887 100644 --- a/adaptors/x11/native-image-source-impl-x.cpp +++ b/adaptors/x11/native-image-source-impl-x.cpp @@ -273,6 +273,20 @@ bool NativeImageSource::EncodeToFile(const std::string& filename) const return false; } +void NativeImageSource::SetNativeImageSource( Any nativeImageSource ) +{ + mPixmap = GetPixmapFromAny( nativeImageSource ); + + if (mPixmap) + { + // we don't own the pixmap + mOwnPixmap = false; + + // find out the pixmap width / height and color depth + GetPixmapDetails(); + } +} + bool NativeImageSource::GlExtensionCreate() { // if the image existed previously delete it. diff --git a/adaptors/x11/native-image-source-impl.h b/adaptors/x11/native-image-source-impl.h index a97bfe1..c7e2357 100644 --- a/adaptors/x11/native-image-source-impl.h +++ b/adaptors/x11/native-image-source-impl.h @@ -70,6 +70,11 @@ public: bool EncodeToFile(const std::string& filename) const; /** + * @copydoc Dali::NativeImageSource::SetNativeImageSource( Any nativeImageSource ) + */ + void SetNativeImageSource( Any nativeImageSource ); + + /** * destructor */ ~NativeImageSource(); @@ -113,6 +118,14 @@ public: return mBlendingRequired; } + /** + * @copydoc Dali::NativeImageInterface::GetExtension() + */ + NativeImageInterface::Extension* GetNativeImageInterfaceExtension() + { + return NULL; + } + private: /** diff --git a/build/tizen/adaptor-uv/Makefile.am b/build/tizen/adaptor-uv/Makefile.am new file mode 100644 index 0000000..60bd418 --- /dev/null +++ b/build/tizen/adaptor-uv/Makefile.am @@ -0,0 +1,547 @@ +# +# 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. +# + +# Build the Dali Adaptor library + + +############# INCLUDE FILE LISTS ############# + +# Base Adaptor +base_adaptor_src_dir = ../../../adaptors/base +include ../../../adaptors/base/file.list + +# Platform Abstraction +tizen_platform_abstraction_src_dir = ../../../platform-abstractions/tizen +portable_platform_abstraction_src_dir = ../../../platform-abstractions/portable +include ../../../platform-abstractions/tizen/file.list + +# Text Abstraction +text_src_dir = ../../../text +include ../../../text/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 + +if USE_EFL +# ECore Common +adaptor_ecore_common_dir = ../../../adaptors/ecore/common +include ../../../adaptors/ecore/common/file.list +else +# If we're not using any EFL, then we need to use libuv mainloop +# for the frame work +adaptor_libuv_dir = ../../../adaptors/libuv +include ../../../adaptors/libuv/file.list +endif + +# Wayland +if WAYLAND +if USE_EFL +## Use ecore_wayland +adaptor_ecore_wayland_dir = ../../../adaptors/ecore/wayland +include ../../../adaptors/ecore/wayland/file.list +else +## Use wayland +adaptor_wayland_dir = ../../../adaptors/wayland +include ../../../adaptors/wayland/file.list +endif +else +# X11 +adaptor_x11_dir = ../../../adaptors/x11 +include ../../../adaptors/x11/file.list +endif + +# Ubuntu +if UBUNTU_PROFILE +adaptor_ubuntu_dir = ../../../adaptors/ubuntu +include ../../../adaptors/ubuntu/file.list +else +# Tizen +adaptor_tizen_dir = ../../../adaptors/tizen +include ../../../adaptors/tizen/file.list +endif + +# Mobile +adaptor_mobile_dir = ../../../adaptors/mobile +include ../../../adaptors/mobile/file.list + +# TV +if TV_PROFILE +adaptor_tv_dir = ../../../adaptors/tv +include ../../../adaptors/tv/file.list +endif + +# Public API +adaptor_public_api_dir = ../../../adaptors/public-api +include ../../../adaptors/public-api/file.list + +# Devel API ( for use by Toolkit) +adaptor_devel_api_dir = ../../../adaptors/devel-api +include ../../../adaptors/devel-api/file.list + + +# Static libraries +static_libraries_libunibreak_src_dir = ../../../text/dali/internal/libunibreak +include ../../../text/dali/internal/libunibreak/file.list + +# Package doc +package_doxy_dir = ../../../doc +include ../../../doc/file.list + +############# source files ############# + +# FRAMEWORK FILES for adaptor +# Either use ecore mainloop + appcore / uiman +# Or libuv main loop with no appcore / uimain +if USE_EFL +adaptor_internal_src_files = $(adaptor_tizen_framework_efl_src_files) \ + $(adaptor_ecore_common_internal_src_files) +else +adaptor_internal_src_files = $(adaptor_tizen_framework_libuv_src_files) +endif + +# COMMON +if COMMON_PROFILE + +adaptor_internal_src_files += $(adaptor_common_internal_src_files) \ + $(adaptor_common_internal_default_profile_src_files) \ + $(adaptor_tizen_internal_src_files) \ + $(adaptor_tizen_internal_non_mobile_src_files) \ + $(static_libraries_libunibreak_src_files) + +if WAYLAND +if USE_ECORE_WAYLAND +adaptor_internal_src_files += $(adaptor_ecore_wayland_tizen_internal_src_files) \ + $(adaptor_ecore_wayland_internal_default_profile_src_files) +else +adaptor_internal_src_files += $(adaptor_wayland_tizen_internal_src_files) +endif # USE_ECORE_WAYLAND + +adaptor_internal_src_files += $(adaptor_tizen_internal_egl_extension_src_files)\ + $(adaptor_tizen_internal_native_image_src_files) +else +adaptor_internal_src_files += $(adaptor_x11_tizen_internal_src_files) \ + $(adaptor_common_internal_egl_extension_src_files) \ + $(adaptor_x11_internal_default_profile_src_files) +endif # WAYLAND +endif # COMMON_PROFILE + + +# UBUNTU +if UBUNTU_PROFILE + +adaptor_internal_src_files += $(adaptor_common_internal_src_files) \ + $(adaptor_common_internal_default_profile_src_files) \ + $(adaptor_ubuntu_internal_src_files) \ + $(adaptor_x11_ubuntu_internal_src_files) \ + $(adaptor_x11_internal_default_profile_src_files) \ + $(static_libraries_libunibreak_src_files) \ + $(adaptor_common_internal_egl_extension_src_files) + +endif # UBUNTU_PROFILE + + +# MOBILE +if MOBILE_PROFILE + +adaptor_internal_src_files += $(adaptor_common_internal_src_files) \ + $(adaptor_common_internal_mobile_profile_src_files) \ + $(adaptor_tizen_internal_src_files) \ + $(static_libraries_libunibreak_src_files) + +if WAYLAND +if USE_ECORE_WAYLAND +adaptor_internal_src_files += $(adaptor_ecore_wayland_tizen_internal_src_files) +else +adaptor_internal_src_files += $(adaptor_wayland_tizen_internal_src_files) +endif # USE_ECORE_WAYLAND + +adaptor_internal_src_files += $(adaptor_tizen_internal_egl_extension_src_files)\ + $(adaptor_tizen_internal_native_image_src_files) + +else +adaptor_internal_src_files += $(adaptor_x11_tizen_internal_src_files) \ + $(adaptor_common_internal_egl_extension_src_files) +endif # WAYLAND + +endif # MOBILE_PROFILE + +# WEARABLE +if WEARABLE_PROFILE + +adaptor_internal_src_files += $(adaptor_common_internal_src_files) \ + $(adaptor_common_internal_mobile_profile_src_files) \ + $(adaptor_tizen_internal_src_files) \ + $(static_libraries_libunibreak_src_files) +if WAYLAND +if USE_ECORE_WAYLAND +adaptor_internal_src_files += $(adaptor_ecore_wayland_tizen_internal_src_files) +else +adaptor_internal_src_files += $(adaptor_wayland_tizen_internal_src_files) +endif # USE_ECORE_WAYLAND + +adaptor_internal_src_files += $(adaptor_tizen_internal_egl_extension_src_files)\ + $(adaptor_tizen_internal_native_image_src_files) + +else +adaptor_internal_src_files += $(adaptor_x11_tizen_internal_src_files) \ + $(adaptor_common_internal_egl_extension_src_files) +endif # WAYLAND + +endif # WEARABLE + + +# TV +if TV_PROFILE + +adaptor_internal_src_files += $(adaptor_common_internal_src_files) \ + $(adaptor_common_internal_tv_profile_src_files) \ + $(adaptor_tizen_internal_src_files) \ + $(adaptor_tizen_internal_non_mobile_src_files) \ + $(static_libraries_libunibreak_src_files) +if WAYLAND +if USE_ECORE_WAYLAND +adaptor_internal_src_files += $(adaptor_ecore_wayland_tizen_internal_src_files) +else +adaptor_internal_src_files += $(adaptor_wayland_tizen_internal_src_files) +endif # USE_ECORE_WAYLAND + +adaptor_internal_src_files += $(adaptor_tizen_internal_egl_extension_src_files)\ + $(adaptor_tizen_internal_native_image_src_files) + +else +adaptor_internal_src_files += $(adaptor_x11_tv_internal_src_files) \ + $(adaptor_x11_internal_tv_profile_key_src_files) \ + $(adaptor_common_internal_egl_extension_src_files) +endif # WAYLAND + +endif + +# Node JS support for using an external libuv main loop. If not enabled then just use e-core as normal +# Used for things like callbacks, file-monintors, x input handling +if LIB_UV_EVENT_LOOP +main_loop_integration_src_files = $(adaptor_common_internal_uv_src_files) +input_event_handler_src_files = $(adaptor_uv_x_event_handler_internal_src_files) +else +main_loop_integration_src_files = $(adaptor_common_internal_ecore_src_files) +input_event_handler_src_files = $(adaptor_ecore_x_event_handler_internal_src_files) +endif + + +pkgconfigdir = $(libdir)/pkgconfig +pkgconfig_DATA = dali-adaptor-uv.pc + +lib_LTLIBRARIES = libdali-adaptor-uv.la + +libdali_adaptor_uv_la_SOURCES = \ + $(base_adaptor_src_files) \ + $(main_loop_integration_src_files) \ + $(tizen_platform_abstraction_src_files) \ + $(text_abstraction_src_files) \ + $(devel_api_src_files) \ + $(public_api_src_files) \ + $(adaptor_internal_src_files) \ + $(input_event_handler_src_files) + + +if ENABLE_NETWORK_LOGGING +libdali_adaptor_uv_la_SOURCES += \ + $(base_adaptor_networking_src_files) +endif + +libdali_adaptor_uv_la_DEPENDENCIES = + +# List include directories with more platform-specific (tizen) before portable root: +libdali_adaptor_uv_la_includes = \ + -I../../.. \ + -I../../../platform-abstractions/tizen \ + -I../../../platform-abstractions/tizen/resource-loader \ + -I../../../platform-abstractions/portable \ + -I../../../platform-abstractions/ \ + -I../../../adaptors/public-api \ + -I../../../adaptors/integration-api \ + -I../../../adaptors/public-api/adaptor-framework \ + -I../../../adaptors/devel-api/adaptor-framework \ + -I../../../adaptors/common \ + -I../../../adaptors/base/interfaces \ + -I../../../adaptors/ \ + -I../../../text \ + -I../../../text/dali/internal/libunibreak + +if WAYLAND +libdali_adaptor_uv_la_includes += -I../../../adaptors/integration-api/wayland +if USE_ECORE_WAYLAND +libdali_adaptor_uv_la_includes += \ + -I../../../adaptors/ecore/common \ + -I../../../adaptors/ecore/wayland +else +libdali_adaptor_uv_la_includes += -I../../../adaptors/wayland \ + -I../../../adaptors/wayland/imf \ + -I../../../adaptors/wayland/clipboard \ + -I../../../adaptors/wayland/native-image +endif # USE_ECORE_WAYLAND + +libdali_adaptor_uv_la_includes += \ + -I../../../adaptors/tizen + +else +libdali_adaptor_uv_la_includes += \ + -I../../../adaptors/ecore/common \ + -I../../../adaptors/x11 \ + -I../../../adaptors/integration-api/x11 +endif # WAYLAND + +if UBUNTU_PROFILE +libdali_adaptor_uv_la_includes += \ + -I../../../adaptors/ubuntu +else +libdali_adaptor_uv_la_includes += \ + -I../../../adaptors/tizen +endif + +daliDefaultThemeDir = ${dataReadWriteDir}/theme/ +daliShaderbinCacheDir = ${dataReadOnlyDir}/core/shaderbin/ + +libdali_adaptor_uv_la_CXXFLAGS = \ + -DDALI_DATA_RW_DIR="\"${daliReadWriteDir}\"" \ + -DDALI_DATA_RO_DIR="\"${daliReadOnlyDir}\"" \ + -DDALI_DEFAULT_FONT_CACHE_DIR="\"${daliDefaultFontCacheDir}\"" \ + -DDALI_USER_FONT_CACHE_DIR="\"${daliUserFontCacheDir}\"" \ + -DDALI_SHADERBIN_DIR="\"${daliShaderbinCacheDir}\"" \ + -DDALI_DEFAULT_THEME_DIR="\"${daliDefaultThemeDir}\"" \ + -DFONT_PRELOADED_PATH="\"${fontPreloadedPath}\"" \ + -DFONT_DOWNLOADED_PATH="\"${fontDownloadedPath}\"" \ + -DFONT_APPLICATION_PATH="\"${fontApplicationPath}\"" \ + -DFONT_CONFIGURATION_FILE="\"${fontConfigurationFile}\"" \ + -DNON_POWER_OF_TWO_TEXTURES \ + -DDALI_COMPILATION -DDALI_ADAPTOR_COMPILATION \ + -Werror -Wall -lgcc \ + $(libdali_adaptor_uv_la_includes) \ + $(DALI_ADAPTOR_CFLAGS) \ + $(DALICORE_CFLAGS) \ + $(OPENGLES20_CFLAGS) \ + $(FREETYPE_CFLAGS) \ + $(FONTCONFIG_CFLAGS) \ + $(PNG_CFLAGS) \ + $(DLOG_CFLAGS) \ + $(VCONF_CFLAGS) \ + $(EXIF_CFLAGS) \ + $(MMFSOUND_CFLAGS) \ + $(TTS_CFLAGS) \ + $(LIBDRM_CFLAGS) \ + $(LIBEXIF_CFLAGS) \ + $(LIBCURL_CFLAGS) \ + $(TPKP_CURL_CFLAGS) + +# Todo, as soon as common repos are updated on build server remove this. +if !COMMON_PROFILE +libdali_adaptor_uv_la_CXXFLAGS += -DWAYLAND_EXTENSIONS_SUPPORTED +endif + +libdali_adaptor_uv_la_CFLAGS = $(libdali_adaptor_uv_la_CXXFLAGS) + +libdali_adaptor_uv_la_LIBADD = \ + $(DALICORE_LIBS) \ + $(OPENGLES20_LIBS) \ + $(FREETYPE_LIBS) \ + $(FONTCONFIG_LIBS) \ + $(PNG_LIBS) \ + $(DLOG_LIBS) \ + $(VCONF_LIBS) \ + $(EXIF_LIBS) \ + $(TTS_LIBS) \ + $(LIBDRM_LIBS) \ + $(LIBEXIF_LIBS) \ + $(LIBCURL_LIBS) \ + $(HARFBUZZ_LIBS) \ + $(TPKP_CURL_LIBS) \ + -lgif \ + -lpthread \ + -lturbojpeg + +if USE_EFL +# EVAS used indicator +libdali_adaptor_uv_la_CXXFLAGS += $(ELEMENTARY_CFLAGS) \ + $(EVAS_CFLAGS) \ + $(ECORE_CFLAGS) \ + $(ECORE_IPC_CFLAGS) \ + $(ELDBUS_CFLAGS) \ + -DUSE_EFL + + +libdali_adaptor_uv_la_LIBADD += $(ELEMENTARY_LIBS) \ + $(ECORE_IPC_LIBS) \ + $(ELDBUS_LIBS) + +else + +if MOBILE_PROFILE +libdali_adaptor_uv_la_CXXFLAGS += $(ECORE_WAYLAND_CFLAGS) +libdali_adaptor_uv_la_LIBADD += $(ECORE_WAYLAND_LIBS) +endif + +endif + +if USE_APPFW + +libdali_adaptor_uv_la_CXXFLAGS += $(CAPI_APPFW_APPLICATION_CFLAGS) \ + $(CAPI_SYSTEM_SYSTEM_SETTINGS_CFLAGS) \ + $(CAPI_SYSTEM_INFO_CFLAGS) \ + $(TTS_CFLAGS) \ + $(SENSOR_CFLAGS) + +libdali_adaptor_uv_la_LIBADD += $(CAPI_APPFW_APPLICATION_LIBS) \ + $(CAPI_SYSTEM_SYSTEM_SETTINGS_LIBS) \ + $(CAPI_SYSTEM_INFO_LIBS) \ + $(TTS_LIBS) \ + $(SENSOR_LIBS) + +endif +if WAYLAND +# This is to avoid having to include wayland-egl.h everywhere +libdali_adaptor_uv_la_CXXFLAGS += -DWL_EGL_PLATFORM +libdali_adaptor_uv_la_CXXFLAGS += $(WAYLAND_CFLAGS) +libdali_adaptor_uv_la_LIBADD += $(WAYLAND_LIBS) +else +libdali_adaptor_uv_la_CXXFLAGS += $(X11_CFLAGS) +libdali_adaptor_uv_la_LIBADD += $(X11_LIBS) +libdali_adaptor_uv_la_LIBADD += $(ECORE_X_LIBS) +endif + +if COMMON_PROFILE +libdali_adaptor_uv_la_CXXFLAGS += $(HAPTIC_CFLAGS) +endif + +if MOBILE_PROFILE +libdali_adaptor_uv_la_CXXFLAGS += \ + $(DEVICED_CFLAGS) \ + $(EFL_ASSIST_CFLAGS) \ + $(NATIVE_BUFFER_CFLAGS) \ + $(NATIVE_BUFFER_POOL_CFLAGS) + +libdali_adaptor_uv_la_LIBADD += \ + $(EFL_ASSIST_LIBS) \ + $(NATIVE_BUFFER_LIBS) \ + $(NATIVE_BUFFER_POOL_LIBS) +endif + +if WEARABLE_PROFILE +libdali_adaptor_uv_la_CXXFLAGS += \ + $(HAPTIC_CFLAGS) \ + $(EFL_ASSIST_CFLAGS) +endif + +if TV_PROFILE +libdali_adaptor_uv_la_CXXFLAGS += $(HAPTIC_CFLAGS) +libdali_adaptor_uv_la_LIBADD += +endif + +if UBUNTU_PROFILE +libdali_adaptor_uv_la_LIBADD += -ljpeg +CFLAGS += -fPIC +endif + +tizenadaptorpublicapidir = $(devincludepath)/dali/public-api +tizenadaptorpublicapi_HEADERS = $(public_api_header_files) + +tizenadaptordevelapidir= $(devincludepath)/dali/devel-api + +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) + +tizenadaptorframeworkdevelapidir = $(tizenadaptordevelapidir)/adaptor-framework +tizenadaptorframeworkdevelapi_HEADERS = $(devel_api_adaptor_framework_header_files) + +tizentextabstractiondevelapidir = $(tizenadaptordevelapidir)/text-abstraction +tizentextabstractiondevelapi_HEADERS = $(text_abstraction_header_files) + +if !UBUNTU_PROFILE + +if !WAYLAND +tizenadaptorframeworkdevelapi_HEADERS += $(devel_api_adaptor_tizen_x11_header_files) +endif # NOT WAYLAND + +endif # NOT UBUNTU_PROFILE + +tizenadaptordaliheaderdir = $(devincludepath)/dali +tizenadaptordaliheader_HEADERS = $(adaptor_dali_header_file) + +install-data-local: + $(MKDIR_P) ${DESTDIR}/${daliUserFontCacheDir} ${DESTDIR}/${daliShaderbinCacheDir} + +# Install resource log analyzer script +bin_SCRIPTS = ../../../adaptors/scripts/dalireslog.sh + +# package doxygen file (contains doxygen grouping information) +packagedoxydir = $(devincludepath)/dali/doc +packagedoxy_HEADERS = $(package_doxy_files) + +# linking test + +# turn off the linker test if were building for libuv +# We can't link to LibUV becase it is statically linked to Node.JS (by default) +if !LIB_UV_EVENT_LOOP +noinst_PROGRAMS = linker.test +endif # NOT LIB_UV_EVENT_LOOP + +linker_test_SOURCES = linker-test.cpp + +linker_test_CXXFLAGS = \ + -DDALI_ADAPTOR_COMPILATION \ + -I../../../adaptors/common \ + -I../../../adaptors/public-api \ + -I../../../adaptors/integration-api \ + -I../../../adaptors/base/interfaces \ + -I../../../adaptors/public-api/adaptor-framework \ + -I../../../adaptors/devel-api/adaptor-framework \ + $(DALI_ADAPTOR_CFLAGS) \ + $(DALICORE_CFLAGS) \ + $(VCONF_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-uv.la +linker_test_LDADD = \ + $(DALICORE_LIBS) \ + $(VCONF_LIBS) \ + libdali-adaptor-uv.la \ + $(HARFBUZZ_LIBS) \ + -L${prefix}/lib diff --git a/build/tizen/adaptor-uv/configure.ac b/build/tizen/adaptor-uv/configure.ac new file mode 100644 index 0000000..2aeb1e3 --- /dev/null +++ b/build/tizen/adaptor-uv/configure.ac @@ -0,0 +1,373 @@ +# +# 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. +# + +m4_define([dali_version],[0.1.0]) +AC_INIT([dali], [dali_version]) +AM_INIT_AUTOMAKE([-Wall foreign]) + +AC_CONFIG_MACRO_DIR([m4]) + +AC_PROG_CXX +AC_PROG_LIBTOOL +AC_PROG_MKDIR_P + +m4_ifdef([AM_SILENT_RULES], [AM_SILENT_RULES([yes])]) + +LT_INIT + +DALI_ADAPTOR_VERSION=dali_version +AC_SUBST(DALI_ADAPTOR_VERSION) + +FREETYPE_REQUIRED=9.16.3 +# 17.1.11 = Freetype version 2.5.2 +FREETYPE_BITMAP_SUPPORT_VERSION=17.1.11 + +PKG_CHECK_MODULES(DALICORE, dali-core) +PKG_CHECK_MODULES(EXIF, libexif) +PKG_CHECK_MODULES(FREETYPE, [freetype2 >= $FREETYPE_REQUIRED]) +PKG_CHECK_MODULES(FREETYPE_BITMAP_SUPPORT, [freetype2 >= $FREETYPE_BITMAP_SUPPORT_VERSION], [ freetype_bitmap_support=yes ], [ freetype_bitmap_support=no ] ) +PKG_CHECK_MODULES(FONTCONFIG, fontconfig) +PKG_CHECK_MODULES(PNG, libpng) +PKG_CHECK_MODULES(LIBEXIF, libexif) +PKG_CHECK_MODULES(LIBDRM, libdrm) +PKG_CHECK_MODULES(LIBCURL, libcurl) +PKG_CHECK_MODULES(HARFBUZZ, harfbuzz) +PKG_CHECK_MODULES(FRIBIDI, fribidi) +PKG_CHECK_MODULES(TTRACE, ttrace, AC_DEFINE(ENABLE_TTRACE, 1, [ttrace available]), + [ AC_MSG_NOTICE([Tizen Trace not avaiable]) ] + ) + + +# Currently, dali-adaptor-uv requires EFL on X11 (e.g. Ubuntu PC) +# and does not require it on Wayland (e.g. Tizen 3.0 devices). +# So we should be able to enable/disable this option for dali-adaptor-uv. +AC_ARG_ENABLE([efl], + [AC_HELP_STRING([--enable-efl], + [Builds with EFL libraries, On by default])], + [enable_efl=$enableval], + [enable_efl=yes]) + + + +# Check if we need EFL Libraries ( on by default, disabled with --use-efl=no ) +# When running on Node.JS with Wayland no EFL libraries are required. +if test "x$enable_efl" = "xyes"; then +PKG_CHECK_MODULES(ECORE, ecore) +PKG_CHECK_MODULES(ECORE_IPC, ecore-ipc) +PKG_CHECK_MODULES(ECORE_IMF, [ecore-imf >= 1.13], [ecore_imf_1_13=yes], [ecore_imf_1_13=no]) +PKG_CHECK_MODULES(ELEMENTARY, elementary) +# Check for EldBus.h in ECore +PKG_CHECK_MODULES(ELDBUS, eldbus, [ eldbus_available=yes ], [ eldbus_available=no ] ) +fi + + +DALI_ELDBUS_AVAILABLE= +if test "x$eldbus_available" = "xyes"; then + DALI_ELDBUS_AVAILABLE=true + DALI_ADAPTOR_CFLAGS="$DALI_ADAPTOR_CFLAGS -DDALI_ELDBUS_AVAILABLE " +fi +AC_SUBST(DALI_ELDBUS_AVAILABLE) + + +PKG_CHECK_MODULES(TPKP_CURL, tpkp-curl, [ tpkp_curl_available=yes ], [ tpkp_curl_available=no ] ) + +if test "x$tpkp_curl_available" = "xyes"; then + DALI_ADAPTOR_CFLAGS="$DALI_ADAPTOR_CFLAGS -DTPK_CURL_ENABLED " +fi + +DALI_ADAPTOR_CFLAGS="$DALI_ADAPTOR_CFLAGS -DPLATFORM_TIZEN" + +AC_ARG_ENABLE(exportall, + [AC_HELP_STRING([--enable-exportall], + [enables the exporting of all the symbols in the library])], + [enable_exportall=yes], + [enable_exportall=no]) + +AC_ARG_ENABLE([debug], + [AC_HELP_STRING([--enable-debug], + [Turns on debugging])], + [enable_debug=$enableval], + [enable_debug=no]) + +AC_ARG_ENABLE(shaderbincache, + [AC_HELP_STRING([--enable-shaderbincache], + [enables shader binary cache])], + [enable_shaderbincache=$enableval], + [enable_shaderbincache=DISABLE]) + +AC_ARG_ENABLE(networklogging, + [AC_HELP_STRING([--enable-networklogging], + [enables network for debug tool])], + [enable_networklogging=$enableval], + [enable_networklogging=no]) + + +if test "x$enable_debug" = "xyes"; then + DALI_ADAPTOR_CFLAGS="$DALI_ADAPTOR_CFLAGS -DDEBUG_ENABLED" +fi + +if test "x$enable_debug" = "xno" -a "x$enable_exportall" = "xno"; then + DALI_ADAPTOR_CFLAGS="$DALI_ADAPTOR_CFLAGS -fvisibility=hidden -DHIDE_DALI_INTERNALS" +fi + +if test "x$enable_shaderbincache" = "xENABLE"; then + DALI_ADAPTOR_CFLAGS="$DALI_ADAPTOR_CFLAGS -DSHADERBIN_CACHE_ENABLED" +fi + +if test "x$enable_networklogging" = "xyes"; then + DALI_ADAPTOR_CFLAGS="$DALI_ADAPTOR_CFLAGS -DNETWORK_LOGGING_ENABLED" +fi + +# If Ecore IMF version is greater than 1.13, then some structures are different +if test "x$ecore_imf_1_13" = "xyes"; then + DALI_ADAPTOR_CFLAGS="$DALI_ADAPTOR_CFLAGS -DECORE_IMF_1_13" +fi + +AC_ARG_ENABLE([gles], + [AC_HELP_STRING([--enable-gles], + [Specify the OpenGL ES version for backwards compatibility])], + [enable_gles=$enableval], + [enable_gles=30]) + +DALI_ADAPTOR_CFLAGS="$DALI_ADAPTOR_CFLAGS -DDALI_GLES_VERSION=${enable_gles}" + +# node.js by default statically links against libuv, so it doesn't need to install +# a libuv headers/ shared library. So we can't use pkg-config to access any headers. +# As a work around we pass the node deps path so we can access the libuv headers inside nodes +# directory +AC_ARG_WITH([libuv], + [AC_HELP_STRING([--with-libuv], + [Path that contains libuv headers. Setting this configures DALi to work with LibUV mainloop used in Node.JS. + For example /usr/tmp/downloads/node/deps/uv/include/ ])], + [with_libuv=$withval], + [with_libuv=no]) + +# Node.JS already has a libuv main loop running,so we have to integrate with it +AM_CONDITIONAL(LIB_UV_EVENT_LOOP, test x$with_libuv != xno) + + +build_for_libuv=no +if test "x$with_libuv" != "xno"; then + AC_MSG_NOTICE("build with libuv mainloop (Node.JS support) == yes"); + [build_for_libuv=yes] + DALI_ADAPTOR_CFLAGS="$DALI_ADAPTOR_CFLAGS -DNODE_JS_SUPPORT -I${with_libuv}" +else + #not using libuv build + AC_MSG_NOTICE("build with libuv mainloop == no (Node.JS not supported)"); +fi + +# Currently, dali-adaptor-uv requires appfw on Tizen +# and does not require it on Ubuntu. +# So we should be able to enable/disable this option for dali-adaptor-uv. +AC_ARG_ENABLE([appfw], + [AC_HELP_STRING([--enable-appfw], + [Builds with Tizen App framework libraries, off by default])], + [enable_appfw=$enableval], + [enable_appfw=no]) + +# Option to allow building with Tizen SDK 2.2 +AC_ARG_WITH([tizen-2-2-compatibility], + [AC_HELP_STRING([--with-tizen-2-2-compatibility], + [Use Tizen SDK 2.2 compatibility])], + [with_tizen_2_2_compatibility=$withval], + [with_tizen_2_2_compatibility=no]) + +# Tizen Profile options +AC_ARG_ENABLE([profile], + [AC_HELP_STRING([--enable-profile=COMMON,MOBILE,WEARABLE,TV,UBUNTU], + [Select the variant of tizen])], + [enable_profile=$enableval], + [enable_profile=COMMON]) + +# Ensure valid profile selected +if test "x$enable_profile" != "xCOMMON" -a "x$enable_profile" != "xMOBILE" -a "x$enable_profile" != "xWEARABLE" -a "x$enable_profile" != "xTV" -a "x$enable_profile" != "xUBUNTU"; then + AC_MSG_ERROR([$enable_profile is an invalid profile]) +fi + +AC_ARG_ENABLE(wayland, + [ --enable-wayland Build on Wayland], + enable_wayland=yes, + enable_wayland=no) + +DALI_ADAPTOR_CFLAGS="$DALI_ADAPTOR_CFLAGS -DDALI_PROFILE_${enable_profile}" +DALI_PROFILE_CFLAGS=" -DDALI_PROFILE_${enable_profile}" +AM_CONDITIONAL([COMMON_PROFILE], [test x$enable_profile = xCOMMON]) +AM_CONDITIONAL([MOBILE_PROFILE], [test x$enable_profile = xMOBILE]) +AM_CONDITIONAL([WEARABLE_PROFILE], [test x$enable_profile = xWEARABLE]) +AM_CONDITIONAL([TV_PROFILE], [test x$enable_profile = xTV]) +AM_CONDITIONAL([UBUNTU_PROFILE], [test x$enable_profile = xUBUNTU]) +AM_CONDITIONAL([WAYLAND], [test x$enable_wayland = xyes]) +AM_CONDITIONAL([USE_EFL], [test x$enable_efl = xyes]) +AM_CONDITIONAL([USE_APPFW], [test x$enable_appfw = xyes]) + +AM_CONDITIONAL([ENABLE_NETWORK_LOGGING], [test x$enable_networklogging = xyes]) + +# Platforms should either enable features or remove them, they +# should not disable features. This allows the developer to override +# features through the command line. + +if test "x$enable_profile" = "xCOMMON"; then +PKG_CHECK_MODULES(OPENGLES20, glesv2 egl) +fi + +if test "x$enable_profile" = "xMOBILE"; then +PKG_CHECK_MODULES(OPENGLES20, gles20) +enable_assimp=no +fi + +if test "x$enable_profile" = "xLITE"; then +PKG_CHECK_MODULES(OPENGLES20, gles20) +fi + +if test "x$enable_profile" = "xWEARABLE"; then +PKG_CHECK_MODULES(OPENGLES20, glesv2) +fi + +if test "x$enable_profile" = "xTV"; then +PKG_CHECK_MODULES(OPENGLES20, glesv2) +fi + +if test "x$enable_profile" = "xUBUNTU"; then +PKG_CHECK_MODULES(OPENGLES20, glesv2 egl) +else + + + +PKG_CHECK_MODULES(DLOG, dlog) +PKG_CHECK_MODULES(SENSOR, sensor) +PKG_CHECK_MODULES(TTS, tts) +PKG_CHECK_MODULES(VCONF, vconf) + +if test "x$enable_efl" = "xyes"; then +if test "x$with_tizen_2_2_compatibility" = "xno"; then +PKG_CHECK_MODULES(CAPI_SYSTEM_INFO, capi-system-info) +fi +fi + +fi # ubuntu profile test + +if test "x$enable_appfw" = "xyes"; then +PKG_CHECK_MODULES(CAPI_APPFW_APPLICATION, capi-appfw-application) +PKG_CHECK_MODULES(CAPI_SYSTEM_SYSTEM_SETTINGS, capi-system-system-settings) +fi + +# Using EFL api's for WAYLAND AND X11 to run on ecore mainloop +if test "x$enable_efl" = "xyes"; then +if test "x$enable_wayland" = "xyes"; then +PKG_CHECK_MODULES(WAYLAND, [ecore-wayland egl wayland-egl wayland-client >= 1.2.0 xkbcommon libtbm], + [DALI_USE_ECORE_WAYLAND=1], + [DALI_USE_ECORE_WAYLAND=0]) + +else +PKG_CHECK_MODULES(ECORE_X, [ecore-x], + [DALI_USE_ECORE_X11=1], + [DALI_USE_ECORE_X11=0]) +PKG_CHECK_MODULES(X11, [x11], + [DALI_USE_X11=1], + [DALI_USE_X11=0]) +fi + +else + +# dali-adaptor-uv for MOBILE profile needs ecore-wayland even if enable_efl==no +# because adaptors/mobile/pixmap-render-surface-factory.cpp uses it. +if test "x$enable_profile" = "xMOBILE"; then +PKG_CHECK_MODULES(ECORE_WAYLAND, ecore-wayland) +fi + +fi +# Using Wayland API directly ( main loop agnostic, typically for running on libuv) +# wayland-extension-client include xdg-shell-client +if test "x$enable_efl" = "xno"; then +if test "x$enable_wayland" = "xyes"; then +PKG_CHECK_MODULES(WAYLAND, [ egl wayland-egl wayland-client >= 1.2.0 xkbcommon libtbm], + [DALI_USE_WAYLAND=1], + [DALI_USE_WAYLAND=0]) +fi +fi + +# remove this when we update common repos +# common profile currently does not have wayland extensions like xdg-shell +if test "x$enable_wayland" = "xyes"; then +if test "x$enable_profile" != "xCOMMON"; then +PKG_CHECK_MODULES(WAYLAND_EXTENSION, xdg-shell-client) +fi +fi +AM_CONDITIONAL([USE_ECORE_WAYLAND], [test "$DALI_USE_ECORE_WAYLAND" -eq 1]) + +if test x$DALI_DATA_RW_DIR != x; then + dataReadWriteDir=$DALI_DATA_RW_DIR +else + dataReadWriteDir=${prefix}/share/dali/ +fi + +if test x$DALI_DATA_RO_DIR != x; then + dataReadOnlyDir=$DALI_DATA_RO_DIR +else + dataReadOnlyDir=${prefix}/share/dali/ +fi + +if test x$FONT_CONFIGURATION_FILE != x; then + fontConfigurationFile=$FONT_CONFIGURATION_FILE +fi + +AC_SUBST(dataReadWriteDir) +AC_SUBST(dataReadOnlyDir) +AC_SUBST(DALI_ADAPTOR_CFLAGS) +AC_SUBST(DALI_PROFILE_CFLAGS) +AC_SUBST(fontConfigurationFile) + +# Specify the include directory for development headers +#devincludepath=${includedir}/dali/internal +devincludepath=${includedir} +AC_SUBST(devincludepath) + +AC_CONFIG_FILES([ + Makefile + dali-adaptor-uv.pc +]) + +if test "x$freetype_bitmap_support" = "xyes"; then +DALI_ADAPTOR_CFLAGS="$DALI_ADAPTOR_CFLAGS -DFREETYPE_BITMAP_SUPPORT" +fi + +AC_OUTPUT + + +echo " +Configuration +------------- + Prefix: $prefix + Debug Build: $enable_debug + Compile flags $DALI_ADAPTOR_CFLAGS + Freetype bitmap support (Emoji): $freetype_bitmap_support + Profile: $enable_profile + Data Dir (Read/Write): $dataReadWriteDir + Data Dir (Read Only): $dataReadOnlyDir + Tizen SDK 2.2 compatibility: $with_tizen_2_2_compatibility + EldBus: $eldbus_available + Shader Binary Cache: $enable_shaderbincache + Using LibUV mainloop (Node.JS) $build_for_libuv + Ecore Version At Least 1.13.0 $ecore_imf_1_13 + Network logging enabled: $enable_networklogging + Font config file: $fontConfigurationFile + Building with EFL Libraries $enable_efl + Using Tizen APP FW libraries $enable_appfw +" +# optional output of node.js source path if we're building with libuv +if test "x$build_for_libuv" != "xno"; then +echo " LibUV header path $with_libuv" +fi diff --git a/build/tizen/adaptor/Makefile.am b/build/tizen/adaptor/Makefile.am index 358aeae..a1c1059 100644 --- a/build/tizen/adaptor/Makefile.am +++ b/build/tizen/adaptor/Makefile.am @@ -127,14 +127,19 @@ adaptor_internal_src_files += $(adaptor_common_internal_src_files) \ $(static_libraries_libunibreak_src_files) if WAYLAND + if USE_ECORE_WAYLAND adaptor_internal_src_files += $(adaptor_ecore_wayland_tizen_internal_src_files) \ $(adaptor_ecore_wayland_internal_default_profile_src_files) else adaptor_internal_src_files += $(adaptor_wayland_tizen_internal_src_files) -endif +endif # USE_ECORE_WAYLAND + +adaptor_internal_src_files += $(adaptor_tizen_internal_egl_extension_src_files) \ + $(adaptor_tizen_internal_native_image_src_files) else adaptor_internal_src_files += $(adaptor_x11_tizen_internal_src_files) \ + $(adaptor_common_internal_egl_extension_src_files) \ $(adaptor_x11_internal_default_profile_src_files) endif # WAYLAND endif # COMMON_PROFILE @@ -148,7 +153,8 @@ adaptor_internal_src_files += $(adaptor_common_internal_src_files) \ $(adaptor_ubuntu_internal_src_files) \ $(adaptor_x11_ubuntu_internal_src_files) \ $(adaptor_x11_internal_default_profile_src_files) \ - $(static_libraries_libunibreak_src_files) + $(static_libraries_libunibreak_src_files) \ + $(adaptor_common_internal_egl_extension_src_files) endif # UBUNTU_PROFILE @@ -162,13 +168,18 @@ adaptor_internal_src_files += $(adaptor_common_internal_src_files) \ $(static_libraries_libunibreak_src_files) if WAYLAND + if USE_ECORE_WAYLAND adaptor_internal_src_files += $(adaptor_ecore_wayland_tizen_internal_src_files) else adaptor_internal_src_files += $(adaptor_wayland_tizen_internal_src_files) -endif +endif # USE_ECORE_WAYLAND + +adaptor_internal_src_files += $(adaptor_tizen_internal_egl_extension_src_files) \ + $(adaptor_tizen_internal_native_image_src_files) else -adaptor_internal_src_files += $(adaptor_x11_tizen_internal_src_files) +adaptor_internal_src_files += $(adaptor_x11_tizen_internal_src_files) \ + $(adaptor_common_internal_egl_extension_src_files) endif # WAYLAND endif # MOBILE_PROFILE @@ -181,13 +192,18 @@ adaptor_internal_src_files += $(adaptor_common_internal_src_files) \ $(adaptor_tizen_internal_src_files) \ $(static_libraries_libunibreak_src_files) if WAYLAND + if USE_ECORE_WAYLAND adaptor_internal_src_files += $(adaptor_ecore_wayland_tizen_internal_src_files) else adaptor_internal_src_files += $(adaptor_wayland_tizen_internal_src_files) -endif +endif # USE_ECORE_WAYLAND + +adaptor_internal_src_files += $(adaptor_tizen_internal_egl_extension_src_files) \ + $(adaptor_tizen_internal_native_image_src_files) else -adaptor_internal_src_files += $(adaptor_x11_tizen_internal_src_files) +adaptor_internal_src_files += $(adaptor_x11_tizen_internal_src_files) \ + $(adaptor_common_internal_egl_extension_src_files) endif # WAYLAND endif # WEARABLE @@ -202,14 +218,19 @@ adaptor_internal_src_files += $(adaptor_common_internal_src_files) \ $(adaptor_tizen_internal_non_mobile_src_files) \ $(static_libraries_libunibreak_src_files) if WAYLAND + if USE_ECORE_WAYLAND adaptor_internal_src_files += $(adaptor_ecore_wayland_tizen_internal_src_files) else adaptor_internal_src_files += $(adaptor_wayland_tizen_internal_src_files) -endif +endif # USE_ECORE_WAYLAND + +adaptor_internal_src_files += $(adaptor_tizen_internal_egl_extension_src_files) \ + $(adaptor_tizen_internal_native_image_src_files) else adaptor_internal_src_files += $(adaptor_x11_tv_internal_src_files) \ - $(adaptor_x11_internal_tv_profile_key_src_files) + $(adaptor_x11_internal_tv_profile_key_src_files) \ + $(adaptor_common_internal_egl_extension_src_files) endif # WAYLAND endif @@ -268,6 +289,7 @@ libdali_adaptor_la_includes = \ if WAYLAND libdali_adaptor_la_includes += -I../../../adaptors/integration-api/wayland + if USE_ECORE_WAYLAND libdali_adaptor_la_includes += \ -I../../../adaptors/ecore/common \ @@ -275,15 +297,17 @@ libdali_adaptor_la_includes += \ else libdali_adaptor_la_includes += -I../../../adaptors/wayland \ -I../../../adaptors/wayland/imf \ - -I../../../adaptors/wayland/clipboard \ - -I../../../adaptors/wayland/native-image -endif + -I../../../adaptors/wayland/clipboard +endif # USE_ECORE_WAYLADN + +libdali_adaptor_la_includes += \ + -I../../../adaptors/tizen else libdali_adaptor_la_includes += \ -I../../../adaptors/ecore/common \ -I../../../adaptors/x11 \ -I../../../adaptors/integration-api/x11 -endif +endif # WAYLAND if UBUNTU_PROFILE libdali_adaptor_la_includes += \ diff --git a/build/tizen/adaptor/configure.ac b/build/tizen/adaptor/configure.ac new file mode 100644 index 0000000..de947db --- /dev/null +++ b/build/tizen/adaptor/configure.ac @@ -0,0 +1,348 @@ +# +# 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. +# + +m4_define([dali_version],[0.1.0]) +AC_INIT([dali], [dali_version]) +AM_INIT_AUTOMAKE([-Wall foreign]) + +AC_CONFIG_MACRO_DIR([m4]) + +AC_PROG_CXX +AC_PROG_LIBTOOL +AC_PROG_MKDIR_P + +m4_ifdef([AM_SILENT_RULES], [AM_SILENT_RULES([yes])]) + +LT_INIT + +DALI_ADAPTOR_VERSION=dali_version +AC_SUBST(DALI_ADAPTOR_VERSION) + +FREETYPE_REQUIRED=9.16.3 +# 17.1.11 = Freetype version 2.5.2 +FREETYPE_BITMAP_SUPPORT_VERSION=17.1.11 + +PKG_CHECK_MODULES(DALICORE, dali-core) +PKG_CHECK_MODULES(EXIF, libexif) +PKG_CHECK_MODULES(FREETYPE, [freetype2 >= $FREETYPE_REQUIRED]) +PKG_CHECK_MODULES(FREETYPE_BITMAP_SUPPORT, [freetype2 >= $FREETYPE_BITMAP_SUPPORT_VERSION], [ freetype_bitmap_support=yes ], [ freetype_bitmap_support=no ] ) +PKG_CHECK_MODULES(FONTCONFIG, fontconfig) +PKG_CHECK_MODULES(PNG, libpng) +PKG_CHECK_MODULES(LIBEXIF, libexif) +PKG_CHECK_MODULES(LIBDRM, libdrm) +PKG_CHECK_MODULES(LIBCURL, libcurl) +PKG_CHECK_MODULES(HARFBUZZ, harfbuzz) +PKG_CHECK_MODULES(FRIBIDI, fribidi) +PKG_CHECK_MODULES(TTRACE, ttrace, AC_DEFINE(ENABLE_TTRACE, 1, [ttrace available]), + [ AC_MSG_NOTICE([Tizen Trace not avaiable]) ] + ) + + +# Currently, dali-adaptor always requires EFL on all platforms. +# (on Wayland & X11, on Tizen devices & Ubuntu PC). +enable_efl=yes +if test "x$enable_efl" = "xyes"; then +PKG_CHECK_MODULES(ECORE, ecore) +PKG_CHECK_MODULES(ECORE_IPC, ecore-ipc) +PKG_CHECK_MODULES(ECORE_IMF, [ecore-imf >= 1.13], [ecore_imf_1_13=yes], [ecore_imf_1_13=no]) +PKG_CHECK_MODULES(ELEMENTARY, elementary) +# Check for EldBus.h in ECore +PKG_CHECK_MODULES(ELDBUS, eldbus, [ eldbus_available=yes ], [ eldbus_available=no ] ) +fi + + +DALI_ELDBUS_AVAILABLE= +if test "x$eldbus_available" = "xyes"; then + DALI_ELDBUS_AVAILABLE=true + DALI_ADAPTOR_CFLAGS="$DALI_ADAPTOR_CFLAGS -DDALI_ELDBUS_AVAILABLE " +fi +AC_SUBST(DALI_ELDBUS_AVAILABLE) + + +PKG_CHECK_MODULES(TPKP_CURL, tpkp-curl, [ tpkp_curl_available=yes ], [ tpkp_curl_available=no ] ) + +if test "x$tpkp_curl_available" = "xyes"; then + DALI_ADAPTOR_CFLAGS="$DALI_ADAPTOR_CFLAGS -DTPK_CURL_ENABLED " +fi + +DALI_ADAPTOR_CFLAGS="$DALI_ADAPTOR_CFLAGS -DPLATFORM_TIZEN" + +AC_ARG_ENABLE(exportall, + [AC_HELP_STRING([--enable-exportall], + [enables the exporting of all the symbols in the library])], + [enable_exportall=yes], + [enable_exportall=no]) + +AC_ARG_ENABLE([debug], + [AC_HELP_STRING([--enable-debug], + [Turns on debugging])], + [enable_debug=$enableval], + [enable_debug=no]) + +AC_ARG_ENABLE(shaderbincache, + [AC_HELP_STRING([--enable-shaderbincache], + [enables shader binary cache])], + [enable_shaderbincache=$enableval], + [enable_shaderbincache=DISABLE]) + +AC_ARG_ENABLE(networklogging, + [AC_HELP_STRING([--enable-networklogging], + [enables network for debug tool])], + [enable_networklogging=$enableval], + [enable_networklogging=no]) + + +if test "x$enable_debug" = "xyes"; then + DALI_ADAPTOR_CFLAGS="$DALI_ADAPTOR_CFLAGS -DDEBUG_ENABLED" +fi + +if test "x$enable_debug" = "xno" -a "x$enable_exportall" = "xno"; then + DALI_ADAPTOR_CFLAGS="$DALI_ADAPTOR_CFLAGS -fvisibility=hidden -DHIDE_DALI_INTERNALS" +fi + +if test "x$enable_shaderbincache" = "xENABLE"; then + DALI_ADAPTOR_CFLAGS="$DALI_ADAPTOR_CFLAGS -DSHADERBIN_CACHE_ENABLED" +fi + +if test "x$enable_networklogging" = "xyes"; then + DALI_ADAPTOR_CFLAGS="$DALI_ADAPTOR_CFLAGS -DNETWORK_LOGGING_ENABLED" +fi + +# If Ecore IMF version is greater than 1.13, then some structures are different +if test "x$ecore_imf_1_13" = "xyes"; then + DALI_ADAPTOR_CFLAGS="$DALI_ADAPTOR_CFLAGS -DECORE_IMF_1_13" +fi + +AC_ARG_ENABLE([gles], + [AC_HELP_STRING([--enable-gles], + [Specify the OpenGL ES version for backwards compatibility])], + [enable_gles=$enableval], + [enable_gles=30]) + +DALI_ADAPTOR_CFLAGS="$DALI_ADAPTOR_CFLAGS -DDALI_GLES_VERSION=${enable_gles}" + +# Currently, dali-adaptor always does not require libuv because it runs on ecore on all platforms. +# (on Wayland & X11, on Tizen devices & Ubuntu PC). +with_libuv=no + +# Node.JS already has a libuv main loop running,so we have to integrate with it +AM_CONDITIONAL(LIB_UV_EVENT_LOOP, test x$with_libuv != xno) + + +build_for_libuv=no +if test "x$with_libuv" != "xno"; then + AC_MSG_NOTICE("build with libuv mainloop (Node.JS support) == yes"); + [build_for_libuv=yes] + DALI_ADAPTOR_CFLAGS="$DALI_ADAPTOR_CFLAGS -DNODE_JS_SUPPORT -I${with_libuv}" +else + #not using libuv build + AC_MSG_NOTICE("build with libuv mainloop == no (Node.JS not supported)"); +fi + +# Currently, dali-adaptor requires appfw on Tizen +# and does not require it on Ubuntu. +# So we should be able to enable/disable this option for dali-adaptor. +AC_ARG_ENABLE([appfw], + [AC_HELP_STRING([--enable-appfw], + [Builds with Tizen App framework libraries, off by default])], + [enable_appfw=$enableval], + [enable_appfw=no]) + +# Option to allow building with Tizen SDK 2.2 +AC_ARG_WITH([tizen-2-2-compatibility], + [AC_HELP_STRING([--with-tizen-2-2-compatibility], + [Use Tizen SDK 2.2 compatibility])], + [with_tizen_2_2_compatibility=$withval], + [with_tizen_2_2_compatibility=no]) + +# Tizen Profile options +AC_ARG_ENABLE([profile], + [AC_HELP_STRING([--enable-profile=COMMON,MOBILE,WEARABLE,TV,UBUNTU], + [Select the variant of tizen])], + [enable_profile=$enableval], + [enable_profile=COMMON]) + +# Ensure valid profile selected +if test "x$enable_profile" != "xCOMMON" -a "x$enable_profile" != "xMOBILE" -a "x$enable_profile" != "xWEARABLE" -a "x$enable_profile" != "xTV" -a "x$enable_profile" != "xUBUNTU"; then + AC_MSG_ERROR([$enable_profile is an invalid profile]) +fi + +AC_ARG_ENABLE(wayland, + [ --enable-wayland Build on Wayland], + enable_wayland=yes, + enable_wayland=no) + +DALI_ADAPTOR_CFLAGS="$DALI_ADAPTOR_CFLAGS -DDALI_PROFILE_${enable_profile}" +DALI_PROFILE_CFLAGS=" -DDALI_PROFILE_${enable_profile}" +AM_CONDITIONAL([COMMON_PROFILE], [test x$enable_profile = xCOMMON]) +AM_CONDITIONAL([MOBILE_PROFILE], [test x$enable_profile = xMOBILE]) +AM_CONDITIONAL([WEARABLE_PROFILE], [test x$enable_profile = xWEARABLE]) +AM_CONDITIONAL([TV_PROFILE], [test x$enable_profile = xTV]) +AM_CONDITIONAL([UBUNTU_PROFILE], [test x$enable_profile = xUBUNTU]) +AM_CONDITIONAL([WAYLAND], [test x$enable_wayland = xyes]) +AM_CONDITIONAL([USE_EFL], [test x$enable_efl = xyes]) +AM_CONDITIONAL([USE_APPFW], [test x$enable_appfw = xyes]) + +AM_CONDITIONAL([ENABLE_NETWORK_LOGGING], [test x$enable_networklogging = xyes]) + +# Platforms should either enable features or remove them, they +# should not disable features. This allows the developer to override +# features through the command line. + +if test "x$enable_profile" = "xCOMMON"; then +PKG_CHECK_MODULES(OPENGLES20, glesv2 egl) +fi + +if test "x$enable_profile" = "xMOBILE"; then +PKG_CHECK_MODULES(OPENGLES20, glesv2 egl) +enable_assimp=no +fi + +if test "x$enable_profile" = "xLITE"; then +PKG_CHECK_MODULES(OPENGLES20, gles20) +fi + +if test "x$enable_profile" = "xWEARABLE"; then +PKG_CHECK_MODULES(OPENGLES20, glesv2) +fi + +if test "x$enable_profile" = "xTV"; then +PKG_CHECK_MODULES(OPENGLES20, glesv2) +fi + +if test "x$enable_profile" = "xUBUNTU"; then +PKG_CHECK_MODULES(OPENGLES20, glesv2 egl) +else + + + +PKG_CHECK_MODULES(DLOG, dlog) +PKG_CHECK_MODULES(SENSOR, sensor) +PKG_CHECK_MODULES(TTS, tts) +PKG_CHECK_MODULES(VCONF, vconf) + +if test "x$enable_efl" = "xyes"; then +if test "x$with_tizen_2_2_compatibility" = "xno"; then +PKG_CHECK_MODULES(CAPI_SYSTEM_INFO, capi-system-info) +fi +fi + +fi # ubuntu profile test + +if test "x$enable_appfw" = "xyes"; then +PKG_CHECK_MODULES(CAPI_APPFW_APPLICATION, capi-appfw-application) +PKG_CHECK_MODULES(CAPI_SYSTEM_SYSTEM_SETTINGS, capi-system-system-settings) +fi + +# Using EFL api's for WAYLAND AND X11 to run on ecore mainloop +if test "x$enable_efl" = "xyes"; then +if test "x$enable_wayland" = "xyes"; then +PKG_CHECK_MODULES(WAYLAND, [ecore-wayland egl wayland-egl wayland-client >= 1.2.0 xkbcommon libtbm], + [DALI_USE_ECORE_WAYLAND=1], + [DALI_USE_ECORE_WAYLAND=0]) + +else +PKG_CHECK_MODULES(ECORE_X, [ecore-x], + [DALI_USE_ECORE_X11=1], + [DALI_USE_ECORE_X11=0]) +PKG_CHECK_MODULES(X11, [x11], + [DALI_USE_X11=1], + [DALI_USE_X11=0]) +fi +fi +# Using Wayland API directly ( main loop agnostic, typically for running on libuv) +# wayland-extension-client include xdg-shell-client +if test "x$enable_efl" = "xno"; then +if test "x$enable_wayland" = "xyes"; then +PKG_CHECK_MODULES(WAYLAND, [ egl wayland-egl wayland-client >= 1.2.0 xkbcommon libtbm], + [DALI_USE_WAYLAND=1], + [DALI_USE_WAYLAND=0]) +fi +fi + +# remove this when we update common repos +# common profile currently does not have wayland extensions like xdg-shell +if test "x$enable_wayland" = "xyes"; then +if test "x$enable_profile" != "xCOMMON"; then +PKG_CHECK_MODULES(WAYLAND_EXTENSION, xdg-shell-client) +fi +fi +AM_CONDITIONAL([USE_ECORE_WAYLAND], [test "$DALI_USE_ECORE_WAYLAND" -eq 1]) + +if test x$DALI_DATA_RW_DIR != x; then + dataReadWriteDir=$DALI_DATA_RW_DIR +else + dataReadWriteDir=${prefix}/share/dali/ +fi + +if test x$DALI_DATA_RO_DIR != x; then + dataReadOnlyDir=$DALI_DATA_RO_DIR +else + dataReadOnlyDir=${prefix}/share/dali/ +fi + +if test x$FONT_CONFIGURATION_FILE != x; then + fontConfigurationFile=$FONT_CONFIGURATION_FILE +fi + +AC_SUBST(dataReadWriteDir) +AC_SUBST(dataReadOnlyDir) +AC_SUBST(DALI_ADAPTOR_CFLAGS) +AC_SUBST(DALI_PROFILE_CFLAGS) +AC_SUBST(fontConfigurationFile) + +# Specify the include directory for development headers +#devincludepath=${includedir}/dali/internal +devincludepath=${includedir} +AC_SUBST(devincludepath) + +AC_CONFIG_FILES([ + Makefile + dali-adaptor.pc + dali-adaptor-integration.pc +]) + +if test "x$freetype_bitmap_support" = "xyes"; then +DALI_ADAPTOR_CFLAGS="$DALI_ADAPTOR_CFLAGS -DFREETYPE_BITMAP_SUPPORT" +fi + +AC_OUTPUT + + +echo " +Configuration +------------- + Prefix: $prefix + Debug Build: $enable_debug + Compile flags $DALI_ADAPTOR_CFLAGS + Freetype bitmap support (Emoji): $freetype_bitmap_support + Profile: $enable_profile + Data Dir (Read/Write): $dataReadWriteDir + Data Dir (Read Only): $dataReadOnlyDir + Tizen SDK 2.2 compatibility: $with_tizen_2_2_compatibility + EldBus: $eldbus_available + Shader Binary Cache: $enable_shaderbincache + Using LibUV mainloop (Node.JS) $build_for_libuv + Ecore Version At Least 1.13.0 $ecore_imf_1_13 + Network logging enabled: $enable_networklogging + Font config file: $fontConfigurationFile + Building with EFL Libraries $enable_efl + Using Tizen APP FW libraries $enable_appfw +" +# optional output of node.js source path if we're building with libuv +if test "x$build_for_libuv" != "xno"; then +echo " LibUV header path $with_libuv" +fi diff --git a/build/tizen/configure.ac b/build/tizen/configure.ac index 77dc857..ad95a18 100644 --- a/build/tizen/configure.ac +++ b/build/tizen/configure.ac @@ -267,7 +267,7 @@ fi # Using EFL api's for WAYLAND AND X11 to run on ecore mainloop if test "x$enable_efl" = "xyes"; then if test "x$enable_wayland" = "xyes"; then -PKG_CHECK_MODULES(WAYLAND, [ecore-wayland egl wayland-egl wayland-client >= 1.2.0 xkbcommon], +PKG_CHECK_MODULES(WAYLAND, [ecore-wayland egl wayland-egl wayland-client >= 1.2.0 xkbcommon libtbm], [DALI_USE_ECORE_WAYLAND=1], [DALI_USE_ECORE_WAYLAND=0]) @@ -285,7 +285,7 @@ fi # wayland-extension-client include xdg-shell-client if test "x$enable_efl" = "xno"; then if test "x$enable_wayland" = "xyes"; then -PKG_CHECK_MODULES(WAYLAND, [ egl wayland-egl wayland-client >= 1.2.0 xkbcommon], +PKG_CHECK_MODULES(WAYLAND, [ egl wayland-egl wayland-client >= 1.2.0 xkbcommon libtbm], [DALI_USE_WAYLAND=1], [DALI_USE_WAYLAND=0]) fi diff --git a/packaging/dali-adaptor.spec b/packaging/dali-adaptor.spec index be7756c..2f5ef34 100644 --- a/packaging/dali-adaptor.spec +++ b/packaging/dali-adaptor.spec @@ -115,6 +115,13 @@ BuildRequires: libxkbcommon-devel ####### BUILDING FOR ECORE WAYLAND ####### BuildRequires: pkgconfig(ecore-wayland) %endif + +# dali-adaptor needs tbm_surface in tizen 3.0 wayland +BuildRequires: pkgconfig(libtbm) + +# tpkp-curl (certificate pinning for libcurl functions) is only available in Tizen 3.0 +BuildRequires: pkgconfig(tpkp-curl) + ####### BUILDING FOR X11####### %else BuildRequires: pkgconfig(egl) -- 2.7.4