#define __DALI_ADAPTOR_TEST_APPLICATION_H__
/*
- * Copyright (c) 2017 Samsung Electronics Co., Ltd.
+ * Copyright (c) 2018 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.
size_t surfaceHeight = DEFAULT_SURFACE_HEIGHT,
float horizontalDpi = DEFAULT_HORIZONTAL_DPI,
float verticalDpi = DEFAULT_VERTICAL_DPI )
- : TestApplication( false, surfaceWidth, surfaceHeight, horizontalDpi, verticalDpi )
+ : TestApplication( surfaceWidth, surfaceHeight, horizontalDpi, verticalDpi )
{
- Initialize();
-
Internal::Adaptor::Adaptor::SetAvailable();
}
using namespace Dali;
-int test_return_value = TET_UNDEF;
+int32_t test_return_value = TET_UNDEF;
-void tet_result(int value)
+void tet_result(int32_t value)
{
// First TET_PASS should set to zero
// first TET_FAIL should prevent any further TET_PASS from setting back to zero
DALI_TEST_EQUALS< const BaseHandle& >( baseHandle1, baseHandle2, location );
}
-void DALI_TEST_EQUALS( const size_t value1, const unsigned int value2, const char* location )
+void DALI_TEST_EQUALS( const size_t value1, const uint32_t value2, const char* location )
{
- DALI_TEST_EQUALS< unsigned int>( ( unsigned int )( value1 ), value2, location );
+ DALI_TEST_EQUALS< uint32_t >( ( uint32_t )( value1 ), value2, location );
}
-void DALI_TEST_EQUALS( const unsigned int value1, const size_t value2, const char* location )
+void DALI_TEST_EQUALS( const uint32_t value1, const size_t value2, const char* location )
{
- DALI_TEST_EQUALS< unsigned int >( value1, ( unsigned int )( value2 ), location );
+ DALI_TEST_EQUALS< uint32_t >( value1, ( uint32_t )( value2 ), location );
}
void DALI_TEST_EQUALS( const Matrix3& matrix1, const Matrix3& matrix2, const char* location)
const float* m2 = matrix2.AsFloat();
bool equivalent = true;
- for (int i=0;i<9;++i)
+ for (int32_t i=0;i<9;++i)
{
if( ! (fabsf(m1[i] - m2[i])< GetRangedEpsilon(m1[i], m2[i])) )
{
const float* m2 = matrix2.AsFloat();
bool equivalent = true;
- for (int i=0;i<9;++i)
+ for (int32_t i=0;i<9;++i)
{
equivalent &= (fabsf(m1[i] - m2[i])<epsilon);
}
const float* m2 = matrix2.AsFloat();
bool identical = true;
- int i;
+ int32_t i;
for (i=0;i<16;++i)
{
if(m1[i] != m2[i])
const float* m2 = matrix2.AsFloat();
bool equivalent = true;
- for (int i=0;i<16;++i)
+ for (int32_t i=0;i<16;++i)
{
equivalent &= (fabsf(m1[i] - m2[i])<epsilon);
}
}
}
-BufferImage CreateBufferImage(int width, int height, const Vector4& color)
+BufferImage CreateBufferImage(int32_t width, int32_t height, const Vector4& color)
{
BufferImage image = BufferImage::New(width, height, Pixel::RGBA8888);
return CreateBufferImage(4, 4, Color::WHITE);
}
-void PrepareResourceImage( TestApplication& application, unsigned int imageWidth, unsigned int imageHeight, Pixel::Format pixelFormat )
+void PrepareResourceImage( TestApplication& application, uint32_t imageWidth, uint32_t imageHeight, Pixel::Format pixelFormat )
{
TestPlatformAbstraction& platform = application.GetPlatform();
platform.SetClosestImageSize(Vector2( imageWidth, imageHeight));
Integration::Bitmap* bitmap = Integration::Bitmap::New( Integration::Bitmap::BITMAP_2D_PACKED_PIXELS, ResourcePolicy::OWNED_RETAIN );
Integration::PixelBuffer* pixbuffer = bitmap->GetPackedPixelsProfile()->ReserveBuffer( pixelFormat, imageWidth, imageHeight, imageWidth, imageHeight );
- unsigned int bytesPerPixel = GetBytesPerPixel( pixelFormat );
- unsigned int initialColor = 0xFF;
+ uint32_t bytesPerPixel = GetBytesPerPixel( pixelFormat );
+ uint32_t initialColor = 0xFF;
memset( pixbuffer, initialColor, imageHeight*imageWidth*bytesPerPixel);
Integration::ResourcePointer resourcePtr(bitmap);
#define TET_FAIL 1
#define TET_PASS 0
-extern int test_return_value;
+extern int32_t test_return_value;
-void tet_result(int value);
+void tet_result(int32_t value);
#define END_TEST \
return ((test_return_value>0)?1:0)
void DALI_TEST_EQUALS( const BaseHandle& baseHandle1, const BaseHandle& baseHandle2, const char* location );
/**
- * Test whether a size_t value and an unsigned int are equal.
+ * Test whether a size_t value and an uint32_t are equal.
* @param[in] value1 The first value
* @param[in] value2 The second value
* @param[in] location The TEST_LOCATION macro should be used here
*/
-void DALI_TEST_EQUALS( const size_t value1, const unsigned int value2, const char* location );
+void DALI_TEST_EQUALS( const size_t value1, const uint32_t value2, const char* location );
/**
- * Test whether an unsigned int and a size_t value and are equal.
+ * Test whether an uint32_t and a size_t value and are equal.
* @param[in] value1 The first value
* @param[in] value2 The second value
* @param[in] location The TEST_LOCATION macro should be used here
*/
-void DALI_TEST_EQUALS( const unsigned int value1, const size_t value2, const char* location );
+void DALI_TEST_EQUALS( const uint32_t value1, const size_t value2, const char* location );
/**
* Test whether two Matrix3 objects are equal.
// Helper to Create buffer image
BufferImage CreateBufferImage();
-BufferImage CreateBufferImage(int width, int height, const Vector4& color);
+BufferImage CreateBufferImage(int32_t width, int32_t height, const Vector4& color);
// Prepare a resource image to be loaded. Should be called before creating the ResourceImage
-void PrepareResourceImage( TestApplication& application, unsigned int imageWidth, unsigned int imageHeight, Pixel::Format pixelFormat );
+void PrepareResourceImage( TestApplication& application, uint32_t imageWidth, uint32_t imageHeight, Pixel::Format pixelFormat );
// Test namespace to prevent pollution of Dali namespace, add Test helper functions here
namespace Test
/*
- * Copyright (c) 2017 Samsung Electronics Co., Ltd.
+ * Copyright (c) 2018 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.
{
-TestApplication::TestApplication( size_t surfaceWidth,
- size_t surfaceHeight,
- float horizontalDpi,
- float verticalDpi,
+TestApplication::TestApplication( uint32_t surfaceWidth,
+ uint32_t surfaceHeight,
+ uint32_t horizontalDpi,
+ uint32_t verticalDpi,
ResourcePolicy::DataRetention policy)
: mCore( NULL ),
mSurfaceWidth( surfaceWidth ),
mSurfaceHeight( surfaceHeight ),
mFrame( 0u ),
- mDpi( horizontalDpi, verticalDpi ),
+ mDpi{ horizontalDpi, verticalDpi },
mLastVSyncTime(0u),
mDataRetentionPolicy( policy )
{
Initialize();
}
-TestApplication::TestApplication( bool initialize,
- size_t surfaceWidth,
- size_t surfaceHeight,
- float horizontalDpi,
- float verticalDpi,
- ResourcePolicy::DataRetention policy)
-: mCore( NULL ),
- mSurfaceWidth( surfaceWidth ),
- mSurfaceHeight( surfaceHeight ),
- mFrame( 0u ),
- mDpi( horizontalDpi, verticalDpi ),
- mLastVSyncTime(0u),
- mDataRetentionPolicy( policy )
-{
- if ( initialize )
- {
- Initialize();
- }
-}
-
void TestApplication::Initialize()
{
// We always need the first update!
mCore->ProcessEvents();
}
-void TestApplication::SetSurfaceWidth( unsigned int width, unsigned height )
+void TestApplication::SetSurfaceWidth( uint32_t width, uint32_t height )
{
mSurfaceWidth = width;
mSurfaceHeight = height;
mCore->SurfaceResized( mSurfaceWidth, mSurfaceHeight );
}
-void TestApplication::SetTopMargin( unsigned int margin )
+void TestApplication::SetTopMargin( uint32_t margin )
{
mCore->SetTopMargin( margin );
}
-void TestApplication::DoUpdate( unsigned int intervalMilliseconds, const char* location )
+void TestApplication::DoUpdate( uint32_t intervalMilliseconds, const char* location )
{
if( GetUpdateStatus() == 0 &&
mRenderStatus.NeedsUpdate() == false &&
fprintf(stderr, "WARNING - Update not required :%s\n", location==NULL?"NULL":location);
}
- unsigned int nextVSyncTime = mLastVSyncTime + intervalMilliseconds;
- float elapsedSeconds = intervalMilliseconds / 1e3f;
+ uint32_t nextVSyncTime = mLastVSyncTime + intervalMilliseconds;
+ float elapsedSeconds = static_cast<float>( intervalMilliseconds ) * 0.001f;
mCore->Update( elapsedSeconds, mLastVSyncTime, nextVSyncTime, mStatus, false, false );
mLastVSyncTime = nextVSyncTime;
}
-bool TestApplication::Render( unsigned int intervalMilliseconds, const char* location )
+bool TestApplication::Render( uint32_t intervalMilliseconds, const char* location )
{
DoUpdate( intervalMilliseconds, location );
mCore->Render( mRenderStatus, false );
return mStatus.KeepUpdating() || mRenderStatus.NeedsUpdate();
}
-unsigned int TestApplication::GetUpdateStatus()
+uint32_t TestApplication::GetUpdateStatus()
{
return mStatus.KeepUpdating();
}
-bool TestApplication::UpdateOnly( unsigned int intervalMilliseconds )
+bool TestApplication::UpdateOnly( uint32_t intervalMilliseconds )
{
DoUpdate( intervalMilliseconds );
return mStatus.KeepUpdating();
mCore->ContextCreated();
}
-unsigned int TestApplication::Wait( unsigned int durationToWait )
+uint32_t TestApplication::Wait( uint32_t durationToWait )
{
int time = 0;
- for(unsigned int i = 0; i <= ( durationToWait / RENDER_FRAME_INTERVAL); i++)
+ for(uint32_t i = 0; i <= ( durationToWait / RENDER_FRAME_INTERVAL); i++)
{
SendNotification();
Render(RENDER_FRAME_INTERVAL);
public:
// Default values derived from H2 device.
- static const unsigned int DEFAULT_SURFACE_WIDTH = 480;
- static const unsigned int DEFAULT_SURFACE_HEIGHT = 800;
+ static const uint32_t DEFAULT_SURFACE_WIDTH = 480;
+ static const uint32_t DEFAULT_SURFACE_HEIGHT = 800;
#ifdef _CPP11
- static constexpr float DEFAULT_HORIZONTAL_DPI = 220.0f;
- static constexpr float DEFAULT_VERTICAL_DPI = 217.0f;
+ static constexpr uint32_t DEFAULT_HORIZONTAL_DPI = 220;
+ static constexpr uint32_t DEFAULT_VERTICAL_DPI = 217;
#else
- static const float DEFAULT_HORIZONTAL_DPI = 220.0f;
- static const float DEFAULT_VERTICAL_DPI = 217.0f;
+ static const uint32_t DEFAULT_HORIZONTAL_DPI = 220;
+ static const uint32_t DEFAULT_VERTICAL_DPI = 217;
#endif
- static const unsigned int DEFAULT_RENDER_INTERVAL = 1;
+ static const uint32_t DEFAULT_RENDER_INTERVAL = 1;
- static const unsigned int RENDER_FRAME_INTERVAL = 16;
+ static const uint32_t RENDER_FRAME_INTERVAL = 16;
- TestApplication( size_t surfaceWidth = DEFAULT_SURFACE_WIDTH,
- size_t surfaceHeight = DEFAULT_SURFACE_HEIGHT,
- float horizontalDpi = DEFAULT_HORIZONTAL_DPI,
- float verticalDpi = DEFAULT_VERTICAL_DPI,
- ResourcePolicy::DataRetention policy = ResourcePolicy::DALI_DISCARDS_ALL_DATA);
-
- TestApplication( bool initialize,
- size_t surfaceWidth = DEFAULT_SURFACE_WIDTH,
- size_t surfaceHeight = DEFAULT_SURFACE_HEIGHT,
- float horizontalDpi = DEFAULT_HORIZONTAL_DPI,
- float verticalDpi = DEFAULT_VERTICAL_DPI,
+ TestApplication( uint32_t surfaceWidth = DEFAULT_SURFACE_WIDTH,
+ 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);
void Initialize();
TestGestureManager& GetGestureManager();
void ProcessEvent(const Integration::Event& event);
void SendNotification();
- void SetSurfaceWidth( unsigned int width, unsigned height );
- void SetTopMargin( unsigned int margin );
- bool Render( unsigned int intervalMilliseconds = DEFAULT_RENDER_INTERVAL, const char* location=NULL );
- unsigned int GetUpdateStatus();
- bool UpdateOnly( unsigned int intervalMilliseconds = DEFAULT_RENDER_INTERVAL );
+ void SetSurfaceWidth( uint32_t width, unsigned height );
+ void SetTopMargin( uint32_t margin );
+ bool Render( uint32_t intervalMilliseconds = DEFAULT_RENDER_INTERVAL, const char* location=NULL );
+ uint32_t GetUpdateStatus();
+ bool UpdateOnly( uint32_t intervalMilliseconds = DEFAULT_RENDER_INTERVAL );
bool RenderOnly( );
void ResetContext();
bool GetRenderNeedsUpdate();
- unsigned int Wait( unsigned int durationToWait );
+ uint32_t Wait( uint32_t durationToWait );
private:
- void DoUpdate( unsigned int intervalMilliseconds, const char* location=NULL );
+ void DoUpdate( uint32_t intervalMilliseconds, const char* location=NULL );
protected:
TestPlatformAbstraction mPlatformAbstraction;
Integration::Core* mCore;
- unsigned int mSurfaceWidth;
- unsigned int mSurfaceHeight;
- unsigned int mFrame;
+ uint32_t mSurfaceWidth;
+ uint32_t mSurfaceHeight;
+ uint32_t mFrame;
- Vector2 mDpi;
- unsigned int mLastVSyncTime;
+ struct { uint32_t x; uint32_t y; } mDpi;
+ uint32_t mLastVSyncTime;
ResourcePolicy::DataRetention mDataRetentionPolicy;
};
*/
TraceCallStack& TestGlSyncAbstraction::GetTrace() { return mTrace; }
-int TestGlSyncAbstraction::GetNumberOfSyncObjects()
+int32_t TestGlSyncAbstraction::GetNumberOfSyncObjects()
{
- return mSyncObjects.size();
+ return static_cast<int32_t>( mSyncObjects.size() );
}
*
* @return the number of sync objects
*/
- int GetNumberOfSyncObjects();
+ int32_t GetNumberOfSyncObjects();
private:
namespace TestHarness
{
-typedef std::map<int, TestCase> RunningTestCases;
+typedef std::map<int32_t, TestCase> RunningTestCases;
const char* basename(const char* path)
{
return slash;
}
-int RunTestCase( struct ::testcase_s& testCase )
+int32_t RunTestCase( struct ::testcase_s& testCase )
{
- int result = EXIT_STATUS_TESTCASE_FAILED;
+ int32_t result = EXIT_STATUS_TESTCASE_FAILED;
// dont want to catch exception as we want to be able to get
// gdb stack trace from the first error
}
-int RunTestCaseInChildProcess( struct ::testcase_s& testCase, bool suppressOutput )
+int32_t RunTestCaseInChildProcess( struct ::testcase_s& testCase, bool suppressOutput )
{
- int testResult = EXIT_STATUS_TESTCASE_FAILED;
+ int32_t testResult = EXIT_STATUS_TESTCASE_FAILED;
- int pid = fork();
+ int32_t pid = fork();
if( pid == 0 ) // Child process
{
if( suppressOutput )
else
{
printf("\n");
- for(int i=0; i<80; ++i) printf("#");
+ for(int32_t i=0; i<80; ++i) printf("#");
printf("\nTC: %s\n", testCase.name);
fflush(stdout);
}
- int status = RunTestCase( testCase );
+ int32_t status = RunTestCase( testCase );
if( ! suppressOutput )
{
}
else // Parent process
{
- int status = 0;
- int childPid = waitpid(pid, &status, 0);
+ int32_t status = 0;
+ int32_t childPid = waitpid(pid, &status, 0);
if( childPid == -1 )
{
perror("waitpid");
}
else if(WIFSIGNALED(status) )
{
- int signal = WTERMSIG(status);
+ int32_t signal = WTERMSIG(status);
testResult = EXIT_STATUS_TESTCASE_ABORTED;
if( signal == SIGABRT )
{
return testResult;
}
-void OutputStatistics( const char* processName, int numPasses, int numFailures )
+void OutputStatistics( const char* processName, int32_t numPasses, int32_t numFailures )
{
FILE* fp=fopen("summary.xml", "a");
if( fp != NULL )
}
}
-int RunAll( const char* processName, ::testcase tc_array[] )
+int32_t RunAll( const char* processName, ::testcase tc_array[] )
{
- int numFailures = 0;
- int numPasses = 0;
+ int32_t numFailures = 0;
+ int32_t numPasses = 0;
// Run test cases in child process( to kill output/handle signals ), but run serially.
- for( unsigned int i=0; tc_array[i].name; i++)
+ for( uint32_t i=0; tc_array[i].name; i++)
{
- int result = RunTestCaseInChildProcess( tc_array[i], false );
+ int32_t result = RunTestCaseInChildProcess( tc_array[i], false );
if( result == 0 )
{
numPasses++;
}
// Constantly runs up to MAX_NUM_CHILDREN processes
-int RunAllInParallel( const char* processName, ::testcase tc_array[], bool reRunFailed)
+int32_t RunAllInParallel( const char* processName, ::testcase tc_array[], bool reRunFailed)
{
- int numFailures = 0;
- int numPasses = 0;
+ int32_t numFailures = 0;
+ int32_t numPasses = 0;
RunningTestCases children;
- std::vector<int> failedTestCases;
+ std::vector<int32_t> failedTestCases;
// Fork up to MAX_NUM_CHILDREN processes, then
// wait. As soon as a proc completes, fork the next.
- int nextTestCase = 0;
- int numRunningChildren = 0;
+ int32_t nextTestCase = 0;
+ int32_t numRunningChildren = 0;
while( tc_array[nextTestCase].name || numRunningChildren > 0)
{
// Create more children (up to the max number or til the end of the array)
while( numRunningChildren < MAX_NUM_CHILDREN && tc_array[nextTestCase].name )
{
- int pid = fork();
+ int32_t pid = fork();
if( pid == 0 ) // Child process
{
close(STDOUT_FILENO);
// Wait for the next child to finish
- int status=0;
- int childPid = waitpid(-1, &status, 0);
+ int32_t status=0;
+ int32_t childPid = waitpid(-1, &status, 0);
if( childPid == -1 )
{
perror("waitpid");
{
if( childPid > 0 )
{
- int testResult = WEXITSTATUS(status);
+ int32_t testResult = WEXITSTATUS(status);
if( testResult )
{
printf("Test case %s failed: %d\n", children[childPid].testCaseName, testResult);
if( reRunFailed )
{
- for( unsigned int i=0; i<failedTestCases.size(); i++)
+ for( uint32_t i=0; i<failedTestCases.size(); i++)
{
char* testCaseStrapline;
- int numChars = asprintf(&testCaseStrapline, "Test case %s", tc_array[failedTestCases[i]].name );
+ int32_t numChars = asprintf(&testCaseStrapline, "Test case %s", tc_array[failedTestCases[i]].name );
printf("\n%s\n", testCaseStrapline);
- for(int j=0; j<numChars; j++)
+ for(int32_t j=0; j<numChars; j++)
{
printf("=");
}
-int FindAndRunTestCase(::testcase tc_array[], const char* testCaseName)
+int32_t FindAndRunTestCase(::testcase tc_array[], const char* testCaseName)
{
- int result = EXIT_STATUS_TESTCASE_NOT_FOUND;
+ int32_t result = EXIT_STATUS_TESTCASE_NOT_FOUND;
- for( int i = 0; tc_array[i].name; i++ )
+ for( int32_t i = 0; tc_array[i].name; i++ )
{
if( !strcmp(testCaseName, tc_array[i].name) )
{
#define TEST_HARNESS_H
/*
- * Copyright (c) 2014 Samsung Electronics Co., Ltd.
+ * Copyright (c) 2018 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.
#include <stdio.h>
#include <testcase.h>
+#include <cstdint>
namespace TestHarness
{
EXIT_STATUS_TESTCASE_NOT_FOUND // 6
};
-const int MAX_NUM_CHILDREN(16);
+const int32_t MAX_NUM_CHILDREN(16);
struct TestCase
{
- int testCase;
+ int32_t testCase;
const char* testCaseName;
TestCase()
{
}
- TestCase(int tc, const char* name)
+ TestCase(int32_t tc, const char* name)
: testCase(tc),
testCaseName(name)
{
* Run a test case
* @param[in] testCase The Testkit-lite test case to run
*/
-int RunTestCase( struct testcase_s& testCase );
+int32_t RunTestCase( struct testcase_s& testCase );
/**
* Run all test cases in parallel
* @param[in] reRunFailed True if failed test cases should be re-run
* @return 0 on success
*/
-int RunAllInParallel(const char* processName, testcase tc_array[], bool reRunFailed);
+int32_t RunAllInParallel(const char* processName, testcase tc_array[], bool reRunFailed);
/**
* Run all test cases in serial
* @param[in] tc_array The array of auto-generated testkit-lite test cases
* @return 0 on success
*/
-int RunAll( const char* processName, testcase tc_array[] );
+int32_t RunAll( const char* processName, testcase tc_array[] );
/**
* Find the named test case in the given array, and run it
* @param[in] testCaseName the name of the test case to run
* @return 0 on success
*/
-int FindAndRunTestCase(::testcase tc_array[], const char* testCaseName);
+int32_t FindAndRunTestCase(::testcase tc_array[], const char* testCaseName);
/**
* Display usage instructions for this program
/*
- * Copyright (c) 2017 Samsung Electronics Co., Ltd.
+ * Copyright (c) 2018 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.
namespace Dali
{
-TestNativeImagePointer TestNativeImage::New(int width, int height)
+TestNativeImagePointer TestNativeImage::New(uint32_t width, uint32_t height)
{
return new TestNativeImage(width, height);
}
-TestNativeImage::TestNativeImage(int width, int height)
+TestNativeImage::TestNativeImage(uint32_t width, uint32_t height)
: mWidth(width), mHeight(height), mExtensionCreateCalls(0), mExtensionDestroyCalls(0), mTargetTextureCalls(0),createResult(true)
{
mExtension = new TestNativeImageExtension();
}
-TestNativeImageNoExtPointer TestNativeImageNoExt::New(int width, int height)
+TestNativeImageNoExtPointer TestNativeImageNoExt::New(uint32_t width, uint32_t height)
{
return new TestNativeImageNoExt(width, height);
}
-TestNativeImageNoExt::TestNativeImageNoExt(int width, int height)
+TestNativeImageNoExt::TestNativeImageNoExt(uint32_t width, uint32_t height)
: mWidth(width), mHeight(height), mExtensionCreateCalls(0), mExtensionDestroyCalls(0), mTargetTextureCalls(0),createResult(true)
{
}
inline const char* GetCustomFragmentPreFix(){return "#extension GL_OES_EGL_image_external:require\n";}
inline const char* GetCustomSamplerTypename(){return "samplerExternalOES";}
- inline int GetEglImageTextureTarget(){return GL_TEXTURE_EXTERNAL_OES;}
+ inline int32_t GetEglImageTextureTarget(){return GL_TEXTURE_EXTERNAL_OES;}
};
class DALI_CORE_API TestNativeImage : public Dali::NativeImageInterface
{
public:
- static TestNativeImagePointer New(int width, int height);
+ static TestNativeImagePointer New(uint32_t width, uint32_t height);
inline void SetGlExtensionCreateResult(bool result){ createResult = result;}
inline virtual bool GlExtensionCreate() { ++mExtensionCreateCalls; return createResult;};
inline virtual void GlExtensionDestroy() { ++mExtensionDestroyCalls; };
inline virtual GLenum TargetTexture() { ++mTargetTextureCalls; return 0;};
inline virtual void PrepareTexture() {};
- inline virtual unsigned int GetWidth() const {return mWidth;};
- inline virtual unsigned int GetHeight() const {return mHeight;};
+ inline virtual uint32_t GetWidth() const {return mWidth;};
+ inline virtual uint32_t GetHeight() const {return mHeight;};
inline virtual bool RequiresBlending() const {return true;};
inline virtual Dali::NativeImageInterface::Extension* GetExtension() {return mExtension;}
private:
- TestNativeImage(int width, int height);
+ TestNativeImage(uint32_t width, uint32_t height);
virtual ~TestNativeImage();
- int mWidth;
- int mHeight;
+ uint32_t mWidth;
+ uint32_t mHeight;
public:
- int mExtensionCreateCalls;
- int mExtensionDestroyCalls;
- int mTargetTextureCalls;
+ int32_t mExtensionCreateCalls;
+ int32_t mExtensionDestroyCalls;
+ int32_t mTargetTextureCalls;
bool createResult;
TestNativeImageExtension* mExtension;
class DALI_CORE_API TestNativeImageNoExt : public Dali::NativeImageInterface
{
public:
- static TestNativeImageNoExtPointer New(int width, int height);
+ static TestNativeImageNoExtPointer New(uint32_t width, uint32_t height);
inline void SetGlExtensionCreateResult(bool result){ createResult = result;}
inline virtual bool GlExtensionCreate() { ++mExtensionCreateCalls; return createResult;};
inline virtual void GlExtensionDestroy() { ++mExtensionDestroyCalls; };
inline virtual GLenum TargetTexture() { ++mTargetTextureCalls; return 1;};
inline virtual void PrepareTexture() {};
- inline virtual unsigned int GetWidth() const {return mWidth;};
- inline virtual unsigned int GetHeight() const {return mHeight;};
+ inline virtual uint32_t GetWidth() const {return mWidth;};
+ inline virtual uint32_t GetHeight() const {return mHeight;};
inline virtual bool RequiresBlending() const {return true;};
private:
- TestNativeImageNoExt(int width, int height);
+ TestNativeImageNoExt(uint32_t width, uint32_t height);
virtual ~TestNativeImageNoExt();
- int mWidth;
- int mHeight;
+ uint32_t mWidth;
+ uint32_t mHeight;
public:
- int mExtensionCreateCalls;
- int mExtensionDestroyCalls;
- int mTargetTextureCalls;
+ int32_t mExtensionCreateCalls;
+ int32_t mExtensionDestroyCalls;
+ int32_t mTargetTextureCalls;
bool createResult;
};
SamplingMode::Type samplingMode,
bool orientationCorrection )
{
- ImageDimensions closestSize = ImageDimensions( mClosestSize.x, mClosestSize.y );
+ ImageDimensions closestSize = ImageDimensions( mClosestSize );
mTrace.PushCall("GetClosestImageSize", "");
return closestSize;
}
SamplingMode::Type samplingMode,
bool orientationCorrection )
{
- ImageDimensions closestSize = ImageDimensions( mClosestSize.x, mClosestSize.y );
+ ImageDimensions closestSize = ImageDimensions( mClosestSize );
mTrace.PushCall("GetClosestImageSize", "");
return closestSize;
}
mDecodedBitmap.Reset();
}
-void TestPlatformAbstraction::SetClosestImageSize(const Vector2& size)
+void TestPlatformAbstraction::SetClosestImageSize( const Vector2& size )
{
- mClosestSize = size;
+ mClosestSize = ImageDimensions( static_cast<uint32_t>( size.x ), static_cast<uint32_t>( size.y ) );
}
void TestPlatformAbstraction::SetLoadFileResult( bool result, Dali::Vector< unsigned char >& buffer )
* @brief Sets the value returned by GetClosestImageSize.
* @param[in] size The size that should be returned.
*/
- void SetClosestImageSize(const Vector2& size);
+ void SetClosestImageSize( const Vector2& size );
/**
* @brief Sets the result return by LoadFile.
mutable TraceCallStack mTrace;
bool mIsLoadingResult;
- Vector2 mClosestSize;
+ ImageDimensions mClosestSize;
LoadFileResult mLoadFileResult;
bool mSaveFileResult;
* @param[in] params A comma separated list of parameter values
* @return index in the stack where the method was found or -1 otherwise
*/
-int TraceCallStack::FindIndexFromMethodAndParams(std::string method, std::string params) const
+int32_t TraceCallStack::FindIndexFromMethodAndParams(std::string method, std::string params) const
{
- int index = -1;
+ int32_t index = -1;
for( size_t i=0; i < mCallStack.size(); i++ )
{
if( 0 == mCallStack[i].method.compare(method) && 0 == mCallStack[i].paramList.compare(params) )
{
- index = i;
+ index = static_cast<int32_t>( i );
break;
}
}
int TraceCallStack::FindIndexFromMethodAndParams(std::string method, const TraceCallStack::NamedParams& params) const
{
- int index = -1;
+ int32_t index = -1;
for( size_t i=0; i < mCallStack.size(); i++ )
{
if( 0 == mCallStack[i].method.compare(method) )
}
if( match == true )
{
- index = i;
+ index = static_cast<int32_t>( i );
break;
}
}
std::string GetTraceString()
{
std::stringstream traceStream;
- int functionCount = mCallStack.size();
- for( int i = 0; i < functionCount; ++i )
+ std::size_t functionCount = mCallStack.size();
+ for( std::size_t i = 0; i < functionCount; ++i )
{
Dali::TraceCallStack::FunctionCall functionCall = mCallStack[ i ];
traceStream << "StackTrace: Index:" << i << ", Function:" << functionCall.method << ", ParamList:" << functionCall.paramList << std::endl;
$(adaptor_devel_api_text_abstraction_src_files) \
$(adaptor_graphics_common_src_files) \
$(adaptor_graphics_gles20_src_files) \
- $(adaptor_graphics_ubuntu_gl_src_files) \
$(adaptor_graphics_ubuntu_src_files) \
$(adaptor_haptics_common_src_files) \
$(adaptor_imaging_common_src_files) \
$(adaptor_imaging_ubuntu_x11_src_files) \
$(adaptor_input_common_src_files) \
- $(adaptor_input_ubuntu_src_files) \
$(adaptor_input_ubuntu_x11_src_files) \
$(adaptor_legacy_common_src_files) \
$(adaptor_network_common_src_files) \
$(adaptor_sensor_ubuntu_src_files) \
$(adaptor_styling_common_src_files) \
$(adaptor_system_common_src_files) \
- $(adaptor_system_ubuntu_src_files) \
+ $(adaptor_system_linux_src_files) \
$(adaptor_system_ubuntu_x11_src_files) \
$(adaptor_text_common_src_files) \
$(adaptor_text_ubuntu_src_files) \
if MOBILE_PROFILE
LIBDALI_ADAPTOR_LA_SOURCES = \
$(adaptor_accessibility_common_src_files) \
- $(adaptor_accessibility_tizen_src_files) \
+ $(adaptor_accessibility_tizen_wayland_src_files) \
$(adaptor_accessibility_tizen_mobile_src_files) \
$(adaptor_adaptor_common_src_files) \
- $(adaptor_adaptor_tizen_src_files) \
$(adaptor_adaptor_tizen_wayland_src_files) \
$(adaptor_clipboard_common_src_files) \
$(adaptor_clipboard_tizen_wayland_src_files) \
$(adaptor_sensor_tizen_src_files) \
$(adaptor_styling_common_src_files) \
$(adaptor_system_common_src_files) \
- $(adaptor_system_tizen_mobile_src_files) \
+ $(adaptor_system_linux_src_files) \
+ $(adaptor_system_tizen_wayland_src_files) \
$(adaptor_text_common_src_files) \
$(adaptor_resampler_src_files) \
$(adaptor_video_common_src_files) \
if IVI_PROFILE
LIBDALI_ADAPTOR_LA_SOURCES = \
$(adaptor_accessibility_common_src_files) \
- $(adaptor_accessibility_tizen_src_files) \
+ $(adaptor_accessibility_tizen_wayland_src_files) \
$(adaptor_accessibility_tizen_ivi_src_files) \
$(adaptor_adaptor_common_src_files) \
- $(adaptor_adaptor_tizen_src_files) \
$(adaptor_adaptor_tizen_wayland_src_files) \
$(adaptor_clipboard_common_src_files) \
$(adaptor_clipboard_tizen_wayland_src_files) \
$(adaptor_sensor_tizen_src_files) \
$(adaptor_styling_common_src_files) \
$(adaptor_system_common_src_files) \
- $(adaptor_system_tizen_ivi_src_files) \
+ $(adaptor_system_linux_src_files) \
+ $(adaptor_system_tizen_wayland_src_files) \
$(adaptor_text_common_src_files) \
$(adaptor_resampler_src_files) \
$(adaptor_video_common_src_files) \
if TV_PROFILE
LIBDALI_ADAPTOR_LA_SOURCES = \
$(adaptor_accessibility_common_src_files) \
- $(adaptor_accessibility_tizen_src_files) \
+ $(adaptor_accessibility_tizen_wayland_src_files) \
$(adaptor_accessibility_tizen_tv_src_files) \
$(adaptor_adaptor_common_src_files) \
- $(adaptor_adaptor_tizen_src_files) \
$(adaptor_adaptor_tizen_wayland_src_files) \
$(adaptor_clipboard_common_src_files) \
$(adaptor_clipboard_tizen_wayland_src_files) \
$(adaptor_sensor_tizen_src_files) \
$(adaptor_styling_common_src_files) \
$(adaptor_system_common_src_files) \
- $(adaptor_system_tizen_tv_src_files) \
+ $(adaptor_system_linux_src_files) \
+ $(adaptor_system_tizen_wayland_src_files) \
$(adaptor_text_common_src_files) \
$(adaptor_resampler_src_files) \
$(adaptor_video_common_src_files) \
if COMMON_PROFILE
LIBDALI_ADAPTOR_LA_SOURCES = \
$(adaptor_accessibility_common_src_files) \
- $(adaptor_accessibility_tizen_src_files) \
+ $(adaptor_accessibility_tizen_wayland_src_files) \
$(adaptor_accessibility_tizen_common_src_files) \
$(adaptor_adaptor_common_src_files) \
- $(adaptor_adaptor_tizen_src_files) \
$(adaptor_adaptor_tizen_wayland_src_files) \
$(adaptor_clipboard_common_src_files) \
$(adaptor_clipboard_tizen_wayland_src_files) \
$(adaptor_sensor_tizen_src_files) \
$(adaptor_styling_common_src_files) \
$(adaptor_system_common_src_files) \
- $(adaptor_system_generic_src_files) \
+ $(adaptor_system_linux_src_files) \
+ $(adaptor_system_tizen_wayland_src_files) \
$(adaptor_text_common_src_files) \
$(adaptor_resampler_src_files) \
$(adaptor_video_common_src_files) \
if WEARABLE_PROFILE
LIBDALI_ADAPTOR_LA_SOURCES = \
$(adaptor_accessibility_common_src_files) \
- $(adaptor_accessibility_tizen_src_files) \
+ $(adaptor_accessibility_tizen_wayland_src_files) \
$(adaptor_accessibility_tizen_wearable_src_files) \
$(adaptor_adaptor_common_src_files) \
- $(adaptor_adaptor_tizen_src_files) \
$(adaptor_adaptor_tizen_wayland_src_files) \
$(adaptor_adaptor_tizen_wearable_src_files) \
$(adaptor_clipboard_common_src_files) \
$(adaptor_sensor_tizen_src_files) \
$(adaptor_styling_common_src_files) \
$(adaptor_system_common_src_files) \
+ $(adaptor_system_linux_src_files) \
$(adaptor_system_tizen_wearable_src_files) \
$(adaptor_text_common_src_files) \
$(adaptor_resampler_src_files) \
return Internal::Adaptor::GetImplementation( application ).AddIdle( callback, true );
}
+Dali::Window CreateWindow( Application application, PositionSize childPosSize, const std::string& childWindowName, const std::string& childWindowClassName, bool childWindowMode )
+{
+ auto& adaptor = Internal::Adaptor::GetImplementation( application ).GetAdaptor();
+
+ Dali::Window childWindow = Dali::Window::New( childPosSize, childWindowName, childWindowClassName, childWindowMode );
+ Internal::Adaptor::Adaptor::GetImplementation( adaptor ).AddWindow( &childWindow, childWindowName, childWindowClassName, childWindowMode );
+ return childWindow;
+}
+
+bool DestroyWindow( Application application, Dali::Window* childWindow )
+{
+ auto& adaptor = Internal::Adaptor::GetImplementation( application ).GetAdaptor();
+
+ return Internal::Adaptor::Adaptor::GetImplementation( adaptor ).RemoveWindow( childWindow );
+}
+
+bool DestroyWindow( Application application, const std::string& childWindowName )
+{
+ auto& adaptor = Internal::Adaptor::GetImplementation( application ).GetAdaptor();
+
+ return Internal::Adaptor::Adaptor::GetImplementation( adaptor ).RemoveWindow( childWindowName );
+}
+
} // namespace DevelApplication
} // namespace Dali
*/
DALI_ADAPTOR_API bool AddIdleWithReturnValue( Application application, CallbackBase* callback );
+/**
+ * @brief Create and Add a child window to the application instance
+ * @param[in] application A handle to the Application
+ * @param[in] childPosSize The position and size of the child window to be created
+ * @param[in] childWindowName The title of the child window
+ * @param[in] childWindowClassName The class name of the child window
+ * @param[in] childWindowMode The mode of the newly created child window
+ * @return @c a window handle if added successfully, @c null otherwise
+ *
+ * @note Function must be called from main event thread only
+ */
+DALI_ADAPTOR_API Dali::Window CreateWindow( Application application, PositionSize childPosSize, const std::string& childWindowName, const std::string& childWindowClassName, bool childWindowMode );
+
+/**
+ * @brief Removes a previously created Window instance from the Adaptor internal list
+ * @note Function must be called from the main event thread only.
+ * @param[in] application A handle to the Application
+ * @param[in] childWindow The created Window instance
+ * @return true if removed successfully, false otherwise
+ */
+DALI_ADAPTOR_API bool DestroyWindow( Application application, Dali::Window* childWindow );
+
+/**
+ * @brief Removes a previously created Window instance from the Adaptor internal list
+ * @note Function must be called from the main event thread only.
+ * @param[in] application A handle to the Application
+ * @param[in] childWindowName The title of the window
+ * @return true if removed successfully, false otherwise
+ */
+DALI_ADAPTOR_API bool DestroyWindow( Application application, const std::string& childWindowName );
+
} // namespace DevelApplication
} // namespace Dali
#include <dali/devel-api/adaptor-framework/color-controller.h>
// INTERNAL INCLUDES
-#include <dali/internal/system/generic/color-controller-impl.h>
+#include <dali/internal/system/common/color-controller-impl.h>
namespace Dali
{
// limit maximum image down load size to 50 MB
const size_t MAXIMUM_DOWNLOAD_IMAGE_SIZE = 50 * 1024 * 1024 ;
-static unsigned int gMaxTextureSize = 4096;
-
}
Devel::PixelBuffer LoadImageFromFile( const std::string& url, ImageDimensions size, FittingMode::Type fittingMode, SamplingMode::Type samplingMode, bool orientationCorrection )
return Dali::Devel::PixelBuffer();
}
-void SetMaxTextureSize( unsigned int size )
-{
- gMaxTextureSize = size;
-}
-
unsigned int GetMaxTextureSize()
{
- return gMaxTextureSize;
+ return TizenPlatform::ImageLoader::GetMaxTextureSize();
}
} // namespace Dali
bool orientationCorrection = true );
/**
- * @brief Set the maximum texture size. Then size can be kwown by GL_MAX_TEXTURE_SIZE.
- *
- * @param [in] size The maximum texture size to set
- */
-DALI_ADAPTOR_API void SetMaxTextureSize( unsigned int size );
-
-/**
* @brief get the maximum texture size.
*
* @return The maximum texture size
{
Any empty;
NativeImageSourceQueuePtr image = new NativeImageSourceQueue( width, height, depth, empty );
- return image;
+ if( image->mImpl )
+ {
+ return image;
+ }
+ return nullptr;
}
NativeImageSourceQueuePtr NativeImageSourceQueue::New( Any nativeImageSourceQueue )
{
NativeImageSourceQueuePtr image = new NativeImageSourceQueue( 0, 0, COLOR_DEPTH_DEFAULT, nativeImageSourceQueue );
- return image;
+ if( image->mImpl )
+ {
+ return image;
+ }
+ return nullptr;
}
Any NativeImageSourceQueue::GetNativeImageSourceQueue()
return GetImplementation(*this).IsColorGlyph( fontId, glyphIndex );
}
+bool FontClient::AddCustomFontDirectory( const FontPath& path )
+{
+ return GetImplementation(*this).AddCustomFontDirectory( path );
+}
+
FontClient::FontClient( Internal::FontClient* internal )
: BaseHandle( internal )
{
*/
bool IsColorGlyph( FontId fontId, GlyphIndex glyphIndex );
+ /**
+ * @brief Add custom fonts directory
+ *
+ * @param[in] path to the fonts directory
+ *
+ * @return true if the fonts can be added.
+ */
+ bool AddCustomFontDirectory( const FontPath& path );
+
public: // Not intended for application developers
/**
* @brief This constructor is used by FontClient::Get().
-#ifndef __DALI_INTEGRATION_ADAPTOR_H__
-#define __DALI_INTEGRATION_ADAPTOR_H__
+#ifndef DALI_INTEGRATION_ADAPTOR_H
+#define DALI_INTEGRATION_ADAPTOR_H
/*
* Copyright (c) 2018 Samsung Electronics Co., Ltd.
{
namespace Adaptor
{
+class GraphicsFactory;
class Adaptor;
}
}
} // namespace Dali
-#endif // __DALI_INTEGRATION_ADAPTOR_H__
+#endif // DALI_INTEGRATION_ADAPTOR_H
-#ifndef __DALI_RENDER_SURFACE_H__
-#define __DALI_RENDER_SURFACE_H__
+#ifndef DALI_RENDER_SURFACE_H
+#define DALI_RENDER_SURFACE_H
/*
* Copyright (c) 2018 Samsung Electronics Co., Ltd.
// INTERNAL INCLUDES
#include <dali/public-api/dali-adaptor-common.h>
+
namespace Dali
{
-class EglInterface;
class DisplayConnection;
class ThreadSynchronizationInterface;
+namespace Internal
+{
+
+namespace Adaptor
+{
+
+class GraphicsInterface;
+
+} // namespace Adaptor
+
+} // namespace Internal
+
namespace Integration
{
virtual void GetDpi( unsigned int& dpiHorizontal, unsigned int& dpiVertical ) = 0;
/**
- * Initialize EGL, RenderSurface should create egl display and initialize
- * @param egl implementation to use for the creation
+ * @brief InitializeGraphics the platform specific graphics surface interfaces
+ * @param[in] graphics The abstracted graphics interface
+ * @param[in] displayConnection The display connection interface
*/
- virtual void InitializeEgl( EglInterface& egl ) = 0;
+ virtual void InitializeGraphics( Dali::Internal::Adaptor::GraphicsInterface& graphics, Dali::DisplayConnection& displayConnection ) = 0;
/**
- * @brief Creates EGL Surface
- * @param egl implementation to use for the creation
+ * @brief Creates the Surface
*/
- virtual void CreateEglSurface( EglInterface& egl ) = 0;
+ virtual void CreateSurface() = 0;
/**
- * @brief Destroys EGL Surface
- * @param egl implementation to use for the destruction
+ * @brief Destroys the Surface
*/
- virtual void DestroyEglSurface( EglInterface& egl ) = 0;
+ virtual void DestroySurface() = 0;
/**
- * @brief Replace the EGL Surface
- * @param egl implementation to use for the creation
+ * @brief Replace the Surface
* @return true if context was lost
*/
- virtual bool ReplaceEGLSurface( EglInterface& egl ) = 0;
+ virtual bool ReplaceGraphicsSurface() = 0;
/**
* @brief Resizes the underlying surface.
+ * @param[in] The dimensions of the new position
*/
virtual void MoveResize( Dali::PositionSize positionSize ) = 0;
* @brief Invoked by render thread before Core::Render
* If the operation fails, then Core::Render should not be called until there is
* a surface to render onto.
- * @param[in] egl The Egl interface
- * @param[in] glAbstraction OpenGLES abstraction interface
* @param[in] resizingSurface True if the surface is being resized
* @return True if the operation is successful, False if the operation failed
*/
- virtual bool PreRender( EglInterface& egl, Integration::GlAbstraction& glAbstraction, bool resizingSurface ) = 0;
+ virtual bool PreRender( bool resizingSurface ) = 0;
/**
* @brief Invoked by render thread after Core::Render
- * @param[in] egl The Egl interface
- * @param[in] glAbstraction OpenGLES abstraction interface
- * @param[in] displayConnection display connection
+ * @param[in] renderToFbo True if render to FBO.
* @param[in] replacingSurface True if the surface is being replaced.
* @param[in] resizingSurface True if the surface is being resized.
*/
- virtual void PostRender( EglInterface& egl, Integration::GlAbstraction& glAbstraction, DisplayConnection* displayConnection, bool replacingSurface, bool resizingSurface ) = 0;
-
+ virtual void PostRender( bool renderToFbo, bool replacingSurface, bool resizingSurface ) = 0;
/**
* @brief Invoked by render thread when the thread should be stop
*/
} // namespace Dali
-#endif // __DALI_RENDER_SURFACE_H__
+#endif // DALI_RENDER_SURFACE_H
/*
- * Copyright (c) 2015 Samsung Electronics Co., Ltd.
+ * Copyright (c) 2018 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.
#include <dali/integration-api/events/gesture-requests.h>
// INTERNAL INCLUDES
-#include <dali/internal/system/generic/system-settings.h>
+#include <dali/internal/system/common/system-settings.h>
namespace Dali
{
${adaptor_accessibility_dir}/common/accessibility-adaptor-impl.cpp \
${adaptor_accessibility_dir}/common/accessibility-gesture-detector.cpp
-# module: accessibility, backend: tizen
-adaptor_accessibility_tizen_src_files=\
- ${adaptor_accessibility_dir}/tizen/tts-player-factory-tizen.cpp \
- ${adaptor_accessibility_dir}/tizen/tts-player-impl-tizen.cpp
+# module: accessibility, backend: tizen-wayland
+adaptor_accessibility_tizen_wayland_src_files=\
+ ${adaptor_accessibility_dir}/tizen-wayland/tts-player-factory-tizen.cpp \
+ ${adaptor_accessibility_dir}/tizen-wayland/tts-player-impl-tizen.cpp
# module: accessibility, backend: tizen-common profile
adaptor_accessibility_tizen_common_src_files=\
- ${adaptor_accessibility_dir}/tizen-common/accessibility-adaptor-impl-tizen.cpp
+ ${adaptor_accessibility_dir}/tizen-wayland/tizen-common/accessibility-adaptor-impl-tizen.cpp
# module: accessibility, backend: tizen-ivi profile
adaptor_accessibility_tizen_ivi_src_files=\
- ${adaptor_accessibility_dir}/tizen-ivi/accessibility-adaptor-impl-ivi.cpp
+ ${adaptor_accessibility_dir}/tizen-wayland/tizen-ivi/accessibility-adaptor-impl-ivi.cpp
# module: accessibility, backend: tizen-mobile profile
adaptor_accessibility_tizen_mobile_src_files=\
- ${adaptor_accessibility_dir}/tizen-mobile/accessibility-adaptor-impl-mobile.cpp
+ ${adaptor_accessibility_dir}/tizen-wayland/tizen-mobile/accessibility-adaptor-impl-mobile.cpp
# module: accessibility, backend: tizen-tv profile
adaptor_accessibility_tizen_tv_src_files=\
- ${adaptor_accessibility_dir}/tizen-tv/accessibility-adaptor-impl-tv.cpp
+ ${adaptor_accessibility_dir}/tizen-wayland/tizen-tv/accessibility-adaptor-impl-tv.cpp
# module: accessibility, backend: tizen-wearable profile
adaptor_accessibility_tizen_wearable_src_files=\
- ${adaptor_accessibility_dir}/tizen-wearable/accessibility-adaptor-impl-wearable.cpp
+ ${adaptor_accessibility_dir}/tizen-wayland/tizen-wearable/accessibility-adaptor-impl-wearable.cpp
# module: accessibility, backend: ubuntu
adaptor_accessibility_ubuntu_src_files=\
/*
- * Copyright (c) 2014 Samsung Electronics Co., Ltd.
+ * Copyright (c) 2018 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.
// INTERNAL INCLUDES
#include <dali/internal/system/common/singleton-service-impl.h>
-#include <dali/internal/system/generic/system-settings.h>
+#include <dali/internal/system/common/system-settings.h>
namespace Dali
{
/*
- * Copyright (c) 2017 Samsung Electronics Co., Ltd.
+ * Copyright (c) 2018 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.
*/
// CLASS HEADER
-#include <dali/internal/accessibility/tizen-mobile/accessibility-adaptor-impl-mobile.h>
+#include <dali/internal/accessibility/tizen-wayland/tizen-mobile/accessibility-adaptor-impl-mobile.h>
// EXTERNAL INCLUDES
#include <vconf.h>
// INTERNAL INCLUDES
#include <dali/internal/system/common/singleton-service-impl.h>
-#include <dali/internal/system/generic/system-settings.h>
+#include <dali/internal/system/common/system-settings.h>
#ifndef WAYLAND
#define MSG_DOMAIN_CONTROL_ACCESS static_cast< int >( ECORE_X_ATOM_E_ILLUME_ACCESS_CONTROL )
/*
- * Copyright (c) 2017 Samsung Electronics Co., Ltd.
+ * Copyright (c) 2018 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.
*/
// CLASS HEADER
-#include <dali/internal/accessibility/tizen-mobile/accessibility-adaptor-impl-mobile.h>
+#include <dali/internal/accessibility/tizen-wayland/tizen-mobile/accessibility-adaptor-impl-mobile.h>
// EXTERNAL INCLUDES
#include <vconf.h>
// INTERNAL INCLUDES
#include <dali/internal/system/common/singleton-service-impl.h>
-#include <dali/internal/system/generic/system-settings.h>
+#include <dali/internal/system/common/system-settings.h>
#ifndef WAYLAND
#define MSG_DOMAIN_CONTROL_ACCESS static_cast< int >( ECORE_X_ATOM_E_ILLUME_ACCESS_CONTROL )
/*
- * Copyright (c) 2014 Samsung Electronics Co., Ltd.
+ * Copyright (c) 2018 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.
// INTERNAL INCLUDES
#include <dali/internal/system/common/singleton-service-impl.h>
-#include <dali/internal/system/generic/system-settings.h>
+#include <dali/internal/system/common/system-settings.h>
namespace Dali
{
/*
- * Copyright (c) 2017 Samsung Electronics Co., Ltd.
+ * Copyright (c) 2018 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.
*/
// CLASS HEADER
-#include <dali/internal/accessibility/tizen-mobile/accessibility-adaptor-impl-mobile.h>
+#include <dali/internal/accessibility/tizen-wayland/tizen-mobile/accessibility-adaptor-impl-mobile.h>
// EXTERNAL INCLUDES
#include <vconf.h>
// INTERNAL INCLUDES
#include <dali/internal/system/common/singleton-service-impl.h>
-#include <dali/internal/system/generic/system-settings.h>
+#include <dali/internal/system/common/system-settings.h>
#ifndef WAYLAND
#define MSG_DOMAIN_CONTROL_ACCESS static_cast< int >( ECORE_X_ATOM_E_ILLUME_ACCESS_CONTROL )
*/
#include <dali/internal/accessibility/common/tts-player-factory.h>
-#include <dali/internal/accessibility/tizen/tts-player-impl-tizen.h>
+#include <dali/internal/accessibility/tizen-wayland/tts-player-impl-tizen.h>
namespace Dali
{
*/
// CLASS HEADER
-#include <dali/internal/accessibility/tizen/tts-player-impl-tizen.h>
+#include <dali/internal/accessibility/tizen-wayland/tts-player-impl-tizen.h>
// EXTERNAL INCLUDES
#include <tts.h>
/*
- * Copyright (c) 2014 Samsung Electronics Co., Ltd.
+ * Copyright (c) 2018 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.
*
*/
-// EXTERNAL INCLUDES
-#include <system_settings.h>
+// CLASS HEADER
+#include <dali/internal/adaptor/common/adaptor-builder-impl.h>
// INTERNAL INCLUDES
-#include <dali/internal/system/generic/system-settings.h>
+#include <dali/public-api/dali-adaptor-common.h>
+#include <dali/internal/graphics/gles20/egl-graphics-factory.h>
+#include <dali/internal/window-system/common/display-utils.h>
+
namespace Dali
{
namespace Adaptor
{
-int GetLongPressTime( int defaultTime )
+AdaptorBuilder::AdaptorBuilder()
{
- return defaultTime;
+ // Construct Graphics Factory
+ mGraphicsFactory = Utils::MakeUnique< GraphicsFactory >();
}
-int GetElmAccessActionOver()
+GraphicsFactory& AdaptorBuilder::GetGraphicsFactory() const
{
- return 0;
+ return *mGraphicsFactory.get();
}
} // namespace Adaptor
--- /dev/null
+#ifndef DALI_INTERNAL_ADAPTOR_BUILDER_IMPL_H
+#define DALI_INTERNAL_ADAPTOR_BUILDER_IMPL_H
+
+/*
+ * Copyright (c) 2018 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.
+ *
+ */
+
+
+// INTERNAL INCLUDES
+#include <dali/internal/system/common/environment-options.h>
+#include <dali/internal/graphics/gles20/egl-graphics-factory.h>
+
+
+namespace Dali
+{
+
+namespace Internal
+{
+
+namespace Adaptor
+{
+
+/**
+ * Implementation of the Adaptor Builder class.
+ */
+class AdaptorBuilder
+{
+public:
+
+ /**
+ * Constructor
+ */
+ AdaptorBuilder();
+
+
+ /**
+ * Destructor
+ */
+ ~AdaptorBuilder() {};
+
+
+public:
+
+ /**
+ * @return reference to the GraphicsFactory object
+ */
+ GraphicsFactory& GetGraphicsFactory() const;
+
+
+private:
+ // Eliminate copy and assigned operations
+ AdaptorBuilder(const AdaptorBuilder&) = delete;
+ AdaptorBuilder& operator=(AdaptorBuilder&) = delete;
+
+
+private:
+ std::unique_ptr< GraphicsFactory > mGraphicsFactory; ///< GraphicsFactory object
+
+};
+
+} // namespace Internal
+
+} // namespace Adaptor
+
+} // namespace Dali
+
+#endif // DALI_INTERNAL_ADAPTOR_BUILDER_IMPL_H
// CLASS HEADER
#include <dali/internal/adaptor/common/adaptor-impl.h>
+#include <dali/internal/adaptor/common/adaptor-builder-impl.h>
// EXTERNAL INCLUDES
#include <dali/public-api/common/stage.h>
#include <dali/internal/system/common/performance-interface-factory.h>
#include <dali/internal/adaptor/common/lifecycle-observer.h>
+#include <dali/internal/graphics/gles20/egl-graphics-factory.h>
+#include <dali/internal/graphics/gles20/egl-graphics.h> // Temporary until Core is abstracted
+
#include <dali/devel-api/text-abstraction/font-client.h>
#include <dali/internal/system/common/callback-manager.h>
#include <dali/internal/graphics/gles20/gl-implementation.h>
#include <dali/internal/graphics/gles20/egl-sync-implementation.h>
#include <dali/internal/graphics/common/egl-image-extensions.h>
-#include <dali/internal/graphics/gles20/egl-factory.h>
#include <dali/internal/clipboard/common/clipboard-impl.h>
#include <dali/internal/graphics/common/vsync-monitor.h>
#include <dali/internal/system/common/object-profiler.h>
#include <dali/internal/window-system/common/window-render-surface.h>
#include <dali/internal/system/common/logging.h>
-#include <dali/devel-api/adaptor-framework/image-loading.h>
#include <dali/internal/system/common/locale-utils.h>
#include <dali/internal/imaging/common/image-loader-plugin-proxy.h>
+#include <dali/internal/imaging/common/image-loader.h>
+
using Dali::TextAbstraction::FontClient;
thread_local Adaptor* gThreadLocalAdaptor = NULL; // raw thread specific pointer to allow Adaptor::Get
} // unnamed namespace
+
Dali::Adaptor* Adaptor::New( Any nativeWindow, RenderSurface *surface, Dali::Configuration::ContextLoss configuration, EnvironmentOptions* environmentOptions )
{
Dali::Adaptor* adaptor = new Dali::Adaptor;
Adaptor* impl = new Adaptor( nativeWindow, *adaptor, surface, environmentOptions );
adaptor->mImpl = impl;
- impl->Initialize(configuration);
+ Dali::Internal::Adaptor::AdaptorBuilder* mAdaptorBuilder = new AdaptorBuilder();
+ auto graphicsFactory = mAdaptorBuilder->GetGraphicsFactory();
+
+ impl->Initialize( graphicsFactory, configuration );
+ delete mAdaptorBuilder; // Not needed anymore as the graphics interface has now been created
return adaptor;
}
{
Any winId = window.GetNativeHandle();
- Window& windowImpl = Dali::GetImplementation(window);
+ Window& windowImpl = Dali::GetImplementation( window );
Dali::Adaptor* adaptor = New( winId, windowImpl.GetSurface(), configuration, environmentOptions );
- windowImpl.SetAdaptor(*adaptor);
+ windowImpl.SetAdaptor( *adaptor );
return adaptor;
}
-void Adaptor::Initialize( Dali::Configuration::ContextLoss configuration )
+Dali::Adaptor* Adaptor::New( GraphicsFactory& graphicsFactory, Any nativeWindow, RenderSurface *surface, Dali::Configuration::ContextLoss configuration, EnvironmentOptions* environmentOptions )
+{
+ Dali::Adaptor* adaptor = new Dali::Adaptor; // Public adaptor
+ Adaptor* impl = new Adaptor( nativeWindow, *adaptor, surface, environmentOptions ); // Impl adaptor
+ adaptor->mImpl = impl;
+
+ impl->Initialize( graphicsFactory, configuration );
+
+ return adaptor;
+} // Called second
+
+Dali::Adaptor* Adaptor::New( GraphicsFactory& graphicsFactory, Dali::Window window, Dali::Configuration::ContextLoss configuration, EnvironmentOptions* environmentOptions )
+{
+ Any winId = window.GetNativeHandle();
+
+ Window& windowImpl = Dali::GetImplementation( window );
+ Dali::Adaptor* adaptor = New( graphicsFactory, winId, windowImpl.GetSurface(), configuration, environmentOptions );
+ windowImpl.SetAdaptor( *adaptor );
+ return adaptor;
+} // Called first
+
+void Adaptor::Initialize( GraphicsFactory& graphicsFactory, Dali::Configuration::ContextLoss configuration )
{
// all threads here (event, update, and render) will send their logs to TIZEN Platform's LogMessage handler.
Dali::Integration::Log::LogFunction logFunction( Dali::TizenPlatform::LogMessage );
{
dataRetentionPolicy = ResourcePolicy::DALI_DISCARDS_ALL_DATA;
}
- // Note, Tizen does not use DALI_RETAINS_ALL_DATA, as it can reload images from
- // files automatically.
+
+ // Note, Tizen does not use DALI_RETAINS_ALL_DATA, as it can reload images from files automatically.
if( mEnvironmentOptions->PerformanceServerRequired() )
{
mCallbackManager = CallbackManager::New();
- PositionSize size = mSurface->GetPositionSize();
+ WindowPane defaultWindow = mWindowFrame.front();
+ PositionSize size = defaultWindow.surface->GetPositionSize();
mGestureManager = new GestureManager(*this, Vector2(size.width, size.height), mCallbackManager, *mEnvironmentOptions);
- if( mEnvironmentOptions->GetGlesCallTime() > 0 )
- {
- mGLES = new GlProxyImplementation( *mEnvironmentOptions );
- }
- else
- {
- mGLES = new GlImplementation();
- }
-
- const Integration::DepthBufferAvailable depthBufferAvailable = static_cast< Integration::DepthBufferAvailable >( mEnvironmentOptions->DepthBufferRequired() );
- const Integration::StencilBufferAvailable stencilBufferAvailable = static_cast< Integration::StencilBufferAvailable >( mEnvironmentOptions->StencilBufferRequired() );
+ mGraphics = &( graphicsFactory.Create() );
+ mGraphics->Initialize( mEnvironmentOptions );
- mEglFactory = new EglFactory( mEnvironmentOptions->GetMultiSamplingLevel(), depthBufferAvailable, stencilBufferAvailable );
+ auto eglGraphics = static_cast<EglGraphics *>( mGraphics ); // This interface is temporary until Core has been updated to match
- EglSyncImplementation* eglSyncImpl = mEglFactory->GetSyncImplementation();
+ GlImplementation& mGLES = eglGraphics->GetGlesInterface();
+ EglSyncImplementation& eglSyncImpl = eglGraphics->GetSyncImplementation();
mCore = Integration::Core::New( *this,
*mPlatformAbstraction,
- *mGLES,
- *eglSyncImpl,
+ mGLES,
+ eglSyncImpl,
*mGestureManager,
dataRetentionPolicy ,
( 0u != mEnvironmentOptions->GetRenderToFboInterval() ) ? Integration::RenderToFrameBuffer::TRUE : Integration::RenderToFrameBuffer::FALSE,
- depthBufferAvailable,
- stencilBufferAvailable );
+ mGraphics->GetDepthBufferRequired(),
+ mGraphics->GetStencilBufferRequired() );
const unsigned int timeInterval = mEnvironmentOptions->GetObjectProfilerInterval();
if( 0u < timeInterval )
mVSyncMonitor = new VSyncMonitor;
+ if( defaultWindow.surface )
+ {
+ mDisplayConnection = Dali::DisplayConnection::New( *mGraphics, defaultWindow.surface->GetSurfaceType() );
+ }
+ else
+ {
+ mDisplayConnection = Dali::DisplayConnection::New( *mGraphics );
+ }
+
mThreadController = new ThreadController( *this, *mEnvironmentOptions );
// Should be called after Core creation
// Set max texture size
if( mEnvironmentOptions->GetMaxTextureSize() > 0 )
{
- Dali::SetMaxTextureSize( mEnvironmentOptions->GetMaxTextureSize() );
+ Dali::TizenPlatform::ImageLoader::SetMaxTextureSize( mEnvironmentOptions->GetMaxTextureSize() );
}
SetupSystemInformation();
delete mObjectProfiler;
delete mCore;
- delete mEglFactory;
- delete mGLES;
+
delete mGestureManager;
+ delete mDisplayConnection;
delete mPlatformAbstraction;
delete mCallbackManager;
delete mPerformanceInterface;
+ mGraphics->Destroy();
+
// uninstall it on this thread (main actor thread)
Dali::Integration::Log::UninstallLogFunction();
void Adaptor::Start()
{
- // it doesn't support restart after stop at this moment
- // to support restarting, need more testing
+ // It doesn't support restart after stop at this moment to support restarting, need more testing
if( READY != mState )
{
return;
// Start the callback manager
mCallbackManager->Start();
- // create event handler
- mEventHandler = new EventHandler( mSurface, *this, *mGestureManager, *this, mDragAndDropDetector );
+ WindowPane defaultWindow = mWindowFrame.front();
+
+ // Create event handler
+ mEventHandler = new EventHandler( defaultWindow.surface, *this, *mGestureManager, *this, mDragAndDropDetector );
if( mDeferredRotationObserver != NULL )
{
unsigned int dpiHor, dpiVer;
dpiHor = dpiVer = 0;
- mSurface->GetDpi( dpiHor, dpiVer );
+
+ defaultWindow.surface->GetDpi( dpiHor, dpiVer );
// tell core about the DPI value
mCore->SetDpi(dpiHor, dpiVer);
fontClient.SetDpi( dpiHor, dpiVer );
// Tell the core the size of the surface just before we start the render-thread
- PositionSize size = mSurface->GetPositionSize();
+ PositionSize size = defaultWindow.surface->GetPositionSize();
+
mCore->SurfaceResized( size.width, size.height );
// Initialize the thread controller
(*iter)->OnResume();
}
- // trigger processing of events queued up while paused
+ // Trigger processing of events queued up while paused
mCore->ProcessEvents();
// Do at end to ensure our first update/render after resumption includes the processed messages as well
mThreadController->Stop();
+ // Clear out all the handles to Windows
+ mWindowFrame.clear();
+
// Delete the TTS player
for(int i =0; i < Dali::TtsPlayer::MODE_NUM; i++)
{
mEventHandler->FeedKeyEvent( keyEvent );
}
-void Adaptor::ReplaceSurface( Any nativeWindow, RenderSurface& surface )
+void Adaptor::ReplaceSurface( Any nativeWindow, RenderSurface& newSurface )
{
- PositionSize positionSize = surface.GetPositionSize();
+ PositionSize positionSize = newSurface.GetPositionSize();
- // let the core know the surface size has changed
+ // Let the core know the surface size has changed
mCore->SurfaceResized( positionSize.width, positionSize.height );
mResizedSignal.Emit( mAdaptor );
- mNativeWindow = nativeWindow;
- mSurface = &surface;
+ WindowPane newDefaultWindow;
+ newDefaultWindow.nativeWindow = nativeWindow;
+ newDefaultWindow.surface = &newSurface;
+
+ // Must delete the old Window first before replacing it with the new one
+ WindowPane oldDefaultWindow = mWindowFrame.front();
+ oldDefaultWindow.surface->DestroySurface();
- // flush the event queue to give the update-render thread chance
+ // Update WindowFrame
+ std::vector<WindowPane>::iterator iter = mWindowFrame.begin();
+ iter = mWindowFrame.insert( iter, newDefaultWindow );
+
+ // Flush the event queue to give the update-render thread chance
// to start processing messages for new camera setup etc as soon as possible
ProcessCoreEvents();
- // this method blocks until the render thread has completed the replace.
- mThreadController->ReplaceSurface(mSurface);
+ // This method blocks until the render thread has completed the replace.
+ mThreadController->ReplaceSurface( newDefaultWindow.surface );
}
RenderSurface& Adaptor::GetSurface() const
{
- return *mSurface;
+ WindowPane defaultWindow = mWindowFrame.front();
+ return *(defaultWindow.surface);
}
void Adaptor::ReleaseSurfaceLock()
{
- mSurface->ReleaseLock();
+ WindowPane defaultWindow = mWindowFrame.front();
+ defaultWindow.surface->ReleaseLock();
}
Dali::TtsPlayer Adaptor::GetTtsPlayer(Dali::TtsPlayer::Mode mode)
mThreadController->SetPreRenderCallback( callback );
}
+bool Adaptor::AddWindow( Dali::Window* childWindow, const std::string& childWindowName, const std::string& childWindowClassName, const bool& childWindowMode )
+{
+ // This is any Window that is not the main (default) one
+ WindowPane additionalWindow;
+ additionalWindow.instance = childWindow;
+ additionalWindow.window_name = childWindowName;
+ additionalWindow.class_name = childWindowClassName;
+ additionalWindow.window_mode = childWindowMode;
+
+ // Add the new Window to the Frame - the order is not important
+ mWindowFrame.push_back( additionalWindow );
+
+ Window& windowImpl = Dali::GetImplementation( *childWindow );
+ windowImpl.SetAdaptor( Get() );
+
+ return true;
+}
+
+bool Adaptor::RemoveWindow( Dali::Window* childWindow )
+{
+ for ( WindowFrames::iterator iter = mWindowFrame.begin(); iter != mWindowFrame.end(); ++iter )
+ {
+ if( iter->instance == childWindow )
+ {
+ mWindowFrame.erase( iter );
+ return true;
+ }
+ }
+
+ return false;
+}
+
+bool Adaptor::RemoveWindow( std::string childWindowName )
+{
+ for ( WindowFrames::iterator iter = mWindowFrame.begin(); iter != mWindowFrame.end(); ++iter )
+ {
+ if( iter->window_name == childWindowName )
+ {
+ mWindowFrame.erase( iter );
+ return true;
+ }
+ }
+
+ return false;
+}
+
Dali::Adaptor& Adaptor::Get()
{
DALI_ASSERT_ALWAYS( IsAvailable() && "Adaptor not instantiated" );
mVSyncMonitor->SetUseHardwareVSync( useHardware );
}
-EglFactory& Adaptor::GetEGLFactory() const
+Dali::DisplayConnection& Adaptor::GetDisplayConnectionInterface()
{
- DALI_ASSERT_DEBUG( mEglFactory && "EGL Factory not created" );
- return *mEglFactory;
+ DALI_ASSERT_DEBUG( mDisplayConnection && "Display connection not created" );
+ return *mDisplayConnection;
}
-EglFactoryInterface& Adaptor::GetEGLFactoryInterface() const
+GraphicsInterface& Adaptor::GetGraphicsInterface()
{
- return *mEglFactory;
-}
-
-Integration::GlAbstraction& Adaptor::GetGlAbstraction() const
-{
- DALI_ASSERT_DEBUG( mGLES && "GLImplementation not created" );
- return *mGLES;
+ DALI_ASSERT_DEBUG( mGraphics && "Graphics interface not created" );
+ return *mGraphics;
}
Dali::Integration::PlatformAbstraction& Adaptor::GetPlatformAbstractionInterface()
return *mPlatformAbstraction;
}
-Dali::Integration::GlAbstraction& Adaptor::GetGlesInterface()
-{
- return *mGLES;
-}
-
TriggerEventInterface& Adaptor::GetProcessCoreEventsTrigger()
{
return *mNotificationTrigger;
RenderSurface* Adaptor::GetRenderSurfaceInterface()
{
- return mSurface;
+ if( !mWindowFrame.empty())
+ {
+ WindowPane defaultWindow = mWindowFrame.front();
+ return defaultWindow.surface;
+ }
+ else
+ {
+ return nullptr;
+ }
}
VSyncMonitorInterface* Adaptor::GetVSyncMonitorInterface()
Any Adaptor::GetNativeWindowHandle()
{
- return mNativeWindow;
+ WindowPane defaultWindow = mWindowFrame.front();
+ return defaultWindow.nativeWindow;
}
Any Adaptor::GetGraphicsDisplay()
{
Any display;
- if( mEglFactory )
+ if (mGraphics)
{
- EglInterface* egl = mEglFactory->GetImplementation();
- if( egl )
- {
- auto eglImpl = static_cast<EglImplementation*>(egl);
- display = eglImpl->GetDisplay();
- }
+ auto eglGraphics = static_cast<EglGraphics *>( mGraphics ); // This interface is temporary until Core has been updated to match
+
+ EglImplementation& eglImpl = eglGraphics->GetEglImplementation();
+ display = eglImpl.GetDisplay();
}
+
return display;
}
void Adaptor::SurfaceResizePrepare( SurfaceSize surfaceSize )
{
- // let the core know the surface size has changed
+ // Let the core know the surface size has changed
mCore->SurfaceResized( surfaceSize.GetWidth(), surfaceSize.GetHeight() );
mResizedSignal.Emit( mAdaptor );
void Adaptor::SurfaceResizeComplete( SurfaceSize surfaceSize )
{
- // flush the event queue to give the update-render thread chance
+ // Flush the event queue to give the update-render thread chance
// to start processing messages for new camera setup etc as soon as possible
ProcessCoreEvents();
// Start thread controller after the scene has been created
mThreadController->Start();
- // process after surface is created (registering to remote surface provider if required)
+ // Process after surface is created (registering to remote surface provider if required)
SurfaceInitialized();
mState = RUNNING;
void Adaptor::IndicatorSizeChanged(int height)
{
- // let the core know the indicator height is changed
+ // Let the core know the indicator height is changed
mCore->SetTopMargin(height);
}
mLanguageChangedSignal(),
mAdaptor( adaptor ),
mState( READY ),
- mCore( NULL ),
- mThreadController( NULL ),
- mVSyncMonitor( NULL ),
- mGLES( NULL ),
- mGlSync( NULL ),
- mEglFactory( NULL ),
- mNativeWindow( nativeWindow ),
- mSurface( surface ),
- mPlatformAbstraction( NULL ),
- mEventHandler( NULL ),
- mCallbackManager( NULL ),
+ mCore( nullptr ),
+ mThreadController( nullptr ),
+ mVSyncMonitor( nullptr ),
+ mDisplayConnection( nullptr ),
+ mPlatformAbstraction( nullptr ),
+ mEventHandler( nullptr ),
+ mCallbackManager( nullptr ),
mNotificationOnIdleInstalled( false ),
- mNotificationTrigger( NULL ),
- mGestureManager( NULL ),
+ mNotificationTrigger( nullptr ),
+ mGestureManager( nullptr ),
mDaliFeedbackPlugin(),
- mFeedbackController( NULL ),
+ mFeedbackController( nullptr ),
mTtsPlayers(),
mObservers(),
mDragAndDropDetector(),
- mDeferredRotationObserver( NULL ),
+ mDeferredRotationObserver( nullptr ),
mEnvironmentOptions( environmentOptions ? environmentOptions : new EnvironmentOptions /* Create the options if not provided */),
- mPerformanceInterface( NULL ),
+ mPerformanceInterface( nullptr ),
mKernelTracer(),
mSystemTracer(),
mTriggerEventFactory(),
- mObjectProfiler( NULL ),
+ mObjectProfiler( nullptr ),
mSocketFactory(),
mEnvironmentOptionsOwned( environmentOptions ? false : true /* If not provided then we own the object */ ),
mUseRemoteSurface( false )
{
DALI_ASSERT_ALWAYS( !IsAvailable() && "Cannot create more than one Adaptor per thread" );
+
+ WindowPane defaultWindow;
+ defaultWindow.nativeWindow = nativeWindow;
+ defaultWindow.surface = surface;
+
+ std::vector<WindowPane>::iterator iter = mWindowFrame.begin();
+ iter = mWindowFrame.insert( iter, defaultWindow );
+
gThreadLocalAdaptor = this;
}
void Adaptor::SetViewMode( ViewMode viewMode )
{
- mSurface->SetViewMode( viewMode );
+ WindowPane defaultWindow = mWindowFrame.front();
+ defaultWindow.surface->SetViewMode( viewMode );
+
mCore->SetViewMode( viewMode );
}
-#ifndef __DALI_INTERNAL_ADAPTOR_IMPL_H__
-#define __DALI_INTERNAL_ADAPTOR_IMPL_H__
+#ifndef DALI_INTERNAL_ADAPTOR_IMPL_H
+#define DALI_INTERNAL_ADAPTOR_IMPL_H
/*
* Copyright (c) 2018 Samsung Electronics Co., Ltd.
#include <dali/public-api/adaptor-framework/tts-player.h>
#include <dali/devel-api/adaptor-framework/clipboard.h>
+#include <dali/internal/graphics/common/graphics-interface.h>
+
#include <dali/internal/legacy/common/tizen-platform-abstraction.h>
#include <dali/internal/adaptor/common/adaptor-internal-services.h>
#include <dali/internal/system/common/environment-options.h>
#include <dali/integration-api/trigger-event-factory.h>
#include <dali/internal/network/common/socket-factory.h>
+
namespace Dali
{
namespace Adaptor
{
+class DisplayConnection;
+class GraphicsFactory;
class EventHandler;
-class EglFactory;
class GestureManager;
class GlImplementation;
class GlSyncImplementation;
* @param[in] configuration The context loss configuration ( to choose resource discard policy )
* @param[in] environmentOptions A pointer to the environment options. If NULL then one is created.
*/
- static Dali::Adaptor* New( Dali::Window window, Dali::Configuration::ContextLoss configuration, EnvironmentOptions* environmentOptions );
+ static Dali::Adaptor* New( Dali::Window window,
+ Dali::Configuration::ContextLoss configuration,
+ EnvironmentOptions* environmentOptions );
+
+ /**
+ * Creates a New Adaptor
+ * @param[in] graphicsFactory A factory that creates the graphics interface
+ * @param[in] nativeWindow Native window handle
+ * @param[in] surface A render surface can be one of the following
+ * - Pixmap, adaptor will use existing Pixmap to draw on to
+ * - Window, adaptor will use existing Window to draw on to
+ * @param[in] configuration The context loss configuration ( to choose resource discard policy )
+ * @param[in] environmentOptions A pointer to the environment options. If NULL then one is created.
+ */
+ static Dali::Adaptor* New( GraphicsFactory& graphicsFactory,
+ Any nativeWindow,
+ RenderSurface* surface,
+ Dali::Configuration::ContextLoss configuration,
+ EnvironmentOptions* environmentOptions );
+
+ /**
+ * Creates a New Adaptor
+ * @param[in] graphicsFactory A factory that creates the graphics interface
+ * @param[in] nativeWindow native window handle
+ * @param[in] configuration The context loss configuration ( to choose resource discard policy )
+ * @param[in] environmentOptions A pointer to the environment options. If NULL then one is created.
+ */
+ static Dali::Adaptor* New( GraphicsFactory& graphicsFactory,
+ Dali::Window window,
+ Dali::Configuration::ContextLoss configuration,
+ EnvironmentOptions* environmentOptions );
/**
* 2-step initialisation, this should be called after creating an adaptor instance.
+ * @param[in] graphicsFactory A factory that creates the graphics interface
+ * @param[in] configuration The context loss configuration ( to choose resource discard policy )
*/
- void Initialize(Dali::Configuration::ContextLoss configuration);
+ void Initialize( GraphicsFactory& graphicsFactory, Dali::Configuration::ContextLoss configuration );
/**
* Virtual destructor.
virtual bool AddIdle( CallbackBase* callback, bool hasReturnValue, bool forceAdd );
/**
+ * Adds a new Window instance to the Adaptor
+ * @param[in] childWindow The child window instance
+ * @param[in] childWindowName The child window title/name
+ * @param[in] childWindowClassName The class name that the child window belongs to
+ * @param[in] childWindowMode The mode of the child window
+ */
+ virtual bool AddWindow( Dali::Window* childWindow,
+ const std::string& childWindowName,
+ const std::string& childWindowClassName,
+ const bool& childWindowMode );
+
+ /**
+ * Removes an existing Window instance from the Adaptor
+ * @param[in] window The Window instance
+ */
+ virtual bool RemoveWindow( Dali::Window* childWindow );
+
+ /**
+ * Removes an existing Window instance from the Adaptor
+ * @param[in] windowName The Window name
+ * @note If two Windows have the same name, the first one that matches will be removed
+ */
+ virtual bool RemoveWindow( std::string childWindowName );
+
+ /**
* @copydoc Dali::Adaptor::RemoveIdle()
*/
virtual void RemoveIdle( CallbackBase* callback );
void SetUseHardwareVSync(bool useHardware);
/**
- * @return reference to EglFactory class
- */
- EglFactory& GetEGLFactory() const;
-
- /**
- * Return GlAbstraction.
- * @return the GlAbstraction.
- */
- Integration::GlAbstraction& GetGlAbstraction() const;
-
- /**
* Return the PlatformAbstraction.
* @return The PlatformAbstraction.
*/
void SetRotationObserver( RotationObserver* observer );
/**
- * Destroy the TtsPlayer of sepcific mode.
+ * Destroy the TtsPlayer of specific mode.
* @param[in] mode The mode of TtsPlayer to destroy
*/
void DestroyTtsPlayer(Dali::TtsPlayer::Mode mode);
Any GetGraphicsDisplay();
/**
- * Sets use remote surface for eglSurface output
+ * Sets use remote surface for Surface output
* @param[in] useRemoteSurface True if the remote surface is used
*/
void SetUseRemoteSurface(bool useRemoteSurface);
virtual Dali::Integration::PlatformAbstraction& GetPlatformAbstractionInterface();
/**
- * @copydoc Dali::Internal::Adaptor::AdaptorInternalServices::GetGlesInterface()
+ * @copydoc Dali::Internal::Adaptor::AdaptorInternalServices::GetDisplayConnectionInterface()
*/
- virtual Dali::Integration::GlAbstraction& GetGlesInterface();
+ virtual Dali::DisplayConnection& GetDisplayConnectionInterface();
/**
- * @copydoc Dali::Internal::Adaptor::AdaptorInternalServices::GetEGLFactoryInterface()
- */
- virtual EglFactoryInterface& GetEGLFactoryInterface() const;
+ * @copydoc Dali::Internal::Adaptor::AdaptorInternalServices::GetGraphicsInterface()
+ */
+ virtual GraphicsInterface& GetGraphicsInterface();
/**
* @copydoc Dali::Internal::Adaptor::AdaptorInternalServices::GetTriggerEventInterface()
private:
// Undefined
- Adaptor(const Adaptor&);
- Adaptor& operator=(Adaptor&);
+ Adaptor(const Adaptor&) = delete;
+ Adaptor& operator=(Adaptor&) = delete;
private:
STOPPED, ///< Adaptor has been stopped.
};
+ // A structure to encapsulate each Window instance for the Adaptor to track them
+ typedef struct WindowPane
+ {
+ Dali::Window* instance; ///< Window object
+ std::string window_name; ///< Name (title)_of the window
+ std::string class_name; ///< Class name that the window belongs to
+ bool window_mode; ///< Display mode of the window
+ Any nativeWindow; ///< window identifier
+ RenderSurface* surface; ///< The surface the Window is bound to
+ } WindowPane;
+
+ typedef std::vector<WindowPane> WindowFrames;
+
typedef std::vector<LifeCycleObserver*> ObserverContainer;
private: // Data
Dali::Integration::Core* mCore; ///< Dali Core
ThreadController* mThreadController; ///< Controls the threads
VSyncMonitor* mVSyncMonitor; ///< Monitors VSync events
- GlImplementation* mGLES; ///< GL implementation
- GlSyncImplementation* mGlSync; ///< GL Sync implementation
- EglFactory* mEglFactory; ///< EGL Factory
- Any mNativeWindow; ///< window identifier
- RenderSurface* mSurface; ///< Current surface
+ GraphicsInterface* mGraphics; ///< Graphics interface
+ Dali::DisplayConnection* mDisplayConnection; ///< Display connection
+ WindowFrames mWindowFrame; ///< A container of all the Windows that are currently created
+
TizenPlatform::TizenPlatformAbstraction* mPlatformAbstraction; ///< Platform abstraction
EventHandler* mEventHandler; ///< event handler
SocketFactory mSocketFactory; ///< Socket factory
const bool mEnvironmentOptionsOwned:1; ///< Whether we own the EnvironmentOptions (and thus, need to delete it)
bool mUseRemoteSurface; ///< whether the remoteSurface is used or not
+
public:
- inline static Adaptor& GetImplementation(Dali::Adaptor& adaptor) {return *adaptor.mImpl;}
+ inline static Adaptor& GetImplementation(Dali::Adaptor& adaptor) { return *adaptor.mImpl; }
};
} // namespace Internal
} // namespace Dali
-#endif // __DALI_INTERNAL_ADAPTOR_IMPL_H__
+#endif // DALI_INTERNAL_ADAPTOR_IMPL_H
-#ifndef __DALI_INTERNAL_ADAPTOR_INTERNAL_SERVICES_H__
-#define __DALI_INTERNAL_ADAPTOR_INTERNAL_SERVICES_H__
+#ifndef DALI_INTERNAL_ADAPTOR_INTERNAL_SERVICES_H
+#define DALI_INTERNAL_ADAPTOR_INTERNAL_SERVICES_H
/*
* Copyright (c) 2014 Samsung Electronics Co., Ltd.
// INTERNAL INCLUDES
#include <dali/integration-api/trigger-event-interface.h>
#include <dali/integration-api/trigger-event-factory-interface.h>
+#include <dali/internal/window-system/common/display-connection.h>
+#include <dali/internal/graphics/common/graphics-interface.h>
#include <dali/internal/graphics/gles20/egl-factory-interface.h>
#include <dali/internal/network/common/socket-factory-interface.h>
#include <dali/internal/system/common/performance-interface.h>
/**
* @return platform abstraction
*/
- virtual Dali::Integration::PlatformAbstraction& GetPlatformAbstractionInterface() = 0;
+ virtual Dali::Integration::PlatformAbstraction& GetPlatformAbstractionInterface() = 0;
/**
- * @return gles abstraction
+ * Used to access the Display Connection interface from the Render thread
+ * @return the Display Connection interface
*/
- virtual Dali::Integration::GlAbstraction& GetGlesInterface() = 0;
+ virtual Dali::DisplayConnection& GetDisplayConnectionInterface() = 0;
/**
- * @return egl factory
+ * Used to access the abstracted graphics interface
+ * This also contains the depth and stencil buffers
+ * @return the graphics interface
*/
- virtual EglFactoryInterface& GetEGLFactoryInterface() const = 0;
+ virtual GraphicsInterface& GetGraphicsInterface() = 0;
/**
* Used by update-thread to notify core (main-thread) it has messages to process
* @return trigger event ProcessCoreEvents
*/
- virtual TriggerEventInterface& GetProcessCoreEventsTrigger() = 0;
+ virtual TriggerEventInterface& GetProcessCoreEventsTrigger() = 0;
/**
* @return trigger event factory interface
/**
* @return render surface
*/
- virtual RenderSurface* GetRenderSurfaceInterface() = 0;
+ virtual RenderSurface* GetRenderSurfaceInterface() = 0;
/**
* @return vsync monitor interface
*/
- virtual VSyncMonitorInterface* GetVSyncMonitorInterface() = 0;
+ virtual VSyncMonitorInterface* GetVSyncMonitorInterface() = 0;
/**
* @return performance interface
*/
- virtual PerformanceInterface* GetPerformanceInterface() = 0;
+ virtual PerformanceInterface* GetPerformanceInterface() = 0;
/**
* @return interface for logging to the kernel ( e.g. using ftrace )
*/
- virtual TraceInterface& GetKernelTraceInterface() = 0;
+ virtual TraceInterface& GetKernelTraceInterface() = 0;
/**
* @return system trace interface, e.g. for using Tizen Trace (ttrace) or Android Trace (atrace)
*/
- virtual TraceInterface& GetSystemTraceInterface() = 0;
+ virtual TraceInterface& GetSystemTraceInterface() = 0;
protected:
};
// Undefined copy constructor.
- AdaptorInternalServices( const AdaptorInternalServices& );
+ AdaptorInternalServices( const AdaptorInternalServices& ) = delete;
// Undefined assignment operator.
- AdaptorInternalServices& operator=( const AdaptorInternalServices& );
+ AdaptorInternalServices& operator=( const AdaptorInternalServices& ) = delete;
};
} // namespace Internal
} // namespace Dali
-#endif // __DALI_INTERNAL_ADAPTOR_INTERNAL_SERVICES_H__
+#endif // DALI_INTERNAL_ADAPTOR_INTERNAL_SERVICES_H
// INTERNAL INCLUDES
#include <dali/devel-api/adaptor-framework/style-monitor.h>
#include <dali/internal/system/common/command-line-options.h>
-#include <dali/internal/adaptor/common/adaptor-impl.h>
#include <dali/internal/adaptor/common/framework.h>
#include <dali/internal/system/common/singleton-service-impl.h>
#include <dali/internal/adaptor/common/lifecycle-controller-impl.h>
mRegionChangedSignal(),
mBatteryLowSignal(),
mMemoryLowSignal(),
- mEventLoop( NULL ),
- mFramework( NULL ),
+ mEventLoop( nullptr ),
+ mFramework( nullptr ),
mContextLossConfiguration( Configuration::APPLICATION_DOES_NOT_HANDLE_CONTEXT_LOSS ),
- mCommandLineOptions( NULL ),
+ mCommandLineOptions( nullptr ),
mSingletonService( SingletonService::New() ),
- mAdaptor( NULL ),
- mWindow(),
- mWindowMode( windowMode ),
- mName(),
+ mAdaptorBuilder( nullptr ),
+ mAdaptor( nullptr ),
+ mMainWindow(),
+ mMainWindowMode( windowMode ),
+ mMainWindowName(),
mStylesheet( stylesheet ),
mEnvironmentOptions(),
mWindowPositionSize( positionSize ),
mSlotDelegate( this )
{
// Get mName from environment options
- mName = mEnvironmentOptions.GetWindowName();
- if( mName.empty() && argc && ( *argc > 0 ) )
+ mMainWindowName = mEnvironmentOptions.GetWindowName();
+ if( mMainWindowName.empty() && argc && ( *argc > 0 ) )
{
// Set mName from command-line args if environment option not set
- mName = (*argv)[0];
+ mMainWindowName = (*argv)[0];
}
mCommandLineOptions = new CommandLineOptions(argc, argv);
{
mSingletonService.UnregisterAll();
- mWindow.Reset();
+ mMainWindow.Reset();
delete mAdaptor;
+ delete mAdaptorBuilder;
delete mCommandLineOptions;
delete mFramework;
}
}
const std::string& windowClassName = mEnvironmentOptions.GetWindowClassName();
- mWindow = Dali::Window::New( mWindowPositionSize, mName, windowClassName, mWindowMode == Dali::Application::TRANSPARENT );
+ mMainWindow = Dali::Window::New( mWindowPositionSize, mMainWindowName, windowClassName, mMainWindowMode == Dali::Application::TRANSPARENT );
int indicatorVisibleMode = mEnvironmentOptions.GetIndicatorVisibleMode();
if( indicatorVisibleMode >= Dali::Window::INVISIBLE && indicatorVisibleMode <= Dali::Window::AUTO )
{
- GetImplementation( mWindow ).SetIndicatorVisibleMode( static_cast< Dali::Window::IndicatorVisibleMode >( indicatorVisibleMode ) );
+ GetImplementation( mMainWindow ).SetIndicatorVisibleMode( static_cast< Dali::Window::IndicatorVisibleMode >( indicatorVisibleMode ) );
}
// Quit the application when the window is closed
- GetImplementation( mWindow ).DeleteRequestSignal().Connect( mSlotDelegate, &Application::Quit );
+ GetImplementation( mMainWindow ).DeleteRequestSignal().Connect( mSlotDelegate, &Application::Quit );
}
void Application::CreateAdaptor()
{
- DALI_ASSERT_ALWAYS( mWindow && "Window required to create adaptor" );
+ DALI_ASSERT_ALWAYS( mMainWindow && "Window required to create adaptor" );
- mAdaptor = Dali::Internal::Adaptor::Adaptor::New( mWindow, mContextLossConfiguration, &mEnvironmentOptions );
+ auto graphicsFactory = mAdaptorBuilder->GetGraphicsFactory();
+
+ mAdaptor = Dali::Internal::Adaptor::Adaptor::New( graphicsFactory, mMainWindow, mContextLossConfiguration, &mEnvironmentOptions );
mAdaptor->ResizedSignal().Connect( mSlotDelegate, &Application::OnResize );
Internal::Adaptor::Adaptor::GetImplementation( *mAdaptor ).SetUseRemoteSurface( mUseRemoteSurface );
}
+void Application::CreateAdaptorBuilder()
+{
+ mAdaptorBuilder = new AdaptorBuilder();
+}
+
void Application::MainLoop(Dali::Configuration::ContextLoss configuration)
{
mContextLossConfiguration = configuration;
void Application::Lower()
{
// Lower the application without quitting it.
- mWindow.Lower();
+ mMainWindow.Lower();
}
void Application::Quit()
void Application::DoInit()
{
+ CreateAdaptorBuilder();
+
// If an application was pre-initialized, a window was made in advance
if( mLaunchpadState == Launchpad::NONE )
{
mAdaptor->Stop();
}
- mWindow.Reset();
+ mMainWindow.Reset(); // This only resets (clears) the default Window
}
void Application::DoPause()
void Application::OnTerminate()
{
- // we've been told to quit by AppCore, ecore_x_destroy has been called, need to quit synchronously
+ // We've been told to quit by AppCore, ecore_x_destroy has been called, need to quit synchronously
// delete the window as ecore_x has been destroyed by AppCore
Dali::Application application(this);
Dali::Window Application::GetWindow()
{
- return mWindow;
+ return mMainWindow;
}
// Stereoscopy
return Internal::Adaptor::Adaptor::GetImplementation( *mAdaptor ).GetStereoBase();
}
-
void Application::ReplaceWindow( const PositionSize& positionSize, const std::string& name )
{
- Dali::Window newWindow = Dali::Window::New( positionSize, name, mWindowMode == Dali::Application::TRANSPARENT );
+ Dali::Window newWindow = Dali::Window::New( positionSize, name, mMainWindowMode == Dali::Application::TRANSPARENT );
Window& windowImpl = GetImplementation(newWindow);
windowImpl.SetAdaptor(*mAdaptor);
Any nativeWindow = newWindow.GetNativeHandle();
Internal::Adaptor::Adaptor::GetImplementation( *mAdaptor ).ReplaceSurface(nativeWindow, *renderSurface);
- mWindow = newWindow;
+ mMainWindow = newWindow;
mWindowPositionSize = positionSize;
}
mStylesheet = stylesheet;
}
-
ApplicationPtr Application::GetPreInitializedApplication()
{
return gPreInitializedApplication;
-#ifndef __DALI_INTERNAL_APPLICATION_H__
-#define __DALI_INTERNAL_APPLICATION_H__
+#ifndef DALI_INTERNAL_APPLICATION_H
+#define DALI_INTERNAL_APPLICATION_H
/*
* Copyright (c) 2018 Samsung Electronics Co., Ltd.
#include <dali/internal/adaptor/common/framework.h>
#include <dali/internal/window-system/common/window-impl.h>
#include <dali/internal/system/common/environment-options.h>
+#include <dali/internal/adaptor/common/adaptor-builder-impl.h>
namespace Dali
{
void CreateAdaptor();
/**
+ * Creates the adaptor builder
+ */
+ void CreateAdaptorBuilder();
+
+ /**
* Quits from the main loop
*/
void QuitFromMainLoop();
Dali::Configuration::ContextLoss mContextLossConfiguration;
CommandLineOptions* mCommandLineOptions;
- Dali::SingletonService mSingletonService;
- Dali::Adaptor* mAdaptor;
- Dali::Window mWindow;
- Dali::Application::WINDOW_MODE mWindowMode;
- std::string mName;
- std::string mStylesheet;
- EnvironmentOptions mEnvironmentOptions;
- PositionSize mWindowPositionSize;
- Launchpad::State mLaunchpadState;
- bool mUseRemoteSurface;
+ Dali::SingletonService mSingletonService;
+ Dali::Internal::Adaptor::AdaptorBuilder* mAdaptorBuilder; ///< The adaptor builder
+ Dali::Adaptor* mAdaptor;
+
+ // The Main Window is that window created by the Application during initial startup
+ // (previously this was the only window)
+ Dali::Window mMainWindow; ///< Main Window instance
+ Dali::Application::WINDOW_MODE mMainWindowMode; ///< Window mode of the main window
+ std::string mMainWindowName; ///< Name of the main window as obtained from environment options
+
+ std::string mStylesheet;
+ EnvironmentOptions mEnvironmentOptions;
+ PositionSize mWindowPositionSize;
+ Launchpad::State mLaunchpadState;
+ bool mUseRemoteSurface;
SlotDelegate< Application > mSlotDelegate;
inline const Application& GetImplementation(const Dali::Application& application)
{
- DALI_ASSERT_ALWAYS(application && "Timre handle is empty");
+ DALI_ASSERT_ALWAYS(application && "application handle is empty");
const BaseObject& handle = application.GetBaseObject();
} // namespace Dali
-#endif // __DALI_INTERNAL_APPLICATION_H__
+#endif // DALI_INTERNAL_APPLICATION_H
CombinedUpdateRenderController::CombinedUpdateRenderController( AdaptorInternalServices& adaptorInterfaces, const EnvironmentOptions& environmentOptions )
: mFpsTracker( environmentOptions ),
mUpdateStatusLogger( environmentOptions ),
- mRenderHelper( adaptorInterfaces ),
mEventThreadSemaphore(),
mUpdateRenderThreadWaitCondition(),
mAdaptorInterfaces( adaptorInterfaces ),
int error = pthread_create( mUpdateRenderThread, NULL, InternalUpdateRenderThreadEntryFunc, this );
DALI_ASSERT_ALWAYS( !error && "Return code from pthread_create() when creating UpdateRenderThread" );
- // The Update/Render thread will now run and initialise EGL etc. and will then wait for Start to be called
+ // The Update/Render thread will now run and initialise the graphics interface etc. and will then wait for Start to be called
// When this function returns, the application initialisation on the event thread should occur
}
sem_wait( &mEventThreadSemaphore );
}
- mRenderHelper.Start();
+ RenderSurface* currentSurface = mAdaptorInterfaces.GetRenderSurfaceInterface();
+ if( currentSurface )
+ {
+ currentSurface->StartRender();
+ }
mRunning = TRUE;
LOG_EVENT_TRACE;
// Stop Rendering and the Update/Render Thread
- mRenderHelper.Stop();
+ RenderSurface* currentSurface = mAdaptorInterfaces.GetRenderSurfaceInterface();
+ if( currentSurface )
+ {
+ currentSurface->StopRender();
+ }
StopUpdateRenderThread();
LOG_UPDATE_RENDER( "THREAD CREATED" );
- mRenderHelper.InitializeEgl();
+ RenderSurface* currentSurface = mAdaptorInterfaces.GetRenderSurfaceInterface();
+ if( currentSurface )
+ {
+ currentSurface->InitializeGraphics( mAdaptorInterfaces.GetGraphicsInterface(), mAdaptorInterfaces.GetDisplayConnectionInterface() );
+ }
- // tell core it has a context
+ // Tell core it has a context
mCore.ContextCreated();
NotifyThreadInitialised();
if( DALI_UNLIKELY( newSurface ) )
{
LOG_UPDATE_RENDER_TRACE_FMT( "Replacing Surface" );
- mRenderHelper.ReplaceSurface( newSurface );
+
+ // This is designed for replacing pixmap surfaces, but should work for window as well
+ // we need to delete the surface and renderable (pixmap / window)
+ // Then create a new pixmap/window and new surface
+ // If the new surface has a different display connection, then the context will be lost
+
+ mAdaptorInterfaces.GetDisplayConnectionInterface().Initialize();
+ newSurface->ReplaceGraphicsSurface();
SurfaceReplaced();
}
bool surfaceResized = ShouldSurfaceBeResized();
if( DALI_UNLIKELY( surfaceResized ) )
{
- // RenderHelper::ResizeSurface() should be called right after a viewport is changed.
if( updateStatus.SurfaceRectChanged() )
{
LOG_UPDATE_RENDER_TRACE_FMT( "Resizing Surface" );
- mRenderHelper.ResizeSurface();
SurfaceResized();
}
}
// RENDER
//////////////////////////////
- mRenderHelper.ConsumeEvents();
+ mAdaptorInterfaces.GetDisplayConnectionInterface().ConsumeEvents();
+
if( mPreRenderCallback != NULL )
{
bool keepCallback = CallbackBase::ExecuteReturn<bool>(*mPreRenderCallback);
mPreRenderCallback = NULL;
}
}
- mRenderHelper.PreRender();
+
+ RenderSurface* currentSurface = mAdaptorInterfaces.GetRenderSurfaceInterface();
+ if( currentSurface )
+ {
+ currentSurface->PreRender( mSurfaceResized );
+ }
Integration::RenderStatus renderStatus;
if( renderStatus.NeedsPostRender() )
{
- mRenderHelper.PostRender( isRenderingToFbo );
+ if( currentSurface )
+ {
+ currentSurface->PostRender( isRenderingToFbo, ( mNewSurface != NULL ), mSurfaceResized );
+ }
}
// Trigger event thread to request Update/Render thread to sleep if update not required
- if( ( Integration::KeepUpdating::NOT_REQUESTED == keepUpdatingStatus ) &&
- ! renderStatus.NeedsUpdate() )
+ if( ( Integration::KeepUpdating::NOT_REQUESTED == keepUpdatingStatus ) && !renderStatus.NeedsUpdate() )
{
mSleepTrigger->Trigger();
updateRequired = false;
// Inform core of context destruction & shutdown EGL
mCore.ContextDestroyed();
- mRenderHelper.ShutdownEgl();
+ if( currentSurface )
+ {
+ currentSurface->DestroySurface();
+ currentSurface = nullptr;
+ }
LOG_UPDATE_RENDER( "THREAD DESTROYED" );
-#ifndef __DALI_INTERNAL_COMBINED_UPDATE_RENDER_CONTROLLER_H__
-#define __DALI_INTERNAL_COMBINED_UPDATE_RENDER_CONTROLLER_H__
+#ifndef DALI_INTERNAL_COMBINED_UPDATE_RENDER_CONTROLLER_H
+#define DALI_INTERNAL_COMBINED_UPDATE_RENDER_CONTROLLER_H
/*
* Copyright (c) 2018 Samsung Electronics Co., Ltd.
#include <dali/integration-api/thread-synchronization-interface.h>
#include <dali/internal/system/common/performance-interface.h>
#include <dali/internal/system/common/fps-tracker.h>
-#include <dali/internal/graphics/common/render-helper.h>
#include <dali/internal/adaptor/common/thread-controller-interface.h>
#include <dali/internal/system/common/update-status-logger.h>
+#include <dali/internal/window-system/common/display-connection.h>
+
namespace Dali
{
FpsTracker mFpsTracker; ///< Object that tracks the FPS
UpdateStatusLogger mUpdateStatusLogger; ///< Object that logs the update-status as required.
- RenderHelper mRenderHelper; ///< Helper class for EGL, pre & post rendering
-
sem_t mEventThreadSemaphore; ///< Used by the event thread to ensure all threads have been initialised, and when replacing the surface.
ConditionalWait mUpdateRenderThreadWaitCondition; ///< The wait condition for the update-render-thread.
volatile unsigned int mPostRendering; ///< Whether post-rendering is taking place (set by the event & render threads, read by the render-thread).
volatile unsigned int mSurfaceResized; ///< Will be set to resize the surface (set by the event-thread, read & cleared by the update-render thread).
- volatile unsigned int mForceClear; ///< Will be set to clear forcely
+ volatile unsigned int mForceClear; ///< Will be set to clear forcibly
};
} // namespace Adaptor
} // namespace Dali
-#endif // __DALI_INTERNAL_COMBINED_UPDATE_RENDER_CONTROLLER_H__
+#endif // DALI_INTERNAL_COMBINED_UPDATE_RENDER_CONTROLLER_H
${adaptor_adaptor_dir}/common/lifecycle-controller-impl.cpp \
${adaptor_adaptor_dir}/common/adaptor-impl.cpp \
${adaptor_adaptor_dir}/common/adaptor.cpp \
+ ${adaptor_adaptor_dir}/common/adaptor-builder-impl.cpp \
${adaptor_adaptor_dir}/common/application-impl.cpp \
${adaptor_adaptor_dir}/common/combined-update-render-controller.cpp
-# module: adaptor, backend: tizen
-adaptor_adaptor_tizen_src_files=\
- ${adaptor_adaptor_dir}/tizen/adaptor-impl-tizen.cpp \
- ${adaptor_adaptor_dir}/tizen/framework-tizen.cpp
+# module: adaptor, backend: tizen-wayland
+adaptor_adaptor_tizen_wayland_src_files=\
+ ${adaptor_adaptor_dir}/tizen-wayland/adaptor-impl-tizen.cpp \
+ ${adaptor_adaptor_dir}/tizen-wayland/framework-tizen.cpp
# module: adaptor, backend: tizen-wearable
adaptor_adaptor_tizen_wearable_src_files=\
- ${adaptor_adaptor_dir}/tizen-wearable/watch-application.cpp \
- ${adaptor_adaptor_dir}/tizen-wearable/watch-application-impl.cpp
+ ${adaptor_adaptor_dir}/tizen-wayland/tizen-wearable/watch-application.cpp \
+ ${adaptor_adaptor_dir}/tizen-wayland/tizen-wearable/watch-application-impl.cpp
# module: adaptor, backend: ubuntu
adaptor_adaptor_ubuntu_src_files=\
${adaptor_adaptor_dir}/ubuntu/adaptor-impl-ubuntu.cpp \
${adaptor_adaptor_dir}/ubuntu/framework-ubuntu.cpp
-# module: adaptor, backend: tizen-wayland
-adaptor_adaptor_tizen_wayland_src_files=\
- ${adaptor_adaptor_dir}/tizen-wayland/framework-ecore-wl.cpp
\ No newline at end of file
// Use strdup() in app_get_id(), so need to free memory
if( appId )
{
+ WindowPane defaultWindow = mWindowFrame.front();
#ifdef ECORE_WAYLAND2
- Ecore_Wl2_Window* ecoreWlWindow = AnyCast< Ecore_Wl2_Window* >( mNativeWindow );
+ Ecore_Wl2_Window* ecoreWlWindow = AnyCast< Ecore_Wl2_Window* >( defaultWindow.nativeWindow );
screen_connector_provider_remote_enable( appId, ecore_wl2_window_surface_get( ecoreWlWindow ) );
#else
- Ecore_Wl_Window* ecoreWlWindow = AnyCast< Ecore_Wl_Window* >( mNativeWindow );
+ Ecore_Wl_Window* ecoreWlWindow = AnyCast< Ecore_Wl_Window* >( defaultWindow.nativeWindow );
screen_connector_provider_remote_enable( appId, ecore_wl_window_surface_get( ecoreWlWindow ) );
#endif
free( appId );
+++ /dev/null
-/*
- * Copyright (c) 2014 Samsung Electronics Co., Ltd.
- *
- * Licensed under the Apache License, Version 2.0 (the "License");
- * you may not use this file except in compliance with the License.
- * You may obtain a copy of the License at
- *
- * http://www.apache.org/licenses/LICENSE-2.0
- *
- * Unless required by applicable law or agreed to in writing, software
- * distributed under the License is distributed on an "AS IS" BASIS,
- * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
- * See the License for the specific language governing permissions and
- * limitations under the License.
- *
- */
-
-// CLASS HEADER
-#include <dali/internal/adaptor/common/framework.h>
-
-namespace Dali
-{
-
-namespace Internal
-{
-
-namespace Adaptor
-{
-
-void Framework::InitThreads()
-{
-}
-
-} // namespace Adaptor
-
-} // namespace Internal
-
-} // namespace Dali
/*
- * Copyright (c) 2017 Samsung Electronics Co., Ltd.
+ * Copyright (c) 2018 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.
}
}
+void Framework::InitThreads()
+{
+}
+
void Framework::SetLanguage( const std::string& language )
{
mImpl->SetLanguage( language );
*/
// CLASS HEADER
-#include <dali/internal/adaptor/tizen-wearable/watch-application-impl.h>
+#include <dali/internal/adaptor/tizen-wayland/tizen-wearable/watch-application-impl.h>
namespace Dali
{
#include <dali/integration-api/debug.h>
// INTERNAL INCLUDES
-#include <dali/internal/adaptor/tizen-wearable/watch-application-impl.h>
+#include <dali/internal/adaptor/tizen-wayland/tizen-wearable/watch-application-impl.h>
namespace Dali
{
--- /dev/null
+#ifndef DALI_INTERNAL_BASE_GRAPHICS_FACTORY_INTERFACE_H
+#define DALI_INTERNAL_BASE_GRAPHICS_FACTORY_INTERFACE_H
+
+/*
+ * Copyright (c) 2018 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.
+ *
+ */
+
+// INTERNAL INCLUDES
+#include <dali/internal/system/common/environment-options.h>
+#include <dali/internal/graphics/common/graphics-interface.h>
+
+namespace Dali
+{
+class GraphicsInterface;
+
+namespace Internal
+{
+
+namespace Adaptor
+{
+
+/**
+ * Factory interface for creating Graphics Factory implementation
+ */
+class GraphicsFactoryInterface
+{
+public:
+ /**
+ * Create a Graphics interface implementation
+ * @return An implementation of the Graphics interface
+ */
+ virtual GraphicsInterface& Create() = 0;
+
+ /**
+ * Destroy the Graphics Factory implementation
+ */
+ virtual void Destroy() = 0;
+
+protected:
+ /**
+ * Virtual protected destructor - no deletion through this interface
+ */
+ virtual ~GraphicsFactoryInterface() {};
+};
+
+} // Adaptor
+
+} // Internal
+
+} // Dali
+
+#endif // DALI_INTERNAL_BASE_GRAPHICS_FACTORY_INTERFACE_H
--- /dev/null
+#ifndef DALI_INTERNAL_BASE_GRAPHICS_INTERFACE_H
+#define DALI_INTERNAL_BASE_GRAPHICS_INTERFACE_H
+
+/*
+ * Copyright (c) 2018 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.
+ *
+ */
+
+// INTERNAL INCLUDES
+#include <dali/internal/system/common/environment-options.h>
+#include <dali/integration-api/core-enumerations.h>
+
+namespace Dali
+{
+
+namespace Internal
+{
+
+namespace Adaptor
+{
+
+/**
+ * Factory interface for creating Graphics Factory implementation
+ */
+class GraphicsInterface
+{
+public:
+
+ /**
+ * Constructor
+ */
+ GraphicsInterface()
+: mDepthBufferRequired( Integration::DepthBufferAvailable::FALSE ),
+ mStencilBufferRequired( Integration::StencilBufferAvailable::FALSE )
+ {
+ };
+
+ /**
+ * Initialize the graphics interface
+ * @param[in] environmentOptions The environment options.
+ */
+ virtual void Initialize( EnvironmentOptions* environmentOptions ) = 0;
+
+ /**
+ * Destroy the Graphics Factory implementation
+ */
+ virtual void Destroy() = 0;
+
+ /**
+ * Get whether the depth buffer is required
+ * @return TRUE if the depth buffer is required
+ */
+ Integration::DepthBufferAvailable& GetDepthBufferRequired()
+ {
+ return mDepthBufferRequired;
+ };
+
+ /**
+ * Get whether the stencil buffer is required
+ * @return TRUE if the stencil buffer is required
+ */
+ Integration::StencilBufferAvailable GetStencilBufferRequired()
+ {
+ return mStencilBufferRequired;
+ };
+
+protected:
+ /**
+ * Virtual protected destructor - no deletion through this interface
+ */
+ virtual ~GraphicsInterface() {};
+
+
+protected:
+
+ Integration::DepthBufferAvailable mDepthBufferRequired; ///< Whether the depth buffer is required
+ Integration::StencilBufferAvailable mStencilBufferRequired; ///< Whether the stencil buffer is required
+};
+
+} // Adaptor
+
+} // Internal
+
+} // Dali
+
+#endif // DALI_INTERNAL_BASE_GRAPHICS_INTERFACE_H
+++ /dev/null
-/*
- * Copyright (c) 2017 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 <dali/internal/graphics/common/render-helper.h>
-
-// EXTERNAL INCLUDES
-#include <dali/integration-api/debug.h>
-
-// INTERNAL INCLUDES
-#include <dali/internal/adaptor/common/adaptor-internal-services.h>
-#include <dali/internal/window-system/common/display-connection.h>
-
-namespace Dali
-{
-
-namespace Internal
-{
-
-namespace Adaptor
-{
-
-RenderHelper::RenderHelper( AdaptorInternalServices& adaptorInterfaces )
-: mGLES( adaptorInterfaces.GetGlesInterface() ),
- mEglFactory( &adaptorInterfaces.GetEGLFactoryInterface()),
- mEGL( NULL ),
- mSurfaceReplaced( false ),
- mSurfaceResized( false )
-{
- // set the initial values before render thread starts
- mSurface = adaptorInterfaces.GetRenderSurfaceInterface();
-
- if( mSurface )
- {
- mDisplayConnection = Dali::DisplayConnection::New( mSurface->GetSurfaceType() );
- }
- else
- {
- mDisplayConnection = Dali::DisplayConnection::New();
- }
-}
-
-RenderHelper::~RenderHelper()
-{
- if (mDisplayConnection)
- {
- delete mDisplayConnection;
- mDisplayConnection = NULL;
- }
-
- mEglFactory->Destroy();
-}
-
-void RenderHelper::Start()
-{
- if( mSurface )
- {
- mSurface->StartRender();
- }
-}
-
-void RenderHelper::Stop()
-{
- if( mSurface )
- {
- // Tell surface we have stopped rendering
- mSurface->StopRender();
- }
-}
-
-void RenderHelper::ConsumeEvents()
-{
- mDisplayConnection->ConsumeEvents();
-}
-
-void RenderHelper::InitializeEgl()
-{
- mEGL = mEglFactory->Create();
-
- DALI_ASSERT_ALWAYS( mSurface && "NULL surface" );
-
- // Initialize EGL & OpenGL
- mDisplayConnection->InitializeEgl( *mEGL );
- mSurface->InitializeEgl( *mEGL );
-
- // create the OpenGL context
- mEGL->CreateContext();
-
- // create the OpenGL surface
- mSurface->CreateEglSurface(*mEGL);
-
- // Make it current
- mEGL->MakeContextCurrent();
-}
-
-void RenderHelper::ReplaceSurface( RenderSurface* newSurface )
-{
- if( mSurface )
- {
- mSurface->DestroyEglSurface(*mEGL);
- }
-
- // This is designed for replacing pixmap surfaces, but should work for window as well
- // we need to delete the egl surface and renderable (pixmap / window)
- // Then create a new pixmap/window and new egl surface
- // If the new surface has a different display connection, then the context will be lost
- DALI_ASSERT_ALWAYS(newSurface && "NULL surface");
-
- mDisplayConnection->InitializeEgl(*mEGL);
-
- newSurface->ReplaceEGLSurface(*mEGL);
-
- // use the new surface from now on
- mSurface = newSurface;
- mSurfaceReplaced = true;
-}
-
-void RenderHelper::ResizeSurface()
-{
- mSurfaceResized = true;
-}
-
-void RenderHelper::ShutdownEgl()
-{
- if( mSurface )
- {
- // give a chance to destroy the OpenGL surface that created externally
- mSurface->DestroyEglSurface( *mEGL );
-
- mSurface = NULL;
- }
-
- // delete the GL context / egl surface
- mEGL->TerminateGles();
-}
-
-bool RenderHelper::PreRender()
-{
- if( mSurface )
- {
- mSurface->PreRender( *mEGL, mGLES, mSurfaceResized );
- }
- mGLES.PreRender();
- return true;
-}
-
-void RenderHelper::PostRender( bool renderToFbo )
-{
- // Inform the gl implementation that rendering has finished before informing the surface
- mGLES.PostRender();
-
- if( renderToFbo )
- {
- mGLES.Flush();
- mGLES.Finish();
- }
- else
- {
- if( mSurface )
- {
- // Inform the surface that rendering this frame has finished.
- mSurface->PostRender( *mEGL, mGLES, mDisplayConnection, mSurfaceReplaced, mSurfaceResized );
- }
- }
- mSurfaceReplaced = false;
- mSurfaceResized = false;
-}
-
-} // namespace Adaptor
-
-} // namespace Internal
-
-} // namespace Dali
+++ /dev/null
-#ifndef DALI_INTERNAL_RENDER_HELPER_H
-#define DALI_INTERNAL_RENDER_HELPER_H
-
-/*
- * Copyright (c) 2017 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.
- *
- */
-
-// INTERNAL INCLUDES
-#include <dali/integration-api/egl-interface.h>
-#include <dali/integration-api/render-surface.h>
-
-namespace Dali
-{
-
-class RenderSurface;
-class DisplayConnection;
-
-namespace Integration
-{
-class GlAbstraction;
-}
-
-namespace Internal
-{
-namespace Adaptor
-{
-
-class AdaptorInternalServices;
-class EglFactoryInterface;
-
-/**
- * Helper class for EGL, surface, pre & post rendering
- */
-class RenderHelper
-{
-public:
-
- /**
- * Create a RenderHelper.
- * @param[in] adaptorInterfaces base adaptor interface
- */
- RenderHelper( AdaptorInternalServices& adaptorInterfaces );
-
- /**
- * Non-virtual Destructor
- */
- ~RenderHelper();
-
- /////////////////////////////////////////////////////////////////////////////////////////////////
- // Called on the Event Thread
- /////////////////////////////////////////////////////////////////////////////////////////////////
-
- /**
- * Sets up all render related objects to start rendering.
- */
- void Start();
-
- /**
- * Sets up all render related objects to stop rendering.
- */
- void Stop();
-
- /////////////////////////////////////////////////////////////////////////////////////////////////
- // Called on the Rendering Thread
- /////////////////////////////////////////////////////////////////////////////////////////////////
-
- /**
- * Consumes any pending events to avoid memory leaks
- *
- * @note Called from rendering thread
- */
- void ConsumeEvents();
-
- /**
- * Initializes EGL.
- *
- * @note Called from rendering thread
- */
- void InitializeEgl();
-
- /**
- * Replaces the rendering surface
- *
- * Used for replacing pixmaps due to resizing
- * @param newSurface to use
- *
- * @note Called from render thread
- */
- void ReplaceSurface( RenderSurface* newSurface );
-
- /**
- * Resize the rendering surface.
- *
- * @note Called from render thread
- */
- void ResizeSurface();
-
- /**
- * Shuts down EGL.
- *
- * @note Called from render thread
- */
- void ShutdownEgl();
-
- /**
- * Called before core renders the scene
- *
- * @return true if successful and Core::Render should be called.
- *
- * @note Called from render thread
- */
- bool PreRender();
-
- /**
- * Called after core has rendered the scene
- *
- * @note Called from render thread
- *
- * @param[in] renderToFbo Whether to render to a Frame Buffer Object.
- */
- void PostRender( bool renderToFbo );
-
-private:
-
- // Undefined
- RenderHelper( const RenderHelper& RenderHelper );
-
- // Undefined
- RenderHelper& operator=( const RenderHelper& RenderHelper );
-
-private: // Data
-
- Integration::GlAbstraction& mGLES; ///< GL abstraction reference
- EglFactoryInterface* mEglFactory; ///< Factory class to create EGL implementation
- EglInterface* mEGL; ///< Interface to EGL implementation
- RenderSurface* mSurface; ///< Current surface
- Dali::DisplayConnection* mDisplayConnection; ///< Display connection
- bool mSurfaceReplaced; ///< True when new surface has been initialized.
- bool mSurfaceResized; ///< True when the surface is resized.
-};
-
-} // namespace Adaptor
-
-} // namespace Internal
-
-} // namespace Dali
-
-#endif // DALI_INTERNAL_RENDER_HELPER_H
-# module: graphics, backend: common
-adaptor_graphics_common_src_files=\
- ${adaptor_graphics_dir}/common/render-helper.cpp
-
# module: graphics, backend: gles20
adaptor_graphics_gles20_src_files=\
${adaptor_graphics_dir}/gles20/egl-debug.cpp \
- ${adaptor_graphics_dir}/gles20/egl-factory.cpp \
${adaptor_graphics_dir}/gles20/egl-implementation.cpp \
${adaptor_graphics_dir}/gles20/egl-sync-implementation.cpp \
${adaptor_graphics_dir}/gles20/gl-extensions.cpp \
- ${adaptor_graphics_dir}/gles20/gl-proxy-implementation.cpp
+ ${adaptor_graphics_dir}/gles20/gl-proxy-implementation.cpp \
+ ${adaptor_graphics_dir}/gles20/egl-graphics-factory.cpp \
+ ${adaptor_graphics_dir}/gles20/egl-graphics.cpp
# module: graphics, backend: tizen
adaptor_graphics_tizen_src_files=\
${adaptor_graphics_dir}/tizen/egl-image-extensions-tizen.cpp \
${adaptor_graphics_dir}/tizen/vsync-monitor-tizen.cpp
-# module: graphics, backend: ubuntu-gl
-adaptor_graphics_ubuntu_gl_src_files=\
- ${adaptor_graphics_dir}/ubuntu-gl/egl-image-extensions.cpp
-
# module: graphics, backend: ubuntu
adaptor_graphics_ubuntu_src_files=\
- ${adaptor_graphics_dir}/ubuntu/vsync-monitor-ubuntu.cpp
\ No newline at end of file
+ ${adaptor_graphics_dir}/ubuntu/egl-image-extensions-ubuntu.cpp \
+ ${adaptor_graphics_dir}/ubuntu/vsync-monitor-ubuntu.cpp
-#ifndef __DALI_INTERNAL_BASE_EGL_FACTORY_INTERFACE_H__
-#define __DALI_INTERNAL_BASE_EGL_FACTORY_INTERFACE_H__
+#ifndef DALI_INTERNAL_BASE_EGL_FACTORY_INTERFACE_H
+#define DALI_INTERNAL_BASE_EGL_FACTORY_INTERFACE_H
/*
* Copyright (c) 2014 Samsung Electronics Co., Ltd.
} // Internal
} // Dali
-#endif // __DALI_INTERNAL_BASE_EGL_FACTORY_INTERFACE_H__
+#endif // DALI_INTERNAL_BASE_EGL_FACTORY_INTERFACE_H
+++ /dev/null
-/*
- * Copyright (c) 2017 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 <dali/internal/graphics/gles20/egl-factory.h>
-
-// INTERNAL INCLUDES
-#include <dali/internal/graphics/gles20/egl-implementation.h>
-#include <dali/internal/graphics/common/egl-image-extensions.h>
-#include <dali/internal/graphics/gles20/egl-sync-implementation.h>
-
-namespace Dali
-{
-namespace Internal
-{
-namespace Adaptor
-{
-
-EglFactory::EglFactory( int multiSamplingLevel,
- Integration::DepthBufferAvailable depthBufferRequired,
- Integration::StencilBufferAvailable stencilBufferRequired )
-: mEglImplementation(NULL),
- mEglImageExtensions(NULL),
- mEglSync(new EglSyncImplementation), // Created early, as needed by Core constructor
- mMultiSamplingLevel( multiSamplingLevel ),
- mDepthBufferRequired( depthBufferRequired ),
- mStencilBufferRequired( stencilBufferRequired )
-{
-}
-
-EglFactory::~EglFactory()
-{
- // Ensure the EGL implementation is destroyed
- delete mEglImageExtensions;
- delete mEglImplementation;
- delete mEglSync;
-}
-
-EglInterface* EglFactory::Create()
-{
- // Created by RenderThread (After Core construction)
- mEglImplementation = new EglImplementation( mMultiSamplingLevel, mDepthBufferRequired, mStencilBufferRequired );
- mEglImageExtensions = new EglImageExtensions( mEglImplementation );
-
- mEglSync->Initialize(mEglImplementation); // The sync impl needs the EglDisplay
- return mEglImplementation;
-}
-
-void EglFactory::Destroy()
-{
- delete mEglImageExtensions;
- mEglImageExtensions = NULL;
- delete mEglImplementation;
- mEglImplementation = NULL;
-}
-
-EglInterface* EglFactory::GetImplementation()
-{
- return mEglImplementation;
-}
-
-EglImageExtensions* EglFactory::GetImageExtensions()
-{
- return mEglImageExtensions;
-}
-
-EglSyncImplementation* EglFactory::GetSyncImplementation()
-{
- return mEglSync;
-}
-
-} // Adaptor
-} // Internal
-} // Dali
+++ /dev/null
-#ifndef DALI_INTERNAL_ADAPTOR_EGL_FACTORY_IMPL_H
-#define DALI_INTERNAL_ADAPTOR_EGL_FACTORY_IMPL_H
-
-/*
- * Copyright (c) 2017 Samsung Electronics Co., Ltd.
- *
- * Licensed under the Apache License, Version 2.0 (the "License");
- * you may not use this file except in compliance with the License.
- * You may obtain a copy of the License at
- *
- * http://www.apache.org/licenses/LICENSE-2.0
- *
- * Unless required by applicable law or agreed to in writing, software
- * distributed under the License is distributed on an "AS IS" BASIS,
- * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
- * See the License for the specific language governing permissions and
- * limitations under the License.
- *
- */
-
-// EXTERNAL INCLUDES
-#include <dali/integration-api/core-enumerations.h>
-
-// INTERNAL INCLUDES
-#include <dali/internal/graphics/gles20/egl-factory-interface.h>
-
-namespace Dali
-{
-namespace Internal
-{
-namespace Adaptor
-{
-class EglImplementation;
-class EglImageExtensions;
-class EglSyncImplementation;
-
-class EglFactory : public EglFactoryInterface
-{
-public:
-
- /**
- * Constructor
- * @param[in] multiSamplingLevel The Multi-sampling level required
- * @param[in] depthBufferRequired Whether the depth buffer is required
- * @param[in] stencilBufferRequired Whether the stencil buffer is required
- */
- EglFactory( int multiSamplingLevel,
- Integration::DepthBufferAvailable depthBufferRequired,
- Integration::StencilBufferAvailable stencilBufferRequired );
-
- /**
- * Destructor
- */
- virtual ~EglFactory();
-
- /**
- * Create an EGL Implementation
- * @return[in] An implementation
- */
- EglInterface* Create();
-
- /**
- * Destroy the EGL Implementation
- */
- void Destroy();
-
- /**
- * Get an implementation if one has been created.
- * @return An implementation, or NULL if one has not yet been created.
- */
- EglInterface* GetImplementation();
-
- /**
- * Get the image extension
- */
- EglImageExtensions* GetImageExtensions();
-
- /**
- * Get the fence sync implementation
- * @return An implementation of fence sync
- */
- EglSyncImplementation* GetSyncImplementation();
-
-private:
- /** Undefined */
- EglFactory(const EglFactory& rhs);
- EglFactory& operator=(const EglFactory& rhs);
-
-private:
- EglImplementation* mEglImplementation;
- EglImageExtensions* mEglImageExtensions;
- EglSyncImplementation* mEglSync;
-
- int mMultiSamplingLevel;
- Integration::DepthBufferAvailable mDepthBufferRequired;
- Integration::StencilBufferAvailable mStencilBufferRequired;
-};
-
-} // namespace Adaptor
-} // namespace Internal
-} // namespace Dali
-
-#endif // DALI_INTERNAL_ADAPTOR_EGL_FACTORY_IMPL_H
/*
- * Copyright (c) 2014 Samsung Electronics Co., Ltd.
+ * Copyright (c) 2018 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.
*
*/
-// EXTERNAL INCLUDES
-#include <system_settings.h>
+
+// CLASS HEADER
+#include <dali/internal/graphics/gles20/egl-graphics-factory.h>
+#include <dali/internal/graphics/gles20/egl-graphics.h>
// INTERNAL INCLUDES
-#include <dali/internal/system/generic/system-settings.h>
namespace Dali
{
-
namespace Internal
{
-
namespace Adaptor
{
-int GetLongPressTime( int defaultTime )
+GraphicsFactory::GraphicsFactory()
{
- return defaultTime;
}
-int GetElmAccessActionOver()
+GraphicsFactory::~GraphicsFactory()
{
- return 0;
+ /* Deleted by Adaptor destructor */
}
-} // namespace Adaptor
+GraphicsInterface& GraphicsFactory::Create()
+{
+ GraphicsInterface* eglGraphicsInterface = new EglGraphics;
+ return *eglGraphicsInterface;
+}
-} // namespace Internal
+void GraphicsFactory::Destroy()
+{
+ /* Deleted by EglGraphics */
+}
-} // namespace Dali
+} // Adaptor
+} // Internal
+} // Dali
--- /dev/null
+#ifndef DALI_INTERNAL_GRAPHICS_FACTORY_H
+#define DALI_INTERNAL_GRAPHICS_FACTORY_H
+
+/*
+ * Copyright (c) 2018 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 <dali/internal/graphics/common/graphics-factory-interface.h>
+
+
+namespace Dali
+{
+
+namespace Internal
+{
+
+namespace Adaptor
+{
+
+class GraphicsFactory : public GraphicsFactoryInterface
+{
+public:
+
+ /**
+ * Constructor
+ */
+ GraphicsFactory();
+
+ /**
+ * Destructor
+ */
+ virtual ~GraphicsFactory();
+
+ /**
+ * @copydoc Dali::Internal::Adaptor::GraphicsFactoryInterface::Create()
+ */
+ GraphicsInterface& Create() override;
+
+ /**
+ * @copydoc Dali::Internal::Adaptor::GraphicsFactoryInterface::Destroy()
+ */
+ void Destroy();
+};
+
+} // Adaptor
+
+} // Internal
+
+} // Dali
+
+#endif // DALI_INTERNAL_GRAPHICS_FACTORY_H
--- /dev/null
+/*
+ * Copyright (c) 2018 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 <dali/internal/graphics/gles20/egl-graphics.h>
+
+// INTERNAL INCLUDES
+#include <dali/internal/window-system/common/display-utils.h> // For Utils::MakeUnique
+
+namespace Dali
+{
+namespace Internal
+{
+namespace Adaptor
+{
+
+EglGraphics::EglGraphics( )
+: mMultiSamplingLevel( 0 )
+{
+}
+
+EglGraphics::~EglGraphics()
+{
+}
+
+
+void EglGraphics::Initialize( EnvironmentOptions* environmentOptions )
+{
+ if( environmentOptions->GetGlesCallTime() > 0 )
+ {
+ mGLES = Utils::MakeUnique< GlProxyImplementation >( *environmentOptions );
+ }
+ else
+ {
+ mGLES.reset ( new GlImplementation() );
+ }
+
+ mDepthBufferRequired = static_cast< Integration::DepthBufferAvailable >( environmentOptions->DepthBufferRequired() );
+ mStencilBufferRequired = static_cast< Integration::StencilBufferAvailable >( environmentOptions->StencilBufferRequired() );
+
+ mMultiSamplingLevel = environmentOptions->GetMultiSamplingLevel();
+
+ mEglSync = Utils::MakeUnique< EglSyncImplementation >();
+}
+
+EglInterface* EglGraphics::Create()
+{
+ mEglImplementation = Utils::MakeUnique< EglImplementation >( mMultiSamplingLevel, mDepthBufferRequired, mStencilBufferRequired );
+ mEglImageExtensions = Utils::MakeUnique< EglImageExtensions >( mEglImplementation.get() );
+
+ mEglSync->Initialize( mEglImplementation.get() ); // The sync impl needs the EglDisplay
+
+ return mEglImplementation.get();
+}
+
+void EglGraphics::Destroy()
+{
+}
+
+//Dali::Integration::GlAbstraction& EglGraphics::GetGlesInterface()
+GlImplementation& EglGraphics::GetGlesInterface()
+{
+ return *mGLES;
+}
+
+Integration::GlAbstraction& EglGraphics::GetGlAbstraction() const
+{
+ DALI_ASSERT_DEBUG( mGLES && "GLImplementation not created" );
+ return *mGLES;
+}
+
+EglImplementation& EglGraphics::GetEglImplementation() const
+{
+ DALI_ASSERT_DEBUG( mEglImplementation && "EGLImplementation not created" );
+ return *mEglImplementation;
+}
+
+EglInterface& EglGraphics::GetEglInterface() const
+{
+ DALI_ASSERT_DEBUG( mEglImplementation && "EGLImplementation not created" );
+ EglInterface* eglInterface = mEglImplementation.get();
+ return *eglInterface;
+}
+
+EglSyncImplementation& EglGraphics::GetSyncImplementation()
+{
+ DALI_ASSERT_DEBUG( mEglSync && "EglSyncImplementation not created" );
+ return *mEglSync;
+}
+
+EglImageExtensions* EglGraphics::GetImageExtensions()
+{
+ DALI_ASSERT_DEBUG( mEglImageExtensions && "EglImageExtensions not created" );
+ return mEglImageExtensions.get();
+}
+
+} // Adaptor
+} // Internal
+} // Dali
--- /dev/null
+#ifndef DALI_INTERNAL_BASE_GRAPHICS_IMPLEMENTATION_H
+#define DALI_INTERNAL_BASE_GRAPHICS_IMPLEMENTATION_H
+
+/*
+ * Copyright (c) 2018 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 <dali/internal/graphics/common/graphics-interface.h>
+#include <dali/internal/graphics/gles20/gl-proxy-implementation.h>
+#include <dali/internal/graphics/gles20/gl-implementation.h>
+#include <dali/integration-api/egl-interface.h>
+
+#include <dali/internal/graphics/gles20/egl-implementation.h>
+#include <dali/internal/graphics/common/egl-image-extensions.h>
+#include <dali/internal/graphics/gles20/egl-sync-implementation.h>
+
+
+namespace Dali
+{
+
+namespace Internal
+{
+
+namespace Adaptor
+{
+
+class EglGraphics : public GraphicsInterface
+{
+public:
+
+ /**
+ * Constructor
+ */
+ EglGraphics();
+
+ /**
+ * Destructor
+ */
+ virtual ~EglGraphics();
+
+ /**
+ * @copydoc Dali::Internal::Adaptor::GraphicsInterface::Initialize()
+ */
+ void Initialize( EnvironmentOptions* environmentOptions ) override;
+
+ /**
+ * Creates the graphics interface for EGL
+ * @return The graphics interface for EGL
+ */
+ EglInterface* Create();
+
+ /**
+ * Gets the GL abstraction
+ * @return The GL abstraction
+ */
+ Integration::GlAbstraction& GetGlAbstraction() const;
+
+ /**
+ * Gets the implementation of EGL
+ * @return The implementation of EGL
+ */
+ EglImplementation& GetEglImplementation() const;
+
+ /**
+ * Gets the graphics interface for EGL
+ * @return The graphics interface for EGL
+ */
+ EglInterface& GetEglInterface() const;
+
+ /**
+ * @copydoc Dali::Integration::GlAbstraction& GetGlesInterface()
+ */
+ GlImplementation& GetGlesInterface();
+
+ /**
+ * Gets the implementation of GlSyncAbstraction for EGL.
+ * @return The implementation of GlSyncAbstraction for EGL.
+ */
+ EglSyncImplementation& GetSyncImplementation();
+
+ /**
+ * @copydoc Dali::Internal::Adaptor::GraphicsInterface::GetDepthBufferRequired()
+ */
+ Integration::DepthBufferAvailable& GetDepthBufferRequired();
+
+ /**
+ * @copydoc Dali::Internal::Adaptor::GraphicsInterface::GetStencilBufferRequired()
+ */
+ Integration::StencilBufferAvailable GetStencilBufferRequired();
+
+ /**
+ * Gets the EGL image extension
+ * @return The EGL image extension
+ */
+ EglImageExtensions* GetImageExtensions();
+
+ /**
+ * @copydoc Dali::Internal::Adaptor::GraphicsInterface::Destroy()
+ */
+ void Destroy() override;
+
+private:
+ // Eliminate copy and assigned operations
+ EglGraphics(const EglGraphics& rhs) = delete;
+ EglGraphics& operator=(const EglGraphics& rhs) = delete;
+
+
+private:
+ std::unique_ptr< GlImplementation > mGLES; ///< GL implementation
+ std::unique_ptr< EglImplementation > mEglImplementation; ///< EGL implementation
+ std::unique_ptr< EglImageExtensions > mEglImageExtensions; ///< EGL image extension
+ std::unique_ptr< EglSyncImplementation > mEglSync; ///< GlSyncAbstraction implementation for EGL
+
+ int mMultiSamplingLevel; ///< The multiple sampling level
+};
+
+} // namespace Adaptor
+
+} // namespace Internal
+
+} // namespace Dali
+
+#endif // __DALI_INTERNAL_BASE_GRAPHICS_IMPLEMENTATION_H__
Integration::Log::Filter* gLogFilter = Debug::Filter::New( Debug::Concise, false, "LOG_IMAGE_LOADING" );
#endif
+static unsigned int gMaxTextureSize = 4096;
/**
* Enum for file formats, has to be in sync with BITMAP_LOADER_LOOKUP_TABLE
return ImageDimensions( width, height );
}
+void SetMaxTextureSize( unsigned int size )
+{
+ gMaxTextureSize = size;
+}
+
+unsigned int GetMaxTextureSize()
+{
+ return gMaxTextureSize;
+}
+
} // ImageLoader
} // TizenPlatform
} // Dali
SamplingMode::Type samplingMode,
bool orientationCorrection );
+/**
+ * @brief Set the maximum texture size. Then size can be kwown by GL_MAX_TEXTURE_SIZE.
+ *
+ * @param [in] size The maximum texture size to set
+ */
+void SetMaxTextureSize( unsigned int size );
+
+/**
+ * @brief Get the maximum texture size.
+ *
+ * @return The maximum texture size
+ */
+unsigned int GetMaxTextureSize();
+
} // ImageLoader
} // TizenPlatform
} // Dali
// INTERNAL HEADERS
#include <dali/internal/graphics/gles20/gl-implementation.h>
+#include <dali/internal/graphics/gles20/egl-graphics.h>
namespace Dali
{
{
NativeBitmapBuffer::NativeBitmapBuffer( Adaptor* adaptor, unsigned int width, unsigned int height, Pixel::Format pFormat )
-: mWidth(width),
+: mGlAbstraction( nullptr),
+ mWidth(width),
mHeight(height),
mPixelFormat(pFormat),
mLastReadBuffer(NULL)
{
DALI_ASSERT_ALWAYS( adaptor );
mBuffer = new Integration::LocklessBuffer( width * height * Pixel::GetBytesPerPixel(pFormat) );
- mGlAbstraction = &(adaptor->GetGlAbstraction());
+
+ GraphicsInterface* graphics = &(adaptor->GetGraphicsInterface());
+ auto eglGraphics = static_cast<EglGraphics *>(graphics);
+ mGlAbstraction = &(eglGraphics->GetGlAbstraction());
}
NativeBitmapBuffer::~NativeBitmapBuffer()
// INTERNAL HEADERS
#include <dali/internal/adaptor/common/adaptor-impl.h>
+#include <dali/internal/graphics/common/graphics-interface.h>
namespace Dali
{
// INTERNAL INCLUDES
#include <dali/internal/graphics/common/egl-image-extensions.h>
-#include <dali/internal/graphics/gles20/egl-factory.h>
+#include <dali/internal/graphics/gles20/egl-graphics.h>
#include <dali/internal/adaptor/common/adaptor-impl.h>
#include <dali/integration-api/render-surface.h>
mBlendingRequired( false ),
mColorDepth( depth ),
mEglImageKHR( NULL ),
+ mEglGraphics( NULL ),
mEglImageExtensions( NULL ),
mSetSource( false )
{
DALI_ASSERT_ALWAYS( Adaptor::IsAvailable() );
- EglFactory& eglFactory = Adaptor::GetImplementation( Adaptor::Get() ).GetEGLFactory();
- mEglImageExtensions = eglFactory.GetImageExtensions();
- DALI_ASSERT_DEBUG( mEglImageExtensions );
+
+ GraphicsInterface* graphics = &( Adaptor::GetImplementation( Adaptor::Get() ).GetGraphicsInterface() );
+ mEglGraphics = static_cast<EglGraphics *>(graphics);
mTbmSurface = GetSurfaceFromAny( nativeImageSource );
return false;
}
+ mEglImageExtensions = mEglGraphics->GetImageExtensions();
+ DALI_ASSERT_DEBUG( mEglImageExtensions );
+
mEglImageKHR = mEglImageExtensions->CreateImageKHR( eglBuffer );
return mEglImageKHR != NULL;
namespace Adaptor
{
+class EglGraphics;
class EglImageExtensions;
/**
bool mBlendingRequired; ///< Whether blending is required
Dali::NativeImageSource::ColorDepth mColorDepth; ///< color depth of image
void* mEglImageKHR; ///< From EGL extension
+ EglGraphics* mEglGraphics; ///< EGL Graphics
EglImageExtensions* mEglImageExtensions; ///< The EGL Image Extensions
bool mSetSource;
};
// INTERNAL INCLUDES
#include <dali/internal/graphics/common/egl-image-extensions.h>
-#include <dali/internal/graphics/gles20/egl-factory.h>
+#include <dali/internal/graphics/gles20/egl-graphics.h>
#include <dali/internal/adaptor/common/adaptor-impl.h>
namespace Dali
mTbmQueue( NULL ),
mConsumeSurface( NULL ),
mEglImages(),
+ mEglGraphics( NULL ),
mEglImageExtensions( NULL ),
mOwnTbmQueue( false ),
mBlendingRequired( false )
{
DALI_ASSERT_ALWAYS( Adaptor::IsAvailable() );
- EglFactory& eglFactory = Adaptor::GetImplementation( Adaptor::Get() ).GetEGLFactory();
- mEglImageExtensions = eglFactory.GetImageExtensions();
- DALI_ASSERT_DEBUG( mEglImageExtensions );
+
+ GraphicsInterface* graphics = &( Adaptor::GetImplementation( Adaptor::Get() ).GetGraphicsInterface() );
+ mEglGraphics = static_cast<EglGraphics *>(graphics);
mTbmQueue = GetSurfaceFromAny( nativeImageSourceQueue );
bool NativeImageSourceQueueTizen::GlExtensionCreate()
{
+ mEglImageExtensions = mEglGraphics->GetImageExtensions();
+ DALI_ASSERT_DEBUG( mEglImageExtensions );
+
return true;
}
{
tbm_surface_h oldSurface = mConsumeSurface;
- bool needToWait = ( mConsumeSurface == NULL ) ? true : false;
-
- if( tbm_surface_queue_can_acquire( mTbmQueue, needToWait ) )
+ if( tbm_surface_queue_can_acquire( mTbmQueue, 0 ) )
{
if( tbm_surface_queue_acquire( mTbmQueue, &mConsumeSurface ) != TBM_SURFACE_QUEUE_ERROR_NONE )
{
DALI_LOG_ERROR( "Failed to aquire a tbm_surface\n" );
return;
}
- }
- if( oldSurface && oldSurface != mConsumeSurface )
- {
- if( tbm_surface_internal_is_valid( oldSurface ) )
+ if( oldSurface )
{
- tbm_surface_queue_release( mTbmQueue, oldSurface );
+ if( tbm_surface_internal_is_valid( oldSurface ) )
+ {
+ tbm_surface_queue_release( mTbmQueue, oldSurface );
+ }
}
- }
- if( mConsumeSurface )
- {
- bool existing = false;
- for( auto&& iter : mEglImages )
+ if( mConsumeSurface )
{
- if( iter.first == mConsumeSurface )
+ bool existing = false;
+ for( auto&& iter : mEglImages )
{
- // Find the surface in the existing list
- existing = true;
- mEglImageExtensions->TargetTextureKHR( iter.second );
- break;
+ if( iter.first == mConsumeSurface )
+ {
+ // Find the surface in the existing list
+ existing = true;
+ mEglImageExtensions->TargetTextureKHR( iter.second );
+ break;
+ }
}
- }
- if( !existing )
- {
- // Push the surface
- tbm_surface_internal_ref( mConsumeSurface );
+ if( !existing )
+ {
+ // Push the surface
+ tbm_surface_internal_ref( mConsumeSurface );
- void* eglImageKHR = mEglImageExtensions->CreateImageKHR( reinterpret_cast< EGLClientBuffer >( mConsumeSurface ) );
- mEglImageExtensions->TargetTextureKHR( eglImageKHR );
+ void* eglImageKHR = mEglImageExtensions->CreateImageKHR( reinterpret_cast< EGLClientBuffer >( mConsumeSurface ) );
+ mEglImageExtensions->TargetTextureKHR( eglImageKHR );
- mEglImages.push_back( EglImagePair( mConsumeSurface, eglImageKHR) );
+ mEglImages.push_back( EglImagePair( mConsumeSurface, eglImageKHR) );
+ }
}
}
}
namespace Adaptor
{
+class EglGraphics;
class EglImageExtensions;
/**
tbm_surface_queue_h mTbmQueue; ///< Tbm surface queue handle
tbm_surface_h mConsumeSurface; ///< The current tbm surface
std::vector< EglImagePair > mEglImages; ///< EGL Image vector
+ EglGraphics* mEglGraphics; ///< EGL Graphics
EglImageExtensions* mEglImageExtensions; ///< The EGL Image Extensions
bool mOwnTbmQueue; ///< Whether we created tbm queue
bool mBlendingRequired; ///< Whether blending is required
// INTERNAL INCLUDES
#include <dali/internal/graphics/common/egl-image-extensions.h>
-#include <dali/internal/graphics/gles20/egl-factory.h>
+#include <dali/internal/graphics/gles20/egl-graphics.h>
#include <dali/internal/adaptor/common/adaptor-impl.h>
#include <dali/devel-api/adaptor-framework/bitmap-saver.h>
#include <dali/integration-api/render-surface.h>
+
namespace Dali
{
mEglImageExtensions( NULL )
{
DALI_ASSERT_ALWAYS( Adaptor::IsAvailable() );
- EglFactory& eglFactory = Adaptor::GetImplementation( Adaptor::Get() ).GetEGLFactory();
- mEglImageExtensions = eglFactory.GetImageExtensions();
+
+ GraphicsInterface* graphics = &( Adaptor::GetImplementation( Adaptor::Get() ).GetGraphicsInterface() );
+ auto eglGraphics = static_cast<EglGraphics *>(graphics);
+
+ mEglImageExtensions = eglGraphics->GetImageExtensions();
+
DALI_ASSERT_DEBUG( mEglImageExtensions );
// assign the pixmap
XImageJanitor xImageJanitor( XGetImage( displayConnection,
mPixmap,
0, 0, // x,y of subregion to extract.
- width, height, // of suregion to extract.
+ width, height, // of subregion to extract.
0xFFFFFFFF,
ZPixmap ) );
XImage* const pXImage = xImageJanitor.mXImage;
#include <Ecore_X.h>
// INTERNAL INCLUDES
+#include <dali/internal/graphics/common/graphics-interface.h>
+
#include <dali/public-api/adaptor-framework/native-image-source.h>
#include <dali/internal/imaging/common/native-image-source-impl.h>
/*
- * Copyright (c) 2014 Samsung Electronics Co., Ltd.
+ * Copyright (c) 2018 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.
#include <dali/integration-api/events/long-press-gesture-event.h>
#include <dali/integration-api/events/touch-event-integ.h>
-#include <dali/internal/system/generic/system-settings.h>
+#include <dali/internal/system/common/system-settings.h>
// INTERNAL INCLUDES
#include <dali/internal/system/common/core-event-interface.h>
${adaptor_input_dir}/tizen-wayland/key-mapping-ecore-wl.cpp \
${adaptor_input_dir}/tizen-wayland/virtual-keyboard-impl-ecore-wl.cpp
-# module: input, backend: ubuntu
-adaptor_input_ubuntu_src_files=\
- ${adaptor_input_dir}/ubuntu/key-mapping-ubuntu.cpp
-
# module: input, backend: ubuntu-x11
adaptor_input_ubuntu_x11_src_files=\
${adaptor_input_dir}/ubuntu-x11/input-method-context-factory-x.cpp \
${adaptor_input_dir}/ubuntu-x11/input-method-context-impl-x.cpp \
+ ${adaptor_input_dir}/ubuntu-x11/key-mapping-x.cpp \
${adaptor_input_dir}/ubuntu-x11/virtual-keyboard-impl-x.cpp
/*
- * Copyright (c) 2017 Samsung Electronics Co., Ltd.
+ * Copyright (c) 20187 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.
namespace Adaptor
{
-ObjectProfiler::ObjectProfiler( unsigned int timeInterval )
+ObjectProfiler::ObjectProfiler( uint32_t timeInterval )
{
// This class must be created after the Stage; this means it doesn't count the initial objects
// that are created by the stage (base layer, default camera actor)
{
for( auto&& element : mInstanceCountContainer )
{
- int memorySize = GetMemorySize( element.first, element.second );
+ std::size_t memorySize = GetMemorySize( element.first, element.second );
if( memorySize > 0 )
{
LogMessage( Debug::DebugInfo, "%-30s: % 4d Memory MemorySize: ~% 6.1f kB\n",
}
}
-int ObjectProfiler::GetMemorySize(const std::string& name, int count)
+std::size_t ObjectProfiler::GetMemorySize( const std::string& name, uint32_t count )
{
struct MemoryMemorySize
{
std::string name;
- int memorySize;
+ std::size_t memorySize;
};
MemoryMemorySize memoryMemorySizes[] =
{
#define __DALI_ADAPTOR_OBJECT_PROFILER_H__
/*
- * Copyright (c) 2017 Samsung Electronics Co., Ltd.
+ * Copyright (c) 2018 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.
*/
// EXTERNAL INCLUDES
+#include <cstdint> // uint32_t
+#include <cstddef> // size_t
#include <dali/public-api/common/vector-wrapper.h>
#include <dali/public-api/object/object-registry.h>
#include <dali/public-api/object/type-registry.h>
* Constructor
* @param timeInterval to specify the frequency of reporting
*/
- ObjectProfiler( unsigned int timeInterval );
+ ObjectProfiler( uint32_t timeInterval );
/**
* Destructor
* Callback used when objects are created. Increases instance count for that object type
* @param[in] handle of the created object
*/
- void OnObjectCreated(BaseHandle handle);
+ void OnObjectCreated( BaseHandle handle );
/**
* Callback used when objects are created. Decreases instance count for that object type
* @param[in] object The object being destroyed
*/
- void OnObjectDestroyed(const Dali::RefObject* object);
+ void OnObjectDestroyed( const Dali::RefObject* object );
/**
* Get the memory size of the given object
*/
- int GetMemorySize(const std::string& name, int count);
+ std::size_t GetMemorySize( const std::string& name, uint32_t count );
private:
- using InstanceCountPair = std::pair< const std::string, int >;
+ using InstanceCountPair = std::pair< const std::string, uint32_t >;
using InstanceTypePair = std::pair< BaseObject*, std::string >;
Dali::ObjectRegistry mObjectRegistry;
*/
#include <dali/public-api/signals/callback.h>
+// INTERNAL INCLUDES
+#include <dali/internal/window-system/common/display-connection.h>
+
namespace Dali
{
private:
// Undefined copy constructor.
- ThreadController( const ThreadController& );
+ ThreadController( const ThreadController& ) = delete;
// Undefined assignment operator.
- ThreadController& operator=( const ThreadController& );
+ ThreadController& operator=( const ThreadController& ) = delete;
private:
${adaptor_system_dir}/common/trigger-event-factory.cpp \
${adaptor_system_dir}/common/update-status-logger.cpp \
${adaptor_system_dir}/common/widget-application-impl.cpp \
- ${adaptor_system_dir}/common/logging.cpp \
- ${adaptor_system_dir}/common/callback-manager-ecore.cpp \
- ${adaptor_system_dir}/common/file-descriptor-monitor-ecore.cpp \
- ${adaptor_system_dir}/common/timer-impl-ecore.cpp
+ ${adaptor_system_dir}/common/logging.cpp
-# module: system, backend: generic
-adaptor_system_generic_src_files=\
- ${adaptor_system_dir}/generic/color-controller-impl.cpp \
- ${adaptor_system_dir}/generic/system-settings.cpp \
- ${adaptor_system_dir}/tizen/widget-application-impl-tizen.cpp \
- ${adaptor_system_dir}/tizen/widget-controller-tizen.cpp
+# module: system, backend: linux
+adaptor_system_linux_src_files=\
+ ${adaptor_system_dir}/linux/callback-manager-ecore.cpp \
+ ${adaptor_system_dir}/linux/file-descriptor-monitor-ecore.cpp \
+ ${adaptor_system_dir}/linux/timer-impl-ecore.cpp
-# module: system, backend: tizen-ivi
-adaptor_system_tizen_ivi_src_files=\
- ${adaptor_system_dir}/tizen-ivi/color-controller-impl-ivi.cpp \
- ${adaptor_system_dir}/tizen-ivi/system-settings-ivi.cpp \
- ${adaptor_system_dir}/tizen/widget-application-impl-tizen.cpp \
- ${adaptor_system_dir}/tizen/widget-controller-tizen.cpp
-
-# module: system, backend: tizen-mobile
-adaptor_system_tizen_mobile_src_files=\
- ${adaptor_system_dir}/tizen-mobile/color-controller-impl-mobile.cpp \
- ${adaptor_system_dir}/tizen-mobile/system-settings-mobile.cpp \
- ${adaptor_system_dir}/tizen/widget-application-impl-tizen.cpp \
- ${adaptor_system_dir}/tizen/widget-controller-tizen.cpp
-
-# module: system, backend: tizen-tv
-adaptor_system_tizen_tv_src_files=\
- ${adaptor_system_dir}/tizen-tv/color-controller-impl-tv.cpp \
- ${adaptor_system_dir}/tizen-tv/system-settings-tv.cpp \
- ${adaptor_system_dir}/tizen/widget-application-impl-tizen.cpp \
- ${adaptor_system_dir}/tizen/widget-controller-tizen.cpp
+# module: system, backend: tizen-wayland
+adaptor_system_tizen_wayland_src_files=\
+ ${adaptor_system_dir}/tizen-wayland/color-controller-impl-tizen.cpp \
+ ${adaptor_system_dir}/tizen-wayland/system-settings-tizen.cpp \
+ ${adaptor_system_dir}/tizen-wayland/widget-application-impl-tizen.cpp \
+ ${adaptor_system_dir}/tizen-wayland/widget-controller-tizen.cpp
# module: system, backend: tizen-wearable
adaptor_system_tizen_wearable_src_files=\
- ${adaptor_system_dir}/tizen-wearable/color-controller-impl-wearable.cpp \
- ${adaptor_system_dir}/tizen-wearable/system-settings-wearable.cpp \
- ${adaptor_system_dir}/tizen-wearable/watch-time.cpp \
- ${adaptor_system_dir}/tizen-wearable/capture.cpp \
- ${adaptor_system_dir}/tizen/widget-application-impl-tizen.cpp \
- ${adaptor_system_dir}/tizen/widget-controller-tizen.cpp \
- ${adaptor_system_dir}/tizen/capture-impl-tizen.cpp
+ ${adaptor_system_dir}/tizen-wayland/tizen-wearable/capture.cpp \
+ ${adaptor_system_dir}/tizen-wayland/tizen-wearable/capture-impl-tizen.cpp \
+ ${adaptor_system_dir}/tizen-wayland/tizen-wearable/watch-time.cpp \
+ ${adaptor_system_dir}/tizen-wayland/color-controller-impl-tizen.cpp \
+ ${adaptor_system_dir}/tizen-wayland/system-settings-tizen.cpp \
+ ${adaptor_system_dir}/tizen-wayland/widget-application-impl-tizen.cpp \
+ ${adaptor_system_dir}/tizen-wayland/widget-controller-tizen.cpp
-# module: system, backend: ubuntu
-adaptor_system_ubuntu_src_files=\
- ${adaptor_system_dir}/ubuntu/color-controller-impl-ubuntu.cpp \
- ${adaptor_system_dir}/ubuntu/system-settings-ubuntu.cpp \
- ${adaptor_system_dir}/ubuntu/widget-application-impl-ubuntu.cpp \
- ${adaptor_system_dir}/ubuntu/widget-controller-ubuntu.cpp
-
# module: system, backend: ubuntu-x11
adaptor_system_ubuntu_x11_src_files=\
- ${adaptor_system_dir}/ubuntu-x11/system-settings-x.cpp
-
+ ${adaptor_system_dir}/ubuntu-x11/color-controller-impl-x.cpp \
+ ${adaptor_system_dir}/ubuntu-x11/system-settings-x.cpp \
+ ${adaptor_system_dir}/ubuntu-x11/widget-application-impl-x.cpp \
+ ${adaptor_system_dir}/ubuntu-x11/widget-controller-x.cpp
+++ /dev/null
-/*
- * Copyright (c) 2014 Samsung Electronics Co., Ltd.
- *
- * Licensed under the Apache License, Version 2.0 (the "License");
- * you may not use this file except in compliance with the License.
- * You may obtain a copy of the License at
- *
- * http://www.apache.org/licenses/LICENSE-2.0
- *
- * Unless required by applicable law or agreed to in writing, software
- * distributed under the License is distributed on an "AS IS" BASIS,
- * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
- * See the License for the specific language governing permissions and
- * limitations under the License.
- *
- */
-
-// INTERNAL INCLUDES
-#include <dali/internal/system/generic/system-settings.h>
-
-namespace Dali
-{
-
-namespace Internal
-{
-
-namespace Adaptor
-{
-
-int GetLongPressTime( int defaultTime )
-{
- return defaultTime;
-}
-
-} // namespace Adaptor
-
-} // namespace Internal
-
-} // namespace Dali
*/
// CLASS HEADER
-#include <dali/internal/system/common/callback-manager-ecore.h>
+#include <dali/internal/system/linux/callback-manager-ecore.h>
// EXTERNAL INCLUDES
// Ecore is littered with C style cast
+++ /dev/null
-/*
- * Copyright (c) 2014 Samsung Electronics Co., Ltd.
- *
- * Licensed under the Apache License, Version 2.0 (the "License");
- * you may not use this file except in compliance with the License.
- * You may obtain a copy of the License at
- *
- * http://www.apache.org/licenses/LICENSE-2.0
- *
- * Unless required by applicable law or agreed to in writing, software
- * distributed under the License is distributed on an "AS IS" BASIS,
- * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
- * See the License for the specific language governing permissions and
- * limitations under the License.
- *
- */
-
-// CLASS HEADER
-#include <dali/internal/system/generic/color-controller-impl.h>
-
-// EXTERNAL INCLUDES
-#include <dali/integration-api/debug.h>
-#include <dali/public-api/object/type-registry.h>
-
-// INTERNAL INCLUDES
-#include <dali/internal/system/common/singleton-service-impl.h>
-
-namespace Dali
-{
-
-namespace Internal
-{
-
-namespace Adaptor
-{
-
-Dali::ColorController ColorController::Get()
-{
- Dali::ColorController colorController;
-
- Dali::SingletonService service( SingletonService::Get() );
- if ( service )
- {
- // Check whether the singleton is already created
- Dali::BaseHandle handle = service.GetSingleton( typeid( Dali::ColorController ) );
- if(handle)
- {
- // If so, downcast the handle
- colorController = Dali::ColorController( dynamic_cast< ColorController* >( handle.GetObjectPtr() ) );
- }
- else
- {
- colorController = Dali::ColorController( new ColorController( ) );
- service.Register( typeid( colorController ), colorController );
- }
- }
-
- return colorController;
-
-}
-
-ColorController::ColorController()
-{
-}
-
-ColorController::~ColorController()
-{
-}
-
-bool ColorController::RetrieveColor( const std::string& colorCode, Vector4& colorValue )
-{
- return false;
-}
-
-bool ColorController::RetrieveColor( const std::string& colorCode , Vector4& textColor, Vector4& textOutlineColor, Vector4& textShadowColor)
-{
- return false;
-}
-
-} // namespace Adaptor
-
-} // namespace Internal
-
-} // namespace Dali
+++ /dev/null
-/*
- * Copyright (c) 2014 Samsung Electronics Co., Ltd.
- *
- * Licensed under the Apache License, Version 2.0 (the "License");
- * you may not use this file except in compliance with the License.
- * You may obtain a copy of the License at
- *
- * http://www.apache.org/licenses/LICENSE-2.0
- *
- * Unless required by applicable law or agreed to in writing, software
- * distributed under the License is distributed on an "AS IS" BASIS,
- * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
- * See the License for the specific language governing permissions and
- * limitations under the License.
- *
- */
-
-// CLASS HEADER
-#include <dali/internal/system/generic/color-controller-impl.h>
-
-namespace Dali
-{
-
-namespace Internal
-{
-
-namespace Adaptor
-{
-
-Dali::ColorController ColorController::Get()
-{
- Dali::ColorController colorController;
- return colorController;
-}
-
-ColorController::ColorController()
-{
-}
-
-ColorController::~ColorController()
-{
-}
-
-bool ColorController::RetrieveColor( const std::string& colorCode, Vector4& colorValue )
-{
- return false;
-}
-
-bool ColorController::RetrieveColor( const std::string& colorCode , Vector4& textColor, Vector4& textOutlineColor, Vector4& textShadowColor)
-{
- return false;
-}
-
-} // namespace Adaptor
-
-} // namespace Internal
-
-} // namespace Dali
+++ /dev/null
-/*
- * Copyright (c) 2015 Samsung Electronics Co., Ltd.
- *
- * Licensed under the Apache License, Version 2.0 (the "License");
- * you may not use this file except in compliance with the License.
- * You may obtain a copy of the License at
- *
- * http://www.apache.org/licenses/LICENSE-2.0
- *
- * Unless required by applicable law or agreed to in writing, software
- * distributed under the License is distributed on an "AS IS" BASIS,
- * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
- * See the License for the specific language governing permissions and
- * limitations under the License.
- *
- */
-
-
-namespace Dali
-{
-
-namespace Internal
-{
-
-namespace Adaptor
-{
-
-int GetLongPressTime( int defaultTime )
-{
- return defaultTime;
-}
-
-int GetElmAccessActionOver()
-{
- return 0;
-}
-
-
-} // namespace Adaptor
-
-} // namespace Internal
-
-} // namespace Dali
/*
- * Copyright (c) 2014 Samsung Electronics Co., Ltd.
+ * Copyright (c) 2018 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.
*/
// CLASS HEADER
-#include <dali/internal/system/generic/color-controller-impl.h>
+#include <dali/internal/system/common/color-controller-impl.h>
// EXTERNAL INCLUDES
#include <dali/integration-api/debug.h>
/*
- * Copyright (c) 2014 Samsung Electronics Co., Ltd.
+ * Copyright (c) 2018 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.
#include <system_settings.h>
// INTERNAL INCLUDES
-#include <dali/internal/system/generic/system-settings.h>
+#include <dali/internal/system/common/system-settings.h>
namespace Dali
{
/*
- * Copyright (c) 2014 Samsung Electronics Co., Ltd.
+ * Copyright (c) 2018 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.
*/
// CLASS HEADER
-#include <dali/internal/system/tizen/capture-impl.h>
+#include <dali/internal/system/tizen-wayland/tizen-wearable/capture-impl.h>
// EXTERNAL INCLUDES
#include <dali/public-api/common/vector-wrapper.h>
/*
- * Copyright (c) 2017 Samsung Electronics Co., Ltd.
+ * Copyright (c) 2018 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.
#include <dali/public-api/capture/capture.h>
// INTERNAL HEADER
-#include <dali/internal/system/tizen/capture-impl.h>
+#include <dali/internal/system/tizen-wayland/tizen-wearable/capture-impl.h>
namespace Dali
{
/*
- * Copyright (c) 2017 Samsung Electronics Co., Ltd.
+ * Copyright (c) 2018 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.
*/
// CLASS HEADER
-#include <dali/internal/system/tizen/widget-application-impl-tizen.h>
+#include <dali/internal/system/tizen-wayland/widget-application-impl-tizen.h>
// INTERNAL INCLUDE
#include <dali/public-api/adaptor-framework/widget.h>
#include <dali/public-api/adaptor-framework/widget-impl.h>
-#include <dali/internal/system/tizen/widget-controller-tizen.h>
+#include <dali/internal/system/tizen-wayland/widget-controller-tizen.h>
#ifdef WIDGET_SUPPOERTED
#include <bundle.h>
} // namespace Internal
} // namespace Dali
-
/*
- * Copyright (c) 2017 Samsung Electronics Co., Ltd.
+ * Copyright (c) 2018 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.
*/
// CLASS HEADER
-#include <dali/internal/system/tizen/widget-controller-tizen.h>
+#include <dali/internal/system/tizen-wayland/widget-controller-tizen.h>
// EXTERNAL INCLUDES
#include <bundle.h>
+++ /dev/null
-/*
- * Copyright (c) 2014 Samsung Electronics Co., Ltd.
- *
- * Licensed under the Apache License, Version 2.0 (the "License");
- * you may not use this file except in compliance with the License.
- * You may obtain a copy of the License at
- *
- * http://www.apache.org/licenses/LICENSE-2.0
- *
- * Unless required by applicable law or agreed to in writing, software
- * distributed under the License is distributed on an "AS IS" BASIS,
- * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
- * See the License for the specific language governing permissions and
- * limitations under the License.
- *
- */
-
-// CLASS HEADER
-#include <dali/internal/system/generic/color-controller-impl.h>
-
-// EXTERNAL INCLUDES
-#include <dali/integration-api/debug.h>
-#include <dali/public-api/object/type-registry.h>
-
-// INTERNAL INCLUDES
-#include <dali/internal/system/common/singleton-service-impl.h>
-
-namespace Dali
-{
-
-namespace Internal
-{
-
-namespace Adaptor
-{
-
-Dali::ColorController ColorController::Get()
-{
- Dali::ColorController colorController;
-
- Dali::SingletonService service( SingletonService::Get() );
- if ( service )
- {
- // Check whether the singleton is already created
- Dali::BaseHandle handle = service.GetSingleton( typeid( Dali::ColorController ) );
- if(handle)
- {
- // If so, downcast the handle
- colorController = Dali::ColorController( dynamic_cast< ColorController* >( handle.GetObjectPtr() ) );
- }
- else
- {
- colorController = Dali::ColorController( new ColorController( ) );
- service.Register( typeid( colorController ), colorController );
- }
- }
-
- return colorController;
-
-}
-
-ColorController::ColorController()
-{
-}
-
-ColorController::~ColorController()
-{
-}
-
-bool ColorController::RetrieveColor( const std::string& colorCode, Vector4& colorValue )
-{
- return false;
-}
-
-bool ColorController::RetrieveColor( const std::string& colorCode , Vector4& textColor, Vector4& textOutlineColor, Vector4& textShadowColor)
-{
- return false;
-}
-
-} // namespace Adaptor
-
-} // namespace Internal
-
-} // namespace Dali
/*
- * Copyright (c) 2014 Samsung Electronics Co., Ltd.
+ * Copyright (c) 2018 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.
*/
// CLASS HEADER
-#include <dali/internal/system/generic/color-controller-impl.h>
+#include <dali/internal/system/common/color-controller-impl.h>
namespace Dali
{
/*
- * Copyright (c) 2014 Samsung Electronics Co., Ltd.
+ * Copyright (c) 2018 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.
#include <Elementary.h>
// INTERNAL INCLUDES
-#include <dali/internal/system/generic/system-settings.h>
+#include <dali/internal/system/common/system-settings.h>
namespace Dali
{
#endif // DALI_PROFILE_UBUNTU
}
+int GetLongPressTime( int defaultTime )
+{
+ return defaultTime;
+}
+
} // namespace Adaptor
} // namespace Internal
/*
- * Copyright (c) 2017 Samsung Electronics Co., Ltd.
+ * Copyright (c) 2018 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.
*/
// CLASS HEADER
-#include <dali/internal/system/ubuntu/widget-application-impl-ubuntu.h>
+#include <dali/internal/system/ubuntu-x11/widget-application-impl-x.h>
#include <dali/integration-api/debug.h>
namespace Dali
#define DALI_INTERNAL_WIDGET_APPLICATION_IMPL_UBUNTU_H
/*
- * Copyright (c) 2017 Samsung Electronics Co., Ltd.
+ * Copyright (c) 2018 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.
// INTERNAL INCLUDES
#include <dali/internal/adaptor/common/application-impl.h>
-#include <dali/internal/system/common//widget-application-impl.h>
+#include <dali/internal/system/common/widget-application-impl.h>
#include <dali/public-api/adaptor-framework/widget-application.h>
namespace Dali
/*
- * Copyright (c) 2017 Samsung Electronics Co., Ltd.
+ * Copyright (c) 2018 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.
*/
// CLASS HEADER
-#include <dali/internal/system/ubuntu/widget-controller-ubuntu.h>
+#include <dali/internal/system/ubuntu-x11/widget-controller-x.h>
namespace Dali
{
+++ /dev/null
-/*
- * Copyright (c) 2014 Samsung Electronics Co., Ltd.
- *
- * Licensed under the Apache License, Version 2.0 (the "License");
- * you may not use this file except in compliance with the License.
- * You may obtain a copy of the License at
- *
- * http://www.apache.org/licenses/LICENSE-2.0
- *
- * Unless required by applicable law or agreed to in writing, software
- * distributed under the License is distributed on an "AS IS" BASIS,
- * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
- * See the License for the specific language governing permissions and
- * limitations under the License.
- *
- */
-
-// CLASS HEADER
-#include <dali/internal/system/generic/color-controller-impl.h>
-
-namespace Dali
-{
-
-namespace Internal
-{
-
-namespace Adaptor
-{
-
-Dali::ColorController ColorController::Get()
-{
- return Dali::ColorController( new ColorController() );
-}
-
-ColorController::ColorController()
-{
-}
-
-ColorController::~ColorController()
-{
-}
-
-bool ColorController::RetrieveColor( const std::string& colorCode, Vector4& colorValue )
-{
- return false;
-}
-
-bool ColorController::RetrieveColor( const std::string& colorCode , Vector4& textColor, Vector4& textOutlineColor, Vector4& textShadowColor)
-{
- return false;
-}
-
-} // namespace Adaptor
-
-} // namespace Internal
-
-} // namespace Dali
+++ /dev/null
-/*
- * Copyright (c) 2014 Samsung Electronics Co., Ltd.
- *
- * Licensed under the Apache License, Version 2.0 (the "License");
- * you may not use this file except in compliance with the License.
- * You may obtain a copy of the License at
- *
- * http://www.apache.org/licenses/LICENSE-2.0
- *
- * Unless required by applicable law or agreed to in writing, software
- * distributed under the License is distributed on an "AS IS" BASIS,
- * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
- * See the License for the specific language governing permissions and
- * limitations under the License.
- *
- */
-
-// INTERNAL INCLUDES
-#include <dali/internal/system/generic/system-settings.h>
-
-namespace Dali
-{
-
-namespace Internal
-{
-
-namespace Adaptor
-{
-
-int GetLongPressTime( int defaultTime )
-{
- return defaultTime;
-}
-
-} // namespace Adaptor
-
-} // namespace Internal
-
-} // namespace Dali
return mPlugin->GetFreetypeFace( fontId );
}
+bool FontClient::AddCustomFontDirectory( const FontPath& path )
+{
+ CreatePlugin();
+
+ return mPlugin->AddCustomFontDirectory( path );
+}
+
void FontClient::CreatePlugin()
{
if( !mPlugin )
*/
FT_FaceRec_* GetFreetypeFace( FontId fontId );
+ /**
+ * @copydoc Dali::TextAbstraction::FontClient::AddCustomFontDirectory()
+ */
+ bool AddCustomFontDirectory( const FontPath& path );
+
private:
/**
return fontFace;
}
+bool FontClient::Plugin::AddCustomFontDirectory( const FontPath& path )
+{
+ // NULL as first parameter means the current configuration is used.
+ return FcConfigAppFontAddDir( NULL, reinterpret_cast<const FcChar8 *>( path.c_str() ) );
+}
+
void FontClient::Plugin::InitSystemFonts()
{
DALI_LOG_INFO( gLogFilter, Debug::General, "-->FontClient::Plugin::InitSystemFonts\n" );
*/
FT_FaceRec_* GetFreetypeFace( FontId fontId );
+ /**
+ * @copydoc Dali::TextAbstraction::FontClient::AddCustomFontDirectory()
+ */
+ bool AddCustomFontDirectory( const FontPath& path );
+
private:
/**
}
mCreateVideoPlayerPtr = reinterpret_cast< CreateVideoPlayerFunction >( dlsym( mHandle, "CreateVideoPlayerPlugin" ) );
- if( mCreateVideoPlayerPtr == NULL )
+
+ error = dlerror();
+ if( mCreateVideoPlayerPtr == NULL || error != NULL )
{
DALI_LOG_ERROR( "Can't load symbol CreateVideoPlayerPlugin(), error: %s\n", error );
return;
}
mDestroyVideoPlayerPtr = reinterpret_cast< DestroyVideoPlayerFunction >( dlsym( mHandle, "DestroyVideoPlayerPlugin" ) );
- if( mDestroyVideoPlayerPtr == NULL )
+
+ error = dlerror();
+ if( mDestroyVideoPlayerPtr == NULL || error != NULL )
{
DALI_LOG_ERROR( "Can't load symbol DestroyVideoPlayerPlugin(), error: %s\n", error );
return;
}
-
}
void VideoPlayer::SetUrl( const std::string& url )
#include <dali/public-api/object/base-object.h>
#include <dali/internal/graphics/gles20/egl-implementation.h>
-#include <memory>
namespace Dali
{
virtual void ConsumeEvents() = 0;
/**
- * @copydoc Dali::DisplayConnection::InitializeEgl
+ * @copydoc Dali::DisplayConnection::InitializeGraphics
*/
- virtual bool InitializeEgl(EglInterface& egl) = 0;
+ virtual bool InitializeGraphics() = 0;
+ /**
+ * Sets the render surface type
+ * @param[in] type The render surface type
+ */
virtual void SetSurfaceType( RenderSurface::Type type ) = 0;
+ /**
+ * Sets the graphics interface
+ * @param[in] graphics The graphics interface
+ */
+ virtual void SetGraphicsInterface( GraphicsInterface& graphics ) = 0;
+
public:
/**
// CLASS HEADER
#include <dali/internal/window-system/common/display-connection.h>
#include <dali/internal/window-system/common/display-connection-factory.h>
-// EXTERNAL INCLUDES
// INTERNAL INCLUDES
#include <dali/internal/window-system/common/display-connection-impl.h>
#include <dali/internal/window-system/common/display-connection-factory.h>
-#include <dali/integration-api/egl-interface.h>
+
namespace Dali
{
-DisplayConnection* DisplayConnection::New()
+DisplayConnection* DisplayConnection::New( Dali::Internal::Adaptor::GraphicsInterface& graphics )
{
auto factory = Dali::Internal::Adaptor::GetDisplayConnectionFactory();
auto displayConnection = factory->CreateDisplayConnection();
Internal::Adaptor::DisplayConnection* internal( displayConnection.release() );
+ internal->SetGraphicsInterface( graphics );
return new DisplayConnection(internal);
}
-DisplayConnection* DisplayConnection::New( RenderSurface::Type type )
+DisplayConnection* DisplayConnection::New( Dali::Internal::Adaptor::GraphicsInterface& graphics, RenderSurface::Type type )
{
auto factory = Dali::Internal::Adaptor::GetDisplayConnectionFactory();
auto displayConnection = factory->CreateDisplayConnection();
Internal::Adaptor::DisplayConnection* internal( displayConnection.release() );
+ internal->SetGraphicsInterface( graphics );
internal->SetSurfaceType( type );
return new DisplayConnection(internal);
mImpl->ConsumeEvents();
}
-bool DisplayConnection::InitializeEgl(EglInterface& egl)
+bool DisplayConnection::Initialize()
{
- return mImpl->InitializeEgl(egl);
+ return mImpl->InitializeGraphics();
}
}
// INTERNAL INCLUDES
#include <dali/integration-api/render-surface.h>
+#include <dali/internal/graphics/common/graphics-interface.h>
-#include <memory>
namespace Dali
{
-
-class EglInterface;
-
namespace Internal
{
namespace Adaptor
/**
* @brief Create an initialized DisplayConnection.
*
+ * @param[in] graphics The abstracted graphics interface
* @return A handle to a newly allocated DisplayConnection resource.
*/
- static DisplayConnection* New();
+ static DisplayConnection* New( Dali::Internal::Adaptor::GraphicsInterface& graphics );
/**
* @brief Create an initialized DisplayConnection.
* Native surface will need this instead of DisplayConnection::New()
*
+ * @param[in] graphics The abstracted graphics interface
* @param[in] type Render surface type
* @return A handle to a newly allocated DisplayConnection resource.
*/
- static DisplayConnection* New( RenderSurface::Type type );
+ static DisplayConnection* New( Dali::Internal::Adaptor::GraphicsInterface& graphics, RenderSurface::Type type );
/**
* @brief Create a DisplayConnection handle; this can be initialised with DisplayConnection::New().
void ConsumeEvents();
/**
- * @brief Initialize EGL display
- *
- * @param egl implementation to use for the creation
+ * @brief Initialize the display
*/
- bool InitializeEgl(EglInterface& egl);
+ bool Initialize();
public:
// EXTERNAL HEADERS
#include <dali/integration-api/core.h>
#include <dali/integration-api/system-overlay.h>
+#include <dali/integration-api/render-task-list-integ.h>
+#include <dali/public-api/actors/camera-actor.h>
#include <dali/public-api/render-tasks/render-task.h>
#include <dali/public-api/render-tasks/render-task-list.h>
#include <dali/devel-api/adaptor-framework/orientation.h>
DALI_ASSERT_ALWAYS( !mStarted && "Adaptor already started" );
mStarted = true;
- // Only create one overlay per window
+ // Create one overlay for the main window only
Internal::Adaptor::Adaptor& adaptorImpl = Internal::Adaptor::Adaptor::GetImplementation(adaptor);
Integration::Core& core = adaptorImpl.GetCore();
mOverlay = &core.GetSystemOverlay();
- Dali::RenderTaskList taskList = mOverlay->GetOverlayRenderTasks();
- taskList.CreateTask();
+ // Only create render task list for the overlay once
+ if (!mOverlay->GetOverlayRenderTasks())
+ {
+ Dali::RenderTaskList overlayRenderTaskList = Integration::RenderTaskList::New();
+
+ Dali::Actor overlayRootActor = mOverlay->GetDefaultRootActor();
+ Dali::CameraActor overlayCameraActor = mOverlay->GetDefaultCameraActor();
+ Integration::RenderTaskList::CreateTask( overlayRenderTaskList, overlayRootActor, overlayCameraActor );
+
+ mOverlay->SetOverlayRenderTasks( overlayRenderTaskList );
+ }
mAdaptor = &adaptorImpl;
mAdaptor->AddObserver( *this );
#include <dali/internal/window-system/common/window-base.h>
#include <dali/internal/window-system/common/window-factory.h>
#include <dali/internal/window-system/common/window-system.h>
+#include <dali/internal/graphics/gles20/egl-graphics.h>
+
namespace Dali
{
void WindowRenderSurface::Initialize( Any surface )
{
- // if width or height are zero, go full screen.
- if ( (mPositionSize.width == 0) || (mPositionSize.height == 0) )
- {
- // Default window size == screen size
- mPositionSize.x = 0;
- mPositionSize.y = 0;
+ // If width or height are zero, go full screen.
+ if ( (mPositionSize.width == 0) || (mPositionSize.height == 0) )
+ {
+ // Default window size == screen size
+ mPositionSize.x = 0;
+ mPositionSize.y = 0;
- WindowSystem::GetScreenSize( mPositionSize.width, mPositionSize.height );
- }
+ WindowSystem::GetScreenSize( mPositionSize.width, mPositionSize.height );
+ }
// Create a window base
auto windowFactory = Dali::Internal::Adaptor::GetWindowFactory();
mWindowBase->GetDpi( dpiHorizontal, dpiVertical );
}
-void WindowRenderSurface::InitializeEgl( EglInterface& eglIf )
+void WindowRenderSurface::InitializeGraphics( GraphicsInterface& graphics, Dali::DisplayConnection& displayConnection )
{
- DALI_LOG_TRACE_METHOD( gWindowRenderSurfaceLogFilter );
+ mGraphics = &graphics;
+
+ auto eglGraphics = static_cast<EglGraphics *>(mGraphics);
+
+ EglInterface* mEGL = eglGraphics->Create();
- Internal::Adaptor::EglImplementation& eglImpl = static_cast<Internal::Adaptor::EglImplementation&>( eglIf );
+ // Initialize EGL & OpenGL
+ displayConnection.Initialize();
+ Internal::Adaptor::EglImplementation& eglImpl = static_cast<Internal::Adaptor::EglImplementation&>(*mEGL);
eglImpl.ChooseConfig(true, mColorDepth);
+
+ // Create the OpenGL context
+ mEGL->CreateContext();
+
+ // Create the OpenGL surface
+ CreateSurface();
+
+ // Make it current
+ mEGL->MakeContextCurrent();
}
-void WindowRenderSurface::CreateEglSurface( EglInterface& eglIf )
+void WindowRenderSurface::CreateSurface()
{
DALI_LOG_TRACE_METHOD( gWindowRenderSurfaceLogFilter );
height = mPositionSize.width;
}
- // create the EGL window
+ // Create the EGL window
EGLNativeWindowType window = mWindowBase->CreateEglWindow( width, height );
- Internal::Adaptor::EglImplementation& eglImpl = static_cast<Internal::Adaptor::EglImplementation&>( eglIf );
+ auto eglGraphics = static_cast<EglGraphics *>(mGraphics);
+
+ Internal::Adaptor::EglImplementation& eglImpl = eglGraphics->GetEglImplementation();
eglImpl.CreateSurfaceWindow( window, mColorDepth );
// Check rotation capability
mRotationSupported = mWindowBase->IsEglWindowRotationSupported();
- DALI_LOG_INFO( gWindowRenderSurfaceLogFilter, Debug::Verbose, "WindowRenderSurface::CreateEglSurface: w = %d h = %d angle = %d screen rotation = %d\n", mPositionSize.width, mPositionSize.height, mRotationAngle, mScreenRotationAngle );
+ DALI_LOG_INFO( gWindowRenderSurfaceLogFilter, Debug::Verbose, "WindowRenderSurface::CreateSurface: w = %d h = %d angle = %d screen rotation = %d\n", mPositionSize.width, mPositionSize.height, mRotationAngle, mScreenRotationAngle );
}
-void WindowRenderSurface::DestroyEglSurface( EglInterface& eglIf )
+void WindowRenderSurface::DestroySurface()
{
DALI_LOG_TRACE_METHOD( gWindowRenderSurfaceLogFilter );
- Internal::Adaptor::EglImplementation& eglImpl = static_cast<Internal::Adaptor::EglImplementation&>( eglIf );
+ auto eglGraphics = static_cast<EglGraphics *>(mGraphics);
+
+ Internal::Adaptor::EglImplementation& eglImpl = eglGraphics->GetEglImplementation();
eglImpl.DestroySurface();
mWindowBase->DestroyEglWindow();
}
-bool WindowRenderSurface::ReplaceEGLSurface( EglInterface& egl )
+bool WindowRenderSurface::ReplaceGraphicsSurface()
{
DALI_LOG_TRACE_METHOD( gWindowRenderSurfaceLogFilter );
height = mPositionSize.width;
}
- // create the EGL window
+ // Create the EGL window
EGLNativeWindowType window = mWindowBase->CreateEglWindow( width, height );
// Set screen rotation
mScreenRotationFinished = false;
- Internal::Adaptor::EglImplementation& eglImpl = static_cast<Internal::Adaptor::EglImplementation&>( egl );
+ auto eglGraphics = static_cast<EglGraphics *>(mGraphics);
+
+ Internal::Adaptor::EglImplementation& eglImpl = eglGraphics->GetEglImplementation();
return eglImpl.ReplaceSurfaceWindow( window );
}
bool needToMove = false;
bool needToResize = false;
- // check moving
+ // Check moving
if( (fabs(positionSize.x - mPositionSize.x) > MINIMUM_DIMENSION_CHANGE) ||
(fabs(positionSize.y - mPositionSize.y) > MINIMUM_DIMENSION_CHANGE) )
{
needToMove = true;
}
- // check resizing
+ // Check resizing
if( (fabs(positionSize.width - mPositionSize.width) > MINIMUM_DIMENSION_CHANGE) ||
(fabs(positionSize.height - mPositionSize.height) > MINIMUM_DIMENSION_CHANGE) )
{
{
}
-bool WindowRenderSurface::PreRender( EglInterface& egl, Integration::GlAbstraction& glAbstraction, bool resizingSurface )
+bool WindowRenderSurface::PreRender( bool resizingSurface )
{
if( resizingSurface )
{
}
}
+ auto eglGraphics = static_cast<EglGraphics *>(mGraphics);
+ auto mGLES = eglGraphics->GetGlesInterface();
+ mGLES.PreRender();
+
return true;
}
-void WindowRenderSurface::PostRender( EglInterface& egl, Integration::GlAbstraction& glAbstraction, Dali::DisplayConnection* displayConnection, bool replacingSurface, bool resizingSurface )
+void WindowRenderSurface::PostRender( bool renderToFbo, bool replacingSurface, bool resizingSurface )
{
- if( resizingSurface )
+ // Inform the gl implementation that rendering has finished before informing the surface
+ auto eglGraphics = static_cast<EglGraphics *>(mGraphics);
+ auto mGLES = eglGraphics->GetGlesInterface();
+ mGLES.PostRender();
+
+ if( renderToFbo )
{
- if( !mRotationFinished )
+ mGLES.Flush();
+ mGLES.Finish();
+ }
+ else
+ {
+ if( resizingSurface )
{
- DALI_LOG_INFO( gWindowRenderSurfaceLogFilter, Debug::Verbose, "WindowRenderSurface::PostRender: Trigger rotation event\n" );
+ if( !mRotationFinished )
+ {
+ DALI_LOG_INFO( gWindowRenderSurfaceLogFilter, Debug::Verbose, "WindowRenderSurface::PostRender: Trigger rotation event\n" );
- mRotationTrigger->Trigger();
+ mRotationTrigger->Trigger();
- if( mThreadSynchronization )
- {
- // Wait until the event-thread complete the rotation event processing
- mThreadSynchronization->PostRenderWaitForCompletion();
+ if( mThreadSynchronization )
+ {
+ // Wait until the event-thread complete the rotation event processing
+ mThreadSynchronization->PostRenderWaitForCompletion();
+ }
}
}
}
- Internal::Adaptor::EglImplementation& eglImpl = static_cast<Internal::Adaptor::EglImplementation&>( egl );
+ Internal::Adaptor::EglImplementation& eglImpl = eglGraphics->GetEglImplementation();
eglImpl.SwapBuffers();
if( mRenderNotification )
// INTERNAL INCLUDES
#include <dali/integration-api/render-surface.h>
#include <dali/integration-api/egl-interface.h>
+#include <dali/internal/graphics/common/graphics-interface.h>
// EXTERNAL INCLUDES
#include <dali/public-api/signals/connection-tracker.h>
#include <dali/public-api/signals/dali-signal.h>
-#include <memory>
+
namespace Dali
{
virtual PositionSize GetPositionSize() const override;
/**
- * @copydoc Dali::RenderSurface::GetDpi()
*/
virtual void GetDpi( unsigned int& dpiHorizontal, unsigned int& dpiVertical ) override;
/**
- * @copydoc Dali::RenderSurface::InitializeEgl()
+ * @copydoc Dali::RenderSurface::InitializeGraphics()
*/
- virtual void InitializeEgl( EglInterface& egl ) override;
+ virtual void InitializeGraphics( GraphicsInterface& graphics, Dali::DisplayConnection& displayConnection ) override;
/**
- * @copydoc Dali::RenderSurface::CreateEglSurface()
+ * @copydoc Dali::RenderSurface::CreateSurface()
*/
- virtual void CreateEglSurface( EglInterface& egl ) override;
+ virtual void CreateSurface() override;
/**
- * @copydoc Dali::RenderSurface::DestroyEglSurface()
+ * @copydoc Dali::RenderSurface::DestroySurface()
*/
- virtual void DestroyEglSurface( EglInterface& egl ) override;
+ virtual void DestroySurface() override;
/**
- * @copydoc Dali::RenderSurface::ReplaceEGLSurface()
+ * @copydoc Dali::RenderSurface::ReplaceGraphicsSurface()
*/
- virtual bool ReplaceEGLSurface( EglInterface& egl ) override;
+ virtual bool ReplaceGraphicsSurface() override;
/**
* @copydoc Dali::RenderSurface::MoveResize()
/**
* @copydoc Dali::RenderSurface::PreRender()
*/
- virtual bool PreRender( EglInterface& egl, Integration::GlAbstraction& glAbstraction, bool resizingSurface ) override;
+ virtual bool PreRender( bool resizingSurface ) override;
/**
* @copydoc Dali::RenderSurface::PostRender()
*/
- virtual void PostRender( EglInterface& egl, Integration::GlAbstraction& glAbstraction, Dali::DisplayConnection* displayConnection, bool replacingSurface, bool resizingSurface ) override;
+ virtual void PostRender( bool renderToFbo, bool replacingSurface, bool resizingSurface );
/**
* @copydoc Dali::RenderSurface::StopRender()
ThreadSynchronizationInterface* mThreadSynchronization;
TriggerEventInterface* mRenderNotification; ///< Render notification trigger
TriggerEventInterface* mRotationTrigger;
+ GraphicsInterface* mGraphics; ///< Graphics interface
ColorDepth mColorDepth; ///< Color depth of surface (32 bit or 24 bit)
OutputSignalType mOutputTransformedSignal;
int mRotationAngle;
// CLASS HEADER
#include <dali/internal/window-system/tizen-wayland/display-connection-impl-ecore-wl.h>
+#include <dali/internal/graphics/gles20/egl-graphics.h>
// EXTERNAL_HEADERS
#include <dali/integration-api/debug.h>
DisplayConnectionEcoreWl::DisplayConnectionEcoreWl()
: mDisplay( NULL ),
- mSurfaceType( RenderSurface::WINDOW_RENDER_SURFACE )
+ mSurfaceType( RenderSurface::WINDOW_RENDER_SURFACE ),
+ mGraphics( nullptr )
{
}
{
}
-bool DisplayConnectionEcoreWl::InitializeEgl(EglInterface& egl)
+bool DisplayConnectionEcoreWl::InitializeGraphics()
{
- EglImplementation& eglImpl = static_cast<EglImplementation&>(egl);
+ auto eglGraphics = static_cast<EglGraphics *>(mGraphics);
+ EglImplementation& eglImpl = eglGraphics->GetEglImplementation();
if( !eglImpl.InitializeGles( mDisplay ) )
{
}
}
+void DisplayConnectionEcoreWl::SetGraphicsInterface( GraphicsInterface& graphics )
+{
+ mGraphics = &graphics;
+}
+
EGLNativeDisplayType DisplayConnectionEcoreWl::GetNativeDisplay()
{
return EGLNativeDisplayType();
void ConsumeEvents();
/**
- * @copydoc Dali::DisplayConnection::InitializeEgl
+ * @copydoc Dali::DisplayConnection::InitializeGraphics
*/
- bool InitializeEgl(EglInterface& egl);
+ bool InitializeGraphics();
/**
- * @brief Sets surface type
+ * @brief Sets the surface type
+ * @param[in] type The surface type
*/
void SetSurfaceType( RenderSurface::Type type );
+ /**
+ * @brief Sets the graphics interface
+ * @param[in] graphics The graphics interface
+ */
+ void SetGraphicsInterface( GraphicsInterface& graphics );
+
public:
/**
private:
EGLNativeDisplayType mDisplay; ///< Wayland-display for rendering
- RenderSurface::Type mSurfaceType;
+ RenderSurface::Type mSurfaceType; ///< The surface type
+ GraphicsInterface* mGraphics; ///< The graphics interface
};
} // namespace Adaptor
// INTERNAL INCLUDES
#include <dali/internal/system/common/trigger-event.h>
#include <dali/internal/graphics/gles20/egl-implementation.h>
+#include <dali/internal/graphics/gles20/egl-graphics.h>
#include <dali/internal/window-system/common/display-connection.h>
#include <dali/internal/window-system/common/window-system.h>
#include <dali/integration-api/thread-synchronization-interface.h>
dpiVertical = int( yres + 0.5f );
}
-void NativeRenderSurfaceEcoreWl::InitializeEgl( EglInterface& egl )
+void NativeRenderSurfaceEcoreWl::InitializeGraphics( Internal::Adaptor::GraphicsInterface& graphics, DisplayConnection& displayConnection )
{
DALI_LOG_TRACE_METHOD( gNativeSurfaceLogFilter );
unsetenv( "EGL_PLATFORM" );
- Internal::Adaptor::EglImplementation& eglImpl = static_cast<Internal::Adaptor::EglImplementation&>( egl );
+ mGraphics = &graphics;
- eglImpl.ChooseConfig( true, mColorDepth );
+ auto eglGraphics = static_cast<Internal::Adaptor::EglGraphics *>(mGraphics);
+
+ EglInterface* mEGL = eglGraphics->Create();
+
+ // Initialize EGL & OpenGL
+ displayConnection.Initialize();
+
+ Internal::Adaptor::EglImplementation& eglImpl = static_cast<Internal::Adaptor::EglImplementation&>(*mEGL);
+ eglImpl.ChooseConfig(true, mColorDepth);
+
+ // Create the OpenGL context
+ mEGL->CreateContext();
+
+ // Create the OpenGL surface
+ CreateSurface();
+
+ // Make it current
+ mEGL->MakeContextCurrent();
}
-void NativeRenderSurfaceEcoreWl::CreateEglSurface( EglInterface& egl )
+void NativeRenderSurfaceEcoreWl::CreateSurface()
{
DALI_LOG_TRACE_METHOD( gNativeSurfaceLogFilter );
- Internal::Adaptor::EglImplementation& eglImpl = static_cast<Internal::Adaptor::EglImplementation&>( egl );
+ auto eglGraphics = static_cast<Internal::Adaptor::EglGraphics *>(mGraphics);
+ Internal::Adaptor::EglImplementation& eglImpl = eglGraphics->GetEglImplementation();
eglImpl.CreateSurfaceWindow( reinterpret_cast< EGLNativeWindowType >( mTbmQueue ), mColorDepth );
}
-void NativeRenderSurfaceEcoreWl::DestroyEglSurface( EglInterface& egl )
+void NativeRenderSurfaceEcoreWl::DestroySurface()
{
DALI_LOG_TRACE_METHOD( gNativeSurfaceLogFilter );
- Internal::Adaptor::EglImplementation& eglImpl = static_cast<Internal::Adaptor::EglImplementation&>( egl );
+ auto eglGraphics = static_cast<Internal::Adaptor::EglGraphics *>(mGraphics);
+ Internal::Adaptor::EglImplementation& eglImpl = eglGraphics->GetEglImplementation();
+
eglImpl.DestroySurface();
}
-bool NativeRenderSurfaceEcoreWl::ReplaceEGLSurface( EglInterface& egl )
+bool NativeRenderSurfaceEcoreWl::ReplaceGraphicsSurface()
{
DALI_LOG_TRACE_METHOD( gNativeSurfaceLogFilter );
return false;
}
- Internal::Adaptor::EglImplementation& eglImpl = static_cast<Internal::Adaptor::EglImplementation&>( egl );
+ auto eglGraphics = static_cast<Internal::Adaptor::EglGraphics *>(mGraphics);
+ Internal::Adaptor::EglImplementation& eglImpl = eglGraphics->GetEglImplementation();
return eglImpl.ReplaceSurfaceWindow( reinterpret_cast< EGLNativeWindowType >( mTbmQueue ) );
}
{
}
-bool NativeRenderSurfaceEcoreWl::PreRender( EglInterface&, Integration::GlAbstraction&, bool )
+bool NativeRenderSurfaceEcoreWl::PreRender( bool )
{
// nothing to do for pixmaps
return true;
}
-void NativeRenderSurfaceEcoreWl::PostRender( EglInterface& egl, Integration::GlAbstraction& glAbstraction, DisplayConnection* displayConnection, bool replacingSurface, bool resizingSurface )
+void NativeRenderSurfaceEcoreWl::PostRender( bool renderToFbo, bool replacingSurface, bool resizingSurface )
{
- Internal::Adaptor::EglImplementation& eglImpl = static_cast<Internal::Adaptor::EglImplementation&>( egl );
+ auto eglGraphics = static_cast<Internal::Adaptor::EglGraphics *>(mGraphics);
+ Internal::Adaptor::EglImplementation& eglImpl = eglGraphics->GetEglImplementation();
+
eglImpl.SwapBuffers();
if( mThreadSynchronization )
{
if( tbm_surface_queue_acquire( mTbmQueue, &mConsumeSurface ) != TBM_SURFACE_QUEUE_ERROR_NONE )
{
- DALI_LOG_ERROR( "Failed to aquire a tbm_surface\n" );
+ DALI_LOG_ERROR( "Failed to acquire a tbm_surface\n" );
return;
}
}
// INTERNAL INCLUDES
#include <dali/public-api/dali-adaptor-common.h>
#include <dali/integration-api/native-render-surface.h>
+#include <dali/internal/graphics/common/graphics-interface.h>
namespace Dali
{
+class DisplayConnection;
+
/**
* Ecore Wayland Native implementation of render surface.
*/
virtual void GetDpi( unsigned int& dpiHorizontal, unsigned int& dpiVertical ) override;
/**
- * @copydoc Dali::RenderSurface::InitializeEgl()
+ * @copydoc Dali::RenderSurface::InitializeGraphics()
*/
- virtual void InitializeEgl( EglInterface& egl ) override;
+ virtual void InitializeGraphics( Internal::Adaptor::GraphicsInterface& graphics, DisplayConnection& displayConnection ) override;
/**
- * @copydoc Dali::RenderSurface::CreateEglSurface()
+ * @copydoc Dali::RenderSurface::CreateSurface()
*/
- virtual void CreateEglSurface( EglInterface& egl ) override;
+ virtual void CreateSurface() override;
/**
- * @copydoc Dali::RenderSurface::DestroyEglSurface()
+ * @copydoc Dali::RenderSurface::DestroySurface()
*/
- virtual void DestroyEglSurface( EglInterface& egl ) override;
+ virtual void DestroySurface() override;
/**
- * @copydoc Dali::RenderSurface::ReplaceEGLSurface()
+ * @copydoc Dali::RenderSurface::ReplaceGraphicsSurface()
*/
- virtual bool ReplaceEGLSurface( EglInterface& egl ) override;
+ virtual bool ReplaceGraphicsSurface() override;
/**
* @copydoc Dali::RenderSurface::MoveResize()
/**
* @copydoc Dali::RenderSurface::PreRender()
*/
- virtual bool PreRender( EglInterface& egl, Integration::GlAbstraction& glAbstraction, bool resizingSurface ) override;
+ virtual bool PreRender( bool resizingSurface ) override;
/**
* @copydoc Dali::RenderSurface::PostRender()
*/
- virtual void PostRender( EglInterface& egl, Integration::GlAbstraction& glAbstraction, DisplayConnection* displayConnection, bool replacingSurface, bool resizingSurface ) override;
+ virtual void PostRender( bool renderToFbo, bool replacingSurface, bool resizingSurface );
/**
* @copydoc Dali::RenderSurface::StopRender()
private: // Data
- PositionSize mPosition;
- TriggerEventInterface* mRenderNotification;
- ColorDepth mColorDepth;
- tbm_format mTbmFormat;
- bool mOwnSurface;
- bool mDrawableCompleted;
-
- tbm_surface_queue_h mTbmQueue;
- tbm_surface_h mConsumeSurface;
- ThreadSynchronizationInterface* mThreadSynchronization; ///< A pointer to the thread-synchronization
- ConditionalWait mTbmSurfaceCondition;
+ PositionSize mPosition;
+ TriggerEventInterface* mRenderNotification;
+ Internal::Adaptor::GraphicsInterface* mGraphics; ///< The graphics interface
+ ColorDepth mColorDepth;
+ tbm_format mTbmFormat;
+ bool mOwnSurface;
+ bool mDrawableCompleted;
+
+ tbm_surface_queue_h mTbmQueue;
+ tbm_surface_h mConsumeSurface;
+ ThreadSynchronizationInterface* mThreadSynchronization; ///< A pointer to the thread-synchronization
+ ConditionalWait mTbmSurfaceCondition;
};
// INTERNAL HEADERS
#include <dali/internal/window-system/ubuntu-x11/pixmap-render-surface-ecore-x.h>
+#include <dali/internal/graphics/gles20/egl-graphics.h>
namespace Dali
{
}
DisplayConnectionX11::DisplayConnectionX11()
-: mDisplay(NULL)
+: mGraphics( nullptr ),
+ mDisplay( nullptr )
{
}
while (events > 0);
}
-bool DisplayConnectionX11::InitializeEgl(EglInterface& egl)
+bool DisplayConnectionX11::InitializeGraphics()
{
- EglImplementation& eglImpl = static_cast<EglImplementation&>(egl);
+ auto eglGraphics = static_cast<EglGraphics *>(mGraphics);
+ EglImplementation& eglImpl = eglGraphics->GetEglImplementation();
if (!eglImpl.InitializeGles(reinterpret_cast<EGLNativeDisplayType>(mDisplay)))
{
}
}
+void DisplayConnectionX11::SetGraphicsInterface( GraphicsInterface& graphics )
+{
+ mGraphics = &graphics;
+}
+
} // namespace Adaptor
} // namespace Internal
void ConsumeEvents();
/**
- * @copydoc Dali::DisplayConnection::InitializeEgl
+ * @copydoc Dali::DisplayConnection::InitializeGraphics
*/
- bool InitializeEgl(EglInterface& egl);
+ bool InitializeGraphics();
+ /**
+ * @copydoc Dali::Internal::Adaptor::DisplayConnection::SetSurfaceType
+ */
void SetSurfaceType( RenderSurface::Type type );
+ /**
+ * @copydoc Dali::Internal::Adaptor::DisplayConnection::SetGraphicsInterface
+ */
+ void SetGraphicsInterface( GraphicsInterface& graphics );
+
public:
/**
private:
+ GraphicsInterface* mGraphics; ///< The graphics interface
+
public:
XDisplay* mDisplay; ///< X-display for rendering
#include <dali/integration-api/thread-synchronization-interface.h>
#include <dali/internal/system/common/trigger-event.h>
#include <dali/internal/window-system/common/display-connection.h>
+#include <dali/internal/graphics/gles20/egl-graphics.h>
+
namespace Dali
{
dpiVertical = int( yres + 0.5f );
}
-void PixmapRenderSurfaceEcoreX::InitializeEgl( EglInterface& egl )
+void PixmapRenderSurfaceEcoreX::InitializeGraphics( GraphicsInterface& graphics, Dali::DisplayConnection& displayConnection )
{
- DALI_LOG_TRACE_METHOD( gPixmapRenderSurfaceLogFilter );
-
- Internal::Adaptor::EglImplementation& eglImpl = static_cast<Internal::Adaptor::EglImplementation&>( egl );
+ mGraphics = &graphics;
+ mDisplayConnection = &displayConnection;
+ auto eglGraphics = static_cast<EglGraphics *>(mGraphics);
+ Internal::Adaptor::EglImplementation& eglImpl = eglGraphics->GetEglImplementation();
eglImpl.ChooseConfig(false, mColorDepth);
}
-void PixmapRenderSurfaceEcoreX::CreateEglSurface( EglInterface& egl )
+void PixmapRenderSurfaceEcoreX::CreateSurface()
{
DALI_LOG_TRACE_METHOD( gPixmapRenderSurfaceLogFilter );
- Internal::Adaptor::EglImplementation& eglImpl = static_cast<Internal::Adaptor::EglImplementation&>( egl );
+ auto eglGraphics = static_cast<EglGraphics *>(mGraphics);
+ Internal::Adaptor::EglImplementation& eglImpl = eglGraphics->GetEglImplementation();
for (int i = 0; i < BUFFER_COUNT; ++i)
{
}
}
-void PixmapRenderSurfaceEcoreX::DestroyEglSurface( EglInterface& egl )
+void PixmapRenderSurfaceEcoreX::DestroySurface()
{
DALI_LOG_TRACE_METHOD( gPixmapRenderSurfaceLogFilter );
- Internal::Adaptor::EglImplementation& eglImpl = static_cast<Internal::Adaptor::EglImplementation&>( egl );
+ auto eglGraphics = static_cast<EglGraphics *>(mGraphics);
+
+ Internal::Adaptor::EglImplementation& eglImpl = eglGraphics->GetEglImplementation();
for (int i = 0; i < BUFFER_COUNT; ++i)
{
}
}
-bool PixmapRenderSurfaceEcoreX::ReplaceEGLSurface( EglInterface& egl )
+bool PixmapRenderSurfaceEcoreX::ReplaceGraphicsSurface()
{
DALI_LOG_TRACE_METHOD( gPixmapRenderSurfaceLogFilter );
bool contextLost = false;
- Internal::Adaptor::EglImplementation& eglImpl = static_cast<Internal::Adaptor::EglImplementation&>( egl );
+ auto eglGraphics = static_cast<EglGraphics *>(mGraphics);
+
+ Internal::Adaptor::EglImplementation& eglImpl = eglGraphics->GetEglImplementation();
for (int i = 0; i < BUFFER_COUNT; ++i)
{
{
}
-bool PixmapRenderSurfaceEcoreX::PreRender( EglInterface& egl, Integration::GlAbstraction&, bool )
+bool PixmapRenderSurfaceEcoreX::PreRender( bool )
{
// Nothing to do for pixmaps
return true;
}
-void PixmapRenderSurfaceEcoreX::PostRender( EglInterface& egl, Integration::GlAbstraction& glAbstraction, Dali::DisplayConnection* displayConnection, bool replacingSurface, bool resizingSurface )
+void PixmapRenderSurfaceEcoreX::PostRender( bool renderToFbo, bool replacingSurface, bool resizingSurface )
{
+ auto eglGraphics = static_cast<EglGraphics *>(mGraphics);
+
// flush gl instruction queue
+ Integration::GlAbstraction& glAbstraction = eglGraphics->GetGlAbstraction();
glAbstraction.Flush();
if( mThreadSynchronization )
ConditionalWait::ScopedLock lock( mPixmapCondition );
mConsumeBufferIndex = __sync_fetch_and_xor( &mProduceBufferIndex, 1 ); // Swap buffer indexes.
- Internal::Adaptor::EglImplementation& eglImpl = static_cast<Internal::Adaptor::EglImplementation&>( egl );
+ Internal::Adaptor::EglImplementation& eglImpl = eglGraphics->GetEglImplementation();
// need to cast to X handle as in 64bit system ECore handle is 32 bit whereas EGLnative and XWindow are 64 bit
XPixmap pixmap = static_cast<XPixmap>( mX11Pixmaps[mProduceBufferIndex] );
rect.width = mPosition.width;
rect.height = mPosition.height;
- XDisplay* display = AnyCast<XDisplay*>(displayConnection->GetDisplay());
+ XDisplay* display = AnyCast<XDisplay*>(mDisplayConnection->GetDisplay());
// make a fixes region as updated area
region = XFixesCreateRegion( display, &rect, 1 );
-#ifndef __DALI_ECORE_X_PIXMAP_RENDER_SURFACE_H__
-#define __DALI_ECORE_X_PIXMAP_RENDER_SURFACE_H__
+#ifndef DALI_ECORE_X_PIXMAP_RENDER_SURFACE_H
+#define DALI_ECORE_X_PIXMAP_RENDER_SURFACE_H
/*
* Copyright (c) 2018 Samsung Electronics Co., Ltd.
#include <dali/internal/window-system/common/pixmap-render-surface.h>
#include <dali/internal/window-system/ubuntu-x11/ecore-x-types.h>
#include <dali/public-api/dali-adaptor-common.h>
+#include <dali/internal/graphics/common/graphics-interface.h>
// EXTERNAL INCLUDES
#include <dali/devel-api/threading/conditional-wait.h>
#include <Ecore_X.h>
+
namespace Dali
{
namespace Internal
virtual void GetDpi( unsigned int& dpiHorizontal, unsigned int& dpiVertical ) override;
/**
- * @copydoc Dali::RenderSurface::InitializeEgl()
+ * @copydoc Dali::RenderSurface::InitializeGraphics()
*/
- virtual void InitializeEgl( EglInterface& egl ) override;
+ virtual void InitializeGraphics( GraphicsInterface& graphics, Dali::DisplayConnection& displayConnection ) override;
/**
- * @copydoc Dali::RenderSurface::CreateEglSurface()
+ * @copydoc Dali::RenderSurface::CreateSurface()
*/
- virtual void CreateEglSurface( EglInterface& egl ) override;
+ virtual void CreateSurface() override;
/**
- * @copydoc Dali::RenderSurface::DestroyEglSurface()
+ * @copydoc Dali::RenderSurface::DestroySurface()
*/
- virtual void DestroyEglSurface( EglInterface& egl ) override;
+ virtual void DestroySurface() override;
/**
- * @copydoc Dali::RenderSurface::ReplaceEGLSurface()
+ * @copydoc Dali::RenderSurface::ReplaceGraphicsSurface()
*/
- virtual bool ReplaceEGLSurface( EglInterface& egl ) override;
+ virtual bool ReplaceGraphicsSurface() override;
/**
* @copydoc Dali::RenderSurface::MoveResize()
/**
* @copydoc Dali::RenderSurface::PreRender()
*/
- virtual bool PreRender( EglInterface& egl, Integration::GlAbstraction& glAbstraction, bool resizingSurface ) override;
+ virtual bool PreRender( bool resizingSurface ) override;
/**
* @copydoc Dali::RenderSurface::PostRender()
*/
- virtual void PostRender( EglInterface& egl, Integration::GlAbstraction& glAbstraction, DisplayConnection* displayConnection, bool replacingSurface, bool resizingSurface );
+ virtual void PostRender( bool renderToFbo, bool replacingSurface, bool resizingSurface ) override;
/**
* @copydoc Dali::RenderSurface::StopRender()
private: // Data
static const int BUFFER_COUNT = 2;
-
+ GraphicsInterface* mGraphics; ///< Graphics interface
+ Dali::DisplayConnection* mDisplayConnection; ///< Display connection
PositionSize mPosition; ///< Position
TriggerEventInterface* mRenderNotification; ///< Render notification trigger
ColorDepth mColorDepth; ///< Color depth of surface (32 bit or 24 bit)
} // namespace Dali
-#endif // __DALI_ECORE_X_PIXMAP_RENDER_SURFACE_H__
+#endif // DALI_ECORE_X_PIXMAP_RENDER_SURFACE_H
-#ifndef __DALI_APPLICATION_H__
-#define __DALI_APPLICATION_H__
+#ifndef DALI_APPLICATION_H
+#define DALI_APPLICATION_H
/*
* Copyright (c) 2018 Samsung Electronics Co., Ltd.
*/
// EXTERNAL INCLUDES
-#include <string>
#include <dali/public-api/common/view-mode.h>
#include <dali/public-api/object/base-handle.h>
#include <dali/public-api/signals/callback.h>
*/
} // namespace Dali
-#endif // __DALI_APPLICATION_H__
+#endif // DALI_APPLICATION_H
const unsigned int ADAPTOR_MAJOR_VERSION = 1;
const unsigned int ADAPTOR_MINOR_VERSION = 3;
-const unsigned int ADAPTOR_MICRO_VERSION = 46;
+const unsigned int ADAPTOR_MICRO_VERSION = 47;
const char * const ADAPTOR_BUILD_DATE = __DATE__ " " __TIME__;
#ifdef DEBUG_ENABLED
Name: dali-adaptor
Summary: The DALi Tizen Adaptor
-Version: 1.3.46
+Version: 1.3.47
Release: 1
Group: System/Libraries
License: Apache-2.0 and BSD-3-Clause and MIT