#!/usr/bin/perl
#
-# Copyright (c) 2016 Samsung Electronics Co., Ltd.
+# Copyright (c) 2020 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.
if(index( $source_file, $file ) > 0 )
{
$gcovfile = $coverage_file;
+ # Some header files do not produce an equivalent gcov file so we shouldn't parse them
+ if(($source_file =~ /\.h$/) && (! -e $gcovfile))
+ {
+ print "Omitting Header: $source_file\n" if $debug;
+ $gcovfile = ""
+ }
last;
}
}
/*
- * Copyright (c) 2019 Samsung Electronics Co., Ltd.
+ * Copyright (c) 2020 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.
uint32_t surfaceHeight,
uint32_t horizontalDpi,
uint32_t verticalDpi,
- ResourcePolicy::DataRetention policy,
bool initialize )
: mRenderSurface( NULL ),
mCore( NULL ),
mSurfaceHeight( surfaceHeight ),
mFrame( 0u ),
mDpi{ horizontalDpi, verticalDpi },
- mLastVSyncTime(0u),
- mDataRetentionPolicy( policy )
+ mLastVSyncTime(0u)
{
if( initialize )
{
mGlAbstraction,
mGlSyncAbstraction,
mGlContextHelperAbstraction,
- mDataRetentionPolicy,
Integration::RenderToFrameBuffer::FALSE,
Integration::DepthBufferAvailable::TRUE,
Integration::StencilBufferAvailable::TRUE );
#define DALI_TEST_APPLICATION_H
/*
- * Copyright (c) 2019 Samsung Electronics Co., Ltd.
+ * Copyright (c) 2020 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.
uint32_t surfaceHeight = DEFAULT_SURFACE_HEIGHT,
uint32_t horizontalDpi = DEFAULT_HORIZONTAL_DPI,
uint32_t verticalDpi = DEFAULT_VERTICAL_DPI,
- ResourcePolicy::DataRetention policy = ResourcePolicy::DALI_DISCARDS_ALL_DATA,
bool initialize = true );
void Initialize();
struct { uint32_t x; uint32_t y; } mDpi;
uint32_t mLastVSyncTime;
- ResourcePolicy::DataRetention mDataRetentionPolicy;
static bool mLoggingEnabled;
};
return GetImplementation( window ).GetCurrentOrientation();
}
+void SetAvailableOrientations( Window window, const Dali::Vector<Dali::Window::WindowOrientation>& orientations )
+{
+ GetImplementation( window ).SetAvailableOrientations( orientations );
+}
+
} // namespace DevelWindow
} // namespace Dali
*/
DALI_ADAPTOR_API Dali::Window::WindowOrientation GetCurrentOrientation( Window window );
+/**
+ * @brief Sets available orientations of the window.
+ *
+ * This API is for setting several orientations one time.
+ *
+ * @param[in] window The window instance
+ * @param[in] orientations The available orientation list to add
+ */
+DALI_ADAPTOR_API void SetAvailableOrientations( Window window, const Dali::Vector<Dali::Window::WindowOrientation>& orientations );
+
} // namespace DevelWindow
} // namespace Dali
return Dali::Internal::Adaptor::ReadFile( filename, size, memblock, fileType);
}
+inline bool hasPrefix(const std::string& prefix, const std::string& path)
+{
+ return std::mismatch(prefix.begin(), prefix.end(), path.begin()).first == prefix.end();
+}
+
+inline std::string ConvertToAssetsInternalPath(const std::string& path, int offset)
+{
+ std::string internalPath = std::string(path.c_str() + offset);
+
+ int i = 0;
+ while ((i = internalPath.find("//", i)) != std::string::npos)
+ {
+ internalPath.replace(i, 2, "/");
+ }
+
+ return internalPath;
+}
+
int ReadFile(const std::string& filename, std::streampos& fileSize, Dali::Vector<char>& memblock, Dali::FileLoader::FileType fileType)
{
int errorCode = 0;
return errorCode;
}
- const char* path = filename.c_str();
- const int assetsOffset = ( sizeof("assets/") - sizeof( char ) ) / sizeof( char );
- if( !strncmp( path, "assets/", assetsOffset ) )
+ const std::string assetsPrefix = "assets/";
+ if( hasPrefix( assetsPrefix, filename ) )
{
+ std::string internalPath = ConvertToAssetsInternalPath( filename, assetsPrefix.length() );
AAssetManager* assetManager = Dali::Integration::AndroidFramework::Get().GetApplicationAssets();
- AAsset* asset = AAssetManager_open( assetManager, path + assetsOffset, AASSET_MODE_BUFFER );
+ AAsset* asset = AAssetManager_open( assetManager, internalPath.c_str(), AASSET_MODE_BUFFER );
if( asset )
{
length = AAsset_getLength( asset );
}
else
{
- DALI_LOG_ERROR( "Asset not found %s\n", path );
+ DALI_LOG_ERROR( "Asset not found %s\n", internalPath.c_str() );
}
}
else
{
- FILE* file = fopen( path, mode );
+ FILE* file = fopen( filename.c_str(), mode );
if( file )
{
fseek( file, 0, SEEK_END );
}
else
{
- DALI_LOG_ERROR( "File not found %s\n", path );
+ DALI_LOG_ERROR( "File not found %s\n", filename.c_str() );
}
}
{
std::streampos size = 0;
- const char* path = filename.c_str();
- const int assetsOffset = ( sizeof("assets/") - sizeof( char ) ) / sizeof( char );
- if( !strncmp( path, "assets/", assetsOffset ) )
+ const std::string assetsPrefix = "assets/";
+ if( hasPrefix( assetsPrefix, filename ) )
{
+ std::string internalPath = ConvertToAssetsInternalPath( filename, assetsPrefix.length() );
AAssetManager* assetManager = Dali::Integration::AndroidFramework::Get().GetApplicationAssets();
- AAsset* asset = AAssetManager_open( assetManager, path + assetsOffset, AASSET_MODE_BUFFER );
+ AAsset* asset = AAssetManager_open( assetManager, internalPath.c_str(), AASSET_MODE_BUFFER );
if( asset )
{
size = AAsset_getLength( asset );
}
else
{
- DALI_LOG_ERROR( "Asset not found %s\n", path );
+ DALI_LOG_ERROR( "Asset not found %s\n", internalPath.c_str() );
}
}
else
{
- FILE* file = fopen( path, "r" );
+ FILE* file = fopen( filename.c_str(), "r" );
if( file )
{
fseek( file, 0, SEEK_END );
}
else
{
- DALI_LOG_ERROR( "File not found %s\n", path );
+ DALI_LOG_ERROR( "File not found %s\n", filename.c_str() );
}
}
}
else
{
- DALI_LOG_WARNING( "file open failed for: \"%s\"", filename.c_str() );
+ DALI_LOG_ERROR( "file open failed for: \"%s\"\n", filename.c_str() );
}
return errorCode;
mFile = fopen( mFileName.c_str(), openMode );
if( !mFile )
{
- DALI_LOG_WARNING( "file open failed for: \"%s\", in mode: \"%s\".\n", mFileName, openMode );
+ DALI_LOG_ERROR( "file open failed for: \"%s\", in mode: \"%s\".\n", mFileName.c_str(), openMode );
}
}
else if( mBuffer )
mFile = fmemopen( mBuffer, mDataSize, openMode );
if( !mFile )
{
- DALI_LOG_WARNING( "File open failed for memory buffer at location: \"%p\", of size: \"%u\", in mode: \"%s\".\n",
+ DALI_LOG_ERROR( "File open failed for memory buffer at location: \"%p\", of size: \"%u\", in mode: \"%s\".\n",
static_cast<void*>( mBuffer ), static_cast<unsigned>( mDataSize ), openMode );
}
}
}
}
+ while (!mImpl->mIdleCallbacks.empty())
+ {
+ mImpl->mIdleCallbacks.pop();
+ }
+
+ mImpl->mRemovedIdleCallbacks.clear();
+ mImpl->mIdleId = 0;
+
ALooper_removeFd( app->looper, idlePipe[0] );
if ( mImpl )
{
GetDataStoragePath( path );
mPlatformAbstraction->SetDataStoragePath( path );
- ResourcePolicy::DataRetention dataRetentionPolicy = ResourcePolicy::DALI_DISCARDS_ALL_DATA;
- if( configuration == Dali::Configuration::APPLICATION_DOES_NOT_HANDLE_CONTEXT_LOSS )
- {
- dataRetentionPolicy = ResourcePolicy::DALI_DISCARDS_ALL_DATA;
- }
-
- // Note, Tizen does not use DALI_RETAINS_ALL_DATA, as it can reload images from files automatically.
-
if( mEnvironmentOptions->PerformanceServerRequired() )
{
mPerformanceInterface = PerformanceInterfaceFactory::CreateInterface( *this, *mEnvironmentOptions );
mGLES,
eglSyncImpl,
eglContextHelperImpl,
- dataRetentionPolicy ,
( 0u != mEnvironmentOptions->GetRenderToFboInterval() ) ? Integration::RenderToFrameBuffer::TRUE : Integration::RenderToFrameBuffer::FALSE,
mGraphics->GetDepthBufferRequired(),
mGraphics->GetStencilBufferRequired() );
// Add the new Window to the container - the order is not important
mWindows.push_back( &windowImpl );
+ Dali::RenderSurfaceInterface* surface = windowImpl.GetSurface();
+
+ mThreadController->AddSurface( surface );
+
mWindowCreatedSignal.Emit( childWindow );
return true;
mPreRenderCallback = callback;
}
+void CombinedUpdateRenderController::AddSurface( Dali::RenderSurfaceInterface* surface )
+{
+ LOG_EVENT_TRACE;
+ LOG_EVENT( "Surface is added" );
+ if( mUpdateRenderThread )
+ {
+ // Set the ThreadSyncronizationInterface on the added surface
+ surface->SetThreadSynchronization( *this );
+ }
+}
+
///////////////////////////////////////////////////////////////////////////////////////////////////
// EVENT THREAD
///////////////////////////////////////////////////////////////////////////////////////////////////
while( mPostRendering &&
! mNewSurface && // We should NOT wait if we're replacing the surface
! mDeletedSurface && // We should NOT wait if we're deleting the surface
- ! mSurfaceResized && // We should NOT wait if we're resizing the surface
! mDestroyUpdateRenderThread )
{
mUpdateRenderThreadWaitCondition.Wait( lock );
*/
void SetPreRenderCallback( CallbackBase* callback ) override;
+ /**
+ * @copydoc ThreadControllerInterface::AddSurface()
+ */
+ virtual void AddSurface( Dali::RenderSurfaceInterface* surface );
+
private:
// Undefined copy constructor.
*/
virtual void SetPreRenderCallback( CallbackBase* callback ) = 0;
+ /**
+ * @brief Adds the new surface.
+ * @param surface new surface
+ */
+ virtual void AddSurface( Dali::RenderSurfaceInterface* surface ) = 0;
+
protected:
/**
width = fileHeader.xsize[0] | ( fileHeader.xsize[1] << 8 ) | ( fileHeader.xsize[2] << 16 );
height = fileHeader.ysize[0] | ( fileHeader.ysize[1] << 8 ) | ( fileHeader.ysize[2] << 16 );
- const unsigned int zDepth = fileHeader.zsize[0] + ( fileHeader.zsize[1] << 8 ) + ( fileHeader.zsize[2] << 16 );
+ const unsigned int zDepth = static_cast<unsigned int>( fileHeader.zsize[0] )
+ + ( static_cast<unsigned int>( fileHeader.zsize[1] ) << 8 )
+ + ( static_cast<unsigned int>( fileHeader.zsize[2] ) << 16 );
// Check image dimensions are within limits.
if( ( width > MAX_TEXTURE_DIMENSION ) || ( height > MAX_TEXTURE_DIMENSION ) )
mPinchMinimumDistance = pinchMinimumDistance;
}
+ int pinchMinimumTouchEvents = -1;
+ if( GetIntegerEnvironmentVariable( DALI_ENV_PINCH_MINIMUM_TOUCH_EVENTS, pinchMinimumTouchEvents ) )
+ {
+ mPinchMinimumTouchEvents = pinchMinimumTouchEvents;
+ }
+
+ int pinchMinimumTouchEventsAfterStart = -1;
+ if( GetIntegerEnvironmentVariable( DALI_ENV_PINCH_MINIMUM_TOUCH_EVENTS_AFTER_START, pinchMinimumTouchEventsAfterStart ) )
+ {
+ mPinchMinimumTouchEventsAfterStart = pinchMinimumTouchEventsAfterStart;
+ }
+
+ int rotationMinimumTouchEvents = -1;
+ if( GetIntegerEnvironmentVariable( DALI_ENV_ROTATION_MINIMUM_TOUCH_EVENTS, rotationMinimumTouchEvents ) )
+ {
+ mRotationMinimumTouchEvents = rotationMinimumTouchEvents;
+ }
+
+ int rotationMinimumTouchEventsAfterStart = -1;
+ if( GetIntegerEnvironmentVariable( DALI_ENV_ROTATION_MINIMUM_TOUCH_EVENTS_AFTER_START, rotationMinimumTouchEventsAfterStart ) )
+ {
+ mRotationMinimumTouchEventsAfterStart = rotationMinimumTouchEventsAfterStart;
+ }
+
int longPressMinimumHoldingTime = -1;
if( GetIntegerEnvironmentVariable( DALI_ENV_LONG_PRESS_MINIMUM_HOLDING_TIME, longPressMinimumHoldingTime ) )
{
mThreadControllerInterface->SetPreRenderCallback( callback );
}
+void ThreadController::AddSurface( Dali::RenderSurfaceInterface* newSurface )
+{
+ mThreadControllerInterface->AddSurface( newSurface );
+}
+
} // namespace Adaptor
} // namespace Internal
*/
void SetPreRenderCallback( CallbackBase* callback );
+ /**
+ * @brief Adds the new surface.
+ *
+ * @param surface new surface
+ */
+ void AddSurface( Dali::RenderSurfaceInterface* surface );
+
private:
// Undefined copy constructor.
mCameraActor.Unparent();
mCameraActor.Reset();
- DALI_ASSERT_ALWAYS(mRenderTask && "RenderTask is NULL.");
+ DALI_ASSERT_ALWAYS( mRenderTask && "RenderTask is NULL." );
Dali::RenderTaskList taskList = Dali::Stage::GetCurrent().GetRenderTaskList();
- Dali::RenderTask firstTask = taskList.GetTask( 0u );
-
- // Stop rendering via frame-buffers as empty handle is used to clear target
- firstTask.SetFrameBuffer( Dali::FrameBuffer() );
-
taskList.RemoveTask( mRenderTask );
mRenderTask.Reset();
}
return ConvertToOrientation( mRotationAngle );
}
+void Window::SetAvailableOrientations( const Dali::Vector<Dali::Window::WindowOrientation>& orientations )
+{
+ Dali::Vector<float>::SizeType count = orientations.Count();
+ for( Dali::Vector<float>::SizeType index = 0; index < count; ++index )
+ {
+ if( IsOrientationAvailable( orientations[index] ) == false )
+ {
+ DALI_LOG_ERROR("Window::SetAvailableOrientations, invalid orientation: %d\n", orientations[index]);
+ continue;
+ }
+
+ bool found = false;
+ int convertedAngle = ConvertToAngle( orientations[index] );
+
+ for( std::size_t i = 0; i < mAvailableAngles.size(); i++ )
+ {
+ if( mAvailableAngles[i] == convertedAngle )
+ {
+ found = true;
+ break;
+ }
+ }
+
+ if( !found )
+ {
+ DALI_LOG_RELEASE_INFO( "Window (%p), WinId (%d), SetAvailableOrientations: %d\n", this, mNativeWindowId, convertedAngle );
+ mAvailableAngles.push_back( convertedAngle );
+ }
+ }
+ SetAvailableAnlges( mAvailableAngles );
+}
+
} // Adaptor
} // Internal
#include <dali/public-api/object/base-object.h>
#include <dali/public-api/actors/layer.h>
#include <dali/public-api/render-tasks/render-task-list.h>
+#include <dali/public-api/object/property-array.h>
// INTERNAL INCLUDES
#include <dali/public-api/adaptor-framework/window.h>
*/
Dali::Window::WindowOrientation GetCurrentOrientation() const;
+ /**
+ * @copydoc Dali::DevelWindow::SetAvailableOrientations()
+ */
+ void SetAvailableOrientations( const Dali::Vector<Dali::Window::WindowOrientation>& orientations );
+
public: // Dali::Internal::Adaptor::SceneHolder
/**
{
if( !mRotationFinished )
{
- DALI_LOG_INFO( gWindowRenderSurfaceLogFilter, Debug::Verbose, "WindowRenderSurface::PostRender: Trigger rotation event\n" );
+ if( mThreadSynchronization )
+ {
+ // Enable PostRender flag
+ mThreadSynchronization->PostRenderStarted();
+ }
+
+ DALI_LOG_RELEASE_INFO("WindowRenderSurface::PostRender: Trigger rotation event\n" );
mRotationTrigger->Trigger();
{
const unsigned int ADAPTOR_MAJOR_VERSION = 1;
-const unsigned int ADAPTOR_MINOR_VERSION = 4;
-const unsigned int ADAPTOR_MICRO_VERSION = 57;
+const unsigned int ADAPTOR_MINOR_VERSION = 5;
+const unsigned int ADAPTOR_MICRO_VERSION = 0;
const char * const ADAPTOR_BUILD_DATE = __DATE__ " " __TIME__;
#ifdef DEBUG_ENABLED
Name: dali-adaptor
Summary: The DALi Tizen Adaptor
-Version: 1.4.57
+Version: 1.5.0
Release: 1
Group: System/Libraries
License: Apache-2.0 and BSD-3-Clause and MIT