#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;