--- /dev/null
+---
+Language: Cpp
+BasedOnStyle: Google
+AccessModifierOffset: -2
+AlignAfterOpenBracket: Align
+AlignConsecutiveAssignments: true
+AlignConsecutiveDeclarations: true
+AlignEscapedNewlinesLeft: true
+AlignOperands: true
+AlignTrailingComments: true
+AllowAllParametersOfDeclarationOnNextLine: true
+AllowShortBlocksOnASingleLine: false
+AllowShortCaseLabelsOnASingleLine: false
+AllowShortFunctionsOnASingleLine: None
+AllowShortIfStatementsOnASingleLine: true
+AllowShortLoopsOnASingleLine: true
+AlwaysBreakAfterDefinitionReturnType: None
+AlwaysBreakAfterReturnType: None
+AlwaysBreakBeforeMultilineStrings: true
+AlwaysBreakTemplateDeclarations: true
+BinPackArguments: false
+BinPackParameters: false
+BraceWrapping:
+ AfterClass: true
+ AfterControlStatement: true
+ AfterEnum: true
+ AfterFunction: true
+ AfterNamespace: true
+ AfterObjCDeclaration: false
+ AfterStruct: true
+ AfterUnion: true
+ BeforeCatch: false
+ BeforeElse: false
+ IndentBraces: false
+ SplitEmptyFunction: true
+ SplitEmptyRecord: true
+BreakBeforeBinaryOperators: None
+BreakBeforeBraces: Allman
+BreakBeforeTernaryOperators: true
+BreakConstructorInitializers: BeforeColon
+ConstructorInitializerAllOnOneLineOrOnePerLine: true
+AllowAllConstructorInitializersOnNextLine : false
+ConstructorInitializerIndentWidth: 0
+ColumnLimit: 0
+CommentPragmas: '^ IWYU pragma:'
+ContinuationIndentWidth: 2
+Cpp11BracedListStyle: true
+DerivePointerAlignment: false
+DisableFormat: false
+ExperimentalAutoDetectBinPacking: false
+ForEachMacros: [ foreach, Q_FOREACH, BOOST_FOREACH ]
+IncludeBlocks: Preserve
+IncludeCategories:
+ - Regex: '^<.*\.h>'
+ Priority: 1
+ - Regex: '^<.*'
+ Priority: 2
+ - Regex: '.*'
+ Priority: 3
+SpaceBeforeCtorInitializerColon: false
+IndentCaseLabels: true
+IndentWidth: 2
+IndentWrappedFunctionNames: false
+KeepEmptyLinesAtTheStartOfBlocks: false
+MacroBlockBegin: '^DALI_ENUM_TO_STRING_TABLE_BEGIN'
+MacroBlockEnd: 'DALI_ENUM_TO_STRING_TABLE_END'
+MaxEmptyLinesToKeep: 1
+NamespaceIndentation: None
+ObjCBlockIndentWidth: 2
+ObjCSpaceAfterProperty: false
+ObjCSpaceBeforeProtocolList: false
+PenaltyBreakBeforeFirstCallParameter: 1
+PenaltyBreakComment: 300
+PenaltyBreakFirstLessLess: 120
+PenaltyBreakString: 1000
+PenaltyExcessCharacter: 1000000
+PenaltyReturnTypeOnItsOwnLine: 200
+PointerAlignment: Left
+ReflowComments: true
+SortIncludes: true
+SpaceAfterCStyleCast: false
+SpaceBeforeAssignmentOperators: true
+SpaceBeforeParens: Never
+SpaceInEmptyParentheses: false
+SpacesInConditionalStatement : false
+SpacesBeforeTrailingComments: 1
+SpacesInAngles: false
+SpacesInContainerLiterals: true
+SpacesInCStyleCastParentheses: false
+SpacesInParentheses: false
+SpacesInSquareBrackets: false
+SpaceAfterTemplateKeyword: false
+Standard: Auto
+TabWidth: 2
+UseTab: Never
+...
#include <stdio.h>
#include <stdlib.h>
-#define assert(exp) \
- if (!(exp)) { \
- fprintf(stderr, \
- "Assert fail in %s:%d\n", __FILE__, __LINE__); \
- fprintf(stderr, \
+#define assert(exp) \
+ if(!(exp)) \
+ { \
+ fprintf(stderr, \
+ "Assert fail in %s:%d\n", \
+ __FILE__, \
+ __LINE__); \
+ fprintf(stderr, \
"Following expression is not true:\n" \
- "%s\n", #exp); \
- return 1; \
- }
+ "%s\n", \
+ #exp); \
+ return 1; \
+ }
-#define assert_eq(var, ref) \
- if (var != ref) { \
- fprintf(stderr, \
- "Assert fail in %s:%d\n", __FILE__, __LINE__); \
- fprintf(stderr, \
+#define assert_eq(var, ref) \
+ if(var != ref) \
+ { \
+ fprintf(stderr, \
+ "Assert fail in %s:%d\n", \
+ __FILE__, \
+ __LINE__); \
+ fprintf(stderr, \
"Values \"%s\" and \"%s\" are not equal:\n" \
- "%s == %d, %s == %d\n", \
- #var, #ref, #var, (int)var, #ref, (int)ref); \
- return 1; \
- }
+ "%s == %d, %s == %d\n", \
+ #var, \
+ #ref, \
+ #var, \
+ (int)var, \
+ #ref, \
+ (int)ref); \
+ return 1; \
+ }
-#define assert_neq(var, ref) \
- if (var == ref) { \
- fprintf(stderr, \
- "Assert fail in %s:%d\n", __FILE__, __LINE__); \
- fprintf(stderr, \
+#define assert_neq(var, ref) \
+ if(var == ref) \
+ { \
+ fprintf(stderr, \
+ "Assert fail in %s:%d\n", \
+ __FILE__, \
+ __LINE__); \
+ fprintf(stderr, \
"Values \"%s\" and \"%s\" are equal:\n" \
- "%s == %s == %d\n", \
- #var, #ref, #var, #ref, (int)ref); \
- return 1; \
- }
+ "%s == %s == %d\n", \
+ #var, \
+ #ref, \
+ #var, \
+ #ref, \
+ (int)ref); \
+ return 1; \
+ }
-#define assert_gt(var, ref) \
- if (var <= ref) { \
- fprintf(stderr, \
- "Assert fail in %s:%d\n", __FILE__, __LINE__); \
- fprintf(stderr, \
+#define assert_gt(var, ref) \
+ if(var <= ref) \
+ { \
+ fprintf(stderr, \
+ "Assert fail in %s:%d\n", \
+ __FILE__, \
+ __LINE__); \
+ fprintf(stderr, \
"Value \"%s\" is not greater than \"%s\":\n" \
- "%s == %d, %s == %d\n", \
- #var, #ref, #var, var, #ref, ref); \
- return 1; \
- }
+ "%s == %d, %s == %d\n", \
+ #var, \
+ #ref, \
+ #var, \
+ var, \
+ #ref, \
+ ref); \
+ return 1; \
+ }
-#define assert_geq(var, ref) \
- if (var < ref) { \
- fprintf(stderr, \
- "Assert fail in %s:%d\n", __FILE__, __LINE__); \
- fprintf(stderr, \
+#define assert_geq(var, ref) \
+ if(var < ref) \
+ { \
+ fprintf(stderr, \
+ "Assert fail in %s:%d\n", \
+ __FILE__, \
+ __LINE__); \
+ fprintf(stderr, \
"Value \"%s\" is not greater or equal to \"%s\":\n" \
- "%s == %d, %s == %d\n", \
- #var, #ref, #var, var, #ref, ref); \
- return 1; \
- }
+ "%s == %d, %s == %d\n", \
+ #var, \
+ #ref, \
+ #var, \
+ var, \
+ #ref, \
+ ref); \
+ return 1; \
+ }
-#define assert_lt(var, ref) \
- if (var >= ref) { \
- fprintf(stderr, \
- "Assert fail in %s:%d\n", __FILE__, __LINE__); \
- fprintf(stderr, \
+#define assert_lt(var, ref) \
+ if(var >= ref) \
+ { \
+ fprintf(stderr, \
+ "Assert fail in %s:%d\n", \
+ __FILE__, \
+ __LINE__); \
+ fprintf(stderr, \
"Value \"%s\" is not lower than \"%s\":\n" \
- "%s == %d, %s == %d\n", \
- #var, #ref, #var, var, #ref, ref); \
- return 1; \
- }
+ "%s == %d, %s == %d\n", \
+ #var, \
+ #ref, \
+ #var, \
+ var, \
+ #ref, \
+ ref); \
+ return 1; \
+ }
-#define assert_leq(var, ref) \
- if (var > ref) { \
- fprintf(stderr, \
- "Assert fail in %s:%d\n", __FILE__, __LINE__); \
- fprintf(stderr, \
+#define assert_leq(var, ref) \
+ if(var > ref) \
+ { \
+ fprintf(stderr, \
+ "Assert fail in %s:%d\n", \
+ __FILE__, \
+ __LINE__); \
+ fprintf(stderr, \
"Value \"%s\" is not lower or equal to \"%s\":\n" \
- "%s == %d, %s == %d\n", \
- #var, #ref, #var, var, #ref, ref); \
- return 1; \
- }
+ "%s == %d, %s == %d\n", \
+ #var, \
+ #ref, \
+ #var, \
+ var, \
+ #ref, \
+ ref); \
+ return 1; \
+ }
#endif // _ASSERT_H_
typedef int (*tc_fun_ptr)(void);
/* struct describing specific testcase */
-typedef struct testcase_s {
- const char* name;
- tc_fun_ptr function;
- void_fun_ptr startup;
- void_fun_ptr cleanup;
+typedef struct testcase_s
+{
+ const char* name;
+ tc_fun_ptr function;
+ void_fun_ptr startup;
+ void_fun_ptr cleanup;
} testcase;
#endif // _TESTCASE_H_
*
*/
-#include <cstring>
-#include <dali/devel-api/addons/addon-base.h>
#include <dali-test-suite-utils.h>
+#include <dali/devel-api/addons/addon-base.h>
+#include <cstring>
namespace
{
bool gIsPaused = false;
}
-int StringLen( const char* str )
+int StringLen(const char* str)
{
- return strlen( str );
+ return strlen(str);
}
-int DoSum( int a, int b )
+int DoSum(int a, int b)
{
- return a+b;
+ return a + b;
}
bool GetLifecycleStatus()
return 42;
}
- static int GetValueWithInstance( AddOnDataInstance* instance )
+ static int GetValueWithInstance(AddOnDataInstance* instance)
{
return instance->GetValue();
}
class TestDummyAddOn : public Dali::AddOns::AddOnBase
{
public:
-
- void GetAddOnInfo( Dali::AddOnInfo& info ) override
+ void GetAddOnInfo(Dali::AddOnInfo& info) override
{
- info.type = Dali::AddOnType::GENERIC;
- info.name = "SampleAddOn";
- info.version = Dali::DALI_ADDON_VERSION( 1, 0, 0 );
- info.next = nullptr;
- tet_printf( "SampleAddOn: GetAddOnInfo() : name = %s\n", info.name.c_str());
+ info.type = Dali::AddOnType::GENERIC;
+ info.name = "SampleAddOn";
+ info.version = Dali::DALI_ADDON_VERSION(1, 0, 0);
+ info.next = nullptr;
+ tet_printf("SampleAddOn: GetAddOnInfo() : name = %s\n", info.name.c_str());
}
/**
Dali::AddOns::DispatchTable* GetGlobalDispatchTable() override
{
static Dali::AddOns::DispatchTable dispatchTable{};
- if( dispatchTable.Empty() )
+ if(dispatchTable.Empty())
{
- dispatchTable["DoSum"] = DoSum;
- dispatchTable["StringLen"] = StringLen;
- dispatchTable["GetLifecycleStatus"] = GetLifecycleStatus;
- dispatchTable["CreateInstance"] = CreateInstance;
-
+ dispatchTable["DoSum"] = DoSum;
+ dispatchTable["StringLen"] = StringLen;
+ dispatchTable["GetLifecycleStatus"] = GetLifecycleStatus;
+ dispatchTable["CreateInstance"] = CreateInstance;
}
return &dispatchTable;
}
Dali::AddOns::DispatchTable* GetInstanceDispatchTable() override
{
static Dali::AddOns::DispatchTable dispatchTable{};
- if( dispatchTable.Empty() )
+ if(dispatchTable.Empty())
{
dispatchTable["InstanceCall"] = AddOnDataInstance::GetValueWithInstance;
}
}
};
-REGISTER_ADDON_CLASS( TestDummyAddOn );
+REGISTER_ADDON_CLASS(TestDummyAddOn);
#include <dali-test-suite-utils.h>
#include <dali/internal/imaging/common/pixel-buffer-impl.h>
-AutoCloseFile::AutoCloseFile( FILE *fp )
-: filePtr( fp )
+AutoCloseFile::AutoCloseFile(FILE* fp)
+: filePtr(fp)
{
}
AutoCloseFile::~AutoCloseFile()
{
- if ( filePtr )
+ if(filePtr)
{
- fclose( filePtr );
+ fclose(filePtr);
}
}
-
-ImageDetails::ImageDetails( const char * const _name, unsigned int _width, unsigned int _height )
-: name( _name ),
- width( _width ),
- height( _height ),
- reportedWidth( _width ),
- reportedHeight( _height ),
- refBufferSize( 0u ),
- refBuffer( nullptr )
+ImageDetails::ImageDetails(const char* const _name, unsigned int _width, unsigned int _height)
+: name(_name),
+ width(_width),
+ height(_height),
+ reportedWidth(_width),
+ reportedHeight(_height),
+ refBufferSize(0u),
+ refBuffer(nullptr)
{
LoadBuffer();
}
-ImageDetails::ImageDetails( const char * const _name, unsigned int _width, unsigned int _height, unsigned int _reportedWidth, unsigned int _reportedHeight )
-: name( _name ),
- width( _width ),
- height( _height ),
- reportedWidth( _reportedWidth ),
- reportedHeight( _reportedHeight ),
- refBufferSize( 0u ),
- refBuffer( nullptr )
+ImageDetails::ImageDetails(const char* const _name, unsigned int _width, unsigned int _height, unsigned int _reportedWidth, unsigned int _reportedHeight)
+: name(_name),
+ width(_width),
+ height(_height),
+ reportedWidth(_reportedWidth),
+ reportedHeight(_reportedHeight),
+ refBufferSize(0u),
+ refBuffer(nullptr)
{
LoadBuffer();
}
ImageDetails::~ImageDetails()
{
- if( refBuffer )
+ if(refBuffer)
{
delete[] refBuffer;
}
void ImageDetails::LoadBuffer()
{
// Load the reference buffer from the buffer file
- std::string refBufferFilename( name + ".buffer" );
- FILE *fp = fopen ( refBufferFilename.c_str(), "rb" );
- AutoCloseFile autoCloseBufferFile( fp );
+ std::string refBufferFilename(name + ".buffer");
+ FILE* fp = fopen(refBufferFilename.c_str(), "rb");
+ AutoCloseFile autoCloseBufferFile(fp);
- if ( fp )
+ if(fp)
{
- fseek( fp, 0, SEEK_END );
- refBufferSize = ftell( fp );
- fseek( fp, 0, SEEK_SET );
- refBuffer = reinterpret_cast<Dali::Integration::PixelBuffer*>( malloc( refBufferSize ) );
- fread( refBuffer, sizeof( Dali::Integration::PixelBuffer ), refBufferSize, fp );
+ fseek(fp, 0, SEEK_END);
+ refBufferSize = ftell(fp);
+ fseek(fp, 0, SEEK_SET);
+ refBuffer = reinterpret_cast<Dali::Integration::PixelBuffer*>(malloc(refBufferSize));
+ fread(refBuffer, sizeof(Dali::Integration::PixelBuffer), refBufferSize, fp);
}
}
-
-LoadFunctions::LoadFunctions( LoadBitmapHeaderFunction _header, LoadBitmapFunction _loader )
-: header( _header ),
- loader( _loader )
+LoadFunctions::LoadFunctions(LoadBitmapHeaderFunction _header, LoadBitmapFunction _loader)
+: header(_header),
+ loader(_loader)
{
}
-void TestImageLoading( const ImageDetails& image, const LoadFunctions& functions, Dali::Integration::Bitmap::Profile bitmapProfile )
+void TestImageLoading(const ImageDetails& image, const LoadFunctions& functions, Dali::Integration::Bitmap::Profile bitmapProfile)
{
- FILE* fp = fopen( image.name.c_str() , "rb" );
- AutoCloseFile autoClose( fp );
- DALI_TEST_CHECK( fp != NULL );
+ FILE* fp = fopen(image.name.c_str(), "rb");
+ AutoCloseFile autoClose(fp);
+ DALI_TEST_CHECK(fp != NULL);
// Check the header file.
- unsigned int width(0), height(0);
- const Dali::ImageLoader::Input input( fp );
- DALI_TEST_CHECK( functions.header( input, width, height ) );
+ unsigned int width(0), height(0);
+ const Dali::ImageLoader::Input input(fp);
+ DALI_TEST_CHECK(functions.header(input, width, height));
- DALI_TEST_EQUALS( width, image.reportedWidth, TEST_LOCATION );
- DALI_TEST_EQUALS( height, image.reportedHeight, TEST_LOCATION );
+ DALI_TEST_EQUALS(width, image.reportedWidth, TEST_LOCATION);
+ DALI_TEST_EQUALS(height, image.reportedHeight, TEST_LOCATION);
// Loading the header moves the pointer within the file so reset to start of file.
- fseek( fp, 0, 0 );
+ fseek(fp, 0, 0);
Dali::Devel::PixelBuffer bitmap;
// Load Bitmap and check its return values.
- DALI_TEST_CHECK( functions.loader( input, bitmap ) );
- DALI_TEST_EQUALS( image.width, bitmap.GetWidth(), TEST_LOCATION );
- DALI_TEST_EQUALS( image.height, bitmap.GetHeight(), TEST_LOCATION );
+ DALI_TEST_CHECK(functions.loader(input, bitmap));
+ DALI_TEST_EQUALS(image.width, bitmap.GetWidth(), TEST_LOCATION);
+ DALI_TEST_EQUALS(image.height, bitmap.GetHeight(), TEST_LOCATION);
// Compare buffer generated with reference buffer.
- Dali::Integration::PixelBuffer* bufferPtr( bitmap.GetBuffer() );
- Dali::Integration::PixelBuffer* refBufferPtr( image.refBuffer );
- for ( unsigned int i = 0; i < image.refBufferSize; ++i, ++bufferPtr, ++refBufferPtr )
+ Dali::Integration::PixelBuffer* bufferPtr(bitmap.GetBuffer());
+ Dali::Integration::PixelBuffer* refBufferPtr(image.refBuffer);
+ for(unsigned int i = 0; i < image.refBufferSize; ++i, ++bufferPtr, ++refBufferPtr)
{
- if( *bufferPtr != *refBufferPtr )
+ if(*bufferPtr != *refBufferPtr)
{
- tet_result( TET_FAIL );
+ tet_result(TET_FAIL);
tet_printf("%s Failed in %s at line %d\n", __PRETTY_FUNCTION__, __FILE__, __LINE__);
break;
}
}
}
-void CompareLoadedImageData( const ImageDetails& image, const LoadFunctions& functions, const uint32_t* master )
+void CompareLoadedImageData(const ImageDetails& image, const LoadFunctions& functions, const uint32_t* master)
{
- FILE* filePointer = fopen( image.name.c_str() , "rb" );
- AutoCloseFile autoClose( filePointer );
- DALI_TEST_CHECK( filePointer != NULL );
+ FILE* filePointer = fopen(image.name.c_str(), "rb");
+ AutoCloseFile autoClose(filePointer);
+ DALI_TEST_CHECK(filePointer != NULL);
// Check the header file.
- unsigned int width = 0, height = 0;
- const Dali::ImageLoader::Input input( filePointer );
- DALI_TEST_CHECK( functions.header( input, width, height ) );
+ unsigned int width = 0, height = 0;
+ const Dali::ImageLoader::Input input(filePointer);
+ DALI_TEST_CHECK(functions.header(input, width, height));
- DALI_TEST_EQUALS( width, image.reportedWidth, TEST_LOCATION );
- DALI_TEST_EQUALS( height, image.reportedHeight, TEST_LOCATION );
+ DALI_TEST_EQUALS(width, image.reportedWidth, TEST_LOCATION);
+ DALI_TEST_EQUALS(height, image.reportedHeight, TEST_LOCATION);
// Loading the header moves the pointer within the file so reset to start of file.
- fseek( filePointer, 0, SEEK_SET );
+ fseek(filePointer, 0, SEEK_SET);
Dali::Devel::PixelBuffer bitmap;
// Load Bitmap and check its return values.
- DALI_TEST_CHECK( functions.loader( input, bitmap ) );
- DALI_TEST_EQUALS( image.width, bitmap.GetWidth(), TEST_LOCATION );
- DALI_TEST_EQUALS( image.height, bitmap.GetHeight(), TEST_LOCATION );
+ DALI_TEST_CHECK(functions.loader(input, bitmap));
+ DALI_TEST_EQUALS(image.width, bitmap.GetWidth(), TEST_LOCATION);
+ DALI_TEST_EQUALS(image.height, bitmap.GetHeight(), TEST_LOCATION);
// Check the bytes per pixel.
- const Pixel::Format pixelFormat = bitmap.GetPixelFormat();
- const unsigned int bytesPerPixel = Pixel::GetBytesPerPixel( pixelFormat );
+ const Pixel::Format pixelFormat = bitmap.GetPixelFormat();
+ const unsigned int bytesPerPixel = Pixel::GetBytesPerPixel(pixelFormat);
// Compare buffer generated with reference buffer.
- Dali::Integration::PixelBuffer* pBitmapData( bitmap.GetBuffer() );
- const uint32_t* pMaster( master );
+ Dali::Integration::PixelBuffer* pBitmapData(bitmap.GetBuffer());
+ const uint32_t* pMaster(master);
// Loop through each pixel in the bitmap.
- for ( unsigned int i = 0; i < image.refBufferSize; ++i, ++pMaster )
+ for(unsigned int i = 0; i < image.refBufferSize; ++i, ++pMaster)
{
unsigned int color = 0;
// Loop through each byte per pixel, to build up a color value for that pixel.
- for( unsigned int j = 0; j < bytesPerPixel; ++j, ++pBitmapData )
+ for(unsigned int j = 0; j < bytesPerPixel; ++j, ++pBitmapData)
{
- color = ( color << 8 ) | *pBitmapData;
+ color = (color << 8) | *pBitmapData;
}
// Check the color value is what we expect.
- DALI_TEST_EQUALS( color, *pMaster, TEST_LOCATION );
+ DALI_TEST_EQUALS(color, *pMaster, TEST_LOCATION);
}
}
-void DumpImageBufferToTempFile( std::string filename, std::string targetFilename, const LoadFunctions& functions )
+void DumpImageBufferToTempFile(std::string filename, std::string targetFilename, const LoadFunctions& functions)
{
- FILE* fp = fopen( filename.c_str() , "rb" );
- AutoCloseFile autoClose( fp );
+ FILE* fp = fopen(filename.c_str(), "rb");
+ AutoCloseFile autoClose(fp);
- Dali::Devel::PixelBuffer bitmap;
- const Dali::ImageLoader::Input input( fp );
+ Dali::Devel::PixelBuffer bitmap;
+ const Dali::ImageLoader::Input input(fp);
- DALI_TEST_CHECK( functions.loader( input, bitmap ) );
+ DALI_TEST_CHECK(functions.loader(input, bitmap));
- Dali::Integration::PixelBuffer* bufferPtr( bitmap.GetBuffer() );
+ Dali::Integration::PixelBuffer* bufferPtr(bitmap.GetBuffer());
- FILE* writeFp = fopen( targetFilename.c_str(), "wb" );
- AutoCloseFile autoCloseWrite( writeFp );
- auto& impl = GetImplementation(bitmap);
- fwrite( bufferPtr, 1, impl.GetBufferSize(), writeFp );
+ FILE* writeFp = fopen(targetFilename.c_str(), "wb");
+ AutoCloseFile autoCloseWrite(writeFp);
+ auto& impl = GetImplementation(bitmap);
+ fwrite(bufferPtr, 1, impl.GetBufferSize(), writeFp);
}
#define DALI_ADAPTOR_TET_IMAGE_LOADERS_H
#include <dali/dali.h>
-#include <dali/integration-api/bitmap.h>
-#include <dali/devel-api/adaptor-framework/pixel-buffer.h>
#include <dali/devel-api/adaptor-framework/image-loader-input.h>
+#include <dali/devel-api/adaptor-framework/pixel-buffer.h>
+#include <dali/integration-api/bitmap.h>
// Simple structure to close the file when finished with it.
struct AutoCloseFile
{
- AutoCloseFile( FILE *fp );
+ AutoCloseFile(FILE* fp);
~AutoCloseFile();
FILE* filePtr;
};
* @param[in] _width The width of the image.
* @param[in] _height The height of the image.
*/
- ImageDetails( const char * const _name, unsigned int _width, unsigned int _height );
+ ImageDetails(const char* const _name, unsigned int _width, unsigned int _height);
/**
* Sometimes an image reports an incorrect size in the header than what it actually is. In such a
* @param[in] _reportedWidth The reported width of the image by reading the header.
* @param[in] _reportedHeight The reported height of the image by reading the header.
*/
- ImageDetails( const char * const _name, unsigned int _width, unsigned int _height, unsigned int _reportedWidth, unsigned int _reportedHeight );
+ ImageDetails(const char* const _name, unsigned int _width, unsigned int _height, unsigned int _reportedWidth, unsigned int _reportedHeight);
/**
* Destructor
*/
~ImageDetails();
-
- std::string name;
- unsigned int width;
- unsigned int height;
- unsigned int reportedWidth;
- unsigned int reportedHeight;
- unsigned int refBufferSize;
+ std::string name;
+ unsigned int width;
+ unsigned int height;
+ unsigned int reportedWidth;
+ unsigned int reportedHeight;
+ unsigned int refBufferSize;
Dali::Integration::PixelBuffer* refBuffer;
private:
-
/**
* Loads the reference buffer file.
*/
*/
struct LoadFunctions
{
- typedef bool (*LoadBitmapFunction)( const Dali::ImageLoader::Input& input, Dali::Devel::PixelBuffer& );
- typedef bool (*LoadBitmapHeaderFunction)( const Dali::ImageLoader::Input& input, unsigned int& width, unsigned int& height );
+ typedef bool (*LoadBitmapFunction)(const Dali::ImageLoader::Input& input, Dali::Devel::PixelBuffer&);
+ typedef bool (*LoadBitmapHeaderFunction)(const Dali::ImageLoader::Input& input, unsigned int& width, unsigned int& height);
- LoadFunctions( LoadBitmapHeaderFunction _header, LoadBitmapFunction _loader );
+ LoadFunctions(LoadBitmapHeaderFunction _header, LoadBitmapFunction _loader);
LoadBitmapHeaderFunction header;
- LoadBitmapFunction loader;
+ LoadBitmapFunction loader;
};
// Helper method to test each image file.
* @param[in] functions The loader functions that need to be called.
* @param[in] bitmapProfile Whether or not the bitmap is raw
*/
-void TestImageLoading( const ImageDetails& image, const LoadFunctions& functions, Dali::Integration::Bitmap::Profile bitmapProfile = Dali::Integration::Bitmap::BITMAP_2D_PACKED_PIXELS );
+void TestImageLoading(const ImageDetails& image, const LoadFunctions& functions, Dali::Integration::Bitmap::Profile bitmapProfile = Dali::Integration::Bitmap::BITMAP_2D_PACKED_PIXELS);
/**
* Helper method to compare the resultant loaded image data of the specified image with a golden master data.
* @param[in] functions The functions to use to load the image
* @param[in] master Golden master data to compare the resultant loaded image with
*/
-void CompareLoadedImageData( const ImageDetails& image, const LoadFunctions& functions, const uint32_t* master );
+void CompareLoadedImageData(const ImageDetails& image, const LoadFunctions& functions, const uint32_t* master);
/**
* Helper function which should be used when first creating a reference buffer file.
* @param[in] targetFilename The path of where the buffer should be written to. This should ideally be in the "/tmp" folder.
* @param[in] functions The loader functions to call.
*/
-void DumpImageBufferToTempFile( std::string filename, std::string targetFilename, const LoadFunctions& functions );
+void DumpImageBufferToTempFile(std::string filename, std::string targetFilename, const LoadFunctions& functions);
#endif // DALI_ADAPTOR_TET_IMAGE_LOADERS_H
-#include <string.h>
#include <getopt.h>
#include <stdlib.h>
+#include <string.h>
#include <test-harness.h>
+
#include "tct-dali-adaptor-internal-core.h"
-int main(int argc, char * const argv[])
+int main(int argc, char* const argv[])
{
int result = TestHarness::EXIT_STATUS_BAD_ARGUMENT;
const char* optString = "sf";
- bool optRerunFailed(true);
- bool optRunSerially(false);
+ bool optRerunFailed(true);
+ bool optRunSerially(false);
int nextOpt = 0;
do
{
- nextOpt = getopt( argc, argv, optString );
+ nextOpt = getopt(argc, argv, optString);
switch(nextOpt)
{
case 'f':
exit(TestHarness::EXIT_STATUS_BAD_ARGUMENT);
break;
}
- } while( nextOpt != -1 );
+ } while(nextOpt != -1);
- if( optind == argc ) // no testcase name in argument list
+ if(optind == argc) // no testcase name in argument list
{
- if( optRunSerially )
+ if(optRunSerially)
{
- result = TestHarness::RunAll( argv[0], tc_array );
+ result = TestHarness::RunAll(argv[0], tc_array);
}
else
{
- result = TestHarness::RunAllInParallel( argv[0], tc_array, optRerunFailed );
+ result = TestHarness::RunAllInParallel(argv[0], tc_array, optRerunFailed);
}
}
else
* limitations under the License.
*
*/
-#include <dali/dali.h>
#include <dali-test-suite-utils.h>
+#include <dali/dali.h>
+#include <dali/devel-api/common/addon-binder.h>
#include <dali/integration-api/addon-manager.h>
#include <dali/internal/addons/common/addon-manager-factory.h>
-#include <dali/devel-api/common/addon-binder.h>
std::unique_ptr<Dali::Integration::AddOnManager> CreateAddOnManager()
{
// Set env variables
- setenv( "DALI_ADDONS_PATH", ADDON_LIBS_PATH, 1 );
- setenv( "DALI_ADDONS_LIBS", "libSampleAddOn.so", 1);
+ setenv("DALI_ADDONS_PATH", ADDON_LIBS_PATH, 1);
+ setenv("DALI_ADDONS_LIBS", "libSampleAddOn.so", 1);
- return std::unique_ptr<Dali::Integration::AddOnManager>( Dali::Internal::AddOnManagerFactory::CreateAddOnManager() );
+ return std::unique_ptr<Dali::Integration::AddOnManager>(Dali::Internal::AddOnManagerFactory::CreateAddOnManager());
}
struct TestAddOn : public Dali::AddOn::AddOnBinder
{
- TestAddOn() : AddOnBinder( "SampleAddOn", 0u )
- {}
+ TestAddOn()
+ : AddOnBinder("SampleAddOn", 0u)
+ {
+ }
- ADDON_BIND_FUNCTION( GetLifecycleStatus, bool() );
+ ADDON_BIND_FUNCTION(GetLifecycleStatus, bool());
};
int UtcDaliTestAddOnInterface(void)
TestAddOn addon;
- DALI_TEST_EQUALS( addon.IsValid(), true, TEST_LOCATION );
+ DALI_TEST_EQUALS(addon.IsValid(), true, TEST_LOCATION);
const auto& info = addon.GetAddOnInfo();
// Test returned addon version and type
- DALI_TEST_EQUALS( info.version, Dali::DALI_ADDON_VERSION( 1, 0 , 0), TEST_LOCATION );
- DALI_TEST_EQUALS( info.type, Dali::AddOnType::GENERIC, TEST_LOCATION );
+ DALI_TEST_EQUALS(info.version, Dali::DALI_ADDON_VERSION(1, 0, 0), TEST_LOCATION);
+ DALI_TEST_EQUALS(info.type, Dali::AddOnType::GENERIC, TEST_LOCATION);
// Test lifecycle
addOnManager->Pause();
auto result1 = addon.GetLifecycleStatus();
- DALI_TEST_EQUALS( result1, true, TEST_LOCATION );
+ DALI_TEST_EQUALS(result1, true, TEST_LOCATION);
addOnManager->Resume();
auto result2 = addon.GetLifecycleStatus();
- DALI_TEST_EQUALS( result2, false, TEST_LOCATION );
+ DALI_TEST_EQUALS(result2, false, TEST_LOCATION);
END_TEST;
}
bool result = addonManager != nullptr;
- DALI_TEST_EQUALS( result, true, TEST_LOCATION );
+ DALI_TEST_EQUALS(result, true, TEST_LOCATION);
auto availableAddons = addonManager->EnumerateAddOns();
// must be 1 addon available
- DALI_TEST_EQUALS( availableAddons.size(), 1u, TEST_LOCATION );
+ DALI_TEST_EQUALS(availableAddons.size(), 1u, TEST_LOCATION);
Dali::AddOnInfo info{};
- addonManager->GetAddOnInfo( availableAddons[0], info );
+ addonManager->GetAddOnInfo(availableAddons[0], info);
// Test returned addon version and type
- DALI_TEST_EQUALS( info.version, Dali::DALI_ADDON_VERSION( 1, 0 , 0), TEST_LOCATION );
- DALI_TEST_EQUALS( info.type, Dali::AddOnType::GENERIC, TEST_LOCATION );
+ DALI_TEST_EQUALS(info.version, Dali::DALI_ADDON_VERSION(1, 0, 0), TEST_LOCATION);
+ DALI_TEST_EQUALS(info.type, Dali::AddOnType::GENERIC, TEST_LOCATION);
// Get addon handle
- auto testAddon = addonManager->GetAddOn( availableAddons[0] );
- result = testAddon != 0;
- DALI_TEST_EQUALS( result, true, TEST_LOCATION );
+ auto testAddon = addonManager->GetAddOn(availableAddons[0]);
+ result = testAddon != 0;
+ DALI_TEST_EQUALS(result, true, TEST_LOCATION);
// Get addon global function
- auto createInstance = addonManager->GetGlobalProc<void*()>( testAddon, "CreateInstance");
- result = createInstance != nullptr;
- DALI_TEST_EQUALS( result, true, TEST_LOCATION );
+ auto createInstance = addonManager->GetGlobalProc<void*()>(testAddon, "CreateInstance");
+ result = createInstance != nullptr;
+ DALI_TEST_EQUALS(result, true, TEST_LOCATION);
// Test for false positive (queried function must not be found)
- auto dummyfunction = addonManager->GetGlobalProc<void*()>( testAddon, "ThisFunctionDoesntExist");
- result = dummyfunction == nullptr;
- DALI_TEST_EQUALS( result, true, TEST_LOCATION );
+ auto dummyfunction = addonManager->GetGlobalProc<void*()>(testAddon, "ThisFunctionDoesntExist");
+ result = dummyfunction == nullptr;
+ DALI_TEST_EQUALS(result, true, TEST_LOCATION);
// Get Instance function and call it, expect answer 42
- auto instanceFunction = addonManager->GetInstanceProc<uint32_t(void*)>( testAddon, "InstanceCall" );
- auto* instance = createInstance();
- auto answer = instanceFunction( instance );
- DALI_TEST_EQUALS( answer, 42, TEST_LOCATION );
+ auto instanceFunction = addonManager->GetInstanceProc<uint32_t(void*)>(testAddon, "InstanceCall");
+ auto* instance = createInstance();
+ auto answer = instanceFunction(instance);
+ DALI_TEST_EQUALS(answer, 42, TEST_LOCATION);
// Test lifecycle
- auto GetLifecycleStatus = addonManager->GetGlobalProc<bool()>( testAddon, "GetLifecycleStatus");
+ auto GetLifecycleStatus = addonManager->GetGlobalProc<bool()>(testAddon, "GetLifecycleStatus");
addonManager->Pause();
- DALI_TEST_EQUALS( GetLifecycleStatus(), true, TEST_LOCATION );
+ DALI_TEST_EQUALS(GetLifecycleStatus(), true, TEST_LOCATION);
addonManager->Resume();
- DALI_TEST_EQUALS( GetLifecycleStatus(), false, TEST_LOCATION );
+ DALI_TEST_EQUALS(GetLifecycleStatus(), false, TEST_LOCATION);
END_TEST;
}
\ No newline at end of file
*
*/
-#include <iostream>
-#include <stdlib.h>
#include <dali-test-suite-utils.h>
+#include <stdlib.h>
+#include <iostream>
#include <dali/internal/imaging/common/loader-bmp.h>
#include "image-loaders.h"
namespace
{
-
-static const LoadFunctions BmpLoaders( TizenPlatform::LoadBmpHeader, TizenPlatform::LoadBitmapFromBmp );
+static const LoadFunctions BmpLoaders(TizenPlatform::LoadBmpHeader, TizenPlatform::LoadBitmapFromBmp);
} // Unnamed namespace.
int UtcDaliBmp24bpp(void)
{
- ImageDetails image( TEST_IMAGE_DIR "/flag-24bpp.bmp", 32u, 32u );
+ ImageDetails image(TEST_IMAGE_DIR "/flag-24bpp.bmp", 32u, 32u);
- TestImageLoading( image, BmpLoaders );
+ TestImageLoading(image, BmpLoaders);
END_TEST;
}
-
#include <iostream>
-#include <stdlib.h>
-#include <getopt.h>
+#include <dali-test-suite-utils.h>
#include <dali/dali.h>
#include <dali/internal/system/common/command-line-options.h>
-#include <dali-test-suite-utils.h>
+#include <getopt.h>
+#include <stdlib.h>
using namespace Dali;
using namespace Dali::Internal::Adaptor;
-
// Called only once before first test is run.
void command_line_options_startup(void)
{
test_return_value = TET_UNDEF;
- optind = 0; // Reset opt for test
+ optind = 0; // Reset opt for test
}
// Called only once after last test is run
int UtcDaliCommandLineOptionsNoArgs(void)
{
- optind=0;
+ optind = 0;
- int argc( 1 );
- const char* argList[1] = { "program" };
- char** argv = const_cast<char**>(argList);
+ int argc(1);
+ const char* argList[1] = {"program"};
+ char** argv = const_cast<char**>(argList);
- CommandLineOptions options( &argc, &argv );
+ CommandLineOptions options(&argc, &argv);
- DALI_TEST_EQUALS( argc, 1, TEST_LOCATION );
+ DALI_TEST_EQUALS(argc, 1, TEST_LOCATION);
// Check values
- DALI_TEST_EQUALS( options.stageWidth, 0, TEST_LOCATION );
- DALI_TEST_EQUALS( options.stageHeight, 0, TEST_LOCATION );
- DALI_TEST_EQUALS( options.stageDPI, "", TEST_LOCATION );
+ DALI_TEST_EQUALS(options.stageWidth, 0, TEST_LOCATION);
+ DALI_TEST_EQUALS(options.stageHeight, 0, TEST_LOCATION);
+ DALI_TEST_EQUALS(options.stageDPI, "", TEST_LOCATION);
END_TEST;
}
int UtcDaliCommandLineOptionsDaliShortArgs(void)
{
- optind=0;
+ optind = 0;
const char* argList[] =
- {
+ {
"program",
- "-w", "800",
- "-h", "1000",
- "-d", "4x5",
- };
- int argc( sizeof( argList ) / sizeof( argList[0] ) );
+ "-w",
+ "800",
+ "-h",
+ "1000",
+ "-d",
+ "4x5",
+ };
+ int argc(sizeof(argList) / sizeof(argList[0]));
char** argv = const_cast<char**>(argList);
- CommandLineOptions options( &argc, &argv );
+ CommandLineOptions options(&argc, &argv);
// Should strip out the height and width
- DALI_TEST_EQUALS( argc, 1, TEST_LOCATION );
+ DALI_TEST_EQUALS(argc, 1, TEST_LOCATION);
// Check values
- DALI_TEST_EQUALS( options.stageWidth, 800, TEST_LOCATION );
- DALI_TEST_EQUALS( options.stageHeight, 1000, TEST_LOCATION );
- DALI_TEST_EQUALS( options.stageDPI, "4x5", TEST_LOCATION );
+ DALI_TEST_EQUALS(options.stageWidth, 800, TEST_LOCATION);
+ DALI_TEST_EQUALS(options.stageHeight, 1000, TEST_LOCATION);
+ DALI_TEST_EQUALS(options.stageDPI, "4x5", TEST_LOCATION);
END_TEST;
}
int UtcDaliCommandLineOptionsDaliLongArgsEqualsSign(void)
{
- optind=0;
+ optind = 0;
const char* argList[] =
- {
+ {
"program",
"--width=800",
"--height=1000",
"--dpi=3x4",
- "--help"
- };
- int argc( sizeof( argList ) / sizeof( argList[0] ) );
+ "--help"};
+ int argc(sizeof(argList) / sizeof(argList[0]));
char** argv = const_cast<char**>(argList);
- CommandLineOptions options( &argc, &argv );
+ CommandLineOptions options(&argc, &argv);
// Should strip out the height and width
- DALI_TEST_EQUALS( argc, 1, TEST_LOCATION );
+ DALI_TEST_EQUALS(argc, 1, TEST_LOCATION);
// Check values
- DALI_TEST_EQUALS( options.stageWidth, 800, TEST_LOCATION );
- DALI_TEST_EQUALS( options.stageHeight, 1000, TEST_LOCATION );
- DALI_TEST_EQUALS( options.stageDPI, "3x4", TEST_LOCATION );
+ DALI_TEST_EQUALS(options.stageWidth, 800, TEST_LOCATION);
+ DALI_TEST_EQUALS(options.stageHeight, 1000, TEST_LOCATION);
+ DALI_TEST_EQUALS(options.stageDPI, "3x4", TEST_LOCATION);
END_TEST;
}
int UtcDaliCommandLineOptionsDaliLongArgsSpaces(void)
{
- optind=0;
+ optind = 0;
const char* argList[] =
- {
+ {
"program",
- "--width", "800",
- "--height", "1000",
- "--dpi", "3x4",
- "--help"
- };
- int argc( sizeof( argList ) / sizeof( argList[0] ) );
+ "--width",
+ "800",
+ "--height",
+ "1000",
+ "--dpi",
+ "3x4",
+ "--help"};
+ int argc(sizeof(argList) / sizeof(argList[0]));
char** argv = const_cast<char**>(argList);
- CommandLineOptions options( &argc, &argv );
+ CommandLineOptions options(&argc, &argv);
// Should strip out the height and width
- DALI_TEST_EQUALS( argc, 1, TEST_LOCATION );
+ DALI_TEST_EQUALS(argc, 1, TEST_LOCATION);
// Check values
- DALI_TEST_EQUALS( options.stageWidth, 800, TEST_LOCATION );
- DALI_TEST_EQUALS( options.stageHeight, 1000, TEST_LOCATION );
- DALI_TEST_EQUALS( options.stageDPI, "3x4", TEST_LOCATION );
+ DALI_TEST_EQUALS(options.stageWidth, 800, TEST_LOCATION);
+ DALI_TEST_EQUALS(options.stageHeight, 1000, TEST_LOCATION);
+ DALI_TEST_EQUALS(options.stageDPI, "3x4", TEST_LOCATION);
END_TEST;
}
int UtcDaliCommandLineOptionsNonDaliArgs(void)
{
- optind=0;
+ optind = 0;
const char* argList[] =
- {
+ {
"program",
"hello-world",
- "-y", "600",
- };
- int argc( sizeof( argList ) / sizeof( argList[0] ) );
+ "-y",
+ "600",
+ };
+ int argc(sizeof(argList) / sizeof(argList[0]));
char** argv = const_cast<char**>(argList);
- CommandLineOptions options( &argc, &argv );
+ CommandLineOptions options(&argc, &argv);
// Should still be the same
- DALI_TEST_EQUALS( argc, 4, TEST_LOCATION );
+ DALI_TEST_EQUALS(argc, 4, TEST_LOCATION);
// Ensure order has not changed
- DALI_TEST_EQUALS( argList[0], "program", TEST_LOCATION );
- DALI_TEST_EQUALS( argList[1], "hello-world", TEST_LOCATION );
- DALI_TEST_EQUALS( argList[2], "-y", TEST_LOCATION );
- DALI_TEST_EQUALS( argList[3], "600", TEST_LOCATION );
+ DALI_TEST_EQUALS(argList[0], "program", TEST_LOCATION);
+ DALI_TEST_EQUALS(argList[1], "hello-world", TEST_LOCATION);
+ DALI_TEST_EQUALS(argList[2], "-y", TEST_LOCATION);
+ DALI_TEST_EQUALS(argList[3], "600", TEST_LOCATION);
END_TEST;
}
optind = 0; // Reset opt for test
const char* argList[] =
- {
- "program",
- "--width=800",
- "hello-world",
- "-y", "600",
- "--height", "1000",
- "-r",
- };
- int argc( sizeof( argList ) / sizeof( argList[0] ) );
- char** argv = const_cast<char**>( argList );
-
- CommandLineOptions options( &argc, &argv );
+ {
+ "program",
+ "--width=800",
+ "hello-world",
+ "-y",
+ "600",
+ "--height",
+ "1000",
+ "-r",
+ };
+ int argc(sizeof(argList) / sizeof(argList[0]));
+ char** argv = const_cast<char**>(argList);
+
+ CommandLineOptions options(&argc, &argv);
// Should still be the same
- DALI_TEST_EQUALS( argc, 5, TEST_LOCATION );
+ DALI_TEST_EQUALS(argc, 5, TEST_LOCATION);
// Ensure order of program name and unhandled options has not changed
- DALI_TEST_EQUALS( argList[0], "program", TEST_LOCATION );
- DALI_TEST_EQUALS( argList[1], "hello-world", TEST_LOCATION );
- DALI_TEST_EQUALS( argList[2], "-y", TEST_LOCATION );
- DALI_TEST_EQUALS( argList[3], "600", TEST_LOCATION );
- DALI_TEST_EQUALS( argList[4], "-r", TEST_LOCATION );
+ DALI_TEST_EQUALS(argList[0], "program", TEST_LOCATION);
+ DALI_TEST_EQUALS(argList[1], "hello-world", TEST_LOCATION);
+ DALI_TEST_EQUALS(argList[2], "-y", TEST_LOCATION);
+ DALI_TEST_EQUALS(argList[3], "600", TEST_LOCATION);
+ DALI_TEST_EQUALS(argList[4], "-r", TEST_LOCATION);
END_TEST;
}
int UtcDaliCommandLineOptionsMixtureDaliOpsAtStart(void)
{
- optind=0;
+ optind = 0;
const char* argList[] =
- {
+ {
"program",
"--width=800",
- "--height", "1000",
+ "--height",
+ "1000",
"-r",
"hello-world",
- "-y", "600",
- };
- int argc( sizeof( argList ) / sizeof( argList[0] ) );
- char** argv = const_cast<char**>( argList );
+ "-y",
+ "600",
+ };
+ int argc(sizeof(argList) / sizeof(argList[0]));
+ char** argv = const_cast<char**>(argList);
- CommandLineOptions options( &argc, &argv );
+ CommandLineOptions options(&argc, &argv);
// Should still be the same
- DALI_TEST_EQUALS( argc, 5, TEST_LOCATION );
+ DALI_TEST_EQUALS(argc, 5, TEST_LOCATION);
// Ensure order of program name and unhandled options has not changed
- DALI_TEST_EQUALS( argList[0], "program", TEST_LOCATION );
- DALI_TEST_EQUALS( argList[1], "-r", TEST_LOCATION );
- DALI_TEST_EQUALS( argList[2], "hello-world", TEST_LOCATION );
- DALI_TEST_EQUALS( argList[3], "-y", TEST_LOCATION );
- DALI_TEST_EQUALS( argList[4], "600", TEST_LOCATION );
+ DALI_TEST_EQUALS(argList[0], "program", TEST_LOCATION);
+ DALI_TEST_EQUALS(argList[1], "-r", TEST_LOCATION);
+ DALI_TEST_EQUALS(argList[2], "hello-world", TEST_LOCATION);
+ DALI_TEST_EQUALS(argList[3], "-y", TEST_LOCATION);
+ DALI_TEST_EQUALS(argList[4], "600", TEST_LOCATION);
END_TEST;
}
int UtcDaliCommandLineOptionsMixtureDaliOpsAtEnd(void)
{
- optind=0;
+ optind = 0;
const char* argList[] =
- {
+ {
"program",
"hello-world",
- "-y", "600",
+ "-y",
+ "600",
"-r",
"--width=800",
- "--height", "1000",
- };
- int argc( sizeof( argList ) / sizeof( argList[0] ) );
- char** argv = const_cast<char**>( argList );
+ "--height",
+ "1000",
+ };
+ int argc(sizeof(argList) / sizeof(argList[0]));
+ char** argv = const_cast<char**>(argList);
- CommandLineOptions options( &argc, &argv );
+ CommandLineOptions options(&argc, &argv);
// Should still be the same
- DALI_TEST_EQUALS( argc, 5, TEST_LOCATION );
+ DALI_TEST_EQUALS(argc, 5, TEST_LOCATION);
// Ensure order of program name and unhandled options has not changed
- DALI_TEST_EQUALS( argList[0], "program", TEST_LOCATION );
- DALI_TEST_EQUALS( argList[1], "hello-world", TEST_LOCATION );
- DALI_TEST_EQUALS( argList[2], "-y", TEST_LOCATION );
- DALI_TEST_EQUALS( argList[3], "600", TEST_LOCATION );
- DALI_TEST_EQUALS( argList[4], "-r", TEST_LOCATION );
+ DALI_TEST_EQUALS(argList[0], "program", TEST_LOCATION);
+ DALI_TEST_EQUALS(argList[1], "hello-world", TEST_LOCATION);
+ DALI_TEST_EQUALS(argList[2], "-y", TEST_LOCATION);
+ DALI_TEST_EQUALS(argList[3], "600", TEST_LOCATION);
+ DALI_TEST_EQUALS(argList[4], "-r", TEST_LOCATION);
END_TEST;
}
/*
- * Copyright (c) 2016 Samsung Electronics Co., Ltd.
+ * Copyright (c) 2020 Samsung Electronics Co., Ltd.
*
* Licensed under the Apache License, Version 2.0 (the "License");
* you may not use this file except in compliance with the License.
*/
// EXTERNAL INCLUDES
-#include <iostream>
-#include <stdlib.h>
-#include <vector>
#include <dali-test-suite-utils.h>
-#include <dali/internal/imaging/common/loader-ktx.h>
#include <dali/internal/imaging/common/loader-astc.h>
+#include <dali/internal/imaging/common/loader-ktx.h>
+#include <stdlib.h>
+#include <iostream>
+#include <vector>
// INTERNAL INCLUDES
#include "image-loaders.h"
using namespace Dali;
// Pre-define loader functions for each image type being tested (as they are reused in different tests).
-static const LoadFunctions KtxLoaders( TizenPlatform::LoadKtxHeader, TizenPlatform::LoadBitmapFromKtx );
-static const LoadFunctions AstcLoaders( TizenPlatform::LoadAstcHeader, TizenPlatform::LoadBitmapFromAstc );
+static const LoadFunctions KtxLoaders(TizenPlatform::LoadKtxHeader, TizenPlatform::LoadBitmapFromKtx);
+static const LoadFunctions AstcLoaders(TizenPlatform::LoadAstcHeader, TizenPlatform::LoadBitmapFromAstc);
/**
* This class encapsulates knowledge of testing compressed files.
*/
class KtxTestFixture
{
- public:
-
- /**
+public:
+ /**
* Constructor.
* Sets up the fixture.
*/
- KtxTestFixture( void )
- {
- }
+ KtxTestFixture(void)
+ {
+ }
- /**
+ /**
* Destructor.
*/
- ~KtxTestFixture()
- {
- }
+ ~KtxTestFixture()
+ {
+ }
- /**
+ /**
* This struct contains any per-test parameters.
* This should be added to if more properties of a file/format should be tested.
*/
- struct TestEntry
+ struct TestEntry
+ {
+ LoadFunctions loadFunctions; ///< Used to parse the header of a given type of image.
+ std::string filename; ///< Name of the compressed texture KTX file to load.
+ int expectedWidth; ///< The width the texture should be.
+ int expectedHeight; ///< The height the KTX texture should be.
+
+ TestEntry(const LoadFunctions& newLoadFunctions, std::string newFilename, int newExpectedWidth, int newExpectedHeight)
+ : loadFunctions(newLoadFunctions),
+ filename(newFilename),
+ expectedWidth(newExpectedWidth),
+ expectedHeight(newExpectedHeight)
{
- LoadFunctions loadFunctions; ///< Used to parse the header of a given type of image.
- std::string filename; ///< Name of the compressed texture KTX file to load.
- int expectedWidth; ///< The width the texture should be.
- int expectedHeight; ///< The height the KTX texture should be.
-
- TestEntry( const LoadFunctions& newLoadFunctions, std::string newFilename, int newExpectedWidth, int newExpectedHeight )
- : loadFunctions( newLoadFunctions ),
- filename( newFilename ),
- expectedWidth( newExpectedWidth ),
- expectedHeight( newExpectedHeight )
- {
- }
- };
-
- private:
-
- typedef std::vector< TestEntry > TestContainer;
+ }
+ };
- public:
+private:
+ typedef std::vector<TestEntry> TestContainer;
- /**
+public:
+ /**
* Adds a test to be performed.
* @param[in] testEntry A TestEntry struct containing all the details to perform one test.
*/
- void AddTest( TestEntry testEntry )
- {
- mTests.push_back( testEntry );
- }
+ void AddTest(TestEntry testEntry)
+ {
+ mTests.push_back(testEntry);
+ }
- /**
+ /**
* Runs all tests created with "AddTest".
* This will create failures upon failing tests.
*/
- void RunTests()
+ void RunTests()
+ {
+ for(TestContainer::iterator testIterator = mTests.begin(); testIterator != mTests.end(); ++testIterator)
{
- for( TestContainer::iterator testIterator = mTests.begin(); testIterator != mTests.end(); ++testIterator )
- {
- const TestEntry& currentTest = *testIterator;
+ const TestEntry& currentTest = *testIterator;
- RunTest( currentTest );
- }
+ RunTest(currentTest);
}
+ }
- private:
-
- /**
+private:
+ /**
* Sets up, Runs and Closes-down an individual test.
* @param[in] testEntry A TestEntry struct containing all the details to perform one test.
*/
- void RunTest( const TestEntry& testEntry )
- {
- FILE* fileDescriptor = fopen( testEntry.filename.c_str(), "rb" );
- AutoCloseFile autoClose( fileDescriptor );
- DALI_TEST_CHECK( fileDescriptor != NULL );
-
- // Check the header file.
- unsigned int width( 0 ), height( 0 );
- const Dali::ImageLoader::Input input( fileDescriptor );
-
- // Use the given loader to parse the image header.
- DALI_TEST_CHECK( testEntry.loadFunctions.header( input, width, height ) );
+ void RunTest(const TestEntry& testEntry)
+ {
+ FILE* fileDescriptor = fopen(testEntry.filename.c_str(), "rb");
+ AutoCloseFile autoClose(fileDescriptor);
+ DALI_TEST_CHECK(fileDescriptor != NULL);
- DALI_TEST_EQUALS( width, testEntry.expectedWidth, TEST_LOCATION );
- DALI_TEST_EQUALS( height, testEntry.expectedHeight, TEST_LOCATION );
- }
+ // Check the header file.
+ unsigned int width(0), height(0);
+ const Dali::ImageLoader::Input input(fileDescriptor);
- private:
+ // Use the given loader to parse the image header.
+ DALI_TEST_CHECK(testEntry.loadFunctions.header(input, width, height));
- TestContainer mTests; ///< Holds all tests to be run.
+ DALI_TEST_EQUALS(width, testEntry.expectedWidth, TEST_LOCATION);
+ DALI_TEST_EQUALS(height, testEntry.expectedHeight, TEST_LOCATION);
+ }
+private:
+ TestContainer mTests; ///< Holds all tests to be run.
};
// KTX files (KTX is a wrapper, so can contain different compressed texture types):
{
KtxTestFixture fixture;
- fixture.AddTest( KtxTestFixture::TestEntry( KtxLoaders, TEST_IMAGE_DIR "/fractal-compressed-ETC1_RGB8_OES-45x80.ktx", 45u, 80u ) );
- fixture.AddTest( KtxTestFixture::TestEntry( KtxLoaders, TEST_IMAGE_DIR "/fractal-compressed-RGB8_ETC2-45x80.ktx", 45u, 80u ) );
+ fixture.AddTest(KtxTestFixture::TestEntry(KtxLoaders, TEST_IMAGE_DIR "/fractal-compressed-ETC1_RGB8_OES-45x80.ktx", 45u, 80u));
+ fixture.AddTest(KtxTestFixture::TestEntry(KtxLoaders, TEST_IMAGE_DIR "/fractal-compressed-RGB8_ETC2-45x80.ktx", 45u, 80u));
fixture.RunTests();
{
KtxTestFixture fixture;
- fixture.AddTest( KtxTestFixture::TestEntry( KtxLoaders, TEST_IMAGE_DIR "/fractal-compressed-RGB_PVRTC_4BPPV1_IMG-32x64.ktx", 32u, 64u ) );
+ fixture.AddTest(KtxTestFixture::TestEntry(KtxLoaders, TEST_IMAGE_DIR "/fractal-compressed-RGB_PVRTC_4BPPV1_IMG-32x64.ktx", 32u, 64u));
fixture.RunTests();
{
KtxTestFixture fixture;
- fixture.AddTest( KtxTestFixture::TestEntry( KtxLoaders, TEST_IMAGE_DIR "/fractal-compressed-R11_EAC-45x80.ktx", 45u, 80u ) );
+ fixture.AddTest(KtxTestFixture::TestEntry(KtxLoaders, TEST_IMAGE_DIR "/fractal-compressed-R11_EAC-45x80.ktx", 45u, 80u));
fixture.RunTests();
{
KtxTestFixture fixture;
- fixture.AddTest( KtxTestFixture::TestEntry( KtxLoaders, TEST_IMAGE_DIR "/fractal-compressed-RGBA_ASTC_4x4_KHR-32x64.ktx", 32u, 64u ) );
- fixture.AddTest( KtxTestFixture::TestEntry( KtxLoaders, TEST_IMAGE_DIR "/fractal-compressed-SRBG8_ALPHA8_ASTC_4x4_KHR-32x64.ktx", 32u, 64u ) );
+ fixture.AddTest(KtxTestFixture::TestEntry(KtxLoaders, TEST_IMAGE_DIR "/fractal-compressed-RGBA_ASTC_4x4_KHR-32x64.ktx", 32u, 64u));
+ fixture.AddTest(KtxTestFixture::TestEntry(KtxLoaders, TEST_IMAGE_DIR "/fractal-compressed-SRBG8_ALPHA8_ASTC_4x4_KHR-32x64.ktx", 32u, 64u));
fixture.RunTests();
END_TEST;
}
-
// ASTC (Native) files:
int UtcDaliAstcLoader(void)
{
KtxTestFixture fixture;
- fixture.AddTest( KtxTestFixture::TestEntry( AstcLoaders, TEST_IMAGE_DIR "/fractal-compressed-RGBA_ASTC_4x4_KHR-32x64.astc", 32u, 64u ) );
+ fixture.AddTest(KtxTestFixture::TestEntry(AstcLoaders, TEST_IMAGE_DIR "/fractal-compressed-RGBA_ASTC_4x4_KHR-32x64.astc", 32u, 64u));
fixture.RunTests();
END_TEST;
}
-
#include <iostream>
-#include <stdlib.h>
-#include <stdint.h>
-#include <dali/dali.h>
#include <dali-test-suite-utils.h>
+#include <dali/dali.h>
#include <dali/internal/text/text-abstraction/font-client-helper.h>
+#include <stdint.h>
+#include <stdlib.h>
using namespace Dali;
int UtcDaliFontClient(void)
{
- const int ORDERED_VALUES[] = { -1, 50, 63, 75, 87, 100, 113, 125, 150, 200 };
+ const int ORDERED_VALUES[] = {-1, 50, 63, 75, 87, 100, 113, 125, 150, 200};
- const unsigned int NUM_OF_ORDERED_VALUES = sizeof( ORDERED_VALUES ) / sizeof( int );
+ const unsigned int NUM_OF_ORDERED_VALUES = sizeof(ORDERED_VALUES) / sizeof(int);
TestApplication application;
- int result=0;
+ int result = 0;
tet_infoline("UtcDaliFontClient No table");
- result = TextAbstraction::Internal::ValueToIndex( 100, NULL, 0u );
- DALI_TEST_EQUALS( -1, result, TEST_LOCATION );
+ result = TextAbstraction::Internal::ValueToIndex(100, NULL, 0u);
+ DALI_TEST_EQUALS(-1, result, TEST_LOCATION);
tet_infoline("UtcDaliFontClient Non defined values");
- result = TextAbstraction::Internal::ValueToIndex( -1, ORDERED_VALUES, NUM_OF_ORDERED_VALUES - 1u );
- DALI_TEST_EQUALS( 0, result, TEST_LOCATION );
- result = TextAbstraction::Internal::ValueToIndex( -3, ORDERED_VALUES, NUM_OF_ORDERED_VALUES - 1u );
- DALI_TEST_EQUALS( 0, result, TEST_LOCATION );
+ result = TextAbstraction::Internal::ValueToIndex(-1, ORDERED_VALUES, NUM_OF_ORDERED_VALUES - 1u);
+ DALI_TEST_EQUALS(0, result, TEST_LOCATION);
+ result = TextAbstraction::Internal::ValueToIndex(-3, ORDERED_VALUES, NUM_OF_ORDERED_VALUES - 1u);
+ DALI_TEST_EQUALS(0, result, TEST_LOCATION);
tet_infoline("UtcDaliFontClient Between non defined and first of range.");
- result = TextAbstraction::Internal::ValueToIndex( 0, ORDERED_VALUES, NUM_OF_ORDERED_VALUES - 1u );
- DALI_TEST_EQUALS( 1, result, TEST_LOCATION );
- result = TextAbstraction::Internal::ValueToIndex( 30, ORDERED_VALUES, NUM_OF_ORDERED_VALUES - 1u );
- DALI_TEST_EQUALS( 1, result, TEST_LOCATION );
- result = TextAbstraction::Internal::ValueToIndex( 49, ORDERED_VALUES, NUM_OF_ORDERED_VALUES - 1u );
- DALI_TEST_EQUALS( 1, result, TEST_LOCATION );
+ result = TextAbstraction::Internal::ValueToIndex(0, ORDERED_VALUES, NUM_OF_ORDERED_VALUES - 1u);
+ DALI_TEST_EQUALS(1, result, TEST_LOCATION);
+ result = TextAbstraction::Internal::ValueToIndex(30, ORDERED_VALUES, NUM_OF_ORDERED_VALUES - 1u);
+ DALI_TEST_EQUALS(1, result, TEST_LOCATION);
+ result = TextAbstraction::Internal::ValueToIndex(49, ORDERED_VALUES, NUM_OF_ORDERED_VALUES - 1u);
+ DALI_TEST_EQUALS(1, result, TEST_LOCATION);
tet_infoline("UtcDaliFontClient Defined in range");
- for( unsigned int index = 1u; index < NUM_OF_ORDERED_VALUES; ++index )
+ for(unsigned int index = 1u; index < NUM_OF_ORDERED_VALUES; ++index)
{
- result = TextAbstraction::Internal::ValueToIndex( ORDERED_VALUES[index], ORDERED_VALUES, NUM_OF_ORDERED_VALUES - 1u );
- DALI_TEST_EQUALS( index, result, TEST_LOCATION );
+ result = TextAbstraction::Internal::ValueToIndex(ORDERED_VALUES[index], ORDERED_VALUES, NUM_OF_ORDERED_VALUES - 1u);
+ DALI_TEST_EQUALS(index, result, TEST_LOCATION);
}
tet_infoline("UtcDaliFontClient Non defined in range");
- result = TextAbstraction::Internal::ValueToIndex( 51, ORDERED_VALUES, NUM_OF_ORDERED_VALUES - 1u );
- DALI_TEST_EQUALS( 1, result, TEST_LOCATION );
- result = TextAbstraction::Internal::ValueToIndex( 55, ORDERED_VALUES, NUM_OF_ORDERED_VALUES - 1u );
- DALI_TEST_EQUALS( 1, result, TEST_LOCATION );
- result = TextAbstraction::Internal::ValueToIndex( 62, ORDERED_VALUES, NUM_OF_ORDERED_VALUES - 1u );
- DALI_TEST_EQUALS( 2, result, TEST_LOCATION );
- result = TextAbstraction::Internal::ValueToIndex( 64, ORDERED_VALUES, NUM_OF_ORDERED_VALUES - 1u );
- DALI_TEST_EQUALS( 2, result, TEST_LOCATION );
- result = TextAbstraction::Internal::ValueToIndex( 151, ORDERED_VALUES, NUM_OF_ORDERED_VALUES - 1u );
- DALI_TEST_EQUALS( 8, result, TEST_LOCATION );
- result = TextAbstraction::Internal::ValueToIndex( 175, ORDERED_VALUES, NUM_OF_ORDERED_VALUES - 1u );
- DALI_TEST_EQUALS( 9, result, TEST_LOCATION );
- result = TextAbstraction::Internal::ValueToIndex( 176, ORDERED_VALUES, NUM_OF_ORDERED_VALUES - 1u );
- DALI_TEST_EQUALS( 9, result, TEST_LOCATION );
- result = TextAbstraction::Internal::ValueToIndex( 199, ORDERED_VALUES, NUM_OF_ORDERED_VALUES - 1u );
- DALI_TEST_EQUALS( 9, result, TEST_LOCATION );
+ result = TextAbstraction::Internal::ValueToIndex(51, ORDERED_VALUES, NUM_OF_ORDERED_VALUES - 1u);
+ DALI_TEST_EQUALS(1, result, TEST_LOCATION);
+ result = TextAbstraction::Internal::ValueToIndex(55, ORDERED_VALUES, NUM_OF_ORDERED_VALUES - 1u);
+ DALI_TEST_EQUALS(1, result, TEST_LOCATION);
+ result = TextAbstraction::Internal::ValueToIndex(62, ORDERED_VALUES, NUM_OF_ORDERED_VALUES - 1u);
+ DALI_TEST_EQUALS(2, result, TEST_LOCATION);
+ result = TextAbstraction::Internal::ValueToIndex(64, ORDERED_VALUES, NUM_OF_ORDERED_VALUES - 1u);
+ DALI_TEST_EQUALS(2, result, TEST_LOCATION);
+ result = TextAbstraction::Internal::ValueToIndex(151, ORDERED_VALUES, NUM_OF_ORDERED_VALUES - 1u);
+ DALI_TEST_EQUALS(8, result, TEST_LOCATION);
+ result = TextAbstraction::Internal::ValueToIndex(175, ORDERED_VALUES, NUM_OF_ORDERED_VALUES - 1u);
+ DALI_TEST_EQUALS(9, result, TEST_LOCATION);
+ result = TextAbstraction::Internal::ValueToIndex(176, ORDERED_VALUES, NUM_OF_ORDERED_VALUES - 1u);
+ DALI_TEST_EQUALS(9, result, TEST_LOCATION);
+ result = TextAbstraction::Internal::ValueToIndex(199, ORDERED_VALUES, NUM_OF_ORDERED_VALUES - 1u);
+ DALI_TEST_EQUALS(9, result, TEST_LOCATION);
tet_infoline("UtcDaliFontClient above of range");
- result = TextAbstraction::Internal::ValueToIndex( 220, ORDERED_VALUES, NUM_OF_ORDERED_VALUES - 1u );
- DALI_TEST_EQUALS( 9, result, TEST_LOCATION );
- result = TextAbstraction::Internal::ValueToIndex( 500, ORDERED_VALUES, NUM_OF_ORDERED_VALUES - 1u );
- DALI_TEST_EQUALS( 9, result, TEST_LOCATION );
+ result = TextAbstraction::Internal::ValueToIndex(220, ORDERED_VALUES, NUM_OF_ORDERED_VALUES - 1u);
+ DALI_TEST_EQUALS(9, result, TEST_LOCATION);
+ result = TextAbstraction::Internal::ValueToIndex(500, ORDERED_VALUES, NUM_OF_ORDERED_VALUES - 1u);
+ DALI_TEST_EQUALS(9, result, TEST_LOCATION);
END_TEST;
}
-
-
*
*/
-#include <iostream>
-#include <stdlib.h>
#include <dali-test-suite-utils.h>
+#include <stdlib.h>
+#include <iostream>
#include <dali/internal/imaging/common/loader-gif.h>
#include "image-loaders.h"
using namespace Dali;
-namespace {
-static const LoadFunctions GifLoaders( TizenPlatform::LoadGifHeader, TizenPlatform::LoadBitmapFromGif );
+namespace
+{
+static const LoadFunctions GifLoaders(TizenPlatform::LoadGifHeader, TizenPlatform::LoadBitmapFromGif);
}
-
void gif_loader_startup(void)
{
}
int UtcDaliGifLoaderInterlaced(void)
{
- ImageDetails interlaced( TEST_IMAGE_DIR "/interlaced.gif", 365u, 227u );
- TestImageLoading( interlaced, GifLoaders );
+ ImageDetails interlaced(TEST_IMAGE_DIR "/interlaced.gif", 365u, 227u);
+ TestImageLoading(interlaced, GifLoaders);
END_TEST;
}
int UtcDaliGifLoaderErrorBits(void)
{
- ImageDetails errorBits( TEST_IMAGE_DIR "/error-bits.gif", 534u, 749u, 1280u, 1024u );
- TestImageLoading( errorBits, GifLoaders );
+ ImageDetails errorBits(TEST_IMAGE_DIR "/error-bits.gif", 534u, 749u, 1280u, 1024u);
+ TestImageLoading(errorBits, GifLoaders);
END_TEST;
}
int UtcDaliGifLoaderPattern(void)
{
- ImageDetails pattern( TEST_IMAGE_DIR "/pattern.gif", 600u, 600u );
- TestImageLoading( pattern, GifLoaders );
+ ImageDetails pattern(TEST_IMAGE_DIR "/pattern.gif", 600u, 600u);
+ TestImageLoading(pattern, GifLoaders);
END_TEST;
}
int UtcDaliGifLoaderTransparency(void)
{
- ImageDetails transparency( TEST_IMAGE_DIR "/transparency.gif", 320u, 280u );
- TestImageLoading( transparency, GifLoaders );
+ ImageDetails transparency(TEST_IMAGE_DIR "/transparency.gif", 320u, 280u);
+ TestImageLoading(transparency, GifLoaders);
END_TEST;
}
*
*/
-#include <iostream>
-#include <stdlib.h>
#include <dali-test-suite-utils.h>
+#include <stdlib.h>
+#include <iostream>
#include <dali/internal/imaging/common/loader-ico.h>
#include "image-loaders.h"
namespace
{
-
-static const LoadFunctions IcoLoaders( TizenPlatform::LoadIcoHeader, TizenPlatform::LoadBitmapFromIco );
-
+static const LoadFunctions IcoLoaders(TizenPlatform::LoadIcoHeader, TizenPlatform::LoadBitmapFromIco);
// Golden master image data for each icon type:
// Note: The bottom right corner of each image is fully transparent.
// Causing no image degradation.
uint32_t ImageCheckData_Ico4x4_32bpp_8alpha[] = {
- 0xff0000ff, 0x00ff00ff, 0x0000ffff, 0xff00ffff,
- 0xc04040ff, 0x40c040ff, 0x4040c0ff, 0xffff00ff,
- 0xa06060ff, 0x60a060ff, 0x6060a0ff, 0x00ffffff,
- 0xffffffff, 0x808080ff, 0x000000ff, 0x00000000
-};
+ 0xff0000ff, 0x00ff00ff, 0x0000ffff, 0xff00ffff, 0xc04040ff, 0x40c040ff, 0x4040c0ff, 0xffff00ff, 0xa06060ff, 0x60a060ff, 0x6060a0ff, 0x00ffffff, 0xffffffff, 0x808080ff, 0x000000ff, 0x00000000};
uint32_t ImageCheckData_Ico4x4_24bpp[] = {
- 0xff0000ff, 0x00ff00ff, 0x0000ffff, 0xff00ffff,
- 0xc04040ff, 0x40c040ff, 0x4040c0ff, 0xffff00ff,
- 0xa06060ff, 0x60a060ff, 0x6060a0ff, 0x00ffffff,
- 0xffffffff, 0x808080ff, 0x000000ff, 0x00000000
-};
+ 0xff0000ff, 0x00ff00ff, 0x0000ffff, 0xff00ffff, 0xc04040ff, 0x40c040ff, 0x4040c0ff, 0xffff00ff, 0xa06060ff, 0x60a060ff, 0x6060a0ff, 0x00ffffff, 0xffffffff, 0x808080ff, 0x000000ff, 0x00000000};
uint32_t ImageCheckData_Ico4x4_8bpp[] = {
- 0xff0000ff, 0x00ff00ff, 0x0000ffff, 0xff00ffff,
- 0xc04040ff, 0x40c040ff, 0x4040c0ff, 0xffff00ff,
- 0xa06060ff, 0x60a060ff, 0x6060a0ff, 0x00ffffff,
- 0xffffffff, 0x808080ff, 0x000000ff, 0x00000000
-};
+ 0xff0000ff, 0x00ff00ff, 0x0000ffff, 0xff00ffff, 0xc04040ff, 0x40c040ff, 0x4040c0ff, 0xffff00ff, 0xa06060ff, 0x60a060ff, 0x6060a0ff, 0x00ffffff, 0xffffffff, 0x808080ff, 0x000000ff, 0x00000000};
uint32_t ImageCheckData_Ico4x4_4bpp[] = {
- 0xff0000ff, 0x00ff00ff, 0x0000ffff, 0xff00ffff,
- 0xc04040ff, 0x40c040ff, 0x4040c0ff, 0xffff00ff,
- 0xa06060ff, 0x60a060ff, 0x6060a0ff, 0x00ffffff,
- 0xffffffff, 0x808080ff, 0x000000ff, 0x00000000
-};
+ 0xff0000ff, 0x00ff00ff, 0x0000ffff, 0xff00ffff, 0xc04040ff, 0x40c040ff, 0x4040c0ff, 0xffff00ff, 0xa06060ff, 0x60a060ff, 0x6060a0ff, 0x00ffffff, 0xffffffff, 0x808080ff, 0x000000ff, 0x00000000};
uint32_t ImageCheckData_Ico4x4_1bpp[] = {
- 0xA18783ff, 0xA18783ff, 0xA18783ff, 0xA18783ff,
- 0xA18783ff, 0xA18783ff, 0xA18783ff, 0xA18783ff,
- 0xA18783ff, 0xA18783ff, 0xA18783ff, 0xA18783ff,
- 0xA18783ff, 0xA18783ff, 0xA18783ff, 0xA1878300
-};
-
+ 0xA18783ff, 0xA18783ff, 0xA18783ff, 0xA18783ff, 0xA18783ff, 0xA18783ff, 0xA18783ff, 0xA18783ff, 0xA18783ff, 0xA18783ff, 0xA18783ff, 0xA18783ff, 0xA18783ff, 0xA18783ff, 0xA18783ff, 0xA1878300};
} // Unnamed namespace.
-
int UtcDaliIco32bpp8alpha(void)
{
- ImageDetails image( TEST_IMAGE_DIR "/test-image-4x4-32bpp.ico", 4u, 4u );
+ ImageDetails image(TEST_IMAGE_DIR "/test-image-4x4-32bpp.ico", 4u, 4u);
- CompareLoadedImageData( image, IcoLoaders, ImageCheckData_Ico4x4_32bpp_8alpha );
+ CompareLoadedImageData(image, IcoLoaders, ImageCheckData_Ico4x4_32bpp_8alpha);
END_TEST;
}
-
int UtcDaliIco24bpp1alpha(void)
{
- ImageDetails image( TEST_IMAGE_DIR "/test-image-4x4-24bpp.ico", 4u, 4u );
+ ImageDetails image(TEST_IMAGE_DIR "/test-image-4x4-24bpp.ico", 4u, 4u);
- CompareLoadedImageData( image, IcoLoaders, ImageCheckData_Ico4x4_24bpp );
+ CompareLoadedImageData(image, IcoLoaders, ImageCheckData_Ico4x4_24bpp);
END_TEST;
}
-
int UtcDaliIco8bpp1alpha(void)
{
- ImageDetails image( TEST_IMAGE_DIR "/test-image-4x4-8bpp.ico", 4u, 4u );
+ ImageDetails image(TEST_IMAGE_DIR "/test-image-4x4-8bpp.ico", 4u, 4u);
- CompareLoadedImageData( image, IcoLoaders, ImageCheckData_Ico4x4_8bpp );
+ CompareLoadedImageData(image, IcoLoaders, ImageCheckData_Ico4x4_8bpp);
END_TEST;
}
-
int UtcDaliIco4bpp1alpha(void)
{
- ImageDetails image( TEST_IMAGE_DIR "/test-image-4x4-4bpp.ico", 4u, 4u );
+ ImageDetails image(TEST_IMAGE_DIR "/test-image-4x4-4bpp.ico", 4u, 4u);
- CompareLoadedImageData( image, IcoLoaders, ImageCheckData_Ico4x4_4bpp );
+ CompareLoadedImageData(image, IcoLoaders, ImageCheckData_Ico4x4_4bpp);
END_TEST;
}
-
int UtcDaliIco1bpp1alpha(void)
{
- ImageDetails image( TEST_IMAGE_DIR "/test-image-4x4-1bpp.ico", 4u, 4u );
+ ImageDetails image(TEST_IMAGE_DIR "/test-image-4x4-1bpp.ico", 4u, 4u);
- CompareLoadedImageData( image, IcoLoaders, ImageCheckData_Ico4x4_1bpp );
+ CompareLoadedImageData(image, IcoLoaders, ImageCheckData_Ico4x4_1bpp);
END_TEST;
}
-
-
-
*/
#include <dali-test-suite-utils.h>
-#include <dali/internal/imaging/common/image-operations.h>
#include <dali/devel-api/common/ref-counted-dali-vector.h>
+#include <dali/internal/imaging/common/image-operations.h>
#include <sys/mman.h>
#include <unistd.h>
namespace
{
-
/**
* @brief Generate a random integer between zero and the parameter passed in.
**/
-uint32_t RandomInRange( uint32_t max )
+uint32_t RandomInRange(uint32_t max)
{
const uint32_t randToMax = lrand48() % (max + 1);
return randToMax;
*/
inline uint32_t RandomComponent8()
{
- return RandomInRange( 255u );
+ return RandomInRange(255u);
}
/**
*/
inline uint32_t RandomComponent5()
{
- return RandomInRange( 31u );
+ return RandomInRange(31u);
}
/**
*/
inline uint32_t RandomComponent6()
{
- return RandomInRange( 63u );
+ return RandomInRange(63u);
}
/**
* @brief RGBA8888 Pixels from separate color components.
*/
-inline uint32_t PixelRGBA8888( uint32_t r, uint32_t g, uint32_t b, uint32_t a )
+inline uint32_t PixelRGBA8888(uint32_t r, uint32_t g, uint32_t b, uint32_t a)
{
return (r << 24) + (g << 16) + (b << 8) + a;
}
/**
* @brief RGB565 Pixels from color components in the low bits of passed-in words.
*/
-inline uint16_t PixelRGB565( uint32_t r, uint32_t g, uint32_t b )
+inline uint16_t PixelRGB565(uint32_t r, uint32_t g, uint32_t b)
{
return (r << 11) + (g << 5) + b;
}
/**
* @brief RGBA8888 Pixels with random color components.
*/
-inline uint32_t RandomPixelRGBA8888( )
+inline uint32_t RandomPixelRGBA8888()
{
- const uint32_t randomPixel = PixelRGBA8888( RandomComponent8(), RandomComponent8(), RandomComponent8(), RandomComponent8() );
+ const uint32_t randomPixel = PixelRGBA8888(RandomComponent8(), RandomComponent8(), RandomComponent8(), RandomComponent8());
return randomPixel;
}
* Used to check a buffer of pixels is unmodified by an operation given inputs
* that should mean that it is not changed.
*/
-inline uint32_t HashPixels( const uint32_t* const pixels, unsigned int numPixels )
+inline uint32_t HashPixels(const uint32_t* const pixels, unsigned int numPixels)
{
uint32_t hash = 5381;
- for( unsigned int i = 0; i < numPixels; ++i )
+ for(unsigned int i = 0; i < numPixels; ++i)
{
hash = hash * 33 + pixels[i];
}
/**
* @brief Build some dummy scanlines to exercise scanline averaging code on.
*/
-void SetupScanlineForHalvingTestsRGBA8888( size_t scanlineLength, Dali::Vector<uint32_t>& scanline, Dali::Vector<uint32_t>& reference )
+void SetupScanlineForHalvingTestsRGBA8888(size_t scanlineLength, Dali::Vector<uint32_t>& scanline, Dali::Vector<uint32_t>& reference)
{
- scanline.Resize( scanlineLength );
- reference.Reserve( scanlineLength / 2 + 32 );
+ scanline.Resize(scanlineLength);
+ reference.Reserve(scanlineLength / 2 + 32);
// Prepare some random pixels:
- srand( 19 * 23 * 47 * 53 );
- for( size_t i = 0; i < scanlineLength / 2; ++i )
+ srand(19 * 23 * 47 * 53);
+ for(size_t i = 0; i < scanlineLength / 2; ++i)
{
// Generate random colors:
const uint32_t red1 = RandomComponent8();
const uint32_t alpha2 = RandomComponent8();
// The average of these pixels should equal the reference:
- scanline[i * 2] = PixelRGBA8888( red1, green1, blue1, alpha1 );
- scanline[i * 2 + 1] = PixelRGBA8888( red2, green2, blue2, alpha2 );
+ scanline[i * 2] = PixelRGBA8888(red1, green1, blue1, alpha1);
+ scanline[i * 2 + 1] = PixelRGBA8888(red2, green2, blue2, alpha2);
// Average the two pixels manually as a reference:
- reference.PushBack( PixelRGBA8888( (red1 + red2) >> 1u, (green1 + green2) >> 1u, (blue1 + blue2) >> 1u, (alpha1 + alpha2) >> 1u ) );
+ reference.PushBack(PixelRGBA8888((red1 + red2) >> 1u, (green1 + green2) >> 1u, (blue1 + blue2) >> 1u, (alpha1 + alpha2) >> 1u));
}
- for( size_t i = scanlineLength / 2; i < reference.Capacity(); ++i )
+ for(size_t i = scanlineLength / 2; i < reference.Capacity(); ++i)
{
reference[i] = 0xEEEEEEEE;
}
/**
* @brief Build some dummy scanlines to exercise scanline averaging code on.
*/
-void SetupScanlineForHalvingTestsRGB565( size_t scanlineLength, Dali::Vector<uint16_t>& scanline, Dali::Vector<uint16_t>& reference )
+void SetupScanlineForHalvingTestsRGB565(size_t scanlineLength, Dali::Vector<uint16_t>& scanline, Dali::Vector<uint16_t>& reference)
{
- scanline.Resize( scanlineLength );
- reference.Reserve( scanlineLength / 2 + 32 );
+ scanline.Resize(scanlineLength);
+ reference.Reserve(scanlineLength / 2 + 32);
// Prepare some random pixels:
- srand48( 19 * 23 * 47 * 53 );
- for( size_t i = 0; i < scanlineLength / 2; ++i )
+ srand48(19 * 23 * 47 * 53);
+ for(size_t i = 0; i < scanlineLength / 2; ++i)
{
// Generate random colors:
const uint32_t red1 = RandomComponent5();
const uint32_t blue2 = RandomComponent5();
// The average of these pixels should equal the reference:
- scanline[i * 2] = PixelRGB565( red1, green1, blue1 );
- scanline[i * 2 + 1] = PixelRGB565( red2, green2, blue2 );
+ scanline[i * 2] = PixelRGB565(red1, green1, blue1);
+ scanline[i * 2 + 1] = PixelRGB565(red2, green2, blue2);
// Average the two pixels manually as a reference:
- reference.PushBack( PixelRGB565( (red1 + red2) >> 1u, (green1 + green2) >> 1u, (blue1 + blue2) >> 1u ) );
+ reference.PushBack(PixelRGB565((red1 + red2) >> 1u, (green1 + green2) >> 1u, (blue1 + blue2) >> 1u));
}
- for( size_t i = scanlineLength / 2; i < reference.Capacity(); ++i )
+ for(size_t i = scanlineLength / 2; i < reference.Capacity(); ++i)
{
reference[i] = 0xEEEE;
}
/**
* @brief Build some dummy scanlines to exercise scanline averaging code on.
*/
-void SetupScanlineForHalvingTests2Bytes( size_t scanlineLength, Dali::Vector<uint8_t>& scanline, Dali::Vector<uint8_t>& reference )
+void SetupScanlineForHalvingTests2Bytes(size_t scanlineLength, Dali::Vector<uint8_t>& scanline, Dali::Vector<uint8_t>& reference)
{
- scanline.Resize( scanlineLength * 2 );
- reference.Reserve( scanlineLength + 32 );
+ scanline.Resize(scanlineLength * 2);
+ reference.Reserve(scanlineLength + 32);
// Prepare some random pixels:
- srand48( 19 * 23 * 47 * 53 * 59 );
- for( size_t i = 0; i < scanlineLength / 2; ++i )
+ srand48(19 * 23 * 47 * 53 * 59);
+ for(size_t i = 0; i < scanlineLength / 2; ++i)
{
// Generate random colors:
- const uint32_t c11 = RandomComponent8();
- const uint32_t c12 = RandomComponent8();
- const uint32_t c21 = RandomComponent8();
- const uint32_t c22 = RandomComponent8();
+ const uint32_t c11 = RandomComponent8();
+ const uint32_t c12 = RandomComponent8();
+ const uint32_t c21 = RandomComponent8();
+ const uint32_t c22 = RandomComponent8();
// The average of these pixels should equal the reference:
scanline[i * 4] = c11;
scanline[i * 4 + 3] = c22;
// Average the two pixels manually as a reference:
- reference.PushBack( (c11 + c21) >> 1u );
- reference.PushBack( (c12 + c22) >> 1u );
+ reference.PushBack((c11 + c21) >> 1u);
+ reference.PushBack((c12 + c22) >> 1u);
}
- for( size_t i = scanlineLength; i < reference.Capacity(); ++i )
+ for(size_t i = scanlineLength; i < reference.Capacity(); ++i)
{
reference[i] = 0xEE;
}
/**
* @brief Build some dummy 1 byte per pixel scanlines to exercise scanline averaging code on.
*/
-void SetupScanlineForHalvingTests1Byte( size_t scanlineLength, Dali::Vector<uint8_t>& scanline, Dali::Vector<uint8_t>& reference )
+void SetupScanlineForHalvingTests1Byte(size_t scanlineLength, Dali::Vector<uint8_t>& scanline, Dali::Vector<uint8_t>& reference)
{
- scanline.Resize( scanlineLength * 2 );
- reference.Reserve( scanlineLength + 32 );
+ scanline.Resize(scanlineLength * 2);
+ reference.Reserve(scanlineLength + 32);
// Prepare some random pixels:
- srand48( 19 * 23 * 47 * 53 * 63 );
- for( size_t i = 0; i < scanlineLength / 2; ++i )
+ srand48(19 * 23 * 47 * 53 * 63);
+ for(size_t i = 0; i < scanlineLength / 2; ++i)
{
// Generate random colors:
const uint32_t c1 = RandomComponent8();
scanline[i * 2 + 1] = c2;
// Average the two pixels manually as a reference:
- reference.PushBack( (c1 + c2) >> 1u );
-
+ reference.PushBack((c1 + c2) >> 1u);
}
- for( size_t i = scanlineLength; i < reference.Capacity(); ++i )
+ for(size_t i = scanlineLength; i < reference.Capacity(); ++i)
{
reference[i] = 0xEE;
}
*
* All tested formats bar RGB565 can share this setup.
*/
-void SetupScanlinesRGBA8888( size_t scanlineLength, Dali::Vector<uint32_t>& scanline1, Dali::Vector<uint32_t>& scanline2, Dali::Vector<uint32_t>& reference, Dali::Vector<uint32_t>& output )
+void SetupScanlinesRGBA8888(size_t scanlineLength, Dali::Vector<uint32_t>& scanline1, Dali::Vector<uint32_t>& scanline2, Dali::Vector<uint32_t>& reference, Dali::Vector<uint32_t>& output)
{
- scanline1.Reserve( scanlineLength );
- scanline2.Reserve( scanlineLength );
- reference.Reserve( scanlineLength + 32 );
- output.Reserve( scanlineLength + 32 );
+ scanline1.Reserve(scanlineLength);
+ scanline2.Reserve(scanlineLength);
+ reference.Reserve(scanlineLength + 32);
+ output.Reserve(scanlineLength + 32);
- for( size_t i = scanlineLength; i < output.Capacity(); ++i )
+ for(size_t i = scanlineLength; i < output.Capacity(); ++i)
{
output[i] = 0xDEADBEEF;
reference[i] = 0xDEADBEEF;
}
// Prepare some random pixels:
- srand48( 19 * 23 * 47 );
- for( size_t i = 0; i < scanlineLength; ++i )
+ srand48(19 * 23 * 47);
+ for(size_t i = 0; i < scanlineLength; ++i)
{
// Generate random colors:
const uint32_t red1 = RandomComponent8();
const uint32_t alpha2 = RandomComponent8();
// The average of these pixels should equal the reference:
- scanline1.PushBack( PixelRGBA8888( red1, green1, blue1, alpha1 ) );
- scanline2.PushBack( PixelRGBA8888( red2, green2, blue2, alpha2 ) );
+ scanline1.PushBack(PixelRGBA8888(red1, green1, blue1, alpha1));
+ scanline2.PushBack(PixelRGBA8888(red2, green2, blue2, alpha2));
// Average the two pixels manually as a reference:
- reference.PushBack( PixelRGBA8888( (red1 + red2) >> 1u, (green1 + green2) >> 1u, (blue1 + blue2) >> 1u, (alpha1 + alpha2) >> 1u ) );
+ reference.PushBack(PixelRGBA8888((red1 + red2) >> 1u, (green1 + green2) >> 1u, (blue1 + blue2) >> 1u, (alpha1 + alpha2) >> 1u));
}
}
/**
* @brief Compares a scanline of interest to a reference, testing each pixel is the same.
*/
-void MatchScanlinesRGBA8888( Dali::Vector<uint32_t>& reference, Dali::Vector<uint32_t>& output, size_t& numMatches, const char * const location )
+void MatchScanlinesRGBA8888(Dali::Vector<uint32_t>& reference, Dali::Vector<uint32_t>& output, size_t& numMatches, const char* const location)
{
numMatches = 0;
- for( size_t i = 0, length = reference.Capacity(); i < length; ++i )
+ for(size_t i = 0, length = reference.Capacity(); i < length; ++i)
{
- DALI_TEST_EQUALS( output[i], reference[i], location );
+ DALI_TEST_EQUALS(output[i], reference[i], location);
numMatches += output[i] == reference[i];
}
}
-} //< namespace unnamed
+} // namespace
/**
* @brief Test component averaging code.
*/
int UtcDaliImageOperationsAverageComponent(void)
{
- DALI_TEST_EQUALS( Dali::Internal::Platform::AverageComponent( 0u, 0u ), 0u, TEST_LOCATION );
- DALI_TEST_EQUALS( Dali::Internal::Platform::AverageComponent( 1u, 1u ), 1u, TEST_LOCATION );
- DALI_TEST_EQUALS( Dali::Internal::Platform::AverageComponent( 0xffffffffu >> 1u, 0xffffffffu >> 1u ), 0xffffffffu >> 1u, TEST_LOCATION );
- const unsigned int avg3 = Dali::Internal::Platform::AverageComponent( 0xfffffffeu, 1u );
- DALI_TEST_EQUALS( avg3, 0x7fffffffu, TEST_LOCATION );
- DALI_TEST_EQUALS( Dali::Internal::Platform::AverageComponent( 255u, 255u ), 255u, TEST_LOCATION );
- DALI_TEST_EQUALS( Dali::Internal::Platform::AverageComponent( 512u, 0u ), 256u, TEST_LOCATION );
- DALI_TEST_EQUALS( Dali::Internal::Platform::AverageComponent( 511u, 0u ), 255u, TEST_LOCATION );
- DALI_TEST_EQUALS( Dali::Internal::Platform::AverageComponent( 510u, 0u ), 255u, TEST_LOCATION );
- DALI_TEST_EQUALS( Dali::Internal::Platform::AverageComponent( 509u, 0u ), 254u, TEST_LOCATION );
- DALI_TEST_EQUALS( Dali::Internal::Platform::AverageComponent( 0u, 509u ), 254u, TEST_LOCATION );
+ DALI_TEST_EQUALS(Dali::Internal::Platform::AverageComponent(0u, 0u), 0u, TEST_LOCATION);
+ DALI_TEST_EQUALS(Dali::Internal::Platform::AverageComponent(1u, 1u), 1u, TEST_LOCATION);
+ DALI_TEST_EQUALS(Dali::Internal::Platform::AverageComponent(0xffffffffu >> 1u, 0xffffffffu >> 1u), 0xffffffffu >> 1u, TEST_LOCATION);
+ const unsigned int avg3 = Dali::Internal::Platform::AverageComponent(0xfffffffeu, 1u);
+ DALI_TEST_EQUALS(avg3, 0x7fffffffu, TEST_LOCATION);
+ DALI_TEST_EQUALS(Dali::Internal::Platform::AverageComponent(255u, 255u), 255u, TEST_LOCATION);
+ DALI_TEST_EQUALS(Dali::Internal::Platform::AverageComponent(512u, 0u), 256u, TEST_LOCATION);
+ DALI_TEST_EQUALS(Dali::Internal::Platform::AverageComponent(511u, 0u), 255u, TEST_LOCATION);
+ DALI_TEST_EQUALS(Dali::Internal::Platform::AverageComponent(510u, 0u), 255u, TEST_LOCATION);
+ DALI_TEST_EQUALS(Dali::Internal::Platform::AverageComponent(509u, 0u), 254u, TEST_LOCATION);
+ DALI_TEST_EQUALS(Dali::Internal::Platform::AverageComponent(0u, 509u), 254u, TEST_LOCATION);
END_TEST;
}
*/
int UtcDaliImageOperationsAveragePixelRGBA8888(void)
{
- DALI_TEST_EQUALS( Dali::Internal::Platform::AveragePixelRGBA8888( 0u, 0u ), 0u, TEST_LOCATION );
- DALI_TEST_EQUALS( Dali::Internal::Platform::AveragePixelRGBA8888( 0x01010101, 0x01010101 ), 0x01010101u, TEST_LOCATION );
- DALI_TEST_EQUALS( Dali::Internal::Platform::AveragePixelRGBA8888( 0x01010101, 0x03030303 ), 0x02020202u, TEST_LOCATION );
- DALI_TEST_EQUALS( Dali::Internal::Platform::AveragePixelRGBA8888( 0xffffffff, 0xffffffff ), 0xffffffffu, TEST_LOCATION );
- DALI_TEST_EQUALS( Dali::Internal::Platform::AveragePixelRGBA8888( 0xffffffff, 0u ), 0x7f7f7f7fu, TEST_LOCATION );
+ DALI_TEST_EQUALS(Dali::Internal::Platform::AveragePixelRGBA8888(0u, 0u), 0u, TEST_LOCATION);
+ DALI_TEST_EQUALS(Dali::Internal::Platform::AveragePixelRGBA8888(0x01010101, 0x01010101), 0x01010101u, TEST_LOCATION);
+ DALI_TEST_EQUALS(Dali::Internal::Platform::AveragePixelRGBA8888(0x01010101, 0x03030303), 0x02020202u, TEST_LOCATION);
+ DALI_TEST_EQUALS(Dali::Internal::Platform::AveragePixelRGBA8888(0xffffffff, 0xffffffff), 0xffffffffu, TEST_LOCATION);
+ DALI_TEST_EQUALS(Dali::Internal::Platform::AveragePixelRGBA8888(0xffffffff, 0u), 0x7f7f7f7fu, TEST_LOCATION);
END_TEST;
}
*/
int UtcDaliImageOperationsAveragePixelRGB565(void)
{
- DALI_TEST_EQUALS( Dali::Internal::Platform::AveragePixelRGB565( 0u, 0u ), 0u, TEST_LOCATION );
- DALI_TEST_EQUALS( Dali::Internal::Platform::AveragePixelRGB565( 0xf800u, 0xf800u ), 0xf800u, TEST_LOCATION );
- DALI_TEST_EQUALS( Dali::Internal::Platform::AveragePixelRGB565( 0xf800u, 0x800u ), 1u << 15, TEST_LOCATION );
- DALI_TEST_EQUALS( Dali::Internal::Platform::AveragePixelRGB565( 0x7e0u, 0x7e0u ), 0x7e0u, TEST_LOCATION );
- DALI_TEST_EQUALS( Dali::Internal::Platform::AveragePixelRGB565( 0x7e0u, 0x20u ), 1u << 10, TEST_LOCATION );
- DALI_TEST_EQUALS( Dali::Internal::Platform::AveragePixelRGB565( 0x1f, 0x1f ), 0x1fu, TEST_LOCATION );
- DALI_TEST_EQUALS( Dali::Internal::Platform::AveragePixelRGB565( 0x1f, 0x1 ), 1u << 4, TEST_LOCATION );
- DALI_TEST_EQUALS( Dali::Internal::Platform::AveragePixelRGB565( 0xf800u, 0x7e0u ), 0x7800u + 0x3e0u, TEST_LOCATION );
- DALI_TEST_EQUALS( Dali::Internal::Platform::AveragePixelRGB565( 0xffff, 0xffff ), 0xffffu, TEST_LOCATION );
+ DALI_TEST_EQUALS(Dali::Internal::Platform::AveragePixelRGB565(0u, 0u), 0u, TEST_LOCATION);
+ DALI_TEST_EQUALS(Dali::Internal::Platform::AveragePixelRGB565(0xf800u, 0xf800u), 0xf800u, TEST_LOCATION);
+ DALI_TEST_EQUALS(Dali::Internal::Platform::AveragePixelRGB565(0xf800u, 0x800u), 1u << 15, TEST_LOCATION);
+ DALI_TEST_EQUALS(Dali::Internal::Platform::AveragePixelRGB565(0x7e0u, 0x7e0u), 0x7e0u, TEST_LOCATION);
+ DALI_TEST_EQUALS(Dali::Internal::Platform::AveragePixelRGB565(0x7e0u, 0x20u), 1u << 10, TEST_LOCATION);
+ DALI_TEST_EQUALS(Dali::Internal::Platform::AveragePixelRGB565(0x1f, 0x1f), 0x1fu, TEST_LOCATION);
+ DALI_TEST_EQUALS(Dali::Internal::Platform::AveragePixelRGB565(0x1f, 0x1), 1u << 4, TEST_LOCATION);
+ DALI_TEST_EQUALS(Dali::Internal::Platform::AveragePixelRGB565(0xf800u, 0x7e0u), 0x7800u + 0x3e0u, TEST_LOCATION);
+ DALI_TEST_EQUALS(Dali::Internal::Platform::AveragePixelRGB565(0xffff, 0xffff), 0xffffu, TEST_LOCATION);
END_TEST;
}
* @brief Build a square bitmap, downscale it and assert the resulting bitmap has the right dimensions.
*/
void TestDownscaledBitmapHasRightDimensionsAndFormat(
- Pixel::Format format,
- uint32_t sourceDimension,
- uint32_t targetDimension,
- uint32_t expectedDimension,
- const char * const location )
+ Pixel::Format format,
+ uint32_t sourceDimension,
+ uint32_t targetDimension,
+ uint32_t expectedDimension,
+ const char* const location)
{
- ImageDimensions desired( targetDimension, targetDimension );
- FittingMode::Type fittingMode( FittingMode::SHRINK_TO_FIT );
- SamplingMode::Type samplingMode( SamplingMode::BOX );
+ ImageDimensions desired(targetDimension, targetDimension);
+ FittingMode::Type fittingMode(FittingMode::SHRINK_TO_FIT);
+ SamplingMode::Type samplingMode(SamplingMode::BOX);
- Dali::Devel::PixelBuffer sourceBitmap = Dali::Devel::PixelBuffer::New( sourceDimension, sourceDimension, format );
+ Dali::Devel::PixelBuffer sourceBitmap = Dali::Devel::PixelBuffer::New(sourceDimension, sourceDimension, format);
- Dali::Devel::PixelBuffer downScaled = DownscaleBitmap( sourceBitmap, desired, fittingMode, samplingMode );
+ Dali::Devel::PixelBuffer downScaled = DownscaleBitmap(sourceBitmap, desired, fittingMode, samplingMode);
- DALI_TEST_EQUALS( downScaled.GetWidth(), expectedDimension, location );
- DALI_TEST_EQUALS( downScaled.GetHeight(), expectedDimension, location );
- DALI_TEST_EQUALS( downScaled.GetPixelFormat(), format, location );
+ DALI_TEST_EQUALS(downScaled.GetWidth(), expectedDimension, location);
+ DALI_TEST_EQUALS(downScaled.GetHeight(), expectedDimension, location);
+ DALI_TEST_EQUALS(downScaled.GetPixelFormat(), format, location);
}
/**
{
// Do Scalings that are expected to work for all pixels modes and assert the resulting bitmap dimensions:
- TestDownscaledBitmapHasRightDimensionsAndFormat( Pixel::RGBA8888, 1024, 8, 8, TEST_LOCATION );
- TestDownscaledBitmapHasRightDimensionsAndFormat( Pixel::RGB888, 1024, 8, 8, TEST_LOCATION );
- TestDownscaledBitmapHasRightDimensionsAndFormat( Pixel::RGB565, 1024, 8, 8, TEST_LOCATION );
- TestDownscaledBitmapHasRightDimensionsAndFormat( Pixel::LA88, 1024, 8, 8, TEST_LOCATION );
- TestDownscaledBitmapHasRightDimensionsAndFormat( Pixel::L8, 1024, 8, 8, TEST_LOCATION );
+ TestDownscaledBitmapHasRightDimensionsAndFormat(Pixel::RGBA8888, 1024, 8, 8, TEST_LOCATION);
+ TestDownscaledBitmapHasRightDimensionsAndFormat(Pixel::RGB888, 1024, 8, 8, TEST_LOCATION);
+ TestDownscaledBitmapHasRightDimensionsAndFormat(Pixel::RGB565, 1024, 8, 8, TEST_LOCATION);
+ TestDownscaledBitmapHasRightDimensionsAndFormat(Pixel::LA88, 1024, 8, 8, TEST_LOCATION);
+ TestDownscaledBitmapHasRightDimensionsAndFormat(Pixel::L8, 1024, 8, 8, TEST_LOCATION);
- TestDownscaledBitmapHasRightDimensionsAndFormat( Pixel::RGBA8888, 773, 1, 1, TEST_LOCATION );
- TestDownscaledBitmapHasRightDimensionsAndFormat( Pixel::RGB888, 787, 1, 1, TEST_LOCATION );
- TestDownscaledBitmapHasRightDimensionsAndFormat( Pixel::RGB565, 797, 1, 1, TEST_LOCATION );
- TestDownscaledBitmapHasRightDimensionsAndFormat( Pixel::LA88, 809, 1, 1, TEST_LOCATION );
- TestDownscaledBitmapHasRightDimensionsAndFormat( Pixel::L8, 811, 1, 1, TEST_LOCATION );
+ TestDownscaledBitmapHasRightDimensionsAndFormat(Pixel::RGBA8888, 773, 1, 1, TEST_LOCATION);
+ TestDownscaledBitmapHasRightDimensionsAndFormat(Pixel::RGB888, 787, 1, 1, TEST_LOCATION);
+ TestDownscaledBitmapHasRightDimensionsAndFormat(Pixel::RGB565, 797, 1, 1, TEST_LOCATION);
+ TestDownscaledBitmapHasRightDimensionsAndFormat(Pixel::LA88, 809, 1, 1, TEST_LOCATION);
+ TestDownscaledBitmapHasRightDimensionsAndFormat(Pixel::L8, 811, 1, 1, TEST_LOCATION);
// Do Scalings that are expected to produce a slightly larger than requested image:
- TestDownscaledBitmapHasRightDimensionsAndFormat( Pixel::RGBA8888, 47, 7, 11, TEST_LOCATION );
- TestDownscaledBitmapHasRightDimensionsAndFormat( Pixel::RGB888, 73, 17, 18, TEST_LOCATION );
- TestDownscaledBitmapHasRightDimensionsAndFormat( Pixel::RGB565, 61, 8, 15, TEST_LOCATION );
- TestDownscaledBitmapHasRightDimensionsAndFormat( Pixel::LA88, 19, 5, 9, TEST_LOCATION );
- TestDownscaledBitmapHasRightDimensionsAndFormat( Pixel::L8, 353, 23, 44, TEST_LOCATION );
+ TestDownscaledBitmapHasRightDimensionsAndFormat(Pixel::RGBA8888, 47, 7, 11, TEST_LOCATION);
+ TestDownscaledBitmapHasRightDimensionsAndFormat(Pixel::RGB888, 73, 17, 18, TEST_LOCATION);
+ TestDownscaledBitmapHasRightDimensionsAndFormat(Pixel::RGB565, 61, 8, 15, TEST_LOCATION);
+ TestDownscaledBitmapHasRightDimensionsAndFormat(Pixel::LA88, 19, 5, 9, TEST_LOCATION);
+ TestDownscaledBitmapHasRightDimensionsAndFormat(Pixel::L8, 353, 23, 44, TEST_LOCATION);
END_TEST;
}
// Do downscaling to 1 x 1 so we can easily assert the value of the single pixel produced:
// Scale down a black/white checkerboard to mid-grey:
- unsigned char check_4x4 [16 * 3] = {
- 0xff, 0xff, 0xff, 0x00, 0x00, 0x00, 0xff, 0xff, 0xff, 0x00, 0x00, 0x00,
- 0x00, 0x00, 0x00, 0xff, 0xff, 0xff, 0x00, 0x00, 0x00, 0xff, 0xff, 0xff,
- 0xff, 0xff, 0xff, 0x00, 0x00, 0x00, 0xff, 0xff, 0xff, 0x00, 0x00, 0x00,
- 0x00, 0x00, 0x00, 0xff, 0xff, 0xff, 0x00, 0x00, 0x00, 0xff, 0xff, 0xff
- };
-
- Dali::Internal::Platform::DownscaleInPlacePow2RGB888(check_4x4, 4, 4, 1, 1, BoxDimensionTestBoth, outWidth, outHeight );
- DALI_TEST_EQUALS( outWidth, 1u, TEST_LOCATION );
- DALI_TEST_EQUALS( outHeight, 1u, TEST_LOCATION );
- DALI_TEST_EQUALS( check_4x4[0], (unsigned char)0x7f, TEST_LOCATION );
+ unsigned char check_4x4[16 * 3] = {
+ 0xff, 0xff, 0xff, 0x00, 0x00, 0x00, 0xff, 0xff, 0xff, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0xff, 0xff, 0xff, 0x00, 0x00, 0x00, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0x00, 0x00, 0x00, 0xff, 0xff, 0xff, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0xff, 0xff, 0xff, 0x00, 0x00, 0x00, 0xff, 0xff, 0xff};
+
+ Dali::Internal::Platform::DownscaleInPlacePow2RGB888(check_4x4, 4, 4, 1, 1, BoxDimensionTestBoth, outWidth, outHeight);
+ DALI_TEST_EQUALS(outWidth, 1u, TEST_LOCATION);
+ DALI_TEST_EQUALS(outHeight, 1u, TEST_LOCATION);
+ DALI_TEST_EQUALS(check_4x4[0], (unsigned char)0x7f, TEST_LOCATION);
// Scale down a 16 pixel black image with a single white pixel to a 1/16th grey single pixel:
- unsigned char single_4x4 [16 * 3] = {
- 0xff, 0xff, 0xff, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00,
- 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00,
- 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00,
- 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00
- };
- Dali::Internal::Platform::DownscaleInPlacePow2RGB888(single_4x4, 4, 4, 1, 1, BoxDimensionTestBoth, outWidth, outHeight );
- DALI_TEST_EQUALS( outWidth, 1u, TEST_LOCATION );
- DALI_TEST_EQUALS( outHeight, 1u, TEST_LOCATION );
- DALI_TEST_EQUALS( single_4x4[0], (unsigned char)0xf, TEST_LOCATION );
+ unsigned char single_4x4[16 * 3] = {
+ 0xff, 0xff, 0xff, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00};
+ Dali::Internal::Platform::DownscaleInPlacePow2RGB888(single_4x4, 4, 4, 1, 1, BoxDimensionTestBoth, outWidth, outHeight);
+ DALI_TEST_EQUALS(outWidth, 1u, TEST_LOCATION);
+ DALI_TEST_EQUALS(outHeight, 1u, TEST_LOCATION);
+ DALI_TEST_EQUALS(single_4x4[0], (unsigned char)0xf, TEST_LOCATION);
// Scale down a 16 pixel black image with a single white pixel to a 1/16th grey single pixel:
// (white pixel at bottom-right of image)
- unsigned char single_4x4_2 [16 * 3] = {
- 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00,
- 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00,
- 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00,
- 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0xff, 0xff, 0xff
- };
- Dali::Internal::Platform::DownscaleInPlacePow2RGB888(single_4x4_2, 4, 4, 1, 1, BoxDimensionTestBoth, outWidth, outHeight );
- DALI_TEST_EQUALS( outWidth, 1u, TEST_LOCATION );
- DALI_TEST_EQUALS( outHeight, 1u, TEST_LOCATION );
- DALI_TEST_EQUALS( single_4x4_2[0], (unsigned char)0xf, TEST_LOCATION );
+ unsigned char single_4x4_2[16 * 3] = {
+ 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0xff, 0xff, 0xff};
+ Dali::Internal::Platform::DownscaleInPlacePow2RGB888(single_4x4_2, 4, 4, 1, 1, BoxDimensionTestBoth, outWidth, outHeight);
+ DALI_TEST_EQUALS(outWidth, 1u, TEST_LOCATION);
+ DALI_TEST_EQUALS(outHeight, 1u, TEST_LOCATION);
+ DALI_TEST_EQUALS(single_4x4_2[0], (unsigned char)0xf, TEST_LOCATION);
// Build a larger ~600 x ~600 uniform magenta image for tests which only test output dimensions:
- unsigned char magenta_600_x_600[608*608 * 3];
- for( unsigned int i = 0; i < sizeof(magenta_600_x_600); i += 3 )
+ unsigned char magenta_600_x_600[608 * 608 * 3];
+ for(unsigned int i = 0; i < sizeof(magenta_600_x_600); i += 3)
{
- magenta_600_x_600[i] = 0xff;
+ magenta_600_x_600[i] = 0xff;
magenta_600_x_600[i + 1] = 0;
magenta_600_x_600[i + 2] = 0xff;
}
// Scaling to 0 x 0 should stop at 1 x 1:
- Dali::Internal::Platform::DownscaleInPlacePow2RGB888( magenta_600_x_600, 352, 352, 0, 0, BoxDimensionTestBoth, outWidth, outHeight );
- DALI_TEST_EQUALS( outWidth, 1u, TEST_LOCATION );
- DALI_TEST_EQUALS( outHeight, 1u, TEST_LOCATION );
+ Dali::Internal::Platform::DownscaleInPlacePow2RGB888(magenta_600_x_600, 352, 352, 0, 0, BoxDimensionTestBoth, outWidth, outHeight);
+ DALI_TEST_EQUALS(outWidth, 1u, TEST_LOCATION);
+ DALI_TEST_EQUALS(outHeight, 1u, TEST_LOCATION);
// Scaling to 1 x 1 should hit 1 x 1:
- Dali::Internal::Platform::DownscaleInPlacePow2RGB888( magenta_600_x_600, 608, 608, 1, 1, BoxDimensionTestBoth, outWidth, outHeight );
- DALI_TEST_EQUALS( outWidth, 1u, TEST_LOCATION );
- DALI_TEST_EQUALS( outHeight, 1u, TEST_LOCATION );
+ Dali::Internal::Platform::DownscaleInPlacePow2RGB888(magenta_600_x_600, 608, 608, 1, 1, BoxDimensionTestBoth, outWidth, outHeight);
+ DALI_TEST_EQUALS(outWidth, 1u, TEST_LOCATION);
+ DALI_TEST_EQUALS(outHeight, 1u, TEST_LOCATION);
// Scaling to original dimensions should NOP:
- Dali::Internal::Platform::DownscaleInPlacePow2RGB888( magenta_600_x_600, 384, 384, 384, 384, BoxDimensionTestBoth, outWidth, outHeight );
- DALI_TEST_EQUALS( outWidth, 384u, TEST_LOCATION );
- DALI_TEST_EQUALS( outHeight, 384u, TEST_LOCATION );
+ Dali::Internal::Platform::DownscaleInPlacePow2RGB888(magenta_600_x_600, 384, 384, 384, 384, BoxDimensionTestBoth, outWidth, outHeight);
+ DALI_TEST_EQUALS(outWidth, 384u, TEST_LOCATION);
+ DALI_TEST_EQUALS(outHeight, 384u, TEST_LOCATION);
// More dimension tests:
- Dali::Internal::Platform::DownscaleInPlacePow2RGB888( magenta_600_x_600, 352, 352, 44, 11, BoxDimensionTestBoth, outWidth, outHeight );
- DALI_TEST_EQUALS( outWidth, 44u, TEST_LOCATION );
- DALI_TEST_EQUALS( outHeight, 44u, TEST_LOCATION );
+ Dali::Internal::Platform::DownscaleInPlacePow2RGB888(magenta_600_x_600, 352, 352, 44, 11, BoxDimensionTestBoth, outWidth, outHeight);
+ DALI_TEST_EQUALS(outWidth, 44u, TEST_LOCATION);
+ DALI_TEST_EQUALS(outHeight, 44u, TEST_LOCATION);
- Dali::Internal::Platform::DownscaleInPlacePow2RGB888( magenta_600_x_600, 384, 384, 3, 48, BoxDimensionTestBoth, outWidth, outHeight );
- DALI_TEST_EQUALS( outWidth, 48u, TEST_LOCATION );
- DALI_TEST_EQUALS( outHeight, 48u, TEST_LOCATION );
+ Dali::Internal::Platform::DownscaleInPlacePow2RGB888(magenta_600_x_600, 384, 384, 3, 48, BoxDimensionTestBoth, outWidth, outHeight);
+ DALI_TEST_EQUALS(outWidth, 48u, TEST_LOCATION);
+ DALI_TEST_EQUALS(outHeight, 48u, TEST_LOCATION);
- Dali::Internal::Platform::DownscaleInPlacePow2RGB888( magenta_600_x_600, 384, 384, 3, 3, BoxDimensionTestBoth, outWidth, outHeight );
- DALI_TEST_CHECK( outWidth == 3u && outHeight == 3u );
+ Dali::Internal::Platform::DownscaleInPlacePow2RGB888(magenta_600_x_600, 384, 384, 3, 3, BoxDimensionTestBoth, outWidth, outHeight);
+ DALI_TEST_CHECK(outWidth == 3u && outHeight == 3u);
- Dali::Internal::Platform::DownscaleInPlacePow2RGB888( magenta_600_x_600, 320, 320, 5, 5, BoxDimensionTestBoth, outWidth, outHeight );
- DALI_TEST_CHECK( outWidth == 5u && outHeight == 5u );
+ Dali::Internal::Platform::DownscaleInPlacePow2RGB888(magenta_600_x_600, 320, 320, 5, 5, BoxDimensionTestBoth, outWidth, outHeight);
+ DALI_TEST_CHECK(outWidth == 5u && outHeight == 5u);
- Dali::Internal::Platform::DownscaleInPlacePow2RGB888( magenta_600_x_600, 448, 448, 7, 7, BoxDimensionTestBoth, outWidth, outHeight );
- DALI_TEST_CHECK( outWidth == 7u && outHeight == 7u );
+ Dali::Internal::Platform::DownscaleInPlacePow2RGB888(magenta_600_x_600, 448, 448, 7, 7, BoxDimensionTestBoth, outWidth, outHeight);
+ DALI_TEST_CHECK(outWidth == 7u && outHeight == 7u);
- Dali::Internal::Platform::DownscaleInPlacePow2RGB888( magenta_600_x_600, 352, 352, 11, 11, BoxDimensionTestBoth, outWidth, outHeight );
- DALI_TEST_CHECK( outWidth == 11u && outHeight == 11u );
+ Dali::Internal::Platform::DownscaleInPlacePow2RGB888(magenta_600_x_600, 352, 352, 11, 11, BoxDimensionTestBoth, outWidth, outHeight);
+ DALI_TEST_CHECK(outWidth == 11u && outHeight == 11u);
// Check that no pixel values were modified by the repeated averaging of identical pixels in tests above:
unsigned int numNonMagenta = 0u;
- for( unsigned i = 0; i < sizeof(magenta_600_x_600); i += 3 )
+ for(unsigned i = 0; i < sizeof(magenta_600_x_600); i += 3)
{
numNonMagenta += magenta_600_x_600[i] == 0xff && magenta_600_x_600[i + 1] == 0x00 && magenta_600_x_600[i + 2] == 0xff ? 0 : 1;
}
- DALI_TEST_EQUALS( numNonMagenta, 0u, TEST_LOCATION );
+ DALI_TEST_EQUALS(numNonMagenta, 0u, TEST_LOCATION);
END_TEST;
}
/**
* @brief Test that resizing RGBA8888 images as raw pixel arrays produces a result of the correct dimensions.
*/
-void TestDownscaleOutputsExpectedDimensionsRGBA8888( uint32_t pixels[], unsigned inputWidth, unsigned inputHeight, unsigned int desiredWidth, unsigned int desiredHeight, unsigned int expectedWidth, unsigned int expectedHeight, const char * const location )
+void TestDownscaleOutputsExpectedDimensionsRGBA8888(uint32_t pixels[], unsigned inputWidth, unsigned inputHeight, unsigned int desiredWidth, unsigned int desiredHeight, unsigned int expectedWidth, unsigned int expectedHeight, const char* const location)
{
unsigned int resultingWidth = -1, resultingHeight = -1;
Dali::Internal::Platform::DownscaleInPlacePow2RGBA8888(
- reinterpret_cast<unsigned char *> (pixels),
- inputWidth, inputHeight,
- desiredWidth, desiredHeight, BoxDimensionTestBoth,
- resultingWidth, resultingHeight );
-
- DALI_TEST_EQUALS( resultingWidth, expectedWidth, location );
- DALI_TEST_EQUALS( resultingHeight, expectedHeight, location );
+ reinterpret_cast<unsigned char*>(pixels),
+ inputWidth,
+ inputHeight,
+ desiredWidth,
+ desiredHeight,
+ BoxDimensionTestBoth,
+ resultingWidth,
+ resultingHeight);
+
+ DALI_TEST_EQUALS(resultingWidth, expectedWidth, location);
+ DALI_TEST_EQUALS(resultingHeight, expectedHeight, location);
}
/**
* @brief Test that resizing RGB565 images as raw pixel arrays produces a result of the correct dimensions.
*/
-void TestDownscaleOutputsExpectedDimensionsRGB565( uint16_t pixels[], unsigned inputWidth, unsigned inputHeight, unsigned int desiredWidth, unsigned int desiredHeight, unsigned int expectedWidth, unsigned int expectedHeight, const char * const location )
+void TestDownscaleOutputsExpectedDimensionsRGB565(uint16_t pixels[], unsigned inputWidth, unsigned inputHeight, unsigned int desiredWidth, unsigned int desiredHeight, unsigned int expectedWidth, unsigned int expectedHeight, const char* const location)
{
unsigned int resultingWidth = -1, resultingHeight = -1;
Dali::Internal::Platform::DownscaleInPlacePow2RGB565(
- reinterpret_cast<unsigned char *> (pixels),
- inputWidth, inputHeight,
- desiredWidth, desiredHeight, BoxDimensionTestBoth,
- resultingWidth, resultingHeight );
-
- DALI_TEST_EQUALS( resultingWidth, expectedWidth, location );
- DALI_TEST_EQUALS( resultingHeight, expectedHeight, location );
+ reinterpret_cast<unsigned char*>(pixels),
+ inputWidth,
+ inputHeight,
+ desiredWidth,
+ desiredHeight,
+ BoxDimensionTestBoth,
+ resultingWidth,
+ resultingHeight);
+
+ DALI_TEST_EQUALS(resultingWidth, expectedWidth, location);
+ DALI_TEST_EQUALS(resultingHeight, expectedHeight, location);
}
/**
* @brief Test that resizing 2-byte-per-pixel images as raw pixel arrays produces a result of the correct dimensions.
*/
-void TestDownscaleOutputsExpectedDimensions2ComponentPair( uint8_t pixels[], unsigned inputWidth, unsigned inputHeight, unsigned int desiredWidth, unsigned int desiredHeight, unsigned int expectedWidth, unsigned int expectedHeight, const char * const location )
+void TestDownscaleOutputsExpectedDimensions2ComponentPair(uint8_t pixels[], unsigned inputWidth, unsigned inputHeight, unsigned int desiredWidth, unsigned int desiredHeight, unsigned int expectedWidth, unsigned int expectedHeight, const char* const location)
{
unsigned int resultingWidth = -1, resultingHeight = -1;
Dali::Internal::Platform::DownscaleInPlacePow2ComponentPair(
- pixels,
- inputWidth, inputHeight,
- desiredWidth, desiredHeight, BoxDimensionTestBoth,
- resultingWidth, resultingHeight );
-
- DALI_TEST_EQUALS( resultingWidth, expectedWidth, location );
- DALI_TEST_EQUALS( resultingHeight, expectedHeight, location );
+ pixels,
+ inputWidth,
+ inputHeight,
+ desiredWidth,
+ desiredHeight,
+ BoxDimensionTestBoth,
+ resultingWidth,
+ resultingHeight);
+
+ DALI_TEST_EQUALS(resultingWidth, expectedWidth, location);
+ DALI_TEST_EQUALS(resultingHeight, expectedHeight, location);
}
/**
* @brief Test that resizing single-byte-per-pixel images as raw pixel arrays produces a result of the correct dimensions.
*/
-void TestDownscaleOutputsExpectedDimensionsSingleComponent( uint8_t pixels[], unsigned inputWidth, unsigned inputHeight, unsigned int desiredWidth, unsigned int desiredHeight, unsigned int expectedWidth, unsigned int expectedHeight, const char * const location )
+void TestDownscaleOutputsExpectedDimensionsSingleComponent(uint8_t pixels[], unsigned inputWidth, unsigned inputHeight, unsigned int desiredWidth, unsigned int desiredHeight, unsigned int expectedWidth, unsigned int expectedHeight, const char* const location)
{
unsigned int resultingWidth = -1, resultingHeight = -1;
Dali::Internal::Platform::DownscaleInPlacePow2SingleBytePerPixel(
- pixels,
- inputWidth, inputHeight,
- desiredWidth, desiredHeight, BoxDimensionTestBoth,
- resultingWidth, resultingHeight );
-
- DALI_TEST_EQUALS( resultingWidth, expectedWidth, location );
- DALI_TEST_EQUALS( resultingHeight, expectedHeight, location );
+ pixels,
+ inputWidth,
+ inputHeight,
+ desiredWidth,
+ desiredHeight,
+ BoxDimensionTestBoth,
+ resultingWidth,
+ resultingHeight);
+
+ DALI_TEST_EQUALS(resultingWidth, expectedWidth, location);
+ DALI_TEST_EQUALS(resultingHeight, expectedHeight, location);
}
/**
*/
int UtcDaliImageOperationsDownscaleInPlacePow2RGBA8888(void)
{
- uint32_t image[608*608];
- for( unsigned i = 0; i < sizeof(image) / sizeof(image[0]); ++i )
+ uint32_t image[608 * 608];
+ for(unsigned i = 0; i < sizeof(image) / sizeof(image[0]); ++i)
{
image[i] = 0xffffffff;
}
- unsigned char* const pixels = reinterpret_cast<unsigned char *> (image);
- unsigned int resultingWidth = -1, resultingHeight = -1;
+ unsigned char* const pixels = reinterpret_cast<unsigned char*>(image);
+ unsigned int resultingWidth = -1, resultingHeight = -1;
// Test downscaling where the input size is an exact multiple of the desired size:
// (We expect a perfect result here)
- DownscaleInPlacePow2RGBA8888( pixels, 600, 600, 75, 75, BoxDimensionTestBoth, resultingWidth, resultingHeight );
- DALI_TEST_EQUALS( resultingWidth, 75u, TEST_LOCATION );
- DALI_TEST_EQUALS( resultingHeight, 75u, TEST_LOCATION );
+ DownscaleInPlacePow2RGBA8888(pixels, 600, 600, 75, 75, BoxDimensionTestBoth, resultingWidth, resultingHeight);
+ DALI_TEST_EQUALS(resultingWidth, 75u, TEST_LOCATION);
+ DALI_TEST_EQUALS(resultingHeight, 75u, TEST_LOCATION);
- DownscaleInPlacePow2RGBA8888( pixels, 512, 512, 16, 16, BoxDimensionTestBoth, resultingWidth, resultingHeight );
- DALI_TEST_EQUALS( resultingWidth, 16u, TEST_LOCATION );
- DALI_TEST_EQUALS( resultingHeight, 16u, TEST_LOCATION );
+ DownscaleInPlacePow2RGBA8888(pixels, 512, 512, 16, 16, BoxDimensionTestBoth, resultingWidth, resultingHeight);
+ DALI_TEST_EQUALS(resultingWidth, 16u, TEST_LOCATION);
+ DALI_TEST_EQUALS(resultingHeight, 16u, TEST_LOCATION);
- DownscaleInPlacePow2RGBA8888( pixels, 512, 64, 16, 2, BoxDimensionTestBoth, resultingWidth, resultingHeight );
- DALI_TEST_EQUALS( resultingWidth, 16u, TEST_LOCATION );
- DALI_TEST_EQUALS( resultingHeight, 2u, TEST_LOCATION );
+ DownscaleInPlacePow2RGBA8888(pixels, 512, 64, 16, 2, BoxDimensionTestBoth, resultingWidth, resultingHeight);
+ DALI_TEST_EQUALS(resultingWidth, 16u, TEST_LOCATION);
+ DALI_TEST_EQUALS(resultingHeight, 2u, TEST_LOCATION);
- DownscaleInPlacePow2RGBA8888( pixels, 64, 1024, 4, 64, BoxDimensionTestBoth, resultingWidth, resultingHeight );
- DALI_TEST_EQUALS( resultingWidth, 4u, TEST_LOCATION );
- DALI_TEST_EQUALS( resultingHeight, 64u, TEST_LOCATION );
+ DownscaleInPlacePow2RGBA8888(pixels, 64, 1024, 4, 64, BoxDimensionTestBoth, resultingWidth, resultingHeight);
+ DALI_TEST_EQUALS(resultingWidth, 4u, TEST_LOCATION);
+ DALI_TEST_EQUALS(resultingHeight, 64u, TEST_LOCATION);
// Test downscaling where the input size is slightly off being an exact multiple of the desired size:
// (We expect a perfect match at the end because of rounding-down to an even width and height at each step)
- DownscaleInPlacePow2RGBA8888( pixels, 601, 603, 75, 75, BoxDimensionTestBoth, resultingWidth, resultingHeight );
- DALI_TEST_EQUALS( resultingWidth, 75u, TEST_LOCATION );
- DALI_TEST_EQUALS( resultingHeight, 75u, TEST_LOCATION );
+ DownscaleInPlacePow2RGBA8888(pixels, 601, 603, 75, 75, BoxDimensionTestBoth, resultingWidth, resultingHeight);
+ DALI_TEST_EQUALS(resultingWidth, 75u, TEST_LOCATION);
+ DALI_TEST_EQUALS(resultingHeight, 75u, TEST_LOCATION);
- DownscaleInPlacePow2RGBA8888( pixels, 736 + 1, 352 + 3, 23, 11, BoxDimensionTestBoth, resultingWidth, resultingHeight );
- DALI_TEST_EQUALS( resultingWidth, 23u, TEST_LOCATION );
- DALI_TEST_EQUALS( resultingHeight, 11u, TEST_LOCATION );
+ DownscaleInPlacePow2RGBA8888(pixels, 736 + 1, 352 + 3, 23, 11, BoxDimensionTestBoth, resultingWidth, resultingHeight);
+ DALI_TEST_EQUALS(resultingWidth, 23u, TEST_LOCATION);
+ DALI_TEST_EQUALS(resultingHeight, 11u, TEST_LOCATION);
- DownscaleInPlacePow2RGBA8888( pixels, 384 + 3, 896 + 1, 3, 7, BoxDimensionTestBoth, resultingWidth, resultingHeight );
- DALI_TEST_EQUALS( resultingWidth, 3u, TEST_LOCATION );
- DALI_TEST_EQUALS( resultingHeight, 7u, TEST_LOCATION );
+ DownscaleInPlacePow2RGBA8888(pixels, 384 + 3, 896 + 1, 3, 7, BoxDimensionTestBoth, resultingWidth, resultingHeight);
+ DALI_TEST_EQUALS(resultingWidth, 3u, TEST_LOCATION);
+ DALI_TEST_EQUALS(resultingHeight, 7u, TEST_LOCATION);
// Test downscales with source dimensions which are under a nice power of two by one:
// The target is hit exactly due to losing spare columns or rows at each iteration:
- DownscaleInPlacePow2RGBA8888( pixels, 63, 31, 7, 3, BoxDimensionTestBoth, resultingWidth, resultingHeight );
- DALI_TEST_EQUALS( resultingWidth, 7u, TEST_LOCATION );
- DALI_TEST_EQUALS( resultingHeight, 3u, TEST_LOCATION );
+ DownscaleInPlacePow2RGBA8888(pixels, 63, 31, 7, 3, BoxDimensionTestBoth, resultingWidth, resultingHeight);
+ DALI_TEST_EQUALS(resultingWidth, 7u, TEST_LOCATION);
+ DALI_TEST_EQUALS(resultingHeight, 3u, TEST_LOCATION);
// Asking to downscale a bit smaller should stop at the dimensions of the last test as one more halving would go down to 3 x 1, which is too small.
- DownscaleInPlacePow2RGBA8888( pixels, 63, 31, 4, 2, BoxDimensionTestBoth, resultingWidth, resultingHeight );
- DALI_TEST_EQUALS( resultingWidth, 7u, TEST_LOCATION );
- DALI_TEST_EQUALS( resultingHeight, 3u, TEST_LOCATION );
+ DownscaleInPlacePow2RGBA8888(pixels, 63, 31, 4, 2, BoxDimensionTestBoth, resultingWidth, resultingHeight);
+ DALI_TEST_EQUALS(resultingWidth, 7u, TEST_LOCATION);
+ DALI_TEST_EQUALS(resultingHeight, 3u, TEST_LOCATION);
// Should stop at almost twice the requested dimensions:
- DownscaleInPlacePow2RGBA8888( pixels, 15, 127, 4, 32, BoxDimensionTestBoth, resultingWidth, resultingHeight );
- DALI_TEST_EQUALS( resultingWidth, 7u, TEST_LOCATION );
- DALI_TEST_EQUALS( resultingHeight, 63u, TEST_LOCATION );
+ DownscaleInPlacePow2RGBA8888(pixels, 15, 127, 4, 32, BoxDimensionTestBoth, resultingWidth, resultingHeight);
+ DALI_TEST_EQUALS(resultingWidth, 7u, TEST_LOCATION);
+ DALI_TEST_EQUALS(resultingHeight, 63u, TEST_LOCATION);
// Test downscales to 1 in one or both dimensions:
// Parameters: input-x input-y, desired-x, desired-y, expected-x, expected-y
- TestDownscaleOutputsExpectedDimensionsRGBA8888( image, 512, 512, 1, 1, 1, 1, TEST_LOCATION );
- TestDownscaleOutputsExpectedDimensionsRGBA8888( image, 512, 32, 16, 1, 16, 1, TEST_LOCATION );
- TestDownscaleOutputsExpectedDimensionsRGBA8888( image, 512, 32, 7, 1, 16, 1, TEST_LOCATION );
- TestDownscaleOutputsExpectedDimensionsRGBA8888( image, 512, 32, 7, 1, 16, 1, TEST_LOCATION );
- TestDownscaleOutputsExpectedDimensionsRGBA8888( image, 512, 32, 5, 1, 16, 1, TEST_LOCATION );
- TestDownscaleOutputsExpectedDimensionsRGBA8888( image, 512, 32, 3, 1, 16, 1, TEST_LOCATION );
- TestDownscaleOutputsExpectedDimensionsRGBA8888( image, 32, 512, 1, 1, 1, 16, TEST_LOCATION );
- TestDownscaleOutputsExpectedDimensionsRGBA8888( image, 32, 512, 1, 16, 1, 16, TEST_LOCATION );
- TestDownscaleOutputsExpectedDimensionsRGBA8888( image, 32, 512, 1, 3, 1, 16, TEST_LOCATION );
- TestDownscaleOutputsExpectedDimensionsRGBA8888( image, 33, 33, 1, 1, 1, 1, TEST_LOCATION );
- TestDownscaleOutputsExpectedDimensionsRGBA8888( image, 17*19, 17*19, 1, 1, 1, 1, TEST_LOCATION );
- TestDownscaleOutputsExpectedDimensionsRGBA8888( image, 33, 33, 3, 1, 4, 4, TEST_LOCATION );
- TestDownscaleOutputsExpectedDimensionsRGBA8888( image, 33, 9, 3, 1, 4, 1, TEST_LOCATION );
-
-
+ TestDownscaleOutputsExpectedDimensionsRGBA8888(image, 512, 512, 1, 1, 1, 1, TEST_LOCATION);
+ TestDownscaleOutputsExpectedDimensionsRGBA8888(image, 512, 32, 16, 1, 16, 1, TEST_LOCATION);
+ TestDownscaleOutputsExpectedDimensionsRGBA8888(image, 512, 32, 7, 1, 16, 1, TEST_LOCATION);
+ TestDownscaleOutputsExpectedDimensionsRGBA8888(image, 512, 32, 7, 1, 16, 1, TEST_LOCATION);
+ TestDownscaleOutputsExpectedDimensionsRGBA8888(image, 512, 32, 5, 1, 16, 1, TEST_LOCATION);
+ TestDownscaleOutputsExpectedDimensionsRGBA8888(image, 512, 32, 3, 1, 16, 1, TEST_LOCATION);
+ TestDownscaleOutputsExpectedDimensionsRGBA8888(image, 32, 512, 1, 1, 1, 16, TEST_LOCATION);
+ TestDownscaleOutputsExpectedDimensionsRGBA8888(image, 32, 512, 1, 16, 1, 16, TEST_LOCATION);
+ TestDownscaleOutputsExpectedDimensionsRGBA8888(image, 32, 512, 1, 3, 1, 16, TEST_LOCATION);
+ TestDownscaleOutputsExpectedDimensionsRGBA8888(image, 33, 33, 1, 1, 1, 1, TEST_LOCATION);
+ TestDownscaleOutputsExpectedDimensionsRGBA8888(image, 17 * 19, 17 * 19, 1, 1, 1, 1, TEST_LOCATION);
+ TestDownscaleOutputsExpectedDimensionsRGBA8888(image, 33, 33, 3, 1, 4, 4, TEST_LOCATION);
+ TestDownscaleOutputsExpectedDimensionsRGBA8888(image, 33, 9, 3, 1, 4, 1, TEST_LOCATION);
// Test downscales to zero in one or both dimensions:
// Scaling should stop when one or both dimensions reach 1.
// Parameters: input-x input-y, desired-x, desired-y, expected-x, expected-y
- TestDownscaleOutputsExpectedDimensionsRGBA8888( image, 512, 512, 0, 0, 1, 1, TEST_LOCATION );
- TestDownscaleOutputsExpectedDimensionsRGBA8888( image, 512, 256, 0, 0, 2, 1, TEST_LOCATION );
- TestDownscaleOutputsExpectedDimensionsRGBA8888( image, 512, 128, 0, 0, 4, 1, TEST_LOCATION );
- TestDownscaleOutputsExpectedDimensionsRGBA8888( image, 512, 16, 0, 0, 32, 1, TEST_LOCATION );
- TestDownscaleOutputsExpectedDimensionsRGBA8888( image, 128, 512, 0, 0, 1, 4, TEST_LOCATION );
- TestDownscaleOutputsExpectedDimensionsRGBA8888( image, 32, 512, 0, 0, 1, 16, TEST_LOCATION );
- TestDownscaleOutputsExpectedDimensionsRGBA8888( image, 8, 512, 0, 0, 1, 64, TEST_LOCATION );
- TestDownscaleOutputsExpectedDimensionsRGBA8888( image, 2, 512, 0, 0, 1, 256, TEST_LOCATION );
+ TestDownscaleOutputsExpectedDimensionsRGBA8888(image, 512, 512, 0, 0, 1, 1, TEST_LOCATION);
+ TestDownscaleOutputsExpectedDimensionsRGBA8888(image, 512, 256, 0, 0, 2, 1, TEST_LOCATION);
+ TestDownscaleOutputsExpectedDimensionsRGBA8888(image, 512, 128, 0, 0, 4, 1, TEST_LOCATION);
+ TestDownscaleOutputsExpectedDimensionsRGBA8888(image, 512, 16, 0, 0, 32, 1, TEST_LOCATION);
+ TestDownscaleOutputsExpectedDimensionsRGBA8888(image, 128, 512, 0, 0, 1, 4, TEST_LOCATION);
+ TestDownscaleOutputsExpectedDimensionsRGBA8888(image, 32, 512, 0, 0, 1, 16, TEST_LOCATION);
+ TestDownscaleOutputsExpectedDimensionsRGBA8888(image, 8, 512, 0, 0, 1, 64, TEST_LOCATION);
+ TestDownscaleOutputsExpectedDimensionsRGBA8888(image, 2, 512, 0, 0, 1, 256, TEST_LOCATION);
END_TEST;
}
*/
int UtcDaliImageOperationsDownscaleInPlacePow2RGBA8888Nops(void)
{
- uint32_t image[608*608];
+ uint32_t image[608 * 608];
const uint32_t numPixels = sizeof(image) / sizeof(image[0]);
- for( unsigned i = 0; i < numPixels; ++i )
+ for(unsigned i = 0; i < numPixels; ++i)
{
image[i] = RandomPixelRGBA8888();
}
- const uint32_t imageHash = HashPixels( image, numPixels );
- unsigned char* const pixels = reinterpret_cast<unsigned char *> (image);
- unsigned int resultingWidth = -1, resultingHeight = -1;
+ const uint32_t imageHash = HashPixels(image, numPixels);
+ unsigned char* const pixels = reinterpret_cast<unsigned char*>(image);
+ unsigned int resultingWidth = -1, resultingHeight = -1;
// Test downscales to the same size:
// The point is just to be sure the downscale is a NOP in this case:
- DownscaleInPlacePow2RGBA8888( pixels, 600, 600, 600, 600, BoxDimensionTestBoth, resultingWidth, resultingHeight );
- DALI_TEST_EQUALS( resultingWidth, 600u, TEST_LOCATION );
- DALI_TEST_EQUALS( resultingHeight, 600u, TEST_LOCATION );
+ DownscaleInPlacePow2RGBA8888(pixels, 600, 600, 600, 600, BoxDimensionTestBoth, resultingWidth, resultingHeight);
+ DALI_TEST_EQUALS(resultingWidth, 600u, TEST_LOCATION);
+ DALI_TEST_EQUALS(resultingHeight, 600u, TEST_LOCATION);
- DownscaleInPlacePow2RGBA8888( pixels, 512, 128, 512, 128, BoxDimensionTestBoth, resultingWidth, resultingHeight );
- DALI_TEST_EQUALS( resultingWidth, 512u, TEST_LOCATION );
- DALI_TEST_EQUALS( resultingHeight, 128u, TEST_LOCATION );
+ DownscaleInPlacePow2RGBA8888(pixels, 512, 128, 512, 128, BoxDimensionTestBoth, resultingWidth, resultingHeight);
+ DALI_TEST_EQUALS(resultingWidth, 512u, TEST_LOCATION);
+ DALI_TEST_EQUALS(resultingHeight, 128u, TEST_LOCATION);
- DownscaleInPlacePow2RGBA8888( pixels, 17, 1001, 17, 1001, BoxDimensionTestBoth, resultingWidth, resultingHeight );
- DALI_TEST_EQUALS( resultingWidth, 17u, TEST_LOCATION );
- DALI_TEST_EQUALS( resultingHeight, 1001u, TEST_LOCATION );
+ DownscaleInPlacePow2RGBA8888(pixels, 17, 1001, 17, 1001, BoxDimensionTestBoth, resultingWidth, resultingHeight);
+ DALI_TEST_EQUALS(resultingWidth, 17u, TEST_LOCATION);
+ DALI_TEST_EQUALS(resultingHeight, 1001u, TEST_LOCATION);
// Test downscales that request a larger size (we never upscale so these are NOPs too):
// Parameters: input-x input-y, desired-x, desired-y, expected-x, expected-y
- TestDownscaleOutputsExpectedDimensionsRGBA8888( image, 300, 300, 600, 600, 300, 300, TEST_LOCATION );
- TestDownscaleOutputsExpectedDimensionsRGBA8888( image, 3, 127, 99, 599, 3, 127, TEST_LOCATION );
- TestDownscaleOutputsExpectedDimensionsRGBA8888( image, 600, 600, 999, 999, 600, 600, TEST_LOCATION ); //< checks no out of bounds mem access in this case
-
+ TestDownscaleOutputsExpectedDimensionsRGBA8888(image, 300, 300, 600, 600, 300, 300, TEST_LOCATION);
+ TestDownscaleOutputsExpectedDimensionsRGBA8888(image, 3, 127, 99, 599, 3, 127, TEST_LOCATION);
+ TestDownscaleOutputsExpectedDimensionsRGBA8888(image, 600, 600, 999, 999, 600, 600, TEST_LOCATION); //< checks no out of bounds mem access in this case
// Make sure that none of these NOP downscalings has affected the pixels of the image:
- DALI_TEST_EQUALS( HashPixels( image, numPixels ), imageHash, TEST_LOCATION );
+ DALI_TEST_EQUALS(HashPixels(image, numPixels), imageHash, TEST_LOCATION);
END_TEST;
}
{
// Test that calling with null and zero parameters doesn't blow up:
unsigned int outWidth, outHeight;
- DownscaleInPlacePow2RGB565( 0, 0, 0, 0, 0, BoxDimensionTestBoth, outWidth, outHeight );
+ DownscaleInPlacePow2RGB565(0, 0, 0, 0, 0, BoxDimensionTestBoth, outWidth, outHeight);
- uint16_t image[608*608];
- for( unsigned i = 0; i < sizeof(image) / sizeof(image[0]); ++i )
+ uint16_t image[608 * 608];
+ for(unsigned i = 0; i < sizeof(image) / sizeof(image[0]); ++i)
{
image[i] = 0xffff;
}
// Do a straightforward test using an exact divisor target size:
- TestDownscaleOutputsExpectedDimensionsRGB565( image, 600, 600, 75, 75, 75, 75, TEST_LOCATION );
+ TestDownscaleOutputsExpectedDimensionsRGB565(image, 600, 600, 75, 75, 75, 75, TEST_LOCATION);
// Test that a slightly smaller than possible to achieve target results in the
// next-higher exact divisor output image dimensions:
- TestDownscaleOutputsExpectedDimensionsRGB565( image, 600, 600, 71, 69, 75, 75, TEST_LOCATION );
+ TestDownscaleOutputsExpectedDimensionsRGB565(image, 600, 600, 71, 69, 75, 75, TEST_LOCATION);
// Test that resizing from a starting size that is slightly larger than an exact
// multiple of the desired dimensions still results in the desired ones being
// reached:
// Parameters: input-x input-y, desired-x, desired-y, expected-x, expected-y
- TestDownscaleOutputsExpectedDimensionsRGB565( image, 600 + 1, 600 + 1, 75, 75, 75, 75, TEST_LOCATION );
- TestDownscaleOutputsExpectedDimensionsRGB565( image, 256 + 1, 512 + 1, 2, 4, 2, 4, TEST_LOCATION );
- TestDownscaleOutputsExpectedDimensionsRGB565( image, 512 + 1, 128 + 1, 16, 4, 16, 4, TEST_LOCATION );
- TestDownscaleOutputsExpectedDimensionsRGB565( image, 512 + 1, 64 + 1, 16, 2, 16, 2, TEST_LOCATION );
- TestDownscaleOutputsExpectedDimensionsRGB565( image, 512 + 3, 512 + 3, 16, 16, 16, 16, TEST_LOCATION );
- TestDownscaleOutputsExpectedDimensionsRGB565( image, 512 + 3, 256 + 3, 16, 8, 16, 8, TEST_LOCATION );
- TestDownscaleOutputsExpectedDimensionsRGB565( image, 256 + 3, 512 + 3, 4, 8, 4, 8, TEST_LOCATION );
- TestDownscaleOutputsExpectedDimensionsRGB565( image, 256 + 7, 512 + 7, 4, 8, 4, 8, TEST_LOCATION );
- TestDownscaleOutputsExpectedDimensionsRGB565( image, 256 + 7, 512 + 7, 2, 4, 2, 4, TEST_LOCATION );
- TestDownscaleOutputsExpectedDimensionsRGB565( image, 512 + 7, 128 + 7, 16, 4, 16, 4, TEST_LOCATION );
- TestDownscaleOutputsExpectedDimensionsRGB565( image, 512 + 7, 64 + 7, 16, 2, 16, 2, TEST_LOCATION );
-
+ TestDownscaleOutputsExpectedDimensionsRGB565(image, 600 + 1, 600 + 1, 75, 75, 75, 75, TEST_LOCATION);
+ TestDownscaleOutputsExpectedDimensionsRGB565(image, 256 + 1, 512 + 1, 2, 4, 2, 4, TEST_LOCATION);
+ TestDownscaleOutputsExpectedDimensionsRGB565(image, 512 + 1, 128 + 1, 16, 4, 16, 4, TEST_LOCATION);
+ TestDownscaleOutputsExpectedDimensionsRGB565(image, 512 + 1, 64 + 1, 16, 2, 16, 2, TEST_LOCATION);
+ TestDownscaleOutputsExpectedDimensionsRGB565(image, 512 + 3, 512 + 3, 16, 16, 16, 16, TEST_LOCATION);
+ TestDownscaleOutputsExpectedDimensionsRGB565(image, 512 + 3, 256 + 3, 16, 8, 16, 8, TEST_LOCATION);
+ TestDownscaleOutputsExpectedDimensionsRGB565(image, 256 + 3, 512 + 3, 4, 8, 4, 8, TEST_LOCATION);
+ TestDownscaleOutputsExpectedDimensionsRGB565(image, 256 + 7, 512 + 7, 4, 8, 4, 8, TEST_LOCATION);
+ TestDownscaleOutputsExpectedDimensionsRGB565(image, 256 + 7, 512 + 7, 2, 4, 2, 4, TEST_LOCATION);
+ TestDownscaleOutputsExpectedDimensionsRGB565(image, 512 + 7, 128 + 7, 16, 4, 16, 4, TEST_LOCATION);
+ TestDownscaleOutputsExpectedDimensionsRGB565(image, 512 + 7, 64 + 7, 16, 2, 16, 2, TEST_LOCATION);
END_TEST;
}
{
// Simple test that a null pointer does not get dereferenced in the function:
unsigned int outWidth, outHeight;
- DownscaleInPlacePow2ComponentPair( 0, 0, 0, 0, 0, BoxDimensionTestBoth, outWidth, outHeight );
+ DownscaleInPlacePow2ComponentPair(0, 0, 0, 0, 0, BoxDimensionTestBoth, outWidth, outHeight);
// Simple tests of dimensions output:
- uint8_t image[608*608*2];
- for( unsigned i = 0; i < sizeof(image) / sizeof(image[0]); ++i )
+ uint8_t image[608 * 608 * 2];
+ for(unsigned i = 0; i < sizeof(image) / sizeof(image[0]); ++i)
{
image[i] = 0xff;
}
- TestDownscaleOutputsExpectedDimensions2ComponentPair( image,
- 600, 600, //< Input dimensions
- 37, 37, //< Requested dimensions
- 37, 37, //< Expected output dimensions
- TEST_LOCATION );
- TestDownscaleOutputsExpectedDimensions2ComponentPair( image,
- 600, 600, //< Input dimensions
- 34, 35, //< Requested dimensions to scale-down to
- 37, 37, //< Expected output dimensions achieved
- TEST_LOCATION );
+ TestDownscaleOutputsExpectedDimensions2ComponentPair(image,
+ 600,
+ 600, //< Input dimensions
+ 37,
+ 37, //< Requested dimensions
+ 37,
+ 37, //< Expected output dimensions
+ TEST_LOCATION);
+ TestDownscaleOutputsExpectedDimensions2ComponentPair(image,
+ 600,
+ 600, //< Input dimensions
+ 34,
+ 35, //< Requested dimensions to scale-down to
+ 37,
+ 37, //< Expected output dimensions achieved
+ TEST_LOCATION);
///@note: No need to be as comprehensive as with RGB888 and RGBA8888 as the logic is shared.
END_TEST;
{
// Simple test that a null pointer does not get dereferenced in the function:
unsigned int outWidth, outHeight;
- DownscaleInPlacePow2SingleBytePerPixel( 0, 0, 0, 0, 0, BoxDimensionTestBoth, outWidth, outHeight );
+ DownscaleInPlacePow2SingleBytePerPixel(0, 0, 0, 0, 0, BoxDimensionTestBoth, outWidth, outHeight);
// Tests of output dimensions from downscaling:
- uint8_t image[608*608];
- for( unsigned i = 0; i < sizeof(image) / sizeof(image[0]); ++i )
+ uint8_t image[608 * 608];
+ for(unsigned i = 0; i < sizeof(image) / sizeof(image[0]); ++i)
{
image[i] = 0xff;
}
- TestDownscaleOutputsExpectedDimensionsSingleComponent( image,
- 600, 300, //< Input dimensions
- 150, 75, //< Requested dimensions to scale-down to
- 150, 75, //< Expected output dimensions achieved
- TEST_LOCATION );
- TestDownscaleOutputsExpectedDimensionsSingleComponent( image, 577, 411, 142, 99, 144, 102, TEST_LOCATION );
+ TestDownscaleOutputsExpectedDimensionsSingleComponent(image,
+ 600,
+ 300, //< Input dimensions
+ 150,
+ 75, //< Requested dimensions to scale-down to
+ 150,
+ 75, //< Expected output dimensions achieved
+ TEST_LOCATION);
+ TestDownscaleOutputsExpectedDimensionsSingleComponent(image, 577, 411, 142, 99, 144, 102, TEST_LOCATION);
END_TEST;
}
int UtcDaliImageOperationsHalveScanlineInPlaceRGB888(void)
{
// Red and cyan, averaging to grey:
- unsigned char shortEven[] = { 0xff, 0, 0, 0, 0xff, 0xff, 0xff, 0, 0, 0, 0xff, 0xff };
- unsigned char shortOdd[] = { 0xff, 0, 0, 0, 0xff, 0xff, 0xff, 0, 0, 0, 0xff, 0xff, 0xC, 0xC, 0xC };
+ unsigned char shortEven[] = {0xff, 0, 0, 0, 0xff, 0xff, 0xff, 0, 0, 0, 0xff, 0xff};
+ unsigned char shortOdd[] = {0xff, 0, 0, 0, 0xff, 0xff, 0xff, 0, 0, 0, 0xff, 0xff, 0xC, 0xC, 0xC};
+
+ Dali::Internal::Platform::HalveScanlineInPlaceRGB888(shortEven, 4u);
+ Dali::Internal::Platform::HalveScanlineInPlaceRGB888(shortOdd, 4u);
- Dali::Internal::Platform::HalveScanlineInPlaceRGB888( shortEven, 4u );
- Dali::Internal::Platform::HalveScanlineInPlaceRGB888( shortOdd, 4u );
- for( unsigned i = 0; i < sizeof(shortEven) >> 1u ; ++i )
+ for(unsigned i = 0; i < (sizeof(shortEven) >> 1u); ++i)
{
- DALI_TEST_EQUALS( unsigned(shortEven[i]), 0x7fu, TEST_LOCATION );
- DALI_TEST_EQUALS( unsigned(shortOdd[i]), 0x7fu, TEST_LOCATION );
+ DALI_TEST_EQUALS(unsigned(shortEven[i]), 0x7fu, TEST_LOCATION);
+ DALI_TEST_EQUALS(unsigned(shortOdd[i]), 0x7fu, TEST_LOCATION);
}
END_TEST;
*/
int UtcDaliImageOperationsHalveScanlineInPlaceRGBA8888(void)
{
- const size_t scanlineLength = 4096u;
+ const size_t scanlineLength = 4096u;
Dali::Vector<uint32_t> scanline;
Dali::Vector<uint32_t> reference;
- SetupScanlineForHalvingTestsRGBA8888( scanlineLength, scanline, reference );
+ SetupScanlineForHalvingTestsRGBA8888(scanlineLength, scanline, reference);
- HalveScanlineInPlaceRGBA8888( (uint8_t *) &scanline[0], scanlineLength );
+ HalveScanlineInPlaceRGBA8888((uint8_t*)&scanline[0], scanlineLength);
// Check that the halving matches the independently calculated reference:
size_t numMatches = 0;
- for( int i = 0, length = reference.Size(); i < length; ++i )
+ for(int i = 0, length = reference.Size(); i < length; ++i)
{
- DALI_TEST_EQUALS( scanline[i], reference[i], TEST_LOCATION );
+ DALI_TEST_EQUALS(scanline[i], reference[i], TEST_LOCATION);
numMatches += scanline[i] == reference[i];
}
- DALI_TEST_EQUALS( numMatches, scanlineLength / 2, TEST_LOCATION );
+ DALI_TEST_EQUALS(numMatches, scanlineLength / 2, TEST_LOCATION);
// Test for no beyond-bounds writes:
- for( size_t i = scanlineLength / 2; i < reference.Capacity(); ++i )
+ for(size_t i = scanlineLength / 2; i < reference.Capacity(); ++i)
{
- DALI_TEST_EQUALS( reference[i], (uint32_t)0xEEEEEEEE, TEST_LOCATION );
+ DALI_TEST_EQUALS(reference[i], (uint32_t)0xEEEEEEEE, TEST_LOCATION);
}
END_TEST;
*/
int UtcDaliImageOperationsHalveScanlineInPlaceRGB565(void)
{
- const size_t scanlineLength = 4096u;
+ const size_t scanlineLength = 4096u;
Dali::Vector<uint16_t> scanline;
Dali::Vector<uint16_t> reference;
- SetupScanlineForHalvingTestsRGB565( scanlineLength, scanline, reference );
+ SetupScanlineForHalvingTestsRGB565(scanlineLength, scanline, reference);
- HalveScanlineInPlaceRGB565( (unsigned char *) (&scanline[0]), scanlineLength );
+ HalveScanlineInPlaceRGB565((unsigned char*)(&scanline[0]), scanlineLength);
// Check output against reference:
size_t numMatches = 0;
- for( int i = 0, length = reference.Size(); i < length; ++i )
+ for(int i = 0, length = reference.Size(); i < length; ++i)
{
- DALI_TEST_EQUALS( scanline[i], reference[i], TEST_LOCATION );
+ DALI_TEST_EQUALS(scanline[i], reference[i], TEST_LOCATION);
numMatches += scanline[i] == reference[i];
}
- DALI_TEST_EQUALS( numMatches, scanlineLength / 2, TEST_LOCATION );
+ DALI_TEST_EQUALS(numMatches, scanlineLength / 2, TEST_LOCATION);
// Test for no beyond-bounds writes:
- for( size_t i = scanlineLength / 2; i < reference.Capacity(); ++i )
+ for(size_t i = scanlineLength / 2; i < reference.Capacity(); ++i)
{
- DALI_TEST_EQUALS( reference[i], (uint16_t)0xEEEE, TEST_LOCATION );
+ DALI_TEST_EQUALS(reference[i], (uint16_t)0xEEEE, TEST_LOCATION);
}
END_TEST;
*/
int UtcDaliImageOperationsHalveScanlineInPlace2Bytes(void)
{
- const size_t scanlineLength = 4096u;
+ const size_t scanlineLength = 4096u;
Dali::Vector<uint8_t> scanline;
Dali::Vector<uint8_t> reference;
- SetupScanlineForHalvingTests2Bytes( scanlineLength, scanline, reference );
+ SetupScanlineForHalvingTests2Bytes(scanlineLength, scanline, reference);
- HalveScanlineInPlace2Bytes( &scanline[0], scanlineLength );
+ HalveScanlineInPlace2Bytes(&scanline[0], scanlineLength);
// Test the output against the reference (no differences):
size_t numMatches = 0;
- for( int i = 0, length = reference.Size(); i < length; ++i )
+ for(int i = 0, length = reference.Size(); i < length; ++i)
{
- DALI_TEST_EQUALS( 1u * scanline[i], 1u * reference[i], TEST_LOCATION );
+ DALI_TEST_EQUALS(1u * scanline[i], 1u * reference[i], TEST_LOCATION);
numMatches += scanline[i] == reference[i];
}
// The number of matching bytes should be double the number of pixels, which happens to be the original scanline length in pixels:
- DALI_TEST_EQUALS( numMatches, scanlineLength, TEST_LOCATION );
+ DALI_TEST_EQUALS(numMatches, scanlineLength, TEST_LOCATION);
END_TEST;
}
*/
int UtcDaliImageOperationsHalveScanlineInPlace1Byte(void)
{
- const size_t scanlineLength = 4096u;
+ const size_t scanlineLength = 4096u;
Dali::Vector<uint8_t> scanline;
Dali::Vector<uint8_t> reference;
- SetupScanlineForHalvingTests1Byte( scanlineLength, scanline, reference );
+ SetupScanlineForHalvingTests1Byte(scanlineLength, scanline, reference);
- HalveScanlineInPlace1Byte( &scanline[0], scanlineLength );
+ HalveScanlineInPlace1Byte(&scanline[0], scanlineLength);
// Test the reference matches the output:
size_t numMatches = 0;
- for( int i = 0, length = reference.Size(); i < length; ++i )
+ for(int i = 0, length = reference.Size(); i < length; ++i)
{
- DALI_TEST_EQUALS( 1u * scanline[i], 1u * reference[i], TEST_LOCATION );
+ DALI_TEST_EQUALS(1u * scanline[i], 1u * reference[i], TEST_LOCATION);
numMatches += scanline[i] == reference[i];
}
- DALI_TEST_EQUALS( numMatches, scanlineLength / 2, TEST_LOCATION );
+ DALI_TEST_EQUALS(numMatches, scanlineLength / 2, TEST_LOCATION);
END_TEST;
}
int UtcDaliImageOperationsAverageScanlines1(void)
{
// Red and cyan, averaging to grey:
- unsigned char shortEven1[] = { 0xff, 0, 0, 0, 0xff, 0xff, 0xff, 0, 0, 0, 0xff, 0xff };
- unsigned char shortEven2[] = { 0, 0xff, 0xff, 0xff, 0, 0, 0, 0xff, 0xff, 0xff, 0, 0 };
+ unsigned char shortEven1[] = {0xff, 0, 0, 0, 0xff, 0xff, 0xff, 0, 0, 0, 0xff, 0xff};
+ unsigned char shortEven2[] = {0, 0xff, 0xff, 0xff, 0, 0, 0, 0xff, 0xff, 0xff, 0, 0};
unsigned char outputBuffer[sizeof(shortEven1)];
- AverageScanlines1( shortEven1, shortEven2, outputBuffer, sizeof(shortEven1) );
- for( unsigned i = 0; i < sizeof(shortEven1) ; ++i )
+ AverageScanlines1(shortEven1, shortEven2, outputBuffer, sizeof(shortEven1));
+ for(unsigned i = 0; i < sizeof(shortEven1); ++i)
{
- DALI_TEST_EQUALS( unsigned(outputBuffer[i]), 0x7fu, TEST_LOCATION );
+ DALI_TEST_EQUALS(unsigned(outputBuffer[i]), 0x7fu, TEST_LOCATION);
}
// Longer test reusing RGBA setup/test logic:
- const size_t scanlineLength = 4096u;
+ const size_t scanlineLength = 4096u;
Dali::Vector<uint32_t> scanline1;
Dali::Vector<uint32_t> scanline2;
Dali::Vector<uint32_t> reference;
Dali::Vector<uint32_t> output;
- SetupScanlinesRGBA8888( scanlineLength, scanline1, scanline2, reference, output );
+ SetupScanlinesRGBA8888(scanlineLength, scanline1, scanline2, reference, output);
- AverageScanlines1( (const unsigned char*) &scanline1[0], (const unsigned char*) &scanline2[0], (unsigned char*) &output[0], scanlineLength * 4 );
+ AverageScanlines1((const unsigned char*)&scanline1[0], (const unsigned char*)&scanline2[0], (unsigned char*)&output[0], scanlineLength * 4);
// Check the output matches the independently generated reference:
size_t numMatches = 0;
- MatchScanlinesRGBA8888( reference, output, numMatches, TEST_LOCATION );
- DALI_TEST_EQUALS( numMatches, reference.Capacity(), TEST_LOCATION );
+ MatchScanlinesRGBA8888(reference, output, numMatches, TEST_LOCATION);
+ DALI_TEST_EQUALS(numMatches, reference.Capacity(), TEST_LOCATION);
END_TEST;
}
int UtcDaliImageOperationsAverageScanlines2(void)
{
// Red and cyan, averaging to grey:
- unsigned char shortEven1[] = { 0xff, 0, 0, 0, 0xff, 0xff, 0xff, 0, 0, 0, 0xff, 0xff };
- unsigned char shortEven2[] = { 0, 0xff, 0xff, 0xff, 0, 0, 0, 0xff, 0xff, 0xff, 0, 0 };
+ unsigned char shortEven1[] = {0xff, 0, 0, 0, 0xff, 0xff, 0xff, 0, 0, 0, 0xff, 0xff};
+ unsigned char shortEven2[] = {0, 0xff, 0xff, 0xff, 0, 0, 0, 0xff, 0xff, 0xff, 0, 0};
unsigned char outputBuffer[sizeof(shortEven1)];
- AverageScanlines2( shortEven1, shortEven2, outputBuffer, sizeof(shortEven1) / 2 );
+ AverageScanlines2(shortEven1, shortEven2, outputBuffer, sizeof(shortEven1) / 2);
- for( unsigned i = 0; i < sizeof(shortEven1); ++i )
+ for(unsigned i = 0; i < sizeof(shortEven1); ++i)
{
- DALI_TEST_EQUALS( unsigned(outputBuffer[i]), 0x7fu, TEST_LOCATION );
+ DALI_TEST_EQUALS(unsigned(outputBuffer[i]), 0x7fu, TEST_LOCATION);
}
// Longer test reusing RGBA setup/test logic:
- const size_t scanlineLength = 4096u;
+ const size_t scanlineLength = 4096u;
Dali::Vector<uint32_t> scanline1;
Dali::Vector<uint32_t> scanline2;
Dali::Vector<uint32_t> reference;
Dali::Vector<uint32_t> output;
- SetupScanlinesRGBA8888( scanlineLength, scanline1, scanline2, reference, output );
+ SetupScanlinesRGBA8888(scanlineLength, scanline1, scanline2, reference, output);
- AverageScanlines2( (const unsigned char*) &scanline1[0], (const unsigned char*) &scanline2[0], (unsigned char*) &output[0], scanlineLength * 2 );
+ AverageScanlines2((const unsigned char*)&scanline1[0], (const unsigned char*)&scanline2[0], (unsigned char*)&output[0], scanlineLength * 2);
// Check the output matches the independently generated reference:
size_t numMatches = 0;
- MatchScanlinesRGBA8888( reference, output, numMatches, TEST_LOCATION );
- DALI_TEST_EQUALS( numMatches, reference.Capacity(), TEST_LOCATION );
+ MatchScanlinesRGBA8888(reference, output, numMatches, TEST_LOCATION);
+ DALI_TEST_EQUALS(numMatches, reference.Capacity(), TEST_LOCATION);
END_TEST;
}
int UtcDaliImageOperationsAverageScanlines3(void)
{
// Red and cyan, averaging to grey:
- unsigned char shortEven1[] = { 0xff, 0, 0, 0, 0xff, 0xff, 0xff, 0, 0, 0, 0xff, 0xff };
- unsigned char shortEven2[] = { 0, 0xff, 0xff, 0xff, 0, 0, 0, 0xff, 0xff, 0xff, 0, 0 };
+ unsigned char shortEven1[] = {0xff, 0, 0, 0, 0xff, 0xff, 0xff, 0, 0, 0, 0xff, 0xff};
+ unsigned char shortEven2[] = {0, 0xff, 0xff, 0xff, 0, 0, 0, 0xff, 0xff, 0xff, 0, 0};
unsigned char outputBuffer[sizeof(shortEven1)];
- AverageScanlines3( shortEven1, shortEven2, outputBuffer, sizeof(shortEven1) / 3 );
- for( unsigned i = 0; i < sizeof(shortEven1) ; ++i )
+ AverageScanlines3(shortEven1, shortEven2, outputBuffer, sizeof(shortEven1) / 3);
+ for(unsigned i = 0; i < sizeof(shortEven1); ++i)
{
- DALI_TEST_EQUALS( unsigned(outputBuffer[i]), 0x7fu, TEST_LOCATION );
+ DALI_TEST_EQUALS(unsigned(outputBuffer[i]), 0x7fu, TEST_LOCATION);
}
// Longer test reusing RGBA setup/test logic:
- const size_t scanlineLength = 3 * 4 * 90u;
+ const size_t scanlineLength = 3 * 4 * 90u;
Dali::Vector<uint32_t> scanline1;
Dali::Vector<uint32_t> scanline2;
Dali::Vector<uint32_t> reference;
Dali::Vector<uint32_t> output;
- SetupScanlinesRGBA8888( scanlineLength, scanline1, scanline2, reference, output );
+ SetupScanlinesRGBA8888(scanlineLength, scanline1, scanline2, reference, output);
- AverageScanlines3( (const unsigned char*) &scanline1[0], (const unsigned char*) &scanline2[0], (unsigned char*) &output[0], scanlineLength * 4 / 3 );
+ AverageScanlines3((const unsigned char*)&scanline1[0], (const unsigned char*)&scanline2[0], (unsigned char*)&output[0], scanlineLength * 4 / 3);
// Check the output matches the independently generated reference:
size_t numMatches = 0;
- MatchScanlinesRGBA8888( reference, output, numMatches, TEST_LOCATION );
- DALI_TEST_EQUALS( numMatches, reference.Capacity(), TEST_LOCATION );
+ MatchScanlinesRGBA8888(reference, output, numMatches, TEST_LOCATION);
+ DALI_TEST_EQUALS(numMatches, reference.Capacity(), TEST_LOCATION);
END_TEST;
}
*/
int UtcDaliImageOperationsAverageScanlinesRGBA8888(void)
{
- const size_t scanlineLength = 4096u;
+ const size_t scanlineLength = 4096u;
Dali::Vector<uint32_t> scanline1;
Dali::Vector<uint32_t> scanline2;
Dali::Vector<uint32_t> reference;
Dali::Vector<uint32_t> output;
- SetupScanlinesRGBA8888( scanlineLength, scanline1, scanline2, reference, output );
+ SetupScanlinesRGBA8888(scanlineLength, scanline1, scanline2, reference, output);
- AverageScanlinesRGBA8888( (const unsigned char*) &scanline1[0], (const unsigned char*) &scanline2[0], (unsigned char*) &output[0], scanlineLength );
+ AverageScanlinesRGBA8888((const unsigned char*)&scanline1[0], (const unsigned char*)&scanline2[0], (unsigned char*)&output[0], scanlineLength);
// Check the output matches the independently generated reference:
size_t numMatches = 0;
- MatchScanlinesRGBA8888( reference, output, numMatches, TEST_LOCATION );
- DALI_TEST_EQUALS( numMatches, reference.Capacity(), TEST_LOCATION );
+ MatchScanlinesRGBA8888(reference, output, numMatches, TEST_LOCATION);
+ DALI_TEST_EQUALS(numMatches, reference.Capacity(), TEST_LOCATION);
END_TEST;
}
int UtcDaliImageOperationsAverageScanlinesRGB565(void)
{
// Red and cyan, averaging to grey:
- const uint16_t shortEven1[] = { 0xf800, 0xf800, 0xf800, 0xf800, 0xf800, 0xf800, 0xBEEF, 0xBEEF };
- const uint16_t shortEven2[] = { 0x7ff, 0x7ff, 0x7ff, 0x7ff, 0x7ff, 0x7ff, 0xBEEF, 0xBEEF };
- const size_t arrayLength = sizeof(shortEven1) / sizeof(shortEven1[0]) - 2;
- uint16_t outputBuffer[arrayLength + 2];
- outputBuffer[arrayLength] = 0xDEAD;
- outputBuffer[arrayLength+1] = 0xDEAD;
-
- Dali::Internal::Platform::AverageScanlinesRGB565( (const unsigned char*) shortEven1, (const unsigned char*) shortEven2, (unsigned char*) outputBuffer, arrayLength );
- for( unsigned i = 0; i < arrayLength ; ++i )
+ const uint16_t shortEven1[] = {0xf800, 0xf800, 0xf800, 0xf800, 0xf800, 0xf800, 0xBEEF, 0xBEEF};
+ const uint16_t shortEven2[] = {0x7ff, 0x7ff, 0x7ff, 0x7ff, 0x7ff, 0x7ff, 0xBEEF, 0xBEEF};
+ const size_t arrayLength = sizeof(shortEven1) / sizeof(shortEven1[0]) - 2;
+ uint16_t outputBuffer[arrayLength + 2];
+ outputBuffer[arrayLength] = 0xDEAD;
+ outputBuffer[arrayLength + 1] = 0xDEAD;
+
+ Dali::Internal::Platform::AverageScanlinesRGB565((const unsigned char*)shortEven1, (const unsigned char*)shortEven2, (unsigned char*)outputBuffer, arrayLength);
+ for(unsigned i = 0; i < arrayLength; ++i)
{
- DALI_TEST_EQUALS( unsigned(outputBuffer[i]), 0xffff - (1u << 15) - (1u << 10) - (1u << 4), TEST_LOCATION );
+ DALI_TEST_EQUALS(unsigned(outputBuffer[i]), 0xffff - (1u << 15) - (1u << 10) - (1u << 4), TEST_LOCATION);
}
// Check for buffer overrun:
- DALI_TEST_EQUALS( outputBuffer[arrayLength], (uint16_t)0xDEAD, TEST_LOCATION );
- DALI_TEST_EQUALS( outputBuffer[arrayLength+1], (uint16_t)0xDEAD, TEST_LOCATION );
+ DALI_TEST_EQUALS(outputBuffer[arrayLength], (uint16_t)0xDEAD, TEST_LOCATION);
+ DALI_TEST_EQUALS(outputBuffer[arrayLength + 1], (uint16_t)0xDEAD, TEST_LOCATION);
END_TEST;
}
namespace
{
-
-void MakeSingleColorImageRGBA8888( unsigned int width, unsigned int height, uint32_t *inputImage )
+void MakeSingleColorImageRGBA8888(unsigned int width, unsigned int height, uint32_t* inputImage)
{
- const uint32_t inPixel = PixelRGBA8888( 255, 192, 128, 64 );
- for( unsigned int i = 0; i < width * height; ++i )
+ const uint32_t inPixel = PixelRGBA8888(255, 192, 128, 64);
+ for(unsigned int i = 0; i < width * height; ++i)
{
inputImage[i] = inPixel;
}
* @brief Make an image with a checkerboard pattern.
* @note This is an easy pattern to scan for correctness after a downscaling test.
*/
-Dali::IntrusivePtr<Dali::RefCountedVector<uint32_t> > MakeCheckerboardImageRGBA8888( unsigned int width, unsigned int height, unsigned int checkerSize )
+Dali::IntrusivePtr<Dali::RefCountedVector<uint32_t> > MakeCheckerboardImageRGBA8888(unsigned int width, unsigned int height, unsigned int checkerSize)
{
- const unsigned int imageWidth = width * checkerSize;
- const unsigned int imageHeight = height * checkerSize;
- Dali::IntrusivePtr<Dali::RefCountedVector<uint32_t> > image = new Dali::RefCountedVector<uint32_t>;
- image->GetVector().Resize( imageWidth * imageHeight );
+ const unsigned int imageWidth = width * checkerSize;
+ const unsigned int imageHeight = height * checkerSize;
+ Dali::IntrusivePtr<Dali::RefCountedVector<uint32_t> > image = new Dali::RefCountedVector<uint32_t>;
+ image->GetVector().Resize(imageWidth * imageHeight);
uint32_t rowColor = 0xffffffff;
- for( unsigned int cy = 0; cy < height; ++cy )
+ for(unsigned int cy = 0; cy < height; ++cy)
{
- rowColor = rowColor == 0xffffffff ? 0xff000000 : 0xffffffff;
+ rowColor = rowColor == 0xffffffff ? 0xff000000 : 0xffffffff;
uint32_t checkColor = rowColor;
- for( unsigned int cx = 0; cx < width; ++cx )
+ for(unsigned int cx = 0; cx < width; ++cx)
{
- checkColor = checkColor == 0xffffffff ? 0xff000000 : 0xffffffff;
+ checkColor = checkColor == 0xffffffff ? 0xff000000 : 0xffffffff;
uint32_t paintedColor = checkColor;
// Draw 3 special case checks as r,g,b:
if(cx == 0 && cy == 0)
{
- paintedColor = 0xff0000ff;// Red
+ paintedColor = 0xff0000ff; // Red
}
else if(cx == 7 && cy == 0)
{
- paintedColor = 0xff00ff00;// Green
+ paintedColor = 0xff00ff00; // Green
}
else if(cx == 7 && cy == 7)
{
- paintedColor = 0xffff0000;// blue
+ paintedColor = 0xffff0000; // blue
}
- uint32_t * check = &image->GetVector()[ (cy * checkerSize * imageWidth) + (cx * checkerSize)];
- for( unsigned int py = 0; py < checkerSize; ++py )
+ uint32_t* check = &image->GetVector()[(cy * checkerSize * imageWidth) + (cx * checkerSize)];
+ for(unsigned int py = 0; py < checkerSize; ++py)
{
- uint32_t * checkLine = check + py * imageWidth;
- for( unsigned int px = 0; px < checkerSize; ++px )
+ uint32_t* checkLine = check + py * imageWidth;
+ for(unsigned int px = 0; px < checkerSize; ++px)
{
checkLine[px] = paintedColor;
}
return image;
}
-}
+} // namespace
/**
* @brief Test the right pixels are generated when downsampling a checkerboard into a small image.
*/
int UtcDaliImageOperationsPointSampleCheckerboardRGBA888(void)
{
- Dali::IntrusivePtr<Dali::RefCountedVector<uint32_t> > image = MakeCheckerboardImageRGBA8888( 8, 8, 32 );
- const unsigned int desiredWidth = 8;
- const unsigned int desiredHeight = 8;
+ Dali::IntrusivePtr<Dali::RefCountedVector<uint32_t> > image = MakeCheckerboardImageRGBA8888(8, 8, 32);
+ const unsigned int desiredWidth = 8;
+ const unsigned int desiredHeight = 8;
- uint32_t outputImage[ desiredWidth * desiredHeight ];
+ uint32_t outputImage[desiredWidth * desiredHeight];
- Dali::Internal::Platform::PointSample4BPP( (const unsigned char *) &image->GetVector()[0], 256, 256, (unsigned char*) outputImage, desiredWidth, desiredHeight );
+ Dali::Internal::Platform::PointSample4BPP((const unsigned char*)&image->GetVector()[0], 256, 256, (unsigned char*)outputImage, desiredWidth, desiredHeight);
- DALI_TEST_EQUALS( outputImage[0], (uint32_t)0xff0000ff, TEST_LOCATION ); // < Red corner pixel
- DALI_TEST_EQUALS( outputImage[7], (uint32_t)0xff00ff00, TEST_LOCATION ); // < Green corner pixel
- DALI_TEST_EQUALS( outputImage[8*8-1], (uint32_t)0xffff0000, TEST_LOCATION ); // < Blue corner pixel
+ DALI_TEST_EQUALS(outputImage[0], (uint32_t)0xff0000ff, TEST_LOCATION); // < Red corner pixel
+ DALI_TEST_EQUALS(outputImage[7], (uint32_t)0xff00ff00, TEST_LOCATION); // < Green corner pixel
+ DALI_TEST_EQUALS(outputImage[8 * 8 - 1], (uint32_t)0xffff0000, TEST_LOCATION); // < Blue corner pixel
- DALI_TEST_EQUALS( outputImage[1], (uint32_t)0xff000000, TEST_LOCATION ); // < black pixel
- DALI_TEST_EQUALS( outputImage[2], (uint32_t)0xffffffff, TEST_LOCATION ); // < white pixel
- DALI_TEST_EQUALS( outputImage[3], (uint32_t)0xff000000, TEST_LOCATION ); // < black pixel
- DALI_TEST_EQUALS( outputImage[4], (uint32_t)0xffffffff, TEST_LOCATION ); // < white pixel
- DALI_TEST_EQUALS( outputImage[5], (uint32_t)0xff000000, TEST_LOCATION ); // < black pixel
- DALI_TEST_EQUALS( outputImage[6], (uint32_t)0xffffffff, TEST_LOCATION ); // < white pixel
+ DALI_TEST_EQUALS(outputImage[1], (uint32_t)0xff000000, TEST_LOCATION); // < black pixel
+ DALI_TEST_EQUALS(outputImage[2], (uint32_t)0xffffffff, TEST_LOCATION); // < white pixel
+ DALI_TEST_EQUALS(outputImage[3], (uint32_t)0xff000000, TEST_LOCATION); // < black pixel
+ DALI_TEST_EQUALS(outputImage[4], (uint32_t)0xffffffff, TEST_LOCATION); // < white pixel
+ DALI_TEST_EQUALS(outputImage[5], (uint32_t)0xff000000, TEST_LOCATION); // < black pixel
+ DALI_TEST_EQUALS(outputImage[6], (uint32_t)0xffffffff, TEST_LOCATION); // < white pixel
// Second scanline:
- DALI_TEST_EQUALS( outputImage[8+0], (uint32_t)0xff000000, TEST_LOCATION ); // < black pixel
- DALI_TEST_EQUALS( outputImage[8+1], (uint32_t)0xffffffff, TEST_LOCATION ); // < white pixel
- DALI_TEST_EQUALS( outputImage[8+2], (uint32_t)0xff000000, TEST_LOCATION ); // < black pixel
- DALI_TEST_EQUALS( outputImage[8+3], (uint32_t)0xffffffff, TEST_LOCATION ); // < white pixel
- DALI_TEST_EQUALS( outputImage[8+4], (uint32_t)0xff000000, TEST_LOCATION ); // < black pixel
- DALI_TEST_EQUALS( outputImage[8+5], (uint32_t)0xffffffff, TEST_LOCATION ); // < white pixel
- DALI_TEST_EQUALS( outputImage[8+6], (uint32_t)0xff000000, TEST_LOCATION ); // < black pixel
- DALI_TEST_EQUALS( outputImage[8+7], (uint32_t)0xffffffff, TEST_LOCATION ); // < white pixel
+ DALI_TEST_EQUALS(outputImage[8 + 0], (uint32_t)0xff000000, TEST_LOCATION); // < black pixel
+ DALI_TEST_EQUALS(outputImage[8 + 1], (uint32_t)0xffffffff, TEST_LOCATION); // < white pixel
+ DALI_TEST_EQUALS(outputImage[8 + 2], (uint32_t)0xff000000, TEST_LOCATION); // < black pixel
+ DALI_TEST_EQUALS(outputImage[8 + 3], (uint32_t)0xffffffff, TEST_LOCATION); // < white pixel
+ DALI_TEST_EQUALS(outputImage[8 + 4], (uint32_t)0xff000000, TEST_LOCATION); // < black pixel
+ DALI_TEST_EQUALS(outputImage[8 + 5], (uint32_t)0xffffffff, TEST_LOCATION); // < white pixel
+ DALI_TEST_EQUALS(outputImage[8 + 6], (uint32_t)0xff000000, TEST_LOCATION); // < black pixel
+ DALI_TEST_EQUALS(outputImage[8 + 7], (uint32_t)0xffffffff, TEST_LOCATION); // < white pixel
// Third scanline:
- DALI_TEST_EQUALS( outputImage[16+0], (uint32_t)0xffffffff, TEST_LOCATION ); // < white pixel
- DALI_TEST_EQUALS( outputImage[16+1], (uint32_t)0xff000000, TEST_LOCATION ); // < black pixel
- DALI_TEST_EQUALS( outputImage[16+2], (uint32_t)0xffffffff, TEST_LOCATION ); // < white pixel
- DALI_TEST_EQUALS( outputImage[16+3], (uint32_t)0xff000000, TEST_LOCATION ); // < black pixel
- DALI_TEST_EQUALS( outputImage[16+4], (uint32_t)0xffffffff, TEST_LOCATION ); // < white pixel
- DALI_TEST_EQUALS( outputImage[16+5], (uint32_t)0xff000000, TEST_LOCATION ); // < black pixel
- DALI_TEST_EQUALS( outputImage[16+6], (uint32_t)0xffffffff, TEST_LOCATION ); // < white pixel
- DALI_TEST_EQUALS( outputImage[16+7], (uint32_t)0xff000000, TEST_LOCATION ); // < black pixel
+ DALI_TEST_EQUALS(outputImage[16 + 0], (uint32_t)0xffffffff, TEST_LOCATION); // < white pixel
+ DALI_TEST_EQUALS(outputImage[16 + 1], (uint32_t)0xff000000, TEST_LOCATION); // < black pixel
+ DALI_TEST_EQUALS(outputImage[16 + 2], (uint32_t)0xffffffff, TEST_LOCATION); // < white pixel
+ DALI_TEST_EQUALS(outputImage[16 + 3], (uint32_t)0xff000000, TEST_LOCATION); // < black pixel
+ DALI_TEST_EQUALS(outputImage[16 + 4], (uint32_t)0xffffffff, TEST_LOCATION); // < white pixel
+ DALI_TEST_EQUALS(outputImage[16 + 5], (uint32_t)0xff000000, TEST_LOCATION); // < black pixel
+ DALI_TEST_EQUALS(outputImage[16 + 6], (uint32_t)0xffffffff, TEST_LOCATION); // < white pixel
+ DALI_TEST_EQUALS(outputImage[16 + 7], (uint32_t)0xff000000, TEST_LOCATION); // < black pixel
// ... could do more scanlines (there are 8)
// Sample a few more pixels:
// Diagonals:
- DALI_TEST_EQUALS( outputImage[24+3], (uint32_t)0xffffffff, TEST_LOCATION ); // < white pixel
- DALI_TEST_EQUALS( outputImage[32+4], (uint32_t)0xffffffff, TEST_LOCATION ); // < white pixel
- DALI_TEST_EQUALS( outputImage[40+5], (uint32_t)0xffffffff, TEST_LOCATION ); // < white pixel
- DALI_TEST_EQUALS( outputImage[48+6], (uint32_t)0xffffffff, TEST_LOCATION ); // < white pixel
- DALI_TEST_EQUALS( outputImage[24+4], (uint32_t)0xff000000, TEST_LOCATION ); // < black pixel
- DALI_TEST_EQUALS( outputImage[32+3], (uint32_t)0xff000000, TEST_LOCATION ); // < black pixel
- DALI_TEST_EQUALS( outputImage[40+2], (uint32_t)0xff000000, TEST_LOCATION ); // < black pixel
- DALI_TEST_EQUALS( outputImage[48+1], (uint32_t)0xff000000, TEST_LOCATION ); // < black pixel
- DALI_TEST_EQUALS( outputImage[56+0], (uint32_t)0xff000000, TEST_LOCATION ); // < black pixel
+ DALI_TEST_EQUALS(outputImage[24 + 3], (uint32_t)0xffffffff, TEST_LOCATION); // < white pixel
+ DALI_TEST_EQUALS(outputImage[32 + 4], (uint32_t)0xffffffff, TEST_LOCATION); // < white pixel
+ DALI_TEST_EQUALS(outputImage[40 + 5], (uint32_t)0xffffffff, TEST_LOCATION); // < white pixel
+ DALI_TEST_EQUALS(outputImage[48 + 6], (uint32_t)0xffffffff, TEST_LOCATION); // < white pixel
+ DALI_TEST_EQUALS(outputImage[24 + 4], (uint32_t)0xff000000, TEST_LOCATION); // < black pixel
+ DALI_TEST_EQUALS(outputImage[32 + 3], (uint32_t)0xff000000, TEST_LOCATION); // < black pixel
+ DALI_TEST_EQUALS(outputImage[40 + 2], (uint32_t)0xff000000, TEST_LOCATION); // < black pixel
+ DALI_TEST_EQUALS(outputImage[48 + 1], (uint32_t)0xff000000, TEST_LOCATION); // < black pixel
+ DALI_TEST_EQUALS(outputImage[56 + 0], (uint32_t)0xff000000, TEST_LOCATION); // < black pixel
END_TEST;
}
*/
int UtcDaliImageOperationsPointSampleRGBA888PixelsCorrectColor(void)
{
- const unsigned int inputWidth = 137;
- const unsigned int inputHeight = 571;
- const unsigned int desiredWidth = 59;
+ const unsigned int inputWidth = 137;
+ const unsigned int inputHeight = 571;
+ const unsigned int desiredWidth = 59;
const unsigned int desiredHeight = 257;
- uint32_t inputImage[ inputWidth * inputHeight ];
- MakeSingleColorImageRGBA8888( inputWidth, inputHeight, inputImage );
+ uint32_t inputImage[inputWidth * inputHeight];
+ MakeSingleColorImageRGBA8888(inputWidth, inputHeight, inputImage);
- const size_t outputBufferSize = desiredWidth * desiredHeight;
- std::vector< uint32_t > buffer;
- buffer.resize( outputBufferSize );
+ const size_t outputBufferSize = desiredWidth * desiredHeight;
+ std::vector<uint32_t> buffer;
+ buffer.resize(outputBufferSize);
uint32_t* outputImage = &buffer[0];
- Dali::Internal::Platform::PointSample4BPP( (const unsigned char *) inputImage, inputWidth, inputHeight, (unsigned char*) outputImage, desiredWidth, desiredHeight );
+ Dali::Internal::Platform::PointSample4BPP((const unsigned char*)inputImage, inputWidth, inputHeight, (unsigned char*)outputImage, desiredWidth, desiredHeight);
// Check that all the output pixels are the right color:
- const uint32_t reference = inputImage[ inputWidth * inputHeight / 2];
- unsigned int differentColorCount = 0;
- for( unsigned int i = 0; i < desiredWidth * desiredHeight; ++i )
+ const uint32_t reference = inputImage[inputWidth * inputHeight / 2];
+ unsigned int differentColorCount = 0;
+ for(unsigned int i = 0; i < desiredWidth * desiredHeight; ++i)
{
- if( outputImage[i] != reference )
+ if(outputImage[i] != reference)
{
++differentColorCount;
}
}
- DALI_TEST_EQUALS( 0U, differentColorCount, TEST_LOCATION );
+ DALI_TEST_EQUALS(0U, differentColorCount, TEST_LOCATION);
END_TEST;
}
*/
int UtcDaliImageOperationsPointSampleRGBA888ScaleToSinglePixel(void)
{
- const unsigned int desiredWidth = 1;
+ const unsigned int desiredWidth = 1;
const unsigned int desiredHeight = 1;
- uint32_t inputImage[ 1024 * 1024 ];
- MakeSingleColorImageRGBA8888( 1024, 1024, inputImage );
+ uint32_t inputImage[1024 * 1024];
+ MakeSingleColorImageRGBA8888(1024, 1024, inputImage);
uint32_t outputImage = 0;
// Try several different starting image sizes:
// 1x1 -> 1x1:
- Dali::Internal::Platform::PointSample4BPP( (const unsigned char *) inputImage, 1, 1, (unsigned char*) &outputImage, desiredWidth, desiredHeight );
- DALI_TEST_EQUALS( outputImage, inputImage[0], TEST_LOCATION );
+ Dali::Internal::Platform::PointSample4BPP((const unsigned char*)inputImage, 1, 1, (unsigned char*)&outputImage, desiredWidth, desiredHeight);
+ DALI_TEST_EQUALS(outputImage, inputImage[0], TEST_LOCATION);
outputImage = 0;
// Single-pixel wide tall stripe:
- Dali::Internal::Platform::PointSample4BPP( (const unsigned char *) inputImage, 1, 1024, (unsigned char*) &outputImage, desiredWidth, desiredHeight );
- DALI_TEST_EQUALS( outputImage, inputImage[0], TEST_LOCATION );
+ Dali::Internal::Platform::PointSample4BPP((const unsigned char*)inputImage, 1, 1024, (unsigned char*)&outputImage, desiredWidth, desiredHeight);
+ DALI_TEST_EQUALS(outputImage, inputImage[0], TEST_LOCATION);
outputImage = 0;
// Single-pixel tall, wide strip:
- Dali::Internal::Platform::PointSample4BPP( (const unsigned char *) inputImage, 1024, 1, (unsigned char*) &outputImage, desiredWidth, desiredHeight );
- DALI_TEST_EQUALS( outputImage, inputImage[0], TEST_LOCATION );
+ Dali::Internal::Platform::PointSample4BPP((const unsigned char*)inputImage, 1024, 1, (unsigned char*)&outputImage, desiredWidth, desiredHeight);
+ DALI_TEST_EQUALS(outputImage, inputImage[0], TEST_LOCATION);
outputImage = 0;
// Square mid-size image:
- Dali::Internal::Platform::PointSample4BPP( (const unsigned char *) inputImage, 103, 103, (unsigned char*) &outputImage, desiredWidth, desiredHeight );
- DALI_TEST_EQUALS( outputImage, inputImage[0], TEST_LOCATION );
+ Dali::Internal::Platform::PointSample4BPP((const unsigned char*)inputImage, 103, 103, (unsigned char*)&outputImage, desiredWidth, desiredHeight);
+ DALI_TEST_EQUALS(outputImage, inputImage[0], TEST_LOCATION);
outputImage = 0;
// Wide mid-size image:
- Dali::Internal::Platform::PointSample4BPP( (const unsigned char *) inputImage, 313, 79, (unsigned char*) &outputImage, desiredWidth, desiredHeight );
- DALI_TEST_EQUALS( outputImage, inputImage[0], TEST_LOCATION );
+ Dali::Internal::Platform::PointSample4BPP((const unsigned char*)inputImage, 313, 79, (unsigned char*)&outputImage, desiredWidth, desiredHeight);
+ DALI_TEST_EQUALS(outputImage, inputImage[0], TEST_LOCATION);
outputImage = 0;
// Tall mid-size image:
- Dali::Internal::Platform::PointSample4BPP( (const unsigned char *) inputImage, 53, 467, (unsigned char*) &outputImage, desiredWidth, desiredHeight );
- DALI_TEST_EQUALS( outputImage, inputImage[0], TEST_LOCATION );
+ Dali::Internal::Platform::PointSample4BPP((const unsigned char*)inputImage, 53, 467, (unsigned char*)&outputImage, desiredWidth, desiredHeight);
+ DALI_TEST_EQUALS(outputImage, inputImage[0], TEST_LOCATION);
outputImage = 0;
// 0 x 0 input image (make sure output not written to):
outputImage = 0xDEADBEEF;
- Dali::Internal::Platform::PointSample4BPP( (const unsigned char *) inputImage, 0, 0, (unsigned char*) &outputImage, desiredWidth, desiredHeight );
- DALI_TEST_EQUALS( outputImage, (uint32_t)0xDEADBEEF, TEST_LOCATION );
+ Dali::Internal::Platform::PointSample4BPP((const unsigned char*)inputImage, 0, 0, (unsigned char*)&outputImage, desiredWidth, desiredHeight);
+ DALI_TEST_EQUALS(outputImage, (uint32_t)0xDEADBEEF, TEST_LOCATION);
outputImage = 0;
END_TEST;
*/
int UtcDaliImageOperationsPointSampleRGBA888N(void)
{
- uint32_t inputImage[ 128 * 128 ];
- MakeSingleColorImageRGBA8888( 128, 128, inputImage );
- uint32_t outputImage[ 128 * 128 ];
- memset( outputImage, 0xaa, 128 * 128 * sizeof(uint32_t) );
+ uint32_t inputImage[128 * 128];
+ MakeSingleColorImageRGBA8888(128, 128, inputImage);
+ uint32_t outputImage[128 * 128];
+ memset(outputImage, 0xaa, 128 * 128 * sizeof(uint32_t));
// Try several different starting image sizes:
// 1x1 -> 1x1:
- Dali::Internal::Platform::PointSample4BPP( (const unsigned char *) inputImage, 1, 1, (unsigned char*) outputImage, 0, 0 );
- DALI_TEST_EQUALS( 0xaaaaaaaa, outputImage[0], TEST_LOCATION );
+ Dali::Internal::Platform::PointSample4BPP((const unsigned char*)inputImage, 1, 1, (unsigned char*)outputImage, 0, 0);
+ DALI_TEST_EQUALS(0xaaaaaaaa, outputImage[0], TEST_LOCATION);
// Single-pixel wide tall stripe:
- Dali::Internal::Platform::PointSample4BPP( (const unsigned char *) inputImage, 1, 102, (unsigned char*) outputImage, 0, 33 );
- DALI_TEST_EQUALS( 0xaaaaaaaa, outputImage[0], TEST_LOCATION );
+ Dali::Internal::Platform::PointSample4BPP((const unsigned char*)inputImage, 1, 102, (unsigned char*)outputImage, 0, 33);
+ DALI_TEST_EQUALS(0xaaaaaaaa, outputImage[0], TEST_LOCATION);
// Single-pixel tall, wide strip:
- Dali::Internal::Platform::PointSample4BPP( (const unsigned char *) inputImage, 102, 1, (unsigned char*) outputImage, 0, 67 );
- DALI_TEST_EQUALS( 0xaaaaaaaa, outputImage[0], TEST_LOCATION );
+ Dali::Internal::Platform::PointSample4BPP((const unsigned char*)inputImage, 102, 1, (unsigned char*)outputImage, 0, 67);
+ DALI_TEST_EQUALS(0xaaaaaaaa, outputImage[0], TEST_LOCATION);
// Square mid-size image:
- Dali::Internal::Platform::PointSample4BPP( (const unsigned char *) inputImage, 103, 103, (unsigned char*) outputImage, 21, 0 );
- DALI_TEST_EQUALS( 0xaaaaaaaa, outputImage[0], TEST_LOCATION );
+ Dali::Internal::Platform::PointSample4BPP((const unsigned char*)inputImage, 103, 103, (unsigned char*)outputImage, 21, 0);
+ DALI_TEST_EQUALS(0xaaaaaaaa, outputImage[0], TEST_LOCATION);
// Wide mid-size image to 0 height
- Dali::Internal::Platform::PointSample4BPP( (const unsigned char *) inputImage, 313, 79, (unsigned char*) outputImage, 99, 0 );
- DALI_TEST_EQUALS( 0xaaaaaaaa, outputImage[0], TEST_LOCATION );
+ Dali::Internal::Platform::PointSample4BPP((const unsigned char*)inputImage, 313, 79, (unsigned char*)outputImage, 99, 0);
+ DALI_TEST_EQUALS(0xaaaaaaaa, outputImage[0], TEST_LOCATION);
// Tall mid-size image to 0 height, over width
- Dali::Internal::Platform::PointSample4BPP( (const unsigned char *) inputImage, 53, 46, (unsigned char*) outputImage, 9999, 0 );
- DALI_TEST_EQUALS( 0xaaaaaaaa, outputImage[0], TEST_LOCATION );
+ Dali::Internal::Platform::PointSample4BPP((const unsigned char*)inputImage, 53, 46, (unsigned char*)outputImage, 9999, 0);
+ DALI_TEST_EQUALS(0xaaaaaaaa, outputImage[0], TEST_LOCATION);
// 0 x 0 input image:
- Dali::Internal::Platform::PointSample4BPP( (const unsigned char *) inputImage, 0, 0, (unsigned char*) outputImage, 200, 99 );
- DALI_TEST_EQUALS( 0xaaaaaaaa, outputImage[0], TEST_LOCATION );
+ Dali::Internal::Platform::PointSample4BPP((const unsigned char*)inputImage, 0, 0, (unsigned char*)outputImage, 200, 99);
+ DALI_TEST_EQUALS(0xaaaaaaaa, outputImage[0], TEST_LOCATION);
END_TEST;
}
*/
int UtcDaliImageOperationsUint16Pair(void)
{
- Uint16Pair vec1( 2, 3 );
+ Uint16Pair vec1(2, 3);
- DALI_TEST_EQUALS( vec1.GetWidth(), (uint16_t)2, TEST_LOCATION );
- DALI_TEST_EQUALS( vec1.GetX(), (uint16_t)2, TEST_LOCATION );
+ DALI_TEST_EQUALS(vec1.GetWidth(), (uint16_t)2, TEST_LOCATION);
+ DALI_TEST_EQUALS(vec1.GetX(), (uint16_t)2, TEST_LOCATION);
- DALI_TEST_EQUALS( vec1.GetHeight(), (uint16_t)3, TEST_LOCATION );
- DALI_TEST_EQUALS( vec1.GetY(), (uint16_t)3, TEST_LOCATION );
+ DALI_TEST_EQUALS(vec1.GetHeight(), (uint16_t)3, TEST_LOCATION);
+ DALI_TEST_EQUALS(vec1.GetY(), (uint16_t)3, TEST_LOCATION);
Uint16Pair vec1Copy = vec1;
- DALI_TEST_EQUALS( vec1Copy.GetWidth(), (uint16_t)2, TEST_LOCATION );
- DALI_TEST_EQUALS( vec1Copy.GetX(), (uint16_t)2, TEST_LOCATION );
+ DALI_TEST_EQUALS(vec1Copy.GetWidth(), (uint16_t)2, TEST_LOCATION);
+ DALI_TEST_EQUALS(vec1Copy.GetX(), (uint16_t)2, TEST_LOCATION);
- DALI_TEST_EQUALS( vec1Copy.GetHeight(), (uint16_t)3, TEST_LOCATION );
- DALI_TEST_EQUALS( vec1Copy.GetY(), (uint16_t)3, TEST_LOCATION );
+ DALI_TEST_EQUALS(vec1Copy.GetHeight(), (uint16_t)3, TEST_LOCATION);
+ DALI_TEST_EQUALS(vec1Copy.GetY(), (uint16_t)3, TEST_LOCATION);
- Uint16Pair vec2( 65535u, 65535u );
+ Uint16Pair vec2(65535u, 65535u);
- DALI_TEST_EQUALS( vec2.GetX(), (uint16_t)65535u, TEST_LOCATION );
- DALI_TEST_EQUALS( vec2.GetY(), (uint16_t)65535u, TEST_LOCATION );
+ DALI_TEST_EQUALS(vec2.GetX(), (uint16_t)65535u, TEST_LOCATION);
+ DALI_TEST_EQUALS(vec2.GetY(), (uint16_t)65535u, TEST_LOCATION);
END_TEST;
}
int UtcDaliImageOperationsBilinearFilter1BPP(void)
{
// Zeros blend to zero:
- DALI_TEST_EQUALS( 0u, BilinearFilter1Component( 0, 0, 0, 0, 0, 0 ), TEST_LOCATION );
- DALI_TEST_EQUALS( 0u, BilinearFilter1Component( 0, 0, 0, 0, 32768, 0 ), TEST_LOCATION );
- DALI_TEST_EQUALS( 0u, BilinearFilter1Component( 0, 0, 0, 0, 65535, 0 ), TEST_LOCATION );
- DALI_TEST_EQUALS( 0u, BilinearFilter1Component( 0, 0, 0, 0, 0, 32768 ), TEST_LOCATION );
- DALI_TEST_EQUALS( 0u, BilinearFilter1Component( 0, 0, 0, 0, 0, 65535 ), TEST_LOCATION );
+ DALI_TEST_EQUALS(0u, BilinearFilter1Component(0, 0, 0, 0, 0, 0), TEST_LOCATION);
+ DALI_TEST_EQUALS(0u, BilinearFilter1Component(0, 0, 0, 0, 32768, 0), TEST_LOCATION);
+ DALI_TEST_EQUALS(0u, BilinearFilter1Component(0, 0, 0, 0, 65535, 0), TEST_LOCATION);
+ DALI_TEST_EQUALS(0u, BilinearFilter1Component(0, 0, 0, 0, 0, 32768), TEST_LOCATION);
+ DALI_TEST_EQUALS(0u, BilinearFilter1Component(0, 0, 0, 0, 0, 65535), TEST_LOCATION);
// Ones and zeros average to 0.5:
- DALI_TEST_EQUALS( 127u, BilinearFilter1Component( 255, 0, 0, 255, 32768, 32768 ), TEST_LOCATION );
- DALI_TEST_EQUALS( 127u, BilinearFilter1Component( 0, 255, 0, 255, 32768, 32768 ), TEST_LOCATION );
+ DALI_TEST_EQUALS(127u, BilinearFilter1Component(255, 0, 0, 255, 32768, 32768), TEST_LOCATION);
+ DALI_TEST_EQUALS(127u, BilinearFilter1Component(0, 255, 0, 255, 32768, 32768), TEST_LOCATION);
// Quarters ones average to 0.25:
- DALI_TEST_EQUALS( 64u, BilinearFilter1Component( 255, 0, 0, 0, 32768, 32768 ), TEST_LOCATION );
- DALI_TEST_EQUALS( 64u, BilinearFilter1Component( 0, 255, 0, 0, 32768, 32768 ), TEST_LOCATION );
- DALI_TEST_EQUALS( 64u, BilinearFilter1Component( 0, 0, 255, 0, 32768, 32768 ), TEST_LOCATION );
- DALI_TEST_EQUALS( 64u, BilinearFilter1Component( 0, 0, 0, 255, 32768, 32768 ), TEST_LOCATION );
+ DALI_TEST_EQUALS(64u, BilinearFilter1Component(255, 0, 0, 0, 32768, 32768), TEST_LOCATION);
+ DALI_TEST_EQUALS(64u, BilinearFilter1Component(0, 255, 0, 0, 32768, 32768), TEST_LOCATION);
+ DALI_TEST_EQUALS(64u, BilinearFilter1Component(0, 0, 255, 0, 32768, 32768), TEST_LOCATION);
+ DALI_TEST_EQUALS(64u, BilinearFilter1Component(0, 0, 0, 255, 32768, 32768), TEST_LOCATION);
// Horizontal blends:
- DALI_TEST_EQUALS( 0u, BilinearFilter1Component( 0, 255, 0, 255, 0, 32768 ), TEST_LOCATION );
- for( unsigned y = 0; y < 65536u; y += 256 )
+ DALI_TEST_EQUALS(0u, BilinearFilter1Component(0, 255, 0, 255, 0, 32768), TEST_LOCATION);
+ for(unsigned y = 0; y < 65536u; y += 256)
{
// Vertical blends don't change result in this case as there is no vertical gradient in inputs:
- DALI_TEST_EQUALS( 0u, BilinearFilter1Component( 0, 255, 0, 255, 0, y ), TEST_LOCATION );
+ DALI_TEST_EQUALS(0u, BilinearFilter1Component(0, 255, 0, 255, 0, y), TEST_LOCATION);
}
- DALI_TEST_EQUALS( 5u, BilinearFilter1Component( 0, 255, 0, 255, 1233, 32768 ), TEST_LOCATION );
- DALI_TEST_EQUALS( 29u, BilinearFilter1Component( 0, 255, 0, 255, 7539, 32768 ), TEST_LOCATION );
- DALI_TEST_EQUALS( 29u, BilinearFilter1Component( 0, 255, 0, 255, 7539, 32768 ), TEST_LOCATION );
- DALI_TEST_EQUALS( 67u, BilinearFilter1Component( 0, 255, 0, 255, 17291, 32768 ), TEST_LOCATION );
- DALI_TEST_EQUALS( 123u, BilinearFilter1Component( 0, 255, 0, 255, 31671, 32768 ), TEST_LOCATION );
- DALI_TEST_EQUALS( 184u, BilinearFilter1Component( 0, 255, 0, 255, 47231, 32768 ), TEST_LOCATION );
- DALI_TEST_EQUALS( 207u, BilinearFilter1Component( 0, 255, 0, 255, 53129, 32768 ), TEST_LOCATION );
- DALI_TEST_EQUALS( 239u, BilinearFilter1Component( 0, 255, 0, 255, 61392, 32768 ), TEST_LOCATION );
- DALI_TEST_EQUALS( 255u, BilinearFilter1Component( 0, 255, 0, 255, 65535, 32768 ), TEST_LOCATION );
+ DALI_TEST_EQUALS(5u, BilinearFilter1Component(0, 255, 0, 255, 1233, 32768), TEST_LOCATION);
+ DALI_TEST_EQUALS(29u, BilinearFilter1Component(0, 255, 0, 255, 7539, 32768), TEST_LOCATION);
+ DALI_TEST_EQUALS(29u, BilinearFilter1Component(0, 255, 0, 255, 7539, 32768), TEST_LOCATION);
+ DALI_TEST_EQUALS(67u, BilinearFilter1Component(0, 255, 0, 255, 17291, 32768), TEST_LOCATION);
+ DALI_TEST_EQUALS(123u, BilinearFilter1Component(0, 255, 0, 255, 31671, 32768), TEST_LOCATION);
+ DALI_TEST_EQUALS(184u, BilinearFilter1Component(0, 255, 0, 255, 47231, 32768), TEST_LOCATION);
+ DALI_TEST_EQUALS(207u, BilinearFilter1Component(0, 255, 0, 255, 53129, 32768), TEST_LOCATION);
+ DALI_TEST_EQUALS(239u, BilinearFilter1Component(0, 255, 0, 255, 61392, 32768), TEST_LOCATION);
+ DALI_TEST_EQUALS(255u, BilinearFilter1Component(0, 255, 0, 255, 65535, 32768), TEST_LOCATION);
// Vertical Blends:
- DALI_TEST_EQUALS( 0u, BilinearFilter1Component( 0, 0, 255, 255, 32768, 0 ), TEST_LOCATION );
- DALI_TEST_EQUALS( 60u, BilinearFilter1Component( 0, 0, 255, 255, 32768, 15379 ), TEST_LOCATION );
- DALI_TEST_EQUALS( 130u, BilinearFilter1Component( 0, 0, 255, 255, 32768, 33451 ), TEST_LOCATION );
- DALI_TEST_EQUALS( 186u, BilinearFilter1Component( 0, 0, 255, 255, 32768, 47836 ), TEST_LOCATION );
- DALI_TEST_EQUALS( 244u, BilinearFilter1Component( 0, 0, 255, 255, 32768, 62731 ), TEST_LOCATION );
- DALI_TEST_EQUALS( 255u, BilinearFilter1Component( 0, 0, 255, 255, 32768, 65535 ), TEST_LOCATION );
+ DALI_TEST_EQUALS(0u, BilinearFilter1Component(0, 0, 255, 255, 32768, 0), TEST_LOCATION);
+ DALI_TEST_EQUALS(60u, BilinearFilter1Component(0, 0, 255, 255, 32768, 15379), TEST_LOCATION);
+ DALI_TEST_EQUALS(130u, BilinearFilter1Component(0, 0, 255, 255, 32768, 33451), TEST_LOCATION);
+ DALI_TEST_EQUALS(186u, BilinearFilter1Component(0, 0, 255, 255, 32768, 47836), TEST_LOCATION);
+ DALI_TEST_EQUALS(244u, BilinearFilter1Component(0, 0, 255, 255, 32768, 62731), TEST_LOCATION);
+ DALI_TEST_EQUALS(255u, BilinearFilter1Component(0, 0, 255, 255, 32768, 65535), TEST_LOCATION);
END_TEST;
}
#include <iostream>
-#include <stdlib.h>
#include <dali/public-api/dali-core.h>
+#include <stdlib.h>
#include <dali-test-suite-utils.h>
test_return_value = TET_PASS;
}
-const char* ChannelToString( Dali::Internal::Adaptor::Channel channel )
+const char* ChannelToString(Dali::Internal::Adaptor::Channel channel)
{
switch(channel)
{
- case LUMINANCE: return "Luminance";
- case RED: return "Red";
- case GREEN: return "Green";
- case BLUE: return "Blue";
- case ALPHA: return "Alpha";
+ case LUMINANCE:
+ return "Luminance";
+ case RED:
+ return "Red";
+ case GREEN:
+ return "Green";
+ case BLUE:
+ return "Blue";
+ case ALPHA:
+ return "Alpha";
default:
return "Unknown";
}
}
-const char* FormatToString( Dali::Pixel::Format format )
+const char* FormatToString(Dali::Pixel::Format format)
{
switch(format)
{
- case Dali::Pixel::A8: return "A8";
- case Dali::Pixel::L8: return "L8";
- case Dali::Pixel::LA88: return "LA88";
- case Dali::Pixel::RGB565: return "RGB565";
- case Dali::Pixel::BGR565: return "BGR565";
- case Dali::Pixel::RGBA4444: return "RGBA4444";
- case Dali::Pixel::BGRA4444: return "BGRA4444";
- case Dali::Pixel::RGBA5551: return "RGBA5551";
- case Dali::Pixel::BGRA5551: return "BGRA5551";
-
- case Dali::Pixel::RGB888: return "RGB888";
- case Dali::Pixel::RGBA8888: return "RGBA8888";
- case Dali::Pixel::BGRA8888: return "BGRA8888";
+ case Dali::Pixel::A8:
+ return "A8";
+ case Dali::Pixel::L8:
+ return "L8";
+ case Dali::Pixel::LA88:
+ return "LA88";
+ case Dali::Pixel::RGB565:
+ return "RGB565";
+ case Dali::Pixel::BGR565:
+ return "BGR565";
+ case Dali::Pixel::RGBA4444:
+ return "RGBA4444";
+ case Dali::Pixel::BGRA4444:
+ return "BGRA4444";
+ case Dali::Pixel::RGBA5551:
+ return "RGBA5551";
+ case Dali::Pixel::BGRA5551:
+ return "BGRA5551";
+
+ case Dali::Pixel::RGB888:
+ return "RGB888";
+ case Dali::Pixel::RGBA8888:
+ return "RGBA8888";
+ case Dali::Pixel::BGRA8888:
+ return "BGRA8888";
default:
return "Unknown";
}
}
-
int UtcDaliPixelManipulation01(void)
{
tet_infoline("Testing Dali::Internal::AdaptorManipulation HasChannel");
- DALI_TEST_EQUALS( Dali::Internal::Adaptor::HasChannel( Dali::Pixel::A8, Dali::Internal::Adaptor::ALPHA ), true, TEST_LOCATION );
- DALI_TEST_EQUALS( Dali::Internal::Adaptor::HasChannel( Dali::Pixel::A8, Dali::Internal::Adaptor::LUMINANCE ), false, TEST_LOCATION );
+ DALI_TEST_EQUALS(Dali::Internal::Adaptor::HasChannel(Dali::Pixel::A8, Dali::Internal::Adaptor::ALPHA), true, TEST_LOCATION);
+ DALI_TEST_EQUALS(Dali::Internal::Adaptor::HasChannel(Dali::Pixel::A8, Dali::Internal::Adaptor::LUMINANCE), false, TEST_LOCATION);
- DALI_TEST_EQUALS( Dali::Internal::Adaptor::HasChannel( Dali::Pixel::L8, Dali::Internal::Adaptor::LUMINANCE ), true, TEST_LOCATION );
- DALI_TEST_EQUALS( Dali::Internal::Adaptor::HasChannel( Dali::Pixel::L8, Dali::Internal::Adaptor::ALPHA ), false, TEST_LOCATION );
+ DALI_TEST_EQUALS(Dali::Internal::Adaptor::HasChannel(Dali::Pixel::L8, Dali::Internal::Adaptor::LUMINANCE), true, TEST_LOCATION);
+ DALI_TEST_EQUALS(Dali::Internal::Adaptor::HasChannel(Dali::Pixel::L8, Dali::Internal::Adaptor::ALPHA), false, TEST_LOCATION);
- DALI_TEST_EQUALS( Dali::Internal::Adaptor::HasChannel( Dali::Pixel::LA88, Dali::Internal::Adaptor::LUMINANCE ), true, TEST_LOCATION );
- DALI_TEST_EQUALS( Dali::Internal::Adaptor::HasChannel( Dali::Pixel::LA88, Dali::Internal::Adaptor::ALPHA ), true, TEST_LOCATION );
- DALI_TEST_EQUALS( Dali::Internal::Adaptor::HasChannel( Dali::Pixel::LA88, Dali::Internal::Adaptor::RED ), false, TEST_LOCATION );
+ DALI_TEST_EQUALS(Dali::Internal::Adaptor::HasChannel(Dali::Pixel::LA88, Dali::Internal::Adaptor::LUMINANCE), true, TEST_LOCATION);
+ DALI_TEST_EQUALS(Dali::Internal::Adaptor::HasChannel(Dali::Pixel::LA88, Dali::Internal::Adaptor::ALPHA), true, TEST_LOCATION);
+ DALI_TEST_EQUALS(Dali::Internal::Adaptor::HasChannel(Dali::Pixel::LA88, Dali::Internal::Adaptor::RED), false, TEST_LOCATION);
- DALI_TEST_EQUALS( Dali::Internal::Adaptor::HasChannel( Dali::Pixel::RGB565, Dali::Internal::Adaptor::RED ), true, TEST_LOCATION );
- DALI_TEST_EQUALS( Dali::Internal::Adaptor::HasChannel( Dali::Pixel::RGB565, Dali::Internal::Adaptor::GREEN ), true, TEST_LOCATION );
- DALI_TEST_EQUALS( Dali::Internal::Adaptor::HasChannel( Dali::Pixel::RGB565, Dali::Internal::Adaptor::BLUE ), true, TEST_LOCATION );
- DALI_TEST_EQUALS( Dali::Internal::Adaptor::HasChannel( Dali::Pixel::RGB565, Dali::Internal::Adaptor::LUMINANCE ), false, TEST_LOCATION );
+ DALI_TEST_EQUALS(Dali::Internal::Adaptor::HasChannel(Dali::Pixel::RGB565, Dali::Internal::Adaptor::RED), true, TEST_LOCATION);
+ DALI_TEST_EQUALS(Dali::Internal::Adaptor::HasChannel(Dali::Pixel::RGB565, Dali::Internal::Adaptor::GREEN), true, TEST_LOCATION);
+ DALI_TEST_EQUALS(Dali::Internal::Adaptor::HasChannel(Dali::Pixel::RGB565, Dali::Internal::Adaptor::BLUE), true, TEST_LOCATION);
+ DALI_TEST_EQUALS(Dali::Internal::Adaptor::HasChannel(Dali::Pixel::RGB565, Dali::Internal::Adaptor::LUMINANCE), false, TEST_LOCATION);
- DALI_TEST_EQUALS( Dali::Internal::Adaptor::HasChannel( Dali::Pixel::RGBA8888, Dali::Internal::Adaptor::RED ), true, TEST_LOCATION );
- DALI_TEST_EQUALS( Dali::Internal::Adaptor::HasChannel( Dali::Pixel::RGBA8888, Dali::Internal::Adaptor::GREEN ), true, TEST_LOCATION );
- DALI_TEST_EQUALS( Dali::Internal::Adaptor::HasChannel( Dali::Pixel::RGBA8888, Dali::Internal::Adaptor::BLUE ), true, TEST_LOCATION );
- DALI_TEST_EQUALS( Dali::Internal::Adaptor::HasChannel( Dali::Pixel::RGBA8888, Dali::Internal::Adaptor::ALPHA ), true, TEST_LOCATION );
- DALI_TEST_EQUALS( Dali::Internal::Adaptor::HasChannel( Dali::Pixel::RGBA8888, Dali::Internal::Adaptor::LUMINANCE ), false, TEST_LOCATION );
+ DALI_TEST_EQUALS(Dali::Internal::Adaptor::HasChannel(Dali::Pixel::RGBA8888, Dali::Internal::Adaptor::RED), true, TEST_LOCATION);
+ DALI_TEST_EQUALS(Dali::Internal::Adaptor::HasChannel(Dali::Pixel::RGBA8888, Dali::Internal::Adaptor::GREEN), true, TEST_LOCATION);
+ DALI_TEST_EQUALS(Dali::Internal::Adaptor::HasChannel(Dali::Pixel::RGBA8888, Dali::Internal::Adaptor::BLUE), true, TEST_LOCATION);
+ DALI_TEST_EQUALS(Dali::Internal::Adaptor::HasChannel(Dali::Pixel::RGBA8888, Dali::Internal::Adaptor::ALPHA), true, TEST_LOCATION);
+ DALI_TEST_EQUALS(Dali::Internal::Adaptor::HasChannel(Dali::Pixel::RGBA8888, Dali::Internal::Adaptor::LUMINANCE), false, TEST_LOCATION);
- DALI_TEST_EQUALS( Dali::Internal::Adaptor::HasChannel( Dali::Pixel::COMPRESSED_RGBA_ASTC_10x6_KHR, Dali::Internal::Adaptor::BLUE ), false, TEST_LOCATION );
+ DALI_TEST_EQUALS(Dali::Internal::Adaptor::HasChannel(Dali::Pixel::COMPRESSED_RGBA_ASTC_10x6_KHR, Dali::Internal::Adaptor::BLUE), false, TEST_LOCATION);
END_TEST;
}
-
-
int UtcDaliPixelManipulation02(void)
{
tet_infoline("Testing Dali::Internal::AdaptorManipulation Read/WriteChannel");
- unsigned char pixel[4] = {0,0,0,0};
+ unsigned char pixel[4] = {0, 0, 0, 0};
- for( int formatIdx=1; formatIdx<Dali::Pixel::COMPRESSED_R11_EAC; ++formatIdx)
+ for(int formatIdx = 1; formatIdx < Dali::Pixel::COMPRESSED_R11_EAC; ++formatIdx)
{
pixel[0] = 0xFF;
pixel[1] = 0xFF;
pixel[2] = 0xFF;
pixel[3] = 0xFF;
- for( int channelIdx=0; channelIdx < Dali::Internal::Adaptor::MAX_NUMBER_OF_CHANNELS; ++channelIdx )
+ for(int channelIdx = 0; channelIdx < Dali::Internal::Adaptor::MAX_NUMBER_OF_CHANNELS; ++channelIdx)
{
- Dali::Pixel::Format format = static_cast<Dali::Pixel::Format>(formatIdx);
+ Dali::Pixel::Format format = static_cast<Dali::Pixel::Format>(formatIdx);
Dali::Internal::Adaptor::Channel channel = static_cast<Dali::Internal::Adaptor::Channel>(channelIdx);
- if( Dali::Internal::Adaptor::HasChannel( format, channel ) )
+ if(Dali::Internal::Adaptor::HasChannel(format, channel))
{
- Dali::Internal::Adaptor::WriteChannel( &pixel[0], format, channel, 0x15);
- unsigned int value = Dali::Internal::Adaptor::ReadChannel( &pixel[0], format, channel );
+ Dali::Internal::Adaptor::WriteChannel(&pixel[0], format, channel, 0x15);
+ unsigned int value = Dali::Internal::Adaptor::ReadChannel(&pixel[0], format, channel);
- tet_printf( "Testing writing and reading to %s channel in %s format:\n",
- ChannelToString(channel), FormatToString(format) );
+ tet_printf("Testing writing and reading to %s channel in %s format:\n",
+ ChannelToString(channel),
+ FormatToString(format));
- if( channel == Dali::Internal::Adaptor::ALPHA && (format == Dali::Pixel::RGBA5551 || format == Dali::Pixel::BGRA5551 ) )
+ if(channel == Dali::Internal::Adaptor::ALPHA && (format == Dali::Pixel::RGBA5551 || format == Dali::Pixel::BGRA5551))
{
- DALI_TEST_EQUALS( value, 0x1, TEST_LOCATION );
+ DALI_TEST_EQUALS(value, 0x1, TEST_LOCATION);
}
- else if( format == Dali::Pixel::RGBA4444 || format == Dali::Pixel::BGRA4444 )
+ else if(format == Dali::Pixel::RGBA4444 || format == Dali::Pixel::BGRA4444)
{
- DALI_TEST_EQUALS( value, 0x05, TEST_LOCATION );
+ DALI_TEST_EQUALS(value, 0x05, TEST_LOCATION);
}
else
{
- DALI_TEST_EQUALS( value, 0x15, TEST_LOCATION );
+ DALI_TEST_EQUALS(value, 0x15, TEST_LOCATION);
}
}
}
END_TEST;
}
-
int UtcDaliPixelManipulation03N(void)
{
tet_infoline("Testing Dali::Internal::AdaptorManipulation Read/WriteChannel");
- unsigned char pixel[4] = {0,0,0,0};
+ unsigned char pixel[4] = {0, 0, 0, 0};
- for( int formatIdx=1; formatIdx<Dali::Pixel::COMPRESSED_R11_EAC; ++formatIdx)
+ for(int formatIdx = 1; formatIdx < Dali::Pixel::COMPRESSED_R11_EAC; ++formatIdx)
{
pixel[0] = 0xFF;
pixel[1] = 0xFF;
pixel[2] = 0xFF;
pixel[3] = 0xFF;
- for( int channelIdx=0; channelIdx < Dali::Internal::Adaptor::MAX_NUMBER_OF_CHANNELS; ++channelIdx )
+ for(int channelIdx = 0; channelIdx < Dali::Internal::Adaptor::MAX_NUMBER_OF_CHANNELS; ++channelIdx)
{
- Dali::Pixel::Format format = static_cast<Dali::Pixel::Format>(formatIdx);
+ Dali::Pixel::Format format = static_cast<Dali::Pixel::Format>(formatIdx);
Dali::Internal::Adaptor::Channel channel = static_cast<Dali::Internal::Adaptor::Channel>(channelIdx);
- if( ! Dali::Internal::Adaptor::HasChannel( format, channel ) )
+ if(!Dali::Internal::Adaptor::HasChannel(format, channel))
{
- unsigned int value = Dali::Internal::Adaptor::ReadChannel( &pixel[0], format, channel );
+ unsigned int value = Dali::Internal::Adaptor::ReadChannel(&pixel[0], format, channel);
- tet_printf( "Testing reading from %s channel in %s format:\n",
- ChannelToString(channel), FormatToString(format) );
+ tet_printf("Testing reading from %s channel in %s format:\n",
+ ChannelToString(channel),
+ FormatToString(format));
- DALI_TEST_EQUALS( value, 0x00, TEST_LOCATION );
+ DALI_TEST_EQUALS(value, 0x00, TEST_LOCATION);
}
}
}
*/
// EXTERNAL INCLUDES
-#include <stdlib.h>
-#include <iostream>
-#include <dali.h>
#include <dali-test-suite-utils.h>
+#include <dali.h>
#include <dali/devel-api/adaptor-framework/lifecycle-controller.h>
+#include <stdlib.h>
+#include <iostream>
#include <dali/internal/adaptor/common/lifecycle-controller-impl.h>
namespace
{
-
-bool g_OnInitCalled = false;
-bool g_OnTerminateCalled = false;
-bool g_OnPauseCalled = false;
-bool g_OnResumeCalled = false;
-bool g_OnResetCalled = false;
+bool g_OnInitCalled = false;
+bool g_OnTerminateCalled = false;
+bool g_OnPauseCalled = false;
+bool g_OnResumeCalled = false;
+bool g_OnResetCalled = false;
bool g_OnLanguageChangedCalled = false;
void OnInit()
// Attempt to retrieve LifecycleController before creating application
LifecycleController lifecycleController;
lifecycleController = LifecycleController::Get();
- DALI_TEST_CHECK( !lifecycleController );
+ DALI_TEST_CHECK(!lifecycleController);
TestApplication app;
- Application application = Application::New();
+ Application application = Application::New();
lifecycleController = LifecycleController::Get();
- DALI_TEST_CHECK( lifecycleController );
+ DALI_TEST_CHECK(lifecycleController);
END_TEST;
}
int UtcDaliLifecycleControllerSignalInit(void)
{
TestApplication app;
- Application application = Application::New();
+ Application application = Application::New();
- DALI_TEST_CHECK( !g_OnInitCalled );
+ DALI_TEST_CHECK(!g_OnInitCalled);
LifecycleController lifecycleController = LifecycleController::Get();
- lifecycleController.InitSignal().Connect( &OnInit );
+ lifecycleController.InitSignal().Connect(&OnInit);
- GetImplementation( lifecycleController ).OnInit( application );
+ GetImplementation(lifecycleController).OnInit(application);
- DALI_TEST_CHECK( g_OnInitCalled );
+ DALI_TEST_CHECK(g_OnInitCalled);
END_TEST;
}
int UtcDaliLifecycleControllerSignalTerminate(void)
{
TestApplication app;
- Application application = Application::New();
+ Application application = Application::New();
- DALI_TEST_CHECK( !g_OnTerminateCalled );
+ DALI_TEST_CHECK(!g_OnTerminateCalled);
LifecycleController lifecycleController = LifecycleController::Get();
- lifecycleController.TerminateSignal().Connect( &OnTerminate );
+ lifecycleController.TerminateSignal().Connect(&OnTerminate);
- GetImplementation( lifecycleController ).OnTerminate( application );
+ GetImplementation(lifecycleController).OnTerminate(application);
- DALI_TEST_CHECK( g_OnTerminateCalled );
+ DALI_TEST_CHECK(g_OnTerminateCalled);
END_TEST;
}
int UtcDaliLifecycleControllerSignalPause(void)
{
TestApplication app;
- Application application = Application::New();
+ Application application = Application::New();
- DALI_TEST_CHECK( !g_OnPauseCalled );
+ DALI_TEST_CHECK(!g_OnPauseCalled);
LifecycleController lifecycleController = LifecycleController::Get();
- lifecycleController.PauseSignal().Connect( &OnPause );
+ lifecycleController.PauseSignal().Connect(&OnPause);
- GetImplementation( lifecycleController ).OnPause( application );
+ GetImplementation(lifecycleController).OnPause(application);
- DALI_TEST_CHECK( g_OnPauseCalled );
+ DALI_TEST_CHECK(g_OnPauseCalled);
END_TEST;
}
int UtcDaliLifecycleControllerSignalResume(void)
{
TestApplication app;
- Application application = Application::New();
+ Application application = Application::New();
- DALI_TEST_CHECK( !g_OnResumeCalled );
+ DALI_TEST_CHECK(!g_OnResumeCalled);
LifecycleController lifecycleController = LifecycleController::Get();
- lifecycleController.ResumeSignal().Connect( &OnResume );
+ lifecycleController.ResumeSignal().Connect(&OnResume);
- GetImplementation( lifecycleController ).OnResume( application );
+ GetImplementation(lifecycleController).OnResume(application);
- DALI_TEST_CHECK( g_OnResumeCalled );
+ DALI_TEST_CHECK(g_OnResumeCalled);
END_TEST;
}
int UtcDaliLifecycleControllerSignalReset(void)
{
TestApplication app;
- Application application = Application::New();
+ Application application = Application::New();
- DALI_TEST_CHECK( !g_OnResetCalled );
+ DALI_TEST_CHECK(!g_OnResetCalled);
LifecycleController lifecycleController = LifecycleController::Get();
- lifecycleController.ResetSignal().Connect( &OnReset );
+ lifecycleController.ResetSignal().Connect(&OnReset);
- GetImplementation( lifecycleController ).OnReset( application );
+ GetImplementation(lifecycleController).OnReset(application);
- DALI_TEST_CHECK( g_OnResetCalled );
+ DALI_TEST_CHECK(g_OnResetCalled);
END_TEST;
}
int UtcDaliLifecycleControllerSignalLanguageChanged(void)
{
TestApplication app;
- Application application = Application::New();
+ Application application = Application::New();
- DALI_TEST_CHECK( !g_OnLanguageChangedCalled );
+ DALI_TEST_CHECK(!g_OnLanguageChangedCalled);
LifecycleController lifecycleController = LifecycleController::Get();
- lifecycleController.LanguageChangedSignal().Connect( &OnLanguageChanged );
+ lifecycleController.LanguageChangedSignal().Connect(&OnLanguageChanged);
- GetImplementation( lifecycleController ).OnLanguageChanged( application );
+ GetImplementation(lifecycleController).OnLanguageChanged(application);
- DALI_TEST_CHECK( g_OnLanguageChangedCalled );
+ DALI_TEST_CHECK(g_OnLanguageChangedCalled);
END_TEST;
}
#include <iostream>
-#include <stdlib.h>
-#include <stdint.h>
-#include <dali/dali.h>
-#include <dali-test-suite-utils.h>
#include <adaptor-test-application.h>
-#include <dali/internal/sensor/common/tilt-sensor-impl.h>
+#include <dali-test-suite-utils.h>
+#include <dali/dali.h>
#include <dali/internal/sensor/common/tilt-sensor-factory.h>
+#include <dali/internal/sensor/common/tilt-sensor-impl.h>
#include <dali/internal/system/linux/dali-ecore.h>
+#include <stdint.h>
+#include <stdlib.h>
using namespace Dali;
struct SignalHelper : public ConnectionTracker
{
SignalHelper()
- : mTiltSignalReceived( false ),
- mTimeoutOccurred( false )
+ : mTiltSignalReceived(false),
+ mTimeoutOccurred(false)
{
}
return Dali::TiltSensor(Dali::Internal::Adaptor::TiltSensorFactory::Create());
}
-bool ecore_timer_running = false;
-Ecore_Task_Cb timer_callback_func=NULL;
-const void* timer_callback_data=NULL;
-intptr_t timerId = 8; // intptr_t has the same size as a pointer and is platform independent so this can be returned as a pointer in ecore_timer_add below without compilation warnings
-}// anon namespace
+bool ecore_timer_running = false;
+Ecore_Task_Cb timer_callback_func = NULL;
+const void* timer_callback_data = NULL;
+intptr_t timerId = 8; // intptr_t has the same size as a pointer and is platform independent so this can be returned as a pointer in ecore_timer_add below without compilation warnings
+} // namespace
extern "C"
{
-Ecore_Timer* ecore_timer_add(double in,
- Ecore_Task_Cb func,
- const void *data)
-{
- ecore_timer_running = true;
- timer_callback_func = func;
- timer_callback_data = data;
- timerId+=8;
- return (Ecore_Timer*)timerId;
-}
-
-void* ecore_timer_del(Ecore_Timer *timer)
-{
- ecore_timer_running = false;
- timer_callback_func = NULL;
- return NULL;
-}
+ Ecore_Timer* ecore_timer_add(double in,
+ Ecore_Task_Cb func,
+ const void* data)
+ {
+ ecore_timer_running = true;
+ timer_callback_func = func;
+ timer_callback_data = data;
+ timerId += 8;
+ return (Ecore_Timer*)timerId;
+ }
+ void* ecore_timer_del(Ecore_Timer* timer)
+ {
+ ecore_timer_running = false;
+ timer_callback_func = NULL;
+ return NULL;
+ }
}
-
-
void tilt_sensor_startup(void)
{
}
{
}
-
int UtcDaliTiltSensorStart(void)
{
AdaptorTestApplication application;
tet_infoline("UtcDaliTiltSensorStart");
TiltSensor sensor = GetTiltSensor();
- DALI_TEST_CHECK( sensor );
+ DALI_TEST_CHECK(sensor);
sensor.Start();
- DALI_TEST_CHECK( sensor.IsStarted() );
+ DALI_TEST_CHECK(sensor.IsStarted());
END_TEST;
}
tet_infoline("UtcDaliTiltSensorStop");
TiltSensor sensor = GetTiltSensor();
- DALI_TEST_CHECK( sensor );
+ DALI_TEST_CHECK(sensor);
sensor.Start();
- DALI_TEST_CHECK( sensor.IsStarted() );
+ DALI_TEST_CHECK(sensor.IsStarted());
sensor.Stop();
- DALI_TEST_CHECK( !sensor.IsStarted() );
+ DALI_TEST_CHECK(!sensor.IsStarted());
END_TEST;
}
tet_infoline("UtcDaliTiltSensorIsStarted");
TiltSensor sensor = GetTiltSensor();
- DALI_TEST_CHECK( sensor );
+ DALI_TEST_CHECK(sensor);
// Should be disabled by default
- DALI_TEST_CHECK( !sensor.IsStarted() );
+ DALI_TEST_CHECK(!sensor.IsStarted());
END_TEST;
}
tet_infoline("UtcDaliTiltSensorGetRoll");
TiltSensor sensor = GetTiltSensor();
- DALI_TEST_CHECK( sensor );
+ DALI_TEST_CHECK(sensor);
float roll = sensor.GetRoll();
- DALI_TEST_CHECK( roll <= 1.0f && roll >= -1.0f ); // range check
+ DALI_TEST_CHECK(roll <= 1.0f && roll >= -1.0f); // range check
END_TEST;
}
tet_infoline("UtcDaliTiltSensorGetPitch");
TiltSensor sensor = GetTiltSensor();
- DALI_TEST_CHECK( sensor );
+ DALI_TEST_CHECK(sensor);
float pitch = sensor.GetPitch();
- DALI_TEST_CHECK( pitch <= 1.0f && pitch >= -1.0f ); // range check
+ DALI_TEST_CHECK(pitch <= 1.0f && pitch >= -1.0f); // range check
END_TEST;
}
tet_infoline("UtcDaliTiltSensorGetRotation");
TiltSensor sensor = GetTiltSensor();
- DALI_TEST_CHECK( sensor );
+ DALI_TEST_CHECK(sensor);
Quaternion rotation = sensor.GetRotation();
- Radian roll( sensor.GetRoll() );
- Radian pitch( sensor.GetPitch() );
+ Radian roll(sensor.GetRoll());
+ Radian pitch(sensor.GetPitch());
- Quaternion expectedRotation = Quaternion( roll * Math::PI * -0.5f, Vector3::YAXIS ) *
- Quaternion( pitch * Math::PI * -0.5f, Vector3::XAXIS );
+ Quaternion expectedRotation = Quaternion(roll * Math::PI * -0.5f, Vector3::YAXIS) *
+ Quaternion(pitch * Math::PI * -0.5f, Vector3::XAXIS);
- DALI_TEST_EQUALS( rotation, expectedRotation, ROTATION_EPSILON, TEST_LOCATION );
+ DALI_TEST_EQUALS(rotation, expectedRotation, ROTATION_EPSILON, TEST_LOCATION);
END_TEST;
}
-
int UtcDaliTiltSensorSignalTilted(void)
{
AdaptorTestApplication application;
tet_infoline("UtcDaliTiltSensorSignalTilted");
TiltSensor sensor = GetTiltSensor();
- DALI_TEST_CHECK( sensor );
+ DALI_TEST_CHECK(sensor);
sensor.Start();
Radian angle(Degree(-45));
//Setting a negative threshold for testing purpose
- sensor.SetRotationThreshold( angle );
+ sensor.SetRotationThreshold(angle);
END_TEST;
}
tet_infoline("UtcDaliTiltSensorSetUpdateFrequency");
TiltSensor sensor = GetTiltSensor();
- DALI_TEST_CHECK( sensor );
- sensor.SetUpdateFrequency( 1.0f/*hertz*/ );
- DALI_TEST_EQUALS( sensor.GetUpdateFrequency(), 1.0f, TEST_LOCATION );
+ DALI_TEST_CHECK(sensor);
+ sensor.SetUpdateFrequency(1.0f /*hertz*/);
+ DALI_TEST_EQUALS(sensor.GetUpdateFrequency(), 1.0f, TEST_LOCATION);
- sensor.SetUpdateFrequency( 60.0f/*hertz*/ );
- DALI_TEST_EQUALS( sensor.GetUpdateFrequency(), 60.0f, TEST_LOCATION );
+ sensor.SetUpdateFrequency(60.0f /*hertz*/);
+ DALI_TEST_EQUALS(sensor.GetUpdateFrequency(), 60.0f, TEST_LOCATION);
END_TEST;
}
-
int UtcDaliTiltSensorSetRotationThreshold01(void)
{
AdaptorTestApplication application;
tet_infoline("UtcDaliTiltSensorSetRotationThreshold01");
TiltSensor sensor = GetTiltSensor();
- DALI_TEST_CHECK( sensor );
+ DALI_TEST_CHECK(sensor);
sensor.Start();
Radian angle(Degree(-45));
- sensor.SetRotationThreshold( angle );
- DALI_TEST_EQUALS( sensor.GetRotationThreshold(), angle, TEST_LOCATION );
+ sensor.SetRotationThreshold(angle);
+ DALI_TEST_EQUALS(sensor.GetRotationThreshold(), angle, TEST_LOCATION);
angle = Degree(90);
- sensor.SetRotationThreshold( angle );
- DALI_TEST_EQUALS( sensor.GetRotationThreshold(), angle, TEST_LOCATION );
+ sensor.SetRotationThreshold(angle);
+ DALI_TEST_EQUALS(sensor.GetRotationThreshold(), angle, TEST_LOCATION);
END_TEST;
}
namespace Dali
{
-
namespace Internal
{
-
namespace Adaptor
{
-
bool Adaptor::mAvailable = false;
bool Adaptor::IsAvailable()
namespace Dali
{
-
namespace Internal
{
-
namespace Adaptor
{
-
class Adaptor
{
public:
static bool IsAvailable();
static void SetAvailable();
- Adaptor() {}
- ~Adaptor() {}
+ Adaptor()
+ {
+ }
+ ~Adaptor()
+ {
+ }
public:
static bool mAvailable;
};
-} // Adaptor
+} // namespace Adaptor
-} // Internal
+} // namespace Internal
-} // Dali
+} // namespace Dali
-#endif // DALI_ADAPTOR_TEST_ADAPTOR_IMPL_H
+#endif // DALI_ADAPTOR_TEST_ADAPTOR_IMPL_H
*/
// INTERNAL INCLUDES
-#include "test-application.h"
#include "adaptor-test-adaptor-impl.h"
+#include "test-application.h"
namespace Dali
{
-
/**
* Adds some functionality on top of TestApplication that is required by the Adaptor.
*/
class AdaptorTestApplication : public TestApplication
{
public:
-
- AdaptorTestApplication( size_t surfaceWidth = DEFAULT_SURFACE_WIDTH,
- size_t surfaceHeight = DEFAULT_SURFACE_HEIGHT,
- float horizontalDpi = DEFAULT_HORIZONTAL_DPI,
- float verticalDpi = DEFAULT_VERTICAL_DPI )
- : TestApplication( surfaceWidth, surfaceHeight, horizontalDpi, verticalDpi )
+ AdaptorTestApplication(size_t surfaceWidth = DEFAULT_SURFACE_WIDTH,
+ size_t surfaceHeight = DEFAULT_SURFACE_HEIGHT,
+ float horizontalDpi = DEFAULT_HORIZONTAL_DPI,
+ float verticalDpi = DEFAULT_VERTICAL_DPI)
+ : TestApplication(surfaceWidth, surfaceHeight, horizontalDpi, verticalDpi)
{
Internal::Adaptor::Adaptor::SetAvailable();
}
#define DALI_TEST_IMG_UTILS_H
/*
- * Copyright (c) 2019 Samsung Electronics Co., Ltd.
+ * Copyright (c) 2020 Samsung Electronics Co., Ltd.
*
* Licensed under the Apache License, Version 2.0 (the "License");
* you may not use this file except in compliance with the License.
// EXTERNAL INCLUDES
#include <cstdarg>
#include <cstdio>
-#include <iostream>
#include <cstring>
+#include <iostream>
// INTERNAL INCLUDES
#include <dali/dali.h>
#include <dali/devel-api/adaptor-framework/image-loading.h>
#include <dali/public-api/dali-core.h>
+#include <dali-test-suite-utils.h>
using namespace Dali;
namespace
{
-
/**
* Test whether two buffers are equal with tolerance value.
* @param[in] buffer1 The first buffer
* @param[in] location The TEST_LOCATION macro should be used here
*/
-inline void DALI_TEST_EQUALS( const unsigned char* buffer1, const unsigned char* buffer2, unsigned int tolerance, long size, const char* location)
+inline void DALI_TEST_EQUALS(const unsigned char* buffer1, const unsigned char* buffer2, unsigned int tolerance, long size, const char* location)
{
- if( !tolerance )
+ if(!tolerance)
{
- if ( memcmp( buffer1, buffer2, size) )
+ if(memcmp(buffer1, buffer2, size))
{
- fprintf(stderr, "%s, checking buffer1 == buffer2\n", location );
+ fprintf(stderr, "%s, checking buffer1 == buffer2\n", location);
tet_result(TET_FAIL);
}
else
{
const unsigned char* buff1 = buffer1;
const unsigned char* buff2 = buffer2;
- unsigned int i = 0;
+ unsigned int i = 0;
//Create a mask to fast compare, it is expected to be similar values.
unsigned int maskBits = 0;
- while( maskBits < tolerance )
+ while(maskBits < tolerance)
{
maskBits |= (1 << i);
i++;
maskBits = ~maskBits;
bool equal = true;
- for( i = 0; i < size; ++i, ++buff1, ++buff2 )
+ for(i = 0; i < size; ++i, ++buff1, ++buff2)
{
//Check bit difference, if exist, do more exhaustive comparison with tolerance value
- if( (*buff1 ^ *buff2 ) & maskBits )
+ if((*buff1 ^ *buff2) & maskBits)
{
- if( *buff1 < *buff2 )
+ if(*buff1 < *buff2)
{
unsigned int diff = *buff2 - *buff1;
- if( diff > tolerance )
+ if(diff > tolerance)
{
equal = false;
break;
else
{
unsigned int diff = *buff1 - *buff2;
- if( diff > tolerance )
+ if(diff > tolerance)
{
equal = false;
break;
}
}
}
- if ( !equal )
+ if(!equal)
{
- fprintf(stderr, "%s, byte %d, checking %u == %u\n", location, i, *buff1, *buff2 );
+ fprintf(stderr, "%s, byte %d, checking %u == %u\n", location, i, *buff1, *buff2);
tet_result(TET_FAIL);
}
else
* @param[in] location The TEST_LOCATION macro should be used here
*/
-inline void DALI_IMAGE_TEST_EQUALS( Dali::Devel::PixelBuffer pixelBuffer1, Dali::Devel::PixelBuffer pixelBuffer2, unsigned int tolerance, const char* location)
+inline void DALI_IMAGE_TEST_EQUALS(Dali::Devel::PixelBuffer pixelBuffer1, Dali::Devel::PixelBuffer pixelBuffer2, unsigned int tolerance, const char* location)
{
- if( ( pixelBuffer1.GetPixelFormat() != Pixel::RGB888 ) || ( pixelBuffer2.GetPixelFormat() != Pixel::RGB888 ) )
+ if((pixelBuffer1.GetPixelFormat() != Pixel::RGB888) || (pixelBuffer2.GetPixelFormat() != Pixel::RGB888))
{
- fprintf(stderr, "%s, PixelFormat != Pixel::RGB888, test only support Pixel::RGB888 formats\n", location );
+ fprintf(stderr, "%s, PixelFormat != Pixel::RGB888, test only support Pixel::RGB888 formats\n", location);
tet_result(TET_FAIL);
}
- else if( ( pixelBuffer1.GetWidth() != pixelBuffer1.GetWidth() ) || ( pixelBuffer1.GetHeight() != pixelBuffer1.GetHeight() ) )
+ else if((pixelBuffer1.GetWidth() != pixelBuffer1.GetWidth()) || (pixelBuffer1.GetHeight() != pixelBuffer1.GetHeight()))
{
- fprintf(stderr, "%s, Different Image sizes\n", location );
+ fprintf(stderr, "%s, Different Image sizes\n", location);
tet_result(TET_FAIL);
}
else
{
- DALI_TEST_EQUALS( pixelBuffer1.GetBuffer(), pixelBuffer2.GetBuffer(), tolerance, pixelBuffer1.GetHeight() * pixelBuffer1.GetWidth() * 3, location);
+ DALI_TEST_EQUALS(pixelBuffer1.GetBuffer(), pixelBuffer2.GetBuffer(), tolerance, pixelBuffer1.GetHeight() * pixelBuffer1.GetWidth() * 3, location);
}
}
-}
+} // namespace
#endif // DALI_TEST_SUITE_UTILS_H
// First TET_PASS should set to zero
// first TET_FAIL should prevent any further TET_PASS from setting back to zero
// Any TET_FAIL should set to fail or leave as fail
- if( test_return_value != 1 )
+ if(test_return_value != 1)
test_return_value = value;
}
#define END_TEST \
- return ((test_return_value>0)?1:0)
+ return ((test_return_value > 0) ? 1 : 0)
extern "C"
{
+ void tet_infoline(const char* str)
+ {
+ fprintf(stderr, "%s\n", str);
+ }
-void tet_infoline(const char* str)
-{
- fprintf(stderr, "%s\n", str);
-}
-
-void tet_printf(const char *format, ...)
-{
- va_list arg;
- va_start(arg, format);
- vfprintf(stderr, format, arg);
- va_end(arg);
-}
+ void tet_printf(const char* format, ...)
+ {
+ va_list arg;
+ va_start(arg, format);
+ vfprintf(stderr, format, arg);
+ va_end(arg);
+ }
}
-
bool operator==(TimePeriod a, TimePeriod b)
{
- return Equals(a.durationSeconds, b.durationSeconds) && Equals(a.delaySeconds, b.delaySeconds) ;
+ return Equals(a.durationSeconds, b.durationSeconds) && Equals(a.delaySeconds, b.delaySeconds);
}
-std::ostream& operator<<( std::ostream& ostream, TimePeriod value )
+std::ostream& operator<<(std::ostream& ostream, TimePeriod value)
{
return ostream << "( Duration:" << value.durationSeconds << " Delay:" << value.delaySeconds << ")";
}
-std::ostream& operator<<( std::ostream& ostream, Radian angle )
+std::ostream& operator<<(std::ostream& ostream, Radian angle)
{
ostream << angle.radian;
return ostream;
}
-std::ostream& operator<<( std::ostream& ostream, Degree angle )
+std::ostream& operator<<(std::ostream& ostream, Degree angle)
{
ostream << angle.degree;
return ostream;
}
-void DALI_TEST_EQUALS( const BaseHandle& baseHandle1, const BaseHandle& baseHandle2, const char* location )
+void DALI_TEST_EQUALS(const BaseHandle& baseHandle1, const BaseHandle& baseHandle2, const char* location)
{
- DALI_TEST_EQUALS< const BaseHandle& >( baseHandle1, baseHandle2, location );
+ DALI_TEST_EQUALS<const BaseHandle&>(baseHandle1, baseHandle2, location);
}
-void DALI_TEST_EQUALS( const size_t value1, const uint32_t value2, const char* location )
+void DALI_TEST_EQUALS(const size_t value1, const uint32_t value2, const char* location)
{
- DALI_TEST_EQUALS< uint32_t >( ( uint32_t )( value1 ), value2, location );
+ DALI_TEST_EQUALS<uint32_t>((uint32_t)(value1), value2, location);
}
-void DALI_TEST_EQUALS( const uint32_t 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< uint32_t >( value1, ( uint32_t )( 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)
+void DALI_TEST_EQUALS(const Matrix3& matrix1, const Matrix3& matrix2, const char* location)
{
- const float* m1 = matrix1.AsFloat();
- const float* m2 = matrix2.AsFloat();
- bool equivalent = true;
+ const float* m1 = matrix1.AsFloat();
+ const float* m2 = matrix2.AsFloat();
+ bool equivalent = true;
- for (int32_t i=0;i<9;++i)
+ for(int32_t i = 0; i < 9; ++i)
{
- if( ! (fabsf(m1[i] - m2[i])< GetRangedEpsilon(m1[i], m2[i])) )
+ if(!(fabsf(m1[i] - m2[i]) < GetRangedEpsilon(m1[i], m2[i])))
{
equivalent = false;
}
}
- if( !equivalent )
+ if(!equivalent)
{
// Align each float to 1234.67, i.e. 3.6 will be " 3.60"
- fprintf( stderr, "%s, checking\n"
- "%7.2f %7.2f %7.2f %7.2f %7.2f %7.2f\n"
- "%7.2f %7.2f %7.2f == %7.2f %7.2f %7.2f\n"
- "%7.2f %7.2f %7.2f %7.2f %7.2f %7.2f\n",
- location,
- m1[0], m1[3], m1[6], m2[0], m2[3], m2[6],
- m1[1], m1[4], m1[7], m2[1], m2[4], m2[7],
- m1[2], m1[5], m1[8], m2[2], m2[5], m2[8] );
+ // clang-format off
+ fprintf(stderr, "%s, checking\n"
+ "%7.2f %7.2f %7.2f %7.2f %7.2f %7.2f\n"
+ "%7.2f %7.2f %7.2f == %7.2f %7.2f %7.2f\n"
+ "%7.2f %7.2f %7.2f %7.2f %7.2f %7.2f\n",
+ location,
+ m1[0],m1[3],m1[6],m2[0],m2[3],m2[6],
+ m1[1],m1[4],m1[7],m2[1],m2[4],m2[7],
+ m1[2],m1[5],m1[8],m2[2],m2[5],m2[8]);
+ // clang-format on
tet_result(TET_FAIL);
throw("TET_FAIL");
}
}
-void DALI_TEST_EQUALS( const Matrix3& matrix1, const Matrix3& matrix2, float epsilon, const char* location)
+void DALI_TEST_EQUALS(const Matrix3& matrix1, const Matrix3& matrix2, float epsilon, const char* location)
{
- const float* m1 = matrix1.AsFloat();
- const float* m2 = matrix2.AsFloat();
- bool equivalent = true;
+ const float* m1 = matrix1.AsFloat();
+ const float* m2 = matrix2.AsFloat();
+ bool equivalent = true;
- for (int32_t i=0;i<9;++i)
+ for(int32_t i = 0; i < 9; ++i)
{
- equivalent &= (fabsf(m1[i] - m2[i])<epsilon);
+ equivalent &= (fabsf(m1[i] - m2[i]) < epsilon);
}
- if (!equivalent)
+ if(!equivalent)
{
// Align each float to 1234.67, i.e. 3.6 will be " 3.60"
- fprintf( stderr, "%s, checking\n"
- "%7.2f %7.2f %7.2f %7.2f %7.2f %7.2f\n"
- "%7.2f %7.2f %7.2f == %7.2f %7.2f %7.2f\n"
- "%7.2f %7.2f %7.2f %7.2f %7.2f %7.2f\n",
- location,
- m1[0], m1[3], m1[6], m2[0], m2[3], m2[6],
- m1[1], m1[4], m1[7], m2[1], m2[4], m2[7],
- m1[2], m1[5], m1[8], m2[2], m2[5], m2[8] );
+ // clang-format off
+ fprintf(stderr, "%s, checking\n"
+ "%7.2f %7.2f %7.2f %7.2f %7.2f %7.2f\n"
+ "%7.2f %7.2f %7.2f == %7.2f %7.2f %7.2f\n"
+ "%7.2f %7.2f %7.2f %7.2f %7.2f %7.2f\n",
+ location,
+ m1[0],m1[3],m1[6],m2[0],m2[3],m2[6],
+ m1[1],m1[4],m1[7],m2[1],m2[4],m2[7],
+ m1[2],m1[5],m1[8],m2[2],m2[5],m2[8]);
+ // clang-format on
tet_result(TET_FAIL);
throw("TET_FAIL");
}
}
-void DALI_TEST_EQUALS( const Matrix& matrix1, const Matrix& matrix2, const char* location)
+void DALI_TEST_EQUALS(const Matrix& matrix1, const Matrix& matrix2, const char* location)
{
- const float* m1 = matrix1.AsFloat();
- const float* m2 = matrix2.AsFloat();
- bool identical = true;
+ const float* m1 = matrix1.AsFloat();
+ const float* m2 = matrix2.AsFloat();
+ bool identical = true;
int32_t i;
- for (i=0;i<16;++i)
+ for(i = 0; i < 16; ++i)
{
if(m1[i] != m2[i])
{
}
}
- if (!identical)
+ if(!identical)
{
// Align each float to 1234.67, i.e. 3.6 will be " 3.60"
- fprintf( stderr, "%s, checking\n"
- "%7.2f %7.2f %7.2f %7.2f %7.2f %7.2f %7.2f %7.2f\n"
- "%7.2f %7.2f %7.2f %7.2f == %7.2f %7.2f %7.2f %7.2f\n"
- "%7.2f %7.2f %7.2f %7.2f %7.2f %7.2f %7.2f %7.2f\n"
- "%7.2f %7.2f %7.2f %7.2f %7.2f %7.2f %7.2f %7.2f\n",
- location,
- m1[0], m1[4], m1[8], m1[12], m2[0], m2[4], m2[8], m2[12],
- m1[1], m1[5], m1[9], m1[13], m2[1], m2[5], m2[9], m2[13],
- m1[2], m1[6], m1[10], m1[14], m2[2], m2[6], m2[10], m2[14],
- m1[3], m1[7], m1[11], m1[15], m2[3], m2[7], m2[11], m2[15] );
+ // clang-format off
+ fprintf(stderr, "%s, checking\n"
+ "%7.2f %7.2f %7.2f %7.2f %7.2f %7.2f %7.2f %7.2f\n"
+ "%7.2f %7.2f %7.2f %7.2f == %7.2f %7.2f %7.2f %7.2f\n"
+ "%7.2f %7.2f %7.2f %7.2f %7.2f %7.2f %7.2f %7.2f\n"
+ "%7.2f %7.2f %7.2f %7.2f %7.2f %7.2f %7.2f %7.2f\n",
+ location,
+ m1[0],m1[4],m1[8],m1[12],m2[0],m2[4],m2[8],m2[12],
+ m1[1],m1[5],m1[9],m1[13],m2[1],m2[5],m2[9],m2[13],
+ m1[2],m1[6],m1[10],m1[14],m2[2],m2[6],m2[10],m2[14],
+ m1[3],m1[7],m1[11],m1[15],m2[3],m2[7],m2[11],m2[15]);
+ // clang-format on
tet_result(TET_FAIL);
throw("TET_FAIL");
}
}
-void DALI_TEST_EQUALS( const Matrix& matrix1, const Matrix& matrix2, float epsilon, const char* location)
+void DALI_TEST_EQUALS(const Matrix& matrix1, const Matrix& matrix2, float epsilon, const char* location)
{
- const float* m1 = matrix1.AsFloat();
- const float* m2 = matrix2.AsFloat();
- bool equivalent = true;
+ const float* m1 = matrix1.AsFloat();
+ const float* m2 = matrix2.AsFloat();
+ bool equivalent = true;
- for (int32_t i=0;i<16;++i)
+ for(int32_t i = 0; i < 16; ++i)
{
- equivalent &= (fabsf(m1[i] - m2[i])<epsilon);
+ equivalent &= (fabsf(m1[i] - m2[i]) < epsilon);
}
- if (!equivalent)
+ if(!equivalent)
{
// Align each float to 1234.67, i.e. 3.6 will be " 3.60"
- fprintf( stderr, "%s, checking\n"
- "%7.2f %7.2f %7.2f %7.2f %7.2f %7.2f %7.2f %7.2f\n"
- "%7.2f %7.2f %7.2f %7.2f == %7.2f %7.2f %7.2f %7.2f\n"
- "%7.2f %7.2f %7.2f %7.2f %7.2f %7.2f %7.2f %7.2f\n"
- "%7.2f %7.2f %7.2f %7.2f %7.2f %7.2f %7.2f %7.2f\n",
- location,
- m1[0], m1[4], m1[8], m1[12], m2[0], m2[4], m2[8], m2[12],
- m1[1], m1[5], m1[9], m1[13], m2[1], m2[5], m2[9], m2[13],
- m1[2], m1[6], m1[10], m1[14], m2[2], m2[6], m2[10], m2[14],
- m1[3], m1[7], m1[11], m1[15], m2[3], m2[7], m2[11], m2[15] );
+ // clang-format off
+ fprintf(stderr, "%s, checking\n"
+ "%7.2f %7.2f %7.2f %7.2f %7.2f %7.2f %7.2f %7.2f\n"
+ "%7.2f %7.2f %7.2f %7.2f == %7.2f %7.2f %7.2f %7.2f\n"
+ "%7.2f %7.2f %7.2f %7.2f %7.2f %7.2f %7.2f %7.2f\n"
+ "%7.2f %7.2f %7.2f %7.2f %7.2f %7.2f %7.2f %7.2f\n",
+ location,
+ m1[0],m1[4],m1[8],m1[12],m2[0],m2[4],m2[8],m2[12],
+ m1[1],m1[5],m1[9],m1[13],m2[1],m2[5],m2[9],m2[13],
+ m1[2],m1[6],m1[10],m1[14],m2[2],m2[6],m2[10],m2[14],
+ m1[3],m1[7],m1[11],m1[15],m2[3],m2[7],m2[11],m2[15]);
+ // clang-format on
tet_result(TET_FAIL);
throw("TET_FAIL");
}
}
-
/**
* Test whether two strings are equal.
* @param[in] str1 The first string
* @param[in] str2 The second string
* @param[in] location The TEST_LOCATION macro should be used here
*/
-void DALI_TEST_EQUALS( const std::string &str1, const char* str2, const char* location)
+void DALI_TEST_EQUALS(const std::string& str1, const char* str2, const char* location)
{
DALI_TEST_EQUALS(str1.c_str(), str2, location);
}
-void DALI_TEST_EQUALS( Property::Value& str1, const char* str2, const char* location)
+void DALI_TEST_EQUALS(Property::Value& str1, const char* str2, const char* location)
{
bool result = false;
- if( str1.GetType() == Property::STRING )
+ if(str1.GetType() == Property::STRING)
{
std::string string;
str1.Get(string);
result = !string.compare(str2);
}
- if( result )
+ if(result)
{
tet_result(TET_PASS);
}
}
}
-void DALI_TEST_EQUALS( const char* str1, const std::string &str2, const char* location)
+void DALI_TEST_EQUALS(const char* str1, const std::string& str2, const char* location)
{
DALI_TEST_EQUALS(str1, str2.c_str(), location);
}
-void DALI_TEST_ASSERT( DaliException& e, std::string conditionSubString, const char* location )
+void DALI_TEST_ASSERT(DaliException& e, std::string conditionSubString, const char* location)
{
- if( NULL == strstr( e.condition, conditionSubString.c_str() ) )
+ if(NULL == strstr(e.condition, conditionSubString.c_str()))
{
- fprintf(stderr, "Expected substring '%s' : actual exception string '%s' : location %s\n", conditionSubString.c_str(), e.condition, location );
+ fprintf(stderr, "Expected substring '%s' : actual exception string '%s' : location %s\n", conditionSubString.c_str(), e.condition, location);
tet_result(TET_FAIL);
throw("TET_FAIL");
}
}
// Functor to test whether an Applied signal is emitted
-ConstraintAppliedCheck::ConstraintAppliedCheck( bool& signalReceived )
-: mSignalReceived( signalReceived )
+ConstraintAppliedCheck::ConstraintAppliedCheck(bool& signalReceived)
+: mSignalReceived(signalReceived)
{
}
-void ConstraintAppliedCheck::operator()( Constraint& constraint )
+void ConstraintAppliedCheck::operator()(Constraint& constraint)
{
mSignalReceived = true;
}
void ConstraintAppliedCheck::CheckSignalReceived()
{
- if ( !mSignalReceived )
+ if(!mSignalReceived)
{
- fprintf(stderr, "Expected Applied signal was not received\n" );
- tet_result( TET_FAIL );
+ fprintf(stderr, "Expected Applied signal was not received\n");
+ tet_result(TET_FAIL);
throw("TET_FAIL");
}
else
{
- tet_result( TET_PASS );
+ tet_result(TET_PASS);
}
}
void ConstraintAppliedCheck::CheckSignalNotReceived()
{
- if ( mSignalReceived )
+ if(mSignalReceived)
{
- fprintf(stderr, "Unexpected Applied signal was received\n" );
- tet_result( TET_FAIL );
+ fprintf(stderr, "Unexpected Applied signal was received\n");
+ tet_result(TET_FAIL);
throw("TET_FAIL");
}
else
{
- tet_result( TET_PASS );
+ tet_result(TET_PASS);
}
}
namespace Test
{
-
struct ObjectDestructionFunctor
{
// Create a ObjectDestructionFunctor passing in a Dali::RefObject* to be monitored and a bool variable.
// Create ObjectRegistry instance and connect to the ObjectDestroyedSignal passing in the above functor for the callback.
// Get the ObjectPointer (Actor::GetObjectPtr) of the Actor to be checked for destruction and assign it to the Dali::RefObject*
// Check the bool variable which would be true when object destroyed.
- ObjectDestructionFunctor( Dali::RefObject* objectPtr, bool& refObjectDestroyed )
- : refObjectPointerToCheck( objectPtr ),
- refObjectDestroyedBoolean( refObjectDestroyed )
+ ObjectDestructionFunctor(Dali::RefObject* objectPtr, bool& refObjectDestroyed)
+ : refObjectPointerToCheck(objectPtr),
+ refObjectDestroyedBoolean(refObjectDestroyed)
{
refObjectDestroyed = false;
}
- void operator()( const Dali::RefObject* objectPointer )
+ void operator()(const Dali::RefObject* objectPointer)
{
- if ( refObjectPointerToCheck == objectPointer )
+ if(refObjectPointerToCheck == objectPointer)
{
refObjectDestroyedBoolean = true;
}
}
Dali::RefObject* refObjectPointerToCheck;
- bool& refObjectDestroyedBoolean;
+ bool& refObjectDestroyedBoolean;
};
-ObjectDestructionTracker::ObjectDestructionTracker( ObjectRegistry objectRegistry )
-: mObjectRegistry( objectRegistry ),
- mRefObjectDestroyed( false)
+ObjectDestructionTracker::ObjectDestructionTracker(ObjectRegistry objectRegistry)
+: mObjectRegistry(objectRegistry),
+ mRefObjectDestroyed(false)
{
}
-void ObjectDestructionTracker::Start( Actor actor )
+void ObjectDestructionTracker::Start(Actor actor)
{
- ObjectDestructionFunctor destructionFunctor( actor.GetObjectPtr(), mRefObjectDestroyed );
- mObjectRegistry.ObjectDestroyedSignal().Connect( this, destructionFunctor );
+ ObjectDestructionFunctor destructionFunctor(actor.GetObjectPtr(), mRefObjectDestroyed);
+ mObjectRegistry.ObjectDestroyedSignal().Connect(this, destructionFunctor);
}
bool ObjectDestructionTracker::IsDestroyed()
{
- return mRefObjectDestroyed;
+ return mRefObjectDestroyed;
}
} // namespace Test
// EXTERNAL INCLUDES
#include <cstdarg>
#include <cstdio>
-#include <iostream>
#include <cstring>
+#include <iostream>
#include <string>
// INTERNAL INCLUDES
extern "C"
{
-void tet_infoline(const char*str);
-void tet_printf(const char *format, ...);
+ void tet_infoline(const char* str);
+ void tet_printf(const char* format, ...);
}
-#include "test-application.h"
#include "test-actor-utils.h"
+#include "test-application.h"
#include "test-gesture-generator.h"
using namespace Dali;
* Inspired by https://stackoverflow.com/questions/1706346/file-macro-manipulation-handling-at-compile-time
* answer by Chetan Reddy
*/
-constexpr int32_t basenameIndex( const char * const path, const int32_t index = 0, const int32_t slashIndex = -1 )
+constexpr int32_t basenameIndex(const char* const path, const int32_t index = 0, const int32_t slashIndex = -1)
{
- return path[ index ]
- ? ( path[ index ] == '/'
- ? basenameIndex( path, index + 1, index )
- : basenameIndex( path, index + 1, slashIndex ) )
- : ( slashIndex + 1 );
+ return path[index]
+ ? (path[index] == '/'
+ ? basenameIndex(path, index + 1, index)
+ : basenameIndex(path, index + 1, slashIndex))
+ : (slashIndex + 1);
}
-#define __FILELINE__ ( { static const int32_t basenameIdx = basenameIndex( __FILE__ ); \
+#define __FILELINE__ ({ static const int32_t basenameIdx = basenameIndex( __FILE__ ); \
static_assert (basenameIdx >= 0, "compile-time basename" ); \
- __FILE__ ":" STRINGIZE(__LINE__) + basenameIdx ; } )
+ __FILE__ ":" STRINGIZE(__LINE__) + basenameIdx ; })
#define TEST_LOCATION __FILELINE__
-#define TEST_INNER_LOCATION(x) ( std::string(x) + " (" + STRINGIZE(__LINE__) + ")" ).c_str()
+#define TEST_INNER_LOCATION(x) (std::string(x) + " (" + STRINGIZE(__LINE__) + ")").c_str()
#define TET_UNDEF 2
#define TET_FAIL 1
void tet_result(int32_t value);
#define END_TEST \
- return ((test_return_value>0)?1:0)
+ return ((test_return_value > 0) ? 1 : 0)
void tet_infoline(const char* str);
-void tet_printf(const char *format, ...);
+void tet_printf(const char* format, ...);
/**
* DALI_TEST_CHECK is a wrapper for tet_result.
* If the condition evaluates to false, the test is stopped.
* @param[in] The boolean expression to check
*/
-#define DALI_TEST_CHECK(condition) \
-if ( (condition) ) \
-{ \
- tet_result(TET_PASS); \
-} \
-else \
-{ \
- fprintf(stderr, "Test failed in %s, condition: %s\n", __FILELINE__, #condition ); \
- tet_result(TET_FAIL); \
- throw("TET_FAIL"); \
-}
-
+#define DALI_TEST_CHECK(condition) \
+ if((condition)) \
+ { \
+ tet_result(TET_PASS); \
+ } \
+ else \
+ { \
+ fprintf(stderr, "Test failed in %s, condition: %s\n", __FILELINE__, #condition); \
+ tet_result(TET_FAIL); \
+ throw("TET_FAIL"); \
+ }
-bool operator==(TimePeriod a, TimePeriod b);
-std::ostream& operator<<( std::ostream& ostream, TimePeriod value );
-std::ostream& operator<<( std::ostream& ostream, Radian angle );
-std::ostream& operator<<( std::ostream& ostream, Degree angle );
+bool operator==(TimePeriod a, TimePeriod b);
+std::ostream& operator<<(std::ostream& ostream, TimePeriod value);
+std::ostream& operator<<(std::ostream& ostream, Radian angle);
+std::ostream& operator<<(std::ostream& ostream, Degree angle);
/**
* Test whether two values are equal.
template<typename Type>
inline void DALI_TEST_EQUALS(Type value1, Type value2, const char* location)
{
- if( !CompareType<Type>(value1, value2, 0.01f) )
+ if(!CompareType<Type>(value1, value2, 0.01f))
{
std::ostringstream o;
o << value1 << " == " << value2 << std::endl;
fprintf(stderr, "Test failed in %s, checking %s", location, o.str().c_str());
tet_result(TET_FAIL);
- throw("TET_FAIL"); \
+ throw("TET_FAIL");
}
else
{
* @param[in] value1 The first value
* @param[in] value2 The second value
*/
-#define DALI_TEST_EQUAL( v1, v2 ) DALI_TEST_EQUALS( v1, v2, __FILELINE__ )
+#define DALI_TEST_EQUAL(v1, v2) DALI_TEST_EQUALS(v1, v2, __FILELINE__)
template<typename Type>
inline void DALI_TEST_EQUALS(Type value1, Type value2, float epsilon, const char* location)
{
- if( !CompareType<Type>(value1, value2, epsilon) )
+ if(!CompareType<Type>(value1, value2, epsilon))
{
std::ostringstream o;
o << value1 << " == " << value2 << std::endl;
fprintf(stderr, "Test failed in %s, checking %s", location, o.str().c_str());
tet_result(TET_FAIL);
- throw("TET_FAIL"); \
+ throw("TET_FAIL");
}
else
{
template<typename Type>
inline void DALI_TEST_NOT_EQUALS(Type value1, Type value2, float epsilon, const char* location)
{
- if( CompareType<Type>(value1, value2, epsilon) )
+ if(CompareType<Type>(value1, value2, epsilon))
{
std::ostringstream o;
o << value1 << " != " << value2 << std::endl;
fprintf(stderr, "Test failed in %s, checking %s", location, o.str().c_str());
tet_result(TET_FAIL);
- throw("TET_FAIL"); \
+ throw("TET_FAIL");
}
else
{
}
}
-
/**
* Test whether two TimePeriods are within a certain distance of each other.
* @param[in] value1 The first value
* @param[in] location The TEST_LOCATION macro should be used here
*/
template<>
-inline void DALI_TEST_EQUALS<TimePeriod>( TimePeriod value1, TimePeriod value2, float epsilon, const char* location)
+inline void DALI_TEST_EQUALS<TimePeriod>(TimePeriod value1, TimePeriod value2, float epsilon, const char* location)
{
- if ((fabs(value1.durationSeconds - value2.durationSeconds) > epsilon))
+ if((fabs(value1.durationSeconds - value2.durationSeconds) > epsilon))
{
fprintf(stderr, "Test failed in %s, checking durations %f == %f, epsilon %f\n", location, value1.durationSeconds, value2.durationSeconds, epsilon);
tet_result(TET_FAIL);
- throw("TET_FAIL"); \
+ throw("TET_FAIL");
}
- else if ((fabs(value1.delaySeconds - value2.delaySeconds) > epsilon))
+ else if((fabs(value1.delaySeconds - value2.delaySeconds) > epsilon))
{
fprintf(stderr, "Test failed in %s, checking delays %f == %f, epsilon %f\n", location, value1.delaySeconds, value2.delaySeconds, epsilon);
tet_result(TET_FAIL);
- throw("TET_FAIL"); \
+ throw("TET_FAIL");
}
else
{
* @param[in] baseHandle2 The second value
* @param[in] location The TEST_LOCATION macro should be used here
*/
-void DALI_TEST_EQUALS( const BaseHandle& baseHandle1, const BaseHandle& baseHandle2, const char* location );
+void DALI_TEST_EQUALS(const BaseHandle& baseHandle1, const BaseHandle& baseHandle2, const char* location);
/**
* Test whether a size_t value and an uint32_t are equal.
* @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 uint32_t value2, const char* location );
+void DALI_TEST_EQUALS(const size_t value1, const uint32_t value2, const char* location);
/**
* Test whether an uint32_t and a size_t value and are equal.
* @param[in] value2 The second value
* @param[in] location The TEST_LOCATION macro should be used here
*/
-void DALI_TEST_EQUALS( const uint32_t 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.
* @param[in] matrix2 The second object
* @param[in] location The TEST_LOCATION macro should be used here
*/
-void DALI_TEST_EQUALS( const Matrix3& matrix1, const Matrix3& matrix2, const char* location);
+void DALI_TEST_EQUALS(const Matrix3& matrix1, const Matrix3& matrix2, const char* location);
/** Test whether two Matrix3 objects are equal (fuzzy compare).
* @param[in] matrix1 The first object
* @param[in] epsilon The epsilon to use for comparison
* @param[in] location The TEST_LOCATION macro should be used here
*/
-void DALI_TEST_EQUALS( const Matrix3& matrix1, const Matrix3& matrix2, float epsilon, const char* location);
+void DALI_TEST_EQUALS(const Matrix3& matrix1, const Matrix3& matrix2, float epsilon, const char* location);
/**
* Test whether two Matrix objects are equal.
* @param[in] matrix2 The second object
* @param[in] location The TEST_LOCATION macro should be used here
*/
-void DALI_TEST_EQUALS( const Matrix& matrix1, const Matrix& matrix2, const char* location);
+void DALI_TEST_EQUALS(const Matrix& matrix1, const Matrix& matrix2, const char* location);
/**
* Test whether two Matrix objects are equal (fuzzy-compare).
* @param[in] matrix2 The second object
* @param[in] location The TEST_LOCATION macro should be used here
*/
-void DALI_TEST_EQUALS( const Matrix& matrix1, const Matrix& matrix2, float epsilon, const char* location);
+void DALI_TEST_EQUALS(const Matrix& matrix1, const Matrix& matrix2, float epsilon, const char* location);
/**
* Test whether two strings are equal.
* @param[in] location The TEST_LOCATION macro should be used here
*/
template<>
-inline void DALI_TEST_EQUALS<const char*>( const char* str1, const char* str2, const char* location)
+inline void DALI_TEST_EQUALS<const char*>(const char* str1, const char* str2, const char* location)
{
- if (strcmp(str1, str2))
+ if(strcmp(str1, str2))
{
fprintf(stderr, "Test failed in %s, checking '%s' == '%s'\n", location, str1, str2);
tet_result(TET_FAIL);
- throw("TET_FAIL"); \
+ throw("TET_FAIL");
}
else
{
* @param[in] location The TEST_LOCATION macro should be used here
*/
template<>
-inline void DALI_TEST_EQUALS<const std::string&>( const std::string &str1, const std::string &str2, const char* location)
+inline void DALI_TEST_EQUALS<const std::string&>(const std::string& str1, const std::string& str2, const char* location)
{
DALI_TEST_EQUALS(str1.c_str(), str2.c_str(), location);
}
* @param[in] str2 The second string
* @param[in] location The TEST_LOCATION macro should be used here
*/
-void DALI_TEST_EQUALS( Property::Value& str1, const char* str2, const char* location);
+void DALI_TEST_EQUALS(Property::Value& str1, const char* str2, const char* location);
/**
* Test whether two strings are equal.
* @param[in] str2 The second string
* @param[in] location The TEST_LOCATION macro should be used here
*/
-void DALI_TEST_EQUALS( const std::string &str1, const char* str2, const char* location);
+void DALI_TEST_EQUALS(const std::string& str1, const char* str2, const char* location);
/**
* Test whether two strings are equal.
* @param[in] str2 The second string
* @param[in] location The TEST_LOCATION macro should be used here
*/
-void DALI_TEST_EQUALS( const char* str1, const std::string &str2, const char* location);
+void DALI_TEST_EQUALS(const char* str1, const std::string& str2, const char* location);
/**
* Test if a property value type is equal to a trivial type.
*/
template<typename Type>
-inline void DALI_TEST_VALUE_EQUALS( Property::Value&& value1, Type value2, float epsilon, const char* location)
+inline void DALI_TEST_VALUE_EQUALS(Property::Value&& value1, Type value2, float epsilon, const char* location)
{
Property::Value value2b(value2);
DALI_TEST_EQUALS(value1, value2b, epsilon, location);
}
-
/**
* Test whether one unsigned integer value is greater than another.
* Test succeeds if value1 > value2
* @param[in] value2 The second value
* @param[in] location The TEST_LOCATION macro should be used here
*/
-template< typename T >
-void DALI_TEST_GREATER( T value1, T value2, const char* location)
+template<typename T>
+void DALI_TEST_GREATER(T value1, T value2, const char* location)
{
- if (!(value1 > value2))
+ if(!(value1 > value2))
{
- std::cerr << "Test failed in " << location << ", checking " << value1 <<" > " << value2 << "\n";
+ std::cerr << "Test failed in " << location << ", checking " << value1 << " > " << value2 << "\n";
tet_result(TET_FAIL);
- throw("TET_FAIL"); \
+ throw("TET_FAIL");
}
else
{
* assertion which triggered the exception.
* @param[in] location The TEST_LOCATION macro should be used here.
*/
-void DALI_TEST_ASSERT( DaliException& e, std::string conditionSubString, const char* location );
+void DALI_TEST_ASSERT(DaliException& e, std::string conditionSubString, const char* location);
/**
* Print the assert
* @param[in] e The exception that we expect was fired by a runtime assertion failure.
*/
-inline void DALI_TEST_PRINT_ASSERT( DaliException& e )
+inline void DALI_TEST_PRINT_ASSERT(DaliException& e)
{
- tet_printf("Assertion %s failed at %s\n", e.condition, e.location );
+ tet_printf("Assertion %s failed at %s\n", e.condition, e.location);
}
/**
* @param expressions code to execute
* @param assertstring the substring expected in the assert
*/
-#define DALI_TEST_ASSERTION( expressions, assertstring ) \
-try \
-{ \
- TestApplication::EnableLogging( false ); \
- expressions; \
- TestApplication::EnableLogging( true ); \
- fprintf(stderr, "Test failed in %s, expected assert: '%s' didn't occur\n", __FILELINE__, assertstring ); \
- tet_result(TET_FAIL); \
- throw("TET_FAIL"); } \
-catch( Dali::DaliException& e ) \
-{ \
- DALI_TEST_ASSERT( e, assertstring, TEST_LOCATION ); \
-}
+#define DALI_TEST_ASSERTION(expressions, assertstring) \
+ try \
+ { \
+ TestApplication::EnableLogging(false); \
+ expressions; \
+ TestApplication::EnableLogging(true); \
+ fprintf(stderr, "Test failed in %s, expected assert: '%s' didn't occur\n", __FILELINE__, assertstring); \
+ tet_result(TET_FAIL); \
+ throw("TET_FAIL"); \
+ } \
+ catch(Dali::DaliException & e) \
+ { \
+ DALI_TEST_ASSERT(e, assertstring, TEST_LOCATION); \
+ }
// Functor to test whether an Applied signal is emitted
struct ConstraintAppliedCheck
{
- ConstraintAppliedCheck( bool& signalReceived );
- void operator()( Constraint& constraint );
- void Reset();
- void CheckSignalReceived();
- void CheckSignalNotReceived();
+ ConstraintAppliedCheck(bool& signalReceived);
+ void operator()(Constraint& constraint);
+ void Reset();
+ void CheckSignalReceived();
+ void CheckSignalNotReceived();
bool& mSignalReceived; // owned by individual tests
};
/**
* A Helper to test default functions
*/
-template <typename T>
+template<typename T>
struct DefaultFunctionCoverage
{
DefaultFunctionCoverage()
{
- T a;
- T *b = new T(a);
+ T a;
+ T* b = new T(a);
DALI_TEST_CHECK(b);
a = *b;
delete b;
class ObjectDestructionTracker : public ConnectionTracker
{
public:
-
/**
* @brief Call in main part of code
* @param[in] objectRegistry The object Registry being used
*/
- ObjectDestructionTracker( ObjectRegistry objectRegistry );
+ ObjectDestructionTracker(ObjectRegistry objectRegistry);
/**
* @brief Call in sub bock of code where the Actor being checked is still alive.
*
* @param[in] actor Actor to be checked for destruction
*/
- void Start( Actor actor );
+ void Start(Actor actor);
/**
* @brief Call to check if Actor alive or destroyed.
private:
ObjectRegistry mObjectRegistry;
- bool mRefObjectDestroyed;
+ bool mRefObjectDestroyed;
};
} // namespace Test
namespace Dali
{
-
Shader CreateShader()
{
- return Shader::New( "vertexSrc", "fragmentSrc" );
+ return Shader::New("vertexSrc", "fragmentSrc");
}
TextureSet CreateTextureSet()
return TextureSet::New();
}
-TextureSet CreateTextureSet( Texture texture )
+TextureSet CreateTextureSet(Texture texture)
{
TextureSet textureSet = TextureSet::New();
textureSet.SetTexture(0u, texture);
VertexBuffer CreateVertexBuffer()
{
Property::Map texturedQuadVertexFormat;
- texturedQuadVertexFormat["aPosition"] = Property::VECTOR2;
+ texturedQuadVertexFormat["aPosition"] = Property::VECTOR2;
texturedQuadVertexFormat["aVertexCoord"] = Property::VECTOR2;
- VertexBuffer vertexData = VertexBuffer::New( texturedQuadVertexFormat );
+ VertexBuffer vertexData = VertexBuffer::New(texturedQuadVertexFormat);
return vertexData;
}
Geometry CreateQuadGeometry(void)
{
- VertexBuffer vertexData = CreateVertexBuffer();
- const float halfQuadSize = .5f;
- struct TexturedQuadVertex { Vector2 position; Vector2 textureCoordinates; };
+ VertexBuffer vertexData = CreateVertexBuffer();
+ const float halfQuadSize = .5f;
+ struct TexturedQuadVertex
+ {
+ Vector2 position;
+ Vector2 textureCoordinates;
+ };
TexturedQuadVertex texturedQuadVertexData[4] = {
- { Vector2(-halfQuadSize, -halfQuadSize), Vector2(0.f, 0.f) },
- { Vector2( halfQuadSize, -halfQuadSize), Vector2(1.f, 0.f) },
- { Vector2(-halfQuadSize, halfQuadSize), Vector2(0.f, 1.f) },
- { Vector2( halfQuadSize, halfQuadSize), Vector2(1.f, 1.f) } };
+ {Vector2(-halfQuadSize, -halfQuadSize), Vector2(0.f, 0.f)},
+ {Vector2(halfQuadSize, -halfQuadSize), Vector2(1.f, 0.f)},
+ {Vector2(-halfQuadSize, halfQuadSize), Vector2(0.f, 1.f)},
+ {Vector2(halfQuadSize, halfQuadSize), Vector2(1.f, 1.f)}};
vertexData.SetData(texturedQuadVertexData, 4);
- unsigned short indexData[6] = { 0, 3, 1, 0, 2, 3 };
+ unsigned short indexData[6] = {0, 3, 1, 0, 2, 3};
Geometry geometry = Geometry::New();
- geometry.AddVertexBuffer( vertexData );
- geometry.SetIndexBuffer( indexData, sizeof(indexData)/sizeof(indexData[0]) );
+ geometry.AddVertexBuffer(vertexData);
+ geometry.SetIndexBuffer(indexData, sizeof(indexData) / sizeof(indexData[0]));
return geometry;
}
-
-
} // namespace Dali
namespace Dali
{
-
-Shader CreateShader();
-TextureSet CreateTextureSet();
-TextureSet CreateTextureSet( Texture texture );
-Geometry CreateQuadGeometry();
+Shader CreateShader();
+TextureSet CreateTextureSet();
+TextureSet CreateTextureSet(Texture texture);
+Geometry CreateQuadGeometry();
VertexBuffer CreateVertexBuffer();
-}
+} // namespace Dali
#endif // MESH_BUILDER_H
namespace Dali
{
-
namespace
{
-
const char* VERTEX_SHADER = DALI_COMPOSE_SHADER(
- attribute mediump vec2 aPosition;\n
- uniform mediump mat4 uMvpMatrix;\n
- uniform mediump vec3 uSize;\n
- \n
- void main()\n
- {\n
- mediump vec4 vertexPosition = vec4(aPosition, 0.0, 1.0);\n
- vertexPosition.xyz *= uSize;\n
- gl_Position = uMvpMatrix * vertexPosition;\n
- }\n
-);
+ attribute mediump vec2 aPosition;\n
+ uniform mediump mat4 uMvpMatrix;\n
+ uniform mediump vec3 uSize;\n
+ \n void main()\n {
+ \n
+ mediump vec4 vertexPosition = vec4(aPosition, 0.0, 1.0);
+ \n
+ vertexPosition.xyz *= uSize;
+ \n
+ gl_Position = uMvpMatrix * vertexPosition;
+ \n
+ }\n);
const char* FRAGMENT_SHADER = DALI_COMPOSE_SHADER(
uniform lowp vec4 uColor;\n
- \n
- void main()\n
- {\n
- gl_FragColor = uColor;\n
- }\n
-);
+ \n void main()\n {
+ \n
+ gl_FragColor = uColor;
+ \n
+ }\n);
} // unnamed namespace
Actor CreateRenderableActor()
{
- return CreateRenderableActor( Texture(), VERTEX_SHADER, FRAGMENT_SHADER );
+ return CreateRenderableActor(Texture(), VERTEX_SHADER, FRAGMENT_SHADER);
}
-Actor CreateRenderableActor( Texture texture )
+Actor CreateRenderableActor(Texture texture)
{
- return CreateRenderableActor( texture, VERTEX_SHADER, FRAGMENT_SHADER );
+ return CreateRenderableActor(texture, VERTEX_SHADER, FRAGMENT_SHADER);
}
-Actor CreateRenderableActor( Texture texture, const std::string& vertexShader, const std::string& fragmentShader )
+Actor CreateRenderableActor(Texture texture, const std::string& vertexShader, const std::string& fragmentShader)
{
// Create the geometry
Geometry geometry = CreateQuadGeometry();
// Create Shader
- Shader shader = Shader::New( vertexShader, fragmentShader );
+ Shader shader = Shader::New(vertexShader, fragmentShader);
// Create renderer from geometry and material
- Renderer renderer = Renderer::New( geometry, shader );
+ Renderer renderer = Renderer::New(geometry, shader);
// Create actor and set renderer
Actor actor = Actor::New();
- actor.AddRenderer( renderer );
+ actor.AddRenderer(renderer);
// If we a texture, then create a texture-set and add to renderer
- if( texture )
+ if(texture)
{
TextureSet textureSet = TextureSet::New();
- textureSet.SetTexture( 0u, texture );
- renderer.SetTextures( textureSet );
+ textureSet.SetTexture(0u, texture);
+ renderer.SetTextures(textureSet);
// Set actor to the size of the texture if set
- actor.SetProperty( Actor::Property::SIZE, Vector2( texture.GetWidth(), texture.GetHeight() ) );
+ actor.SetProperty(Actor::Property::SIZE, Vector2(texture.GetWidth(), texture.GetHeight()));
}
return actor;
namespace Dali
{
-
class Actor;
class Image;
class Texture;
* @param[in] texture Texture to set.
* @return An actor with a renderer.
*/
-Actor CreateRenderableActor( Texture texture );
+Actor CreateRenderableActor(Texture texture);
/**
* @brief Creates a renderable-actor with a texture and custom shaders.
* @param[in] fragmentShader The fragment-shader.
* @return An actor with a renderer.
*/
-Actor CreateRenderableActor( Texture texture, const std::string& vertexShader, const std::string& fragmentShader );
+Actor CreateRenderableActor(Texture texture, const std::string& vertexShader, const std::string& fragmentShader);
} // namespace Dali
namespace Dali
{
-
bool TestApplication::mLoggingEnabled = true;
-TestApplication::TestApplication( uint32_t surfaceWidth,
- uint32_t surfaceHeight,
- uint32_t horizontalDpi,
- uint32_t verticalDpi,
- bool initialize,
- bool enablePartialUpdate )
-: mCore( NULL ),
- mSurfaceWidth( surfaceWidth ),
- mSurfaceHeight( surfaceHeight ),
- mFrame( 0u ),
- mDpi{ horizontalDpi, verticalDpi },
+TestApplication::TestApplication(uint32_t surfaceWidth,
+ uint32_t surfaceHeight,
+ uint32_t horizontalDpi,
+ uint32_t verticalDpi,
+ bool initialize,
+ bool enablePartialUpdate)
+: mCore(NULL),
+ mSurfaceWidth(surfaceWidth),
+ mSurfaceHeight(surfaceHeight),
+ mFrame(0u),
+ mDpi{horizontalDpi, verticalDpi},
mLastVSyncTime(0u),
mPartialUpdateEnabled(enablePartialUpdate)
{
- if( initialize )
+ if(initialize)
{
Initialize();
}
// We always need the first update!
mStatus.keepUpdating = Integration::KeepUpdating::STAGE_KEEP_RENDERING;
- mCore = Dali::Integration::Core::New( mRenderController,
- mPlatformAbstraction,
- mGlAbstraction,
- mGlSyncAbstraction,
- mGlContextHelperAbstraction,
- Integration::RenderToFrameBuffer::FALSE,
- Integration::DepthBufferAvailable::TRUE,
- Integration::StencilBufferAvailable::TRUE,
- mPartialUpdateEnabled ? Integration::PartialUpdateAvailable::TRUE : Integration::PartialUpdateAvailable::FALSE );
+ mCore = Dali::Integration::Core::New(mRenderController,
+ mPlatformAbstraction,
+ mGlAbstraction,
+ mGlSyncAbstraction,
+ mGlContextHelperAbstraction,
+ Integration::RenderToFrameBuffer::FALSE,
+ Integration::DepthBufferAvailable::TRUE,
+ Integration::StencilBufferAvailable::TRUE,
+ mPartialUpdateEnabled ? Integration::PartialUpdateAvailable::TRUE : Integration::PartialUpdateAvailable::FALSE);
mCore->ContextCreated();
Dali::Integration::Log::InstallLogFunction(logFunction);
Dali::Integration::Trace::LogContextFunction logContextFunction(&TestApplication::LogContext);
- Dali::Integration::Trace::InstallLogContextFunction( logContextFunction );
+ Dali::Integration::Trace::InstallLogContextFunction(logContextFunction);
- Dali::Integration::Trace::LogContext( true, "Test" );
+ Dali::Integration::Trace::LogContext(true, "Test");
}
void TestApplication::CreateScene()
{
- mScene = Dali::Integration::Scene::New( Size( static_cast<float>( mSurfaceWidth ), static_cast<float>( mSurfaceHeight ) ) );
- mScene.SetDpi( Vector2( static_cast<float>( mDpi.x ), static_cast<float>( mDpi.y ) ) );
+ mScene = Dali::Integration::Scene::New(Size(static_cast<float>(mSurfaceWidth), static_cast<float>(mSurfaceHeight)));
+ mScene.SetDpi(Vector2(static_cast<float>(mDpi.x), static_cast<float>(mDpi.y)));
}
void TestApplication::InitializeCore()
delete mCore;
}
-void TestApplication::LogContext( bool start, const char* tag )
+void TestApplication::LogContext(bool start, const char* tag)
{
- if( start )
+ if(start)
{
fprintf(stderr, "INFO: Trace Start: %s\n", tag);
}
void TestApplication::LogMessage(Dali::Integration::Log::DebugPriority level, std::string& message)
{
- if( mLoggingEnabled )
+ if(mLoggingEnabled)
{
switch(level)
{
mCore->ProcessEvents();
}
-void TestApplication::DoUpdate( uint32_t intervalMilliseconds, const char* location )
+void TestApplication::DoUpdate(uint32_t intervalMilliseconds, const char* location)
{
- if( GetUpdateStatus() == 0 &&
- mRenderStatus.NeedsUpdate() == false &&
- ! GetRenderController().WasCalled(TestRenderController::RequestUpdateFunc) )
+ if(GetUpdateStatus() == 0 &&
+ mRenderStatus.NeedsUpdate() == false &&
+ !GetRenderController().WasCalled(TestRenderController::RequestUpdateFunc))
{
- fprintf(stderr, "WARNING - Update not required :%s\n", location==NULL?"NULL":location);
+ fprintf(stderr, "WARNING - Update not required :%s\n", location == NULL ? "NULL" : location);
}
- uint32_t nextVSyncTime = mLastVSyncTime + intervalMilliseconds;
- float elapsedSeconds = static_cast<float>( intervalMilliseconds ) * 0.001f;
+ uint32_t nextVSyncTime = mLastVSyncTime + intervalMilliseconds;
+ float elapsedSeconds = static_cast<float>(intervalMilliseconds) * 0.001f;
- mCore->Update( elapsedSeconds, mLastVSyncTime, nextVSyncTime, mStatus, false, false );
+ mCore->Update(elapsedSeconds, mLastVSyncTime, nextVSyncTime, mStatus, false, false);
GetRenderController().Initialize();
mLastVSyncTime = nextVSyncTime;
}
-bool TestApplication::Render( uint32_t intervalMilliseconds, const char* location )
+bool TestApplication::Render(uint32_t intervalMilliseconds, const char* location)
{
- DoUpdate( intervalMilliseconds, location );
+ DoUpdate(intervalMilliseconds, location);
// Reset the status
- mRenderStatus.SetNeedsUpdate( false );
- mRenderStatus.SetNeedsPostRender( false );
+ mRenderStatus.SetNeedsUpdate(false);
+ mRenderStatus.SetNeedsPostRender(false);
- mCore->PreRender( mRenderStatus, false /*do not force clear*/, false /*do not skip rendering*/ );
- mCore->RenderScene( mRenderStatus, mScene, true /*render the off-screen buffers*/ );
- mCore->RenderScene( mRenderStatus, mScene, false /*render the surface*/ );
- mCore->PostRender( false /*do not skip rendering*/ );
+ mCore->PreRender(mRenderStatus, false /*do not force clear*/, false /*do not skip rendering*/);
+ mCore->RenderScene(mRenderStatus, mScene, true /*render the off-screen buffers*/);
+ mCore->RenderScene(mRenderStatus, mScene, false /*render the surface*/);
+ mCore->PostRender(false /*do not skip rendering*/);
mFrame++;
{
DoUpdate(intervalMilliseconds, location);
- mCore->PreRender(mRenderStatus, false /*do not force clear*/, false /*do not skip rendering*/ );
+ mCore->PreRender(mRenderStatus, false /*do not force clear*/, false /*do not skip rendering*/);
mCore->PreRender(mScene, damagedRects);
return mStatus.KeepUpdating() || mRenderStatus.NeedsUpdate();
return mStatus.KeepUpdating();
}
-bool TestApplication::UpdateOnly( uint32_t intervalMilliseconds )
+bool TestApplication::UpdateOnly(uint32_t intervalMilliseconds)
{
- DoUpdate( intervalMilliseconds );
+ DoUpdate(intervalMilliseconds);
return mStatus.KeepUpdating();
}
return mRenderStatus.NeedsPostRender();
}
-bool TestApplication::RenderOnly( )
+bool TestApplication::RenderOnly()
{
// Update Time values
- mCore->PreRender( mRenderStatus, false /*do not force clear*/, false /*do not skip rendering*/ );
- mCore->RenderScene( mRenderStatus, mScene, true /*render the off-screen buffers*/ );
- mCore->RenderScene( mRenderStatus, mScene, false /*render the surface*/ );
- mCore->PostRender( false /*do not skip rendering*/ );
+ mCore->PreRender(mRenderStatus, false /*do not force clear*/, false /*do not skip rendering*/);
+ mCore->RenderScene(mRenderStatus, mScene, true /*render the off-screen buffers*/);
+ mCore->RenderScene(mRenderStatus, mScene, false /*render the surface*/);
+ mCore->PostRender(false /*do not skip rendering*/);
mFrame++;
mCore->ContextCreated();
}
-uint32_t TestApplication::Wait( uint32_t durationToWait )
+uint32_t TestApplication::Wait(uint32_t durationToWait)
{
int time = 0;
- for(uint32_t i = 0; i <= ( durationToWait / RENDER_FRAME_INTERVAL); i++)
+ for(uint32_t i = 0; i <= (durationToWait / RENDER_FRAME_INTERVAL); i++)
{
SendNotification();
Render(RENDER_FRAME_INTERVAL);
return time;
}
-} // Namespace dali
+} // namespace Dali
*/
// INTERNAL INCLUDES
+#include <dali/integration-api/resource-policies.h>
+#include <dali/integration-api/scene.h>
+#include <dali/integration-api/trace.h>
+#include <dali/public-api/common/dali-common.h>
#include <test-platform-abstraction.h>
-#include "test-gl-sync-abstraction.h"
+
#include "test-gl-abstraction.h"
#include "test-gl-context-helper-abstraction.h"
+#include "test-gl-sync-abstraction.h"
#include "test-render-controller.h"
-#include <dali/public-api/common/dali-common.h>
-#include <dali/integration-api/resource-policies.h>
-#include <dali/integration-api/trace.h>
-#include <dali/integration-api/scene.h>
namespace Dali
{
-
class DALI_CORE_API TestApplication : public ConnectionTracker
{
public:
-
// Default values derived from H2 device.
- static const uint32_t DEFAULT_SURFACE_WIDTH = 480;
+ static const uint32_t DEFAULT_SURFACE_WIDTH = 480;
static const uint32_t DEFAULT_SURFACE_HEIGHT = 800;
static constexpr uint32_t DEFAULT_HORIZONTAL_DPI = 220;
static const uint32_t RENDER_FRAME_INTERVAL = 16;
- 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,
- bool initialize = true,
- bool enablePartialUpdate = false );
+ 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,
+ bool initialize = true,
+ bool enablePartialUpdate = false);
void Initialize();
void CreateCore();
void CreateScene();
void InitializeCore();
- virtual ~TestApplication();
- static void LogMessage( Dali::Integration::Log::DebugPriority level, std::string& message );
- static void LogContext( bool start, const char* tag );
- Dali::Integration::Core& GetCore();
- TestPlatformAbstraction& GetPlatform();
- TestRenderController& GetRenderController();
- TestGlAbstraction& GetGlAbstraction();
- TestGlSyncAbstraction& GetGlSyncAbstraction();
+ ~TestApplication() override;
+ static void LogMessage(Dali::Integration::Log::DebugPriority level, std::string& message);
+ static void LogContext(bool start, const char* tag);
+ Dali::Integration::Core& GetCore();
+ TestPlatformAbstraction& GetPlatform();
+ TestRenderController& GetRenderController();
+ TestGlAbstraction& GetGlAbstraction();
+ TestGlSyncAbstraction& GetGlSyncAbstraction();
TestGlContextHelperAbstraction& GetGlContextHelperAbstraction();
- void ProcessEvent(const Integration::Event& event);
- void SendNotification();
- bool Render( uint32_t intervalMilliseconds = DEFAULT_RENDER_INTERVAL, const char* location=NULL );
- bool PreRenderWithPartialUpdate(uint32_t intervalMilliseconds, const char* location, std::vector<Rect<int>>& damagedRects);
- bool RenderWithPartialUpdate(std::vector<Rect<int>>& damagedRects, Rect<int>& clippingRect);
- uint32_t GetUpdateStatus();
- bool UpdateOnly( uint32_t intervalMilliseconds = DEFAULT_RENDER_INTERVAL );
- bool RenderOnly( );
- void ResetContext();
- bool GetRenderNeedsUpdate();
- bool GetRenderNeedsPostRender();
- uint32_t Wait( uint32_t durationToWait );
- static void EnableLogging( bool enabled )
+ void ProcessEvent(const Integration::Event& event);
+ void SendNotification();
+ bool Render(uint32_t intervalMilliseconds = DEFAULT_RENDER_INTERVAL, const char* location = NULL);
+ bool PreRenderWithPartialUpdate(uint32_t intervalMilliseconds, const char* location, std::vector<Rect<int>>& damagedRects);
+ bool RenderWithPartialUpdate(std::vector<Rect<int>>& damagedRects, Rect<int>& clippingRect);
+ uint32_t GetUpdateStatus();
+ bool UpdateOnly(uint32_t intervalMilliseconds = DEFAULT_RENDER_INTERVAL);
+ bool RenderOnly();
+ void ResetContext();
+ bool GetRenderNeedsUpdate();
+ bool GetRenderNeedsPostRender();
+ uint32_t Wait(uint32_t durationToWait);
+ static void EnableLogging(bool enabled)
{
mLoggingEnabled = enabled;
}
}
private:
- void DoUpdate( uint32_t intervalMilliseconds, const char* location=NULL );
+ void DoUpdate(uint32_t intervalMilliseconds, const char* location = NULL);
protected:
- TestPlatformAbstraction mPlatformAbstraction;
- TestRenderController mRenderController;
- TestGlAbstraction mGlAbstraction;
- TestGlSyncAbstraction mGlSyncAbstraction;
+ TestPlatformAbstraction mPlatformAbstraction;
+ TestRenderController mRenderController;
+ TestGlAbstraction mGlAbstraction;
+ TestGlSyncAbstraction mGlSyncAbstraction;
TestGlContextHelperAbstraction mGlContextHelperAbstraction;
Integration::UpdateStatus mStatus;
Integration::RenderStatus mRenderStatus;
- Integration::Core* mCore;
+ Integration::Core* mCore;
Dali::Integration::Scene mScene;
uint32_t mSurfaceWidth;
uint32_t mSurfaceHeight;
uint32_t mFrame;
- struct { uint32_t x; uint32_t y; } mDpi;
- uint32_t mLastVSyncTime;
- bool mPartialUpdateEnabled;
+ struct
+ {
+ uint32_t x;
+ uint32_t y;
+ } mDpi;
+ uint32_t mLastVSyncTime;
+ bool mPartialUpdateEnabled;
static bool mLoggingEnabled;
};
-} // Dali
+} // namespace Dali
#endif // DALI_TEST_APPLICATION_H
#define DALI_TEST_COMPARE_TYPES_H
/*
- * Copyright (c) 2017 Samsung Electronics Co., Ltd.
+ * Copyright (c) 2020 Samsung Electronics Co., Ltd.
*
* Licensed under the Apache License, Version 2.0 (the "License");
* you may not use this file except in compliance with the License.
#include <dali/public-api/dali-core.h>
using namespace Dali;
-
-template <typename Type>
+template<typename Type>
inline bool CompareType(Type value1, Type value2, float epsilon)
{
return value1 == value2;
* @param[in] epsilon difference threshold
* @returns true if difference is smaller than epsilon threshold, false otherwise
*/
-template <>
+template<>
inline bool CompareType<float>(float value1, float value2, float epsilon)
{
return fabsf(value1 - value2) < epsilon;
* @param[in] epsilon difference threshold
* @returns true if difference is smaller than epsilon threshold, false otherwise
*/
-template <>
+template<>
inline bool CompareType<Vector2>(Vector2 vector1, Vector2 vector2, float epsilon)
{
- return fabsf(vector1.x - vector2.x)<epsilon && fabsf(vector1.y - vector2.y)<epsilon;
+ return fabsf(vector1.x - vector2.x) < epsilon && fabsf(vector1.y - vector2.y) < epsilon;
}
/**
* @param[in] epsilon difference threshold
* @returns true if difference is smaller than epsilon threshold, false otherwise
*/
-template <>
+template<>
inline bool CompareType<Vector3>(Vector3 vector1, Vector3 vector2, float epsilon)
{
- return fabsf(vector1.x - vector2.x)<epsilon &&
- fabsf(vector1.y - vector2.y)<epsilon &&
- fabsf(vector1.z - vector2.z)<epsilon;
+ return fabsf(vector1.x - vector2.x) < epsilon &&
+ fabsf(vector1.y - vector2.y) < epsilon &&
+ fabsf(vector1.z - vector2.z) < epsilon;
}
-
/**
* A helper for fuzzy-comparing Vector4 objects
* @param[in] vector1 the first object
* @param[in] epsilon difference threshold
* @returns true if difference is smaller than epsilon threshold, false otherwise
*/
-template <>
+template<>
inline bool CompareType<Vector4>(Vector4 vector1, Vector4 vector2, float epsilon)
{
- return fabsf(vector1.x - vector2.x)<epsilon &&
- fabsf(vector1.y - vector2.y)<epsilon &&
- fabsf(vector1.z - vector2.z)<epsilon &&
- fabsf(vector1.w - vector2.w)<epsilon;
+ return fabsf(vector1.x - vector2.x) < epsilon &&
+ fabsf(vector1.y - vector2.y) < epsilon &&
+ fabsf(vector1.z - vector2.z) < epsilon &&
+ fabsf(vector1.w - vector2.w) < epsilon;
}
-template <>
+template<>
inline bool CompareType<Quaternion>(Quaternion q1, Quaternion q2, float epsilon)
{
Quaternion q2N = -q2; // These quaternions represent the same rotation
return CompareType<Vector4>(q1.mVector, q2.mVector, epsilon) || CompareType<Vector4>(q1.mVector, q2N.mVector, epsilon);
}
-template <>
+template<>
inline bool CompareType<Radian>(Radian q1, Radian q2, float epsilon)
{
return CompareType<float>(q1.radian, q2.radian, epsilon);
}
-template <>
+template<>
inline bool CompareType<Degree>(Degree q1, Degree q2, float epsilon)
{
return CompareType<float>(q1.degree, q2.degree, epsilon);
}
-template <>
+template<>
inline bool CompareType<Extents>(Extents extents1, Extents extents2, float epsilon)
{
return (extents1.start == extents2.start) &&
(extents1.bottom == extents2.bottom);
}
-template <>
+template<>
inline bool CompareType<Property::Value>(Property::Value q1, Property::Value q2, float epsilon)
{
Property::Type type = q1.GetType();
- if( type != q2.GetType() )
+ if(type != q2.GetType())
{
return false;
}
bool a, b;
q1.Get(a);
q2.Get(b);
- result = a == b;
+ result = a == b;
break;
}
case Property::INTEGER:
int a, b;
q1.Get(a);
q2.Get(b);
- result = a == b;
+ result = a == b;
break;
}
case Property::FLOAT:
float a, b;
q1.Get(a);
q2.Get(b);
- result = CompareType<float>(a, b, epsilon);
+ result = CompareType<float>(a, b, epsilon);
break;
}
case Property::VECTOR2:
case Property::MAP:
{
//TODO: Implement this?
- DALI_ASSERT_ALWAYS( 0 && "Not implemented");
+ DALI_ASSERT_ALWAYS(0 && "Not implemented");
result = false;
break;
}
Extents a, b;
q1.Get(a);
q2.Get(b);
- result = CompareType<Extents>( a, b, epsilon );
+ result = CompareType<Extents>(a, b, epsilon);
break;
}
case Property::NONE:
return result;
}
-
-
#endif
/*
- * Copyright (c) 2019 Samsung Electronics Co., Ltd.
+ * Copyright (c) 2020 Samsung Electronics Co., Ltd.
*
* Licensed under the Apache License, Version 2.0 (the "License");
* you may not use this file except in compliance with the License.
namespace
{
-const uint32_t RENDER_FRAME_INTERVAL = 16; ///< Duration of each frame in ms. (at approx 60FPS)
+const uint32_t RENDER_FRAME_INTERVAL = 16; ///< Duration of each frame in ms. (at approx 60FPS)
-Integration::TouchEvent GenerateSingleTouch( PointState::Type state, const Vector2& screenPosition, uint32_t time )
+Integration::TouchEvent GenerateSingleTouch(PointState::Type state, const Vector2& screenPosition, uint32_t time)
{
Integration::TouchEvent touchEvent;
- Integration::Point point;
- point.SetState( state );
+ Integration::Point point;
+ point.SetState(state);
point.SetDeviceId(4);
- point.SetScreenPosition( screenPosition );
- point.SetDeviceClass( Device::Class::TOUCH );
- point.SetDeviceSubclass( Device::Subclass::NONE );
- touchEvent.points.push_back( point );
+ point.SetScreenPosition(screenPosition);
+ point.SetDeviceClass(Device::Class::TOUCH);
+ point.SetDeviceSubclass(Device::Subclass::NONE);
+ touchEvent.points.push_back(point);
touchEvent.time = time;
return touchEvent;
}
-Integration::TouchEvent GenerateDoubleTouch( PointState::Type stateA, const Vector2& screenPositionA, PointState::Type stateB, const Vector2& screenPositionB, uint32_t time )
+Integration::TouchEvent GenerateDoubleTouch(PointState::Type stateA, const Vector2& screenPositionA, PointState::Type stateB, const Vector2& screenPositionB, uint32_t time)
{
Integration::TouchEvent touchEvent;
- Integration::Point point;
- point.SetState( stateA );
+ Integration::Point point;
+ point.SetState(stateA);
point.SetDeviceId(4);
- point.SetScreenPosition( screenPositionA );
- point.SetDeviceClass( Device::Class::TOUCH );
- point.SetDeviceSubclass( Device::Subclass::NONE );
- touchEvent.points.push_back( point );
- point.SetScreenPosition( screenPositionB );
- point.SetState( stateB);
+ point.SetScreenPosition(screenPositionA);
+ point.SetDeviceClass(Device::Class::TOUCH);
+ point.SetDeviceSubclass(Device::Subclass::NONE);
+ touchEvent.points.push_back(point);
+ point.SetScreenPosition(screenPositionB);
+ point.SetState(stateB);
point.SetDeviceId(7);
- touchEvent.points.push_back( point );
+ touchEvent.points.push_back(point);
touchEvent.time = time;
return touchEvent;
}
return RENDER_FRAME_INTERVAL;
}
-void TestStartLongPress( TestApplication& application, float x, float y, uint32_t time )
+void TestStartLongPress(TestApplication& application, float x, float y, uint32_t time)
{
- application.ProcessEvent( GenerateSingleTouch( PointState::DOWN, Vector2( x, y ), time ) );
+ application.ProcessEvent(GenerateSingleTouch(PointState::DOWN, Vector2(x, y), time));
}
-void TestTriggerLongPress( TestApplication& application )
+void TestTriggerLongPress(TestApplication& application)
{
application.GetPlatform().TriggerTimer();
}
-void TestGenerateLongPress( TestApplication& application, float x, float y, uint32_t time )
+void TestGenerateLongPress(TestApplication& application, float x, float y, uint32_t time)
{
- TestStartLongPress( application, x, y, time );
- TestTriggerLongPress( application );
+ TestStartLongPress(application, x, y, time);
+ TestTriggerLongPress(application);
}
-void TestEndLongPress( TestApplication& application, float x, float y, uint32_t time )
+void TestEndLongPress(TestApplication& application, float x, float y, uint32_t time)
{
- application.ProcessEvent( GenerateSingleTouch( PointState::UP, Vector2( x, y ), time ) );
+ application.ProcessEvent(GenerateSingleTouch(PointState::UP, Vector2(x, y), time));
}
-void TestGeneratePinch( TestApplication& application)
+void TestGeneratePinch(TestApplication& application)
{
- application.ProcessEvent( GenerateDoubleTouch( PointState::DOWN, Vector2( 20.0f, 20.0f ), PointState::DOWN, Vector2( 20.0f, 90.0f ), 150 ) );
- application.ProcessEvent( GenerateDoubleTouch( PointState::MOTION, Vector2( 20.0f, 28.0f ), PointState::MOTION, Vector2( 20.0f, 82.0f ), 160 ) );
- application.ProcessEvent( GenerateDoubleTouch( PointState::MOTION, Vector2( 20.0f, 37.0f ), PointState::MOTION, Vector2( 20.0f, 74.0f ), 170 ) );
- application.ProcessEvent( GenerateDoubleTouch( PointState::MOTION, Vector2( 20.0f, 46.0f ), PointState::MOTION, Vector2( 20.0f, 66.0f ), 180 ) );
- application.ProcessEvent( GenerateDoubleTouch( PointState::MOTION, Vector2( 20.0f, 55.0f ), PointState::MOTION, Vector2( 20.0f, 58.0f ), 190 ) );
- application.ProcessEvent( GenerateDoubleTouch( PointState::UP, Vector2( 20.0f, 55.0f ), PointState::UP, Vector2( 20.0f, 58.0f ), 200 ) );
+ application.ProcessEvent(GenerateDoubleTouch(PointState::DOWN, Vector2(20.0f, 20.0f), PointState::DOWN, Vector2(20.0f, 90.0f), 150));
+ application.ProcessEvent(GenerateDoubleTouch(PointState::MOTION, Vector2(20.0f, 28.0f), PointState::MOTION, Vector2(20.0f, 82.0f), 160));
+ application.ProcessEvent(GenerateDoubleTouch(PointState::MOTION, Vector2(20.0f, 37.0f), PointState::MOTION, Vector2(20.0f, 74.0f), 170));
+ application.ProcessEvent(GenerateDoubleTouch(PointState::MOTION, Vector2(20.0f, 46.0f), PointState::MOTION, Vector2(20.0f, 66.0f), 180));
+ application.ProcessEvent(GenerateDoubleTouch(PointState::MOTION, Vector2(20.0f, 55.0f), PointState::MOTION, Vector2(20.0f, 58.0f), 190));
+ application.ProcessEvent(GenerateDoubleTouch(PointState::UP, Vector2(20.0f, 55.0f), PointState::UP, Vector2(20.0f, 58.0f), 200));
}
-void TestStartPinch( TestApplication& application, Vector2 a1, Vector2 b1, Vector2 a2, Vector2 b2, uint32_t time )
+void TestStartPinch(TestApplication& application, Vector2 a1, Vector2 b1, Vector2 a2, Vector2 b2, uint32_t time)
{
- application.ProcessEvent( GenerateDoubleTouch( PointState::DOWN, a1, PointState::DOWN, b1, time ) );
- application.ProcessEvent( GenerateDoubleTouch( PointState::MOTION, a2, PointState::MOTION, b2, time + 50 ) );
- application.ProcessEvent( GenerateDoubleTouch( PointState::MOTION, a2, PointState::MOTION, b2, time + 100 ) );
- application.ProcessEvent( GenerateDoubleTouch( PointState::MOTION, a2, PointState::MOTION, b2, time + 150 ) );
+ application.ProcessEvent(GenerateDoubleTouch(PointState::DOWN, a1, PointState::DOWN, b1, time));
+ application.ProcessEvent(GenerateDoubleTouch(PointState::MOTION, a2, PointState::MOTION, b2, time + 50));
+ application.ProcessEvent(GenerateDoubleTouch(PointState::MOTION, a2, PointState::MOTION, b2, time + 100));
+ application.ProcessEvent(GenerateDoubleTouch(PointState::MOTION, a2, PointState::MOTION, b2, time + 150));
}
-void TestContinuePinch( TestApplication& application, Vector2 a1, Vector2 b1, Vector2 a2, Vector2 b2, uint32_t time )
+void TestContinuePinch(TestApplication& application, Vector2 a1, Vector2 b1, Vector2 a2, Vector2 b2, uint32_t time)
{
- application.ProcessEvent( GenerateDoubleTouch( PointState::MOTION, a1, PointState::MOTION, b1, time ) );
- application.ProcessEvent( GenerateDoubleTouch( PointState::MOTION, a1, PointState::MOTION, b1, time + 50 ) );
- application.ProcessEvent( GenerateDoubleTouch( PointState::MOTION, a2, PointState::MOTION, b2, time + 100 ) );
- application.ProcessEvent( GenerateDoubleTouch( PointState::MOTION, a2, PointState::MOTION, b2, time +150 ) );
+ application.ProcessEvent(GenerateDoubleTouch(PointState::MOTION, a1, PointState::MOTION, b1, time));
+ application.ProcessEvent(GenerateDoubleTouch(PointState::MOTION, a1, PointState::MOTION, b1, time + 50));
+ application.ProcessEvent(GenerateDoubleTouch(PointState::MOTION, a2, PointState::MOTION, b2, time + 100));
+ application.ProcessEvent(GenerateDoubleTouch(PointState::MOTION, a2, PointState::MOTION, b2, time + 150));
}
-void TestEndPinch( TestApplication& application, Vector2 a1, Vector2 b1, Vector2 a2, Vector2 b2, uint32_t time )
+void TestEndPinch(TestApplication& application, Vector2 a1, Vector2 b1, Vector2 a2, Vector2 b2, uint32_t time)
{
- application.ProcessEvent( GenerateDoubleTouch( PointState::MOTION, a1, PointState::MOTION, b1, time ) );
- application.ProcessEvent( GenerateDoubleTouch( PointState::UP, a2, PointState::UP, b2, time +50 ) );
+ application.ProcessEvent(GenerateDoubleTouch(PointState::MOTION, a1, PointState::MOTION, b1, time));
+ application.ProcessEvent(GenerateDoubleTouch(PointState::UP, a2, PointState::UP, b2, time + 50));
}
-void TestGenerateMiniPan( TestApplication& application)
+void TestGenerateMiniPan(TestApplication& application)
{
- application.ProcessEvent( GenerateSingleTouch( PointState::DOWN, Vector2( 20.0f, 20.0f ), 250 ) );
- application.ProcessEvent( GenerateSingleTouch( PointState::MOTION, Vector2( 20.0f, 40.0f ), 251 ) );
- application.ProcessEvent( GenerateSingleTouch( PointState::UP, Vector2( 20.0f, 40.0f ), 255 ) );
+ application.ProcessEvent(GenerateSingleTouch(PointState::DOWN, Vector2(20.0f, 20.0f), 250));
+ application.ProcessEvent(GenerateSingleTouch(PointState::MOTION, Vector2(20.0f, 40.0f), 251));
+ application.ProcessEvent(GenerateSingleTouch(PointState::UP, Vector2(20.0f, 40.0f), 255));
}
-void TestStartPan( TestApplication& application, Vector2 start, Vector2 end, uint32_t& time )
+void TestStartPan(TestApplication& application, Vector2 start, Vector2 end, uint32_t& time)
{
- application.ProcessEvent( GenerateSingleTouch( PointState::DOWN, start, time ) );
+ application.ProcessEvent(GenerateSingleTouch(PointState::DOWN, start, time));
time += RENDER_FRAME_INTERVAL;
- application.ProcessEvent( GenerateSingleTouch( PointState::MOTION, end, time ) );
+ application.ProcessEvent(GenerateSingleTouch(PointState::MOTION, end, time));
time += RENDER_FRAME_INTERVAL;
- application.ProcessEvent( GenerateSingleTouch( PointState::MOTION, end, time ) );
+ application.ProcessEvent(GenerateSingleTouch(PointState::MOTION, end, time));
time += RENDER_FRAME_INTERVAL;
}
-void TestMovePan( TestApplication& application, Vector2 pos, uint32_t time )
+void TestMovePan(TestApplication& application, Vector2 pos, uint32_t time)
{
- application.ProcessEvent( GenerateSingleTouch( PointState::MOTION, pos, time ) );
+ application.ProcessEvent(GenerateSingleTouch(PointState::MOTION, pos, time));
}
-void TestEndPan( TestApplication& application, Vector2 pos, uint32_t time )
+void TestEndPan(TestApplication& application, Vector2 pos, uint32_t time)
{
- application.ProcessEvent( GenerateSingleTouch( PointState::UP, pos, time ) );
+ application.ProcessEvent(GenerateSingleTouch(PointState::UP, pos, time));
}
-void TestGenerateTap( TestApplication& application, float x, float y, uint32_t time_down )
+void TestGenerateTap(TestApplication& application, float x, float y, uint32_t time_down)
{
- application.ProcessEvent( GenerateSingleTouch( PointState::DOWN, Vector2( x, y ), time_down ) );
- application.ProcessEvent( GenerateSingleTouch( PointState::UP, Vector2( x, y ), time_down + 20 ) );
+ application.ProcessEvent(GenerateSingleTouch(PointState::DOWN, Vector2(x, y), time_down));
+ application.ProcessEvent(GenerateSingleTouch(PointState::UP, Vector2(x, y), time_down + 20));
}
-void TestGenerateTwoPointTap( TestApplication& application, float x1, float y1, float x2, float y2, uint32_t time_down )
+void TestGenerateTwoPointTap(TestApplication& application, float x1, float y1, float x2, float y2, uint32_t time_down)
{
- application.ProcessEvent( GenerateDoubleTouch( PointState::DOWN, Vector2( x1, y1 ), PointState::DOWN, Vector2( x2, y2 ), time_down ) );
- application.ProcessEvent( GenerateDoubleTouch( PointState::UP, Vector2( x1, y1 ), PointState::UP, Vector2( x2, y2 ), time_down + 20 ) );
+ application.ProcessEvent(GenerateDoubleTouch(PointState::DOWN, Vector2(x1, y1), PointState::DOWN, Vector2(x2, y2), time_down));
+ application.ProcessEvent(GenerateDoubleTouch(PointState::UP, Vector2(x1, y1), PointState::UP, Vector2(x2, y2), time_down + 20));
}
-void TestGenerateRotation( TestApplication& application )
+void TestGenerateRotation(TestApplication& application)
{
- application.ProcessEvent( GenerateDoubleTouch( PointState::DOWN, Vector2( 20.0f, 20.0f ), PointState::DOWN, Vector2( 20.0f, 90.0f ), 150 ) );
- application.ProcessEvent( GenerateDoubleTouch( PointState::MOTION, Vector2( 20.0f, 20.0f ), PointState::MOTION, Vector2( 25.0f, 95.0f ), 160 ) );
- application.ProcessEvent( GenerateDoubleTouch( PointState::MOTION, Vector2( 20.0f, 20.0f ), PointState::MOTION, Vector2( 30.0f, 100.0f ), 170 ) );
- application.ProcessEvent( GenerateDoubleTouch( PointState::MOTION, Vector2( 20.0f, 20.0f ), PointState::MOTION, Vector2( 35.0f, 105.0f ), 180 ) );
- application.ProcessEvent( GenerateDoubleTouch( PointState::MOTION, Vector2( 20.0f, 20.0f ), PointState::MOTION, Vector2( 40.0f, 110.0f ), 190 ) );
- application.ProcessEvent( GenerateDoubleTouch( PointState::UP, Vector2( 20.0f, 20.0f ), PointState::UP, Vector2( 45.0f, 115.0f ), 200 ) );
+ application.ProcessEvent(GenerateDoubleTouch(PointState::DOWN, Vector2(20.0f, 20.0f), PointState::DOWN, Vector2(20.0f, 90.0f), 150));
+ application.ProcessEvent(GenerateDoubleTouch(PointState::MOTION, Vector2(20.0f, 20.0f), PointState::MOTION, Vector2(25.0f, 95.0f), 160));
+ application.ProcessEvent(GenerateDoubleTouch(PointState::MOTION, Vector2(20.0f, 20.0f), PointState::MOTION, Vector2(30.0f, 100.0f), 170));
+ application.ProcessEvent(GenerateDoubleTouch(PointState::MOTION, Vector2(20.0f, 20.0f), PointState::MOTION, Vector2(35.0f, 105.0f), 180));
+ application.ProcessEvent(GenerateDoubleTouch(PointState::MOTION, Vector2(20.0f, 20.0f), PointState::MOTION, Vector2(40.0f, 110.0f), 190));
+ application.ProcessEvent(GenerateDoubleTouch(PointState::UP, Vector2(20.0f, 20.0f), PointState::UP, Vector2(45.0f, 115.0f), 200));
}
-void TestStartRotation( TestApplication& application, Vector2 a1, Vector2 b1, Vector2 a2, Vector2 b2, uint32_t time )
+void TestStartRotation(TestApplication& application, Vector2 a1, Vector2 b1, Vector2 a2, Vector2 b2, uint32_t time)
{
- application.ProcessEvent( GenerateDoubleTouch( PointState::DOWN, a1, PointState::DOWN, b1, time ) );
- application.ProcessEvent( GenerateDoubleTouch( PointState::MOTION, a2, PointState::MOTION, b2, time + 50 ) );
- application.ProcessEvent( GenerateDoubleTouch( PointState::MOTION, a2, PointState::MOTION, b2, time + 100 ) );
- application.ProcessEvent( GenerateDoubleTouch( PointState::MOTION, a2, PointState::MOTION, b2, time + 150 ) );
+ application.ProcessEvent(GenerateDoubleTouch(PointState::DOWN, a1, PointState::DOWN, b1, time));
+ application.ProcessEvent(GenerateDoubleTouch(PointState::MOTION, a2, PointState::MOTION, b2, time + 50));
+ application.ProcessEvent(GenerateDoubleTouch(PointState::MOTION, a2, PointState::MOTION, b2, time + 100));
+ application.ProcessEvent(GenerateDoubleTouch(PointState::MOTION, a2, PointState::MOTION, b2, time + 150));
}
-void TestContinueRotation( TestApplication& application, Vector2 a1, Vector2 b1, Vector2 a2, Vector2 b2, uint32_t time )
+void TestContinueRotation(TestApplication& application, Vector2 a1, Vector2 b1, Vector2 a2, Vector2 b2, uint32_t time)
{
- application.ProcessEvent( GenerateDoubleTouch( PointState::MOTION, a1, PointState::MOTION, b1, time ) );
- application.ProcessEvent( GenerateDoubleTouch( PointState::MOTION, a1, PointState::MOTION, b1, time + 50 ) );
- application.ProcessEvent( GenerateDoubleTouch( PointState::MOTION, a2, PointState::MOTION, b2, time + 100 ) );
- application.ProcessEvent( GenerateDoubleTouch( PointState::MOTION, a2, PointState::MOTION, b2, time +150 ) );
+ application.ProcessEvent(GenerateDoubleTouch(PointState::MOTION, a1, PointState::MOTION, b1, time));
+ application.ProcessEvent(GenerateDoubleTouch(PointState::MOTION, a1, PointState::MOTION, b1, time + 50));
+ application.ProcessEvent(GenerateDoubleTouch(PointState::MOTION, a2, PointState::MOTION, b2, time + 100));
+ application.ProcessEvent(GenerateDoubleTouch(PointState::MOTION, a2, PointState::MOTION, b2, time + 150));
}
-void TestEndRotation( TestApplication& application, Vector2 a1, Vector2 b1, Vector2 a2, Vector2 b2, uint32_t time )
+void TestEndRotation(TestApplication& application, Vector2 a1, Vector2 b1, Vector2 a2, Vector2 b2, uint32_t time)
{
- application.ProcessEvent( GenerateDoubleTouch( PointState::MOTION, a1, PointState::MOTION, b1, time ) );
- application.ProcessEvent( GenerateDoubleTouch( PointState::UP, a2, PointState::UP, b2, time +50 ) );
+ application.ProcessEvent(GenerateDoubleTouch(PointState::MOTION, a1, PointState::MOTION, b1, time));
+ application.ProcessEvent(GenerateDoubleTouch(PointState::UP, a2, PointState::UP, b2, time + 50));
}
} // namespace Dali
#define DALI_TEST_GESTURE_GENERATOR_H
/*
- * Copyright (c) 2019 Samsung Electronics Co., Ltd.
+ * Copyright (c) 2020 Samsung Electronics Co., Ltd.
*
* Licensed under the Apache License, Version 2.0 (the "License");
* you may not use this file except in compliance with the License.
/**
* Produces the initial touch of a long press
*/
-void TestStartLongPress( TestApplication& application, float x = 20.0f, float y = 20.0f, uint32_t time = 450 );
+void TestStartLongPress(TestApplication& application, float x = 20.0f, float y = 20.0f, uint32_t time = 450);
/**
* Triggers the timer to begin a long press gesture
*/
-void TestTriggerLongPress( TestApplication& application );
+void TestTriggerLongPress(TestApplication& application);
/**
* Produces the initial press and triggers the timer to begin a long press gesture
*/
-void TestGenerateLongPress( TestApplication& application, float x = 20.0f, float y = 20.0f, uint32_t time = 450 );
+void TestGenerateLongPress(TestApplication& application, float x = 20.0f, float y = 20.0f, uint32_t time = 450);
/**
* End a long press by lifting the touch
*/
-void TestEndLongPress( TestApplication& application, float x = 20.0f, float y = 20.0f, uint32_t time = 450 );
+void TestEndLongPress(TestApplication& application, float x = 20.0f, float y = 20.0f, uint32_t time = 450);
/**
* Produces a vertical pinch gesture between (20,20) and (20,90)
*/
-void TestGeneratePinch( TestApplication& application );
+void TestGeneratePinch(TestApplication& application);
/**
* Produces the gesture started event of a pinch, using 4 touches, 50ms apart, starting with 1, ending at 2
*/
-void TestStartPinch( TestApplication& application, Vector2 a1, Vector2 b1, Vector2 a2, Vector2 b2, uint32_t time );
+void TestStartPinch(TestApplication& application, Vector2 a1, Vector2 b1, Vector2 a2, Vector2 b2, uint32_t time);
/**
* Produces a gesture continuing event of a pinch, using 4 touches, 50ms apart, starting with 1, ending at 2
*/
-void TestContinuePinch( TestApplication& application, Vector2 a1, Vector2 b1, Vector2 a2, Vector2 b2, uint32_t time );
+void TestContinuePinch(TestApplication& application, Vector2 a1, Vector2 b1, Vector2 a2, Vector2 b2, uint32_t time);
/**
* Produces a gesture finished event of a pinch, using 2 touches, 50ms apart
*/
-void TestEndPinch( TestApplication& application, Vector2 a1, Vector2 b1, Vector2 a2, Vector2 b2, uint32_t time );
+void TestEndPinch(TestApplication& application, Vector2 a1, Vector2 b1, Vector2 a2, Vector2 b2, uint32_t time);
/**
* Produces a pan gesture from (20,20) to (20,40)
*/
-void TestGenerateMiniPan( TestApplication& application );
+void TestGenerateMiniPan(TestApplication& application);
/**
* Produces the start event of a pan gesture, assuming minimum distance moved between start and end is greater than 15
* in either direction or 11 in both (x&y). Time will be incremented using the standard frame interval per touch movement
*/
-void TestStartPan( TestApplication& application, Vector2 start, Vector2 end, uint32_t& time );
+void TestStartPan(TestApplication& application, Vector2 start, Vector2 end, uint32_t& time);
/**
* Continues a pan event by creating a single touch at pos.
* N.B This does not increment the time
*/
-void TestMovePan( TestApplication& application, Vector2 pos, uint32_t time = 400);
+void TestMovePan(TestApplication& application, Vector2 pos, uint32_t time = 400);
/**
* End a pan gesture at position pos
*/
-void TestEndPan( TestApplication& application, Vector2 pos, uint32_t time = 500);
+void TestEndPan(TestApplication& application, Vector2 pos, uint32_t time = 500);
/**
* Produces a single point tap gesture with a 20ms interval
*/
-void TestGenerateTap( TestApplication& application, float x = 20.0f, float y = 20.0f, uint32_t time_down = 100 );
+void TestGenerateTap(TestApplication& application, float x = 20.0f, float y = 20.0f, uint32_t time_down = 100);
/**
* Produce a tap gesture with two touch points and a 20ms interval
*/
-void TestGenerateTwoPointTap( TestApplication& application, float x1, float y1, float x2, float y2, uint32_t time_down );
+void TestGenerateTwoPointTap(TestApplication& application, float x1, float y1, float x2, float y2, uint32_t time_down);
/**
* Produces a rotation gesture.
*/
-void TestGenerateRotation( TestApplication& application );
+void TestGenerateRotation(TestApplication& application);
/**
* Produces the gesture started event of a rotation, using 4 touches, 50ms apart, starting with 1, ending at 2
*/
-void TestStartRotation( TestApplication& application, Vector2 a1, Vector2 b1, Vector2 a2, Vector2 b2, uint32_t time );
+void TestStartRotation(TestApplication& application, Vector2 a1, Vector2 b1, Vector2 a2, Vector2 b2, uint32_t time);
/**
* Produces a gesture continuing event of a rotation, using 4 touches, 50ms apart, starting with 1, ending at 2
*/
-void TestContinueRotation( TestApplication& application, Vector2 a1, Vector2 b1, Vector2 a2, Vector2 b2, uint32_t time );
+void TestContinueRotation(TestApplication& application, Vector2 a1, Vector2 b1, Vector2 a2, Vector2 b2, uint32_t time);
/**
* Produces a gesture finished event of a rotation, using 2 touches, 50ms apart
*/
-void TestEndRotation( TestApplication& application, Vector2 a1, Vector2 b1, Vector2 a2, Vector2 b2, uint32_t time );
+void TestEndRotation(TestApplication& application, Vector2 a1, Vector2 b1, Vector2 a2, Vector2 b2, uint32_t time);
} // namespace Dali
/*
- * Copyright (c) 2019 Samsung Electronics Co., Ltd.
+ * Copyright (c) 2020 Samsung Electronics Co., Ltd.
*
* Licensed under the Apache License, Version 2.0 (the "License");
* you may not use this file except in compliance with the License.
namespace Dali
{
-
TestGlAbstraction::TestGlAbstraction()
{
Initialize();
}
-TestGlAbstraction::~TestGlAbstraction() {}
+TestGlAbstraction::~TestGlAbstraction()
+{
+}
void TestGlAbstraction::Initialize()
{
- mCurrentProgram = 0;
- mCompileStatus = GL_TRUE;
- mLinkStatus = GL_TRUE;
- mNumberOfActiveUniforms = 0;
- mGetAttribLocationResult = 0;
- mGetErrorResult = 0;
- mGetStringResult = NULL;
- mIsBufferResult = 0;
- mIsEnabledResult = 0;
- mIsFramebufferResult = 0;
- mIsProgramResult = 0;
- mIsRenderbufferResult = 0;
- mIsShaderResult = 0;
- mIsTextureResult = 0;
- mActiveTextureUnit = 0;
- mCheckFramebufferStatusResult = 0;
- mFramebufferStatus = 0;
- mFramebufferDepthAttached = 0;
- mFramebufferStencilAttached = 0;
+ mCurrentProgram = 0;
+ mCompileStatus = GL_TRUE;
+ mLinkStatus = GL_TRUE;
+ mNumberOfActiveUniforms = 0;
+ mGetAttribLocationResult = 0;
+ mGetErrorResult = 0;
+ mGetStringResult = NULL;
+ mIsBufferResult = 0;
+ mIsEnabledResult = 0;
+ mIsFramebufferResult = 0;
+ mIsProgramResult = 0;
+ mIsRenderbufferResult = 0;
+ mIsShaderResult = 0;
+ mIsTextureResult = 0;
+ mActiveTextureUnit = 0;
+ mCheckFramebufferStatusResult = 0;
+ mFramebufferStatus = 0;
+ mFramebufferDepthAttached = 0;
+ mFramebufferStencilAttached = 0;
mFramebufferColorAttachmentCount = 0;
- mFrameBufferColorStatus = 0;
- mNumBinaryFormats = 0;
- mBinaryFormats = 0;
- mProgramBinaryLength = 0;
+ mFrameBufferColorStatus = 0;
+ mNumBinaryFormats = 0;
+ mBinaryFormats = 0;
+ mProgramBinaryLength = 0;
mVertexAttribArrayChanged = false;
- mGetProgramBinaryCalled = false;
+ mGetProgramBinaryCalled = false;
mLastShaderCompiled = 0;
- mLastClearBitMask = 0;
- mLastClearColor = Color::TRANSPARENT;
- mClearCount = 0;
+ mLastClearBitMask = 0;
+ mLastClearColor = Color::TRANSPARENT;
+ mClearCount = 0;
mLastBlendEquationRgb = 0;
mLastBlendEquationAlpha = 0;
mLastBlendFuncDstRgb = 0;
mLastBlendFuncSrcAlpha = 0;
mLastBlendFuncDstAlpha = 0;
- mLastAutoTextureIdUsed = 0;
- mNumGeneratedTextures = 0;
- mLastShaderIdUsed = 0;
- mLastProgramIdUsed = 0;
- mLastUniformIdUsed = 0;
- mLastDepthMask = false;
+ mLastAutoTextureIdUsed = 0;
+ mNumGeneratedTextures = 0;
+ mLastShaderIdUsed = 0;
+ mLastProgramIdUsed = 0;
+ mLastUniformIdUsed = 0;
+ mLastDepthMask = false;
mUniforms.clear();
mProgramUniforms1i.clear();
mTexParamaterTrace.Reset();
mDrawTrace.Reset();
- for( unsigned int i=0; i<MAX_ATTRIBUTE_CACHE_SIZE; ++i )
+ for(unsigned int i = 0; i < MAX_ATTRIBUTE_CACHE_SIZE; ++i)
{
mVertexAttribArrayState[i] = false;
}
return true;
}
-bool TestGlAbstraction::TextureRequiresConverting( const GLenum imageGlFormat, const GLenum textureGlFormat, const bool isSubImage ) const
+bool TestGlAbstraction::TextureRequiresConverting(const GLenum imageGlFormat, const GLenum textureGlFormat, const bool isSubImage) const
{
- return ( ( imageGlFormat == GL_RGB ) && ( textureGlFormat == GL_RGBA ) );
+ return ((imageGlFormat == GL_RGB) && (textureGlFormat == GL_RGBA));
}
-} // Namespace dali
+} // namespace Dali
bool BlendEnabled(const Dali::TraceCallStack& callStack)
{
std::stringstream out;
out << GL_BLEND;
- bool blendEnabled = callStack.FindMethodAndParams( "Enable", out.str() );
+ bool blendEnabled = callStack.FindMethodAndParams("Enable", out.str());
return blendEnabled;
}
{
std::stringstream out;
out << GL_BLEND;
- bool blendEnabled = callStack.FindMethodAndParams( "Disable", out.str() );
+ bool blendEnabled = callStack.FindMethodAndParams("Disable", out.str());
return blendEnabled;
}
-
*/
// EXTERNAL INCLUDES
-#include <sstream>
-#include <string>
-#include <cstring>
-#include <map>
#include <cstdio>
+#include <cstring>
#include <cstring> // for strcmp
+#include <map>
+#include <sstream>
+#include <string>
#include <typeinfo>
// INTERNAL INCLUDES
-#include <dali/public-api/dali-core.h>
#include <dali/devel-api/rendering/frame-buffer-devel.h>
#include <dali/integration-api/core.h>
#include <dali/integration-api/gl-abstraction.h>
#include <dali/integration-api/gl-defines.h>
-#include <test-trace-call-stack.h>
+#include <dali/public-api/dali-core.h>
#include <test-compare-types.h>
+#include <test-trace-call-stack.h>
namespace Dali
{
-
static const unsigned int MAX_ATTRIBUTE_CACHE_SIZE = 64;
-static const char *mStdAttribs[MAX_ATTRIBUTE_CACHE_SIZE] =
-{
+static const char* mStdAttribs[MAX_ATTRIBUTE_CACHE_SIZE] =
+ {
"aPosition", // ATTRIB_POSITION
"aNormal", // ATTRIB_NORMAL
"aTexCoord", // ATTRIB_TEXCOORD
"aBoneIndices" // ATTRIB_BONE_INDICES
};
-class DALI_CORE_API TestGlAbstraction: public Dali::Integration::GlAbstraction
+class DALI_CORE_API TestGlAbstraction : public Dali::Integration::GlAbstraction
{
public:
TestGlAbstraction();
- ~TestGlAbstraction();
+ ~TestGlAbstraction() override;
void Initialize();
- void PreRender();
- void PostRender();
+ void PreRender() override;
+ void PostRender() override;
- bool IsSurfacelessContextSupported() const;
+ bool IsSurfacelessContextSupported() const override;
- bool TextureRequiresConverting( const GLenum imageGlFormat, const GLenum textureGlFormat, const bool isSubImage ) const;
+ bool TextureRequiresConverting(const GLenum imageGlFormat, const GLenum textureGlFormat, const bool isSubImage) const override;
/* OpenGL ES 2.0 */
- inline void ActiveTexture( GLenum textureUnit )
+ inline void ActiveTexture(GLenum textureUnit) override
{
mActiveTextureUnit = textureUnit - GL_TEXTURE0;
}
return mActiveTextureUnit + GL_TEXTURE0;
}
- inline void AttachShader( GLuint program, GLuint shader )
+ inline void AttachShader(GLuint program, GLuint shader) override
{
std::stringstream out;
out << program << ", " << shader;
TraceCallStack::NamedParams namedParams;
namedParams["program"] = ToString(program);
- namedParams["shader"] = ToString(shader);
+ namedParams["shader"] = ToString(shader);
mShaderTrace.PushCall("AttachShader", out.str(), namedParams);
}
- inline void BindAttribLocation( GLuint program, GLuint index, const char* name )
+ inline void BindAttribLocation(GLuint program, GLuint index, const char* name) override
{
}
- inline void BindBuffer( GLenum target, GLuint buffer )
+ inline void BindBuffer(GLenum target, GLuint buffer) override
{
}
- inline void BindFramebuffer( GLenum target, GLuint framebuffer )
+ inline void BindFramebuffer(GLenum target, GLuint framebuffer) override
{
//Add 010 bit;
mFramebufferStatus |= 2;
}
- inline void BindRenderbuffer( GLenum target, GLuint renderbuffer )
+ inline void BindRenderbuffer(GLenum target, GLuint renderbuffer) override
{
}
* @param[in] activeTextureUnit The specific active texture unit.
* @return A vector containing the IDs that were bound.
*/
- inline const std::vector<GLuint>& GetBoundTextures( GLuint activeTextureUnit ) const
+ inline const std::vector<GLuint>& GetBoundTextures(GLuint activeTextureUnit) const
{
- return mActiveTextures[ activeTextureUnit - GL_TEXTURE0 ].mBoundTextures;
+ return mActiveTextures[activeTextureUnit - GL_TEXTURE0].mBoundTextures;
}
/**
{
mBoundTextures.clear();
- for( unsigned int i=0; i<MIN_TEXTURE_UNIT_LIMIT; ++i )
+ for(unsigned int i = 0; i < MIN_TEXTURE_UNIT_LIMIT; ++i)
{
- mActiveTextures[ i ].mBoundTextures.clear();
+ mActiveTextures[i].mBoundTextures.clear();
}
}
- inline void BindTexture( GLenum target, GLuint texture )
+ inline void BindTexture(GLenum target, GLuint texture) override
{
// Record the bound textures for future checks
- if( texture )
+ if(texture)
{
- mBoundTextures.push_back( texture );
+ mBoundTextures.push_back(texture);
- if( mActiveTextureUnit < MIN_TEXTURE_UNIT_LIMIT )
+ if(mActiveTextureUnit < MIN_TEXTURE_UNIT_LIMIT)
{
- mActiveTextures[ mActiveTextureUnit ].mBoundTextures.push_back( texture );
+ mActiveTextures[mActiveTextureUnit].mBoundTextures.push_back(texture);
}
}
out << target << ", " << texture;
TraceCallStack::NamedParams namedParams;
- namedParams["target"] = ToString(target);
+ namedParams["target"] = ToString(target);
namedParams["texture"] = ToString(texture);
mTextureTrace.PushCall("BindTexture", out.str(), namedParams);
}
- inline void BlendColor(GLclampf red, GLclampf green, GLclampf blue, GLclampf alpha)
+ inline void BlendColor(GLclampf red, GLclampf green, GLclampf blue, GLclampf alpha) override
{
mLastBlendColor.r = red;
mLastBlendColor.g = green;
return mLastBlendColor;
}
- inline void BlendEquation( GLenum mode )
+ inline void BlendEquation(GLenum mode) override
{
mLastBlendEquationRgb = mode;
mLastBlendEquationAlpha = mode;
}
- inline void BlendEquationSeparate( GLenum modeRgb, GLenum modeAlpha )
+ inline void BlendEquationSeparate(GLenum modeRgb, GLenum modeAlpha) override
{
mLastBlendEquationRgb = modeRgb;
mLastBlendEquationAlpha = modeAlpha;
return mLastBlendEquationAlpha;
}
- inline void BlendFunc(GLenum sfactor, GLenum dfactor)
+ inline void BlendFunc(GLenum sfactor, GLenum dfactor) override
{
- mLastBlendFuncSrcRgb = sfactor;
- mLastBlendFuncDstRgb = dfactor;
+ mLastBlendFuncSrcRgb = sfactor;
+ mLastBlendFuncDstRgb = dfactor;
mLastBlendFuncSrcAlpha = sfactor;
mLastBlendFuncDstAlpha = dfactor;
}
- inline void BlendFuncSeparate(GLenum srcRGB, GLenum dstRGB, GLenum srcAlpha, GLenum dstAlpha)
+ inline void BlendFuncSeparate(GLenum srcRGB, GLenum dstRGB, GLenum srcAlpha, GLenum dstAlpha) override
{
- mLastBlendFuncSrcRgb = srcRGB;
- mLastBlendFuncDstRgb = dstRGB;
+ mLastBlendFuncSrcRgb = srcRGB;
+ mLastBlendFuncDstRgb = dstRGB;
mLastBlendFuncSrcAlpha = srcAlpha;
mLastBlendFuncDstAlpha = dstAlpha;
}
return mLastBlendFuncDstAlpha;
}
- inline void BufferData(GLenum target, GLsizeiptr size, const void* data, GLenum usage)
+ inline void BufferData(GLenum target, GLsizeiptr size, const void* data, GLenum usage) override
{
- mBufferDataCalls.push_back(size);
+ mBufferDataCalls.push_back(size);
}
- inline void BufferSubData(GLenum target, GLintptr offset, GLsizeiptr size, const void* data)
+ inline void BufferSubData(GLenum target, GLintptr offset, GLsizeiptr size, const void* data) override
{
- mBufferSubDataCalls.push_back(size);
+ mBufferSubDataCalls.push_back(size);
}
- inline GLenum CheckFramebufferStatus(GLenum target)
+ inline GLenum CheckFramebufferStatus(GLenum target) override
{
//If it has the three last bits set to 1 - 111, then the three minimum functions to create a
//Framebuffer texture have been called
- if( mFramebufferStatus == 7 )
+ if(mFramebufferStatus == 7)
{
return GL_FRAMEBUFFER_COMPLETE;
}
return mFramebufferStencilAttached;
}
- inline void Clear(GLbitfield mask)
+ inline void Clear(GLbitfield mask) override
{
mClearCount++;
mLastClearBitMask = mask;
}
- inline void ClearColor(GLclampf red, GLclampf green, GLclampf blue, GLclampf alpha)
+ inline void ClearColor(GLclampf red, GLclampf green, GLclampf blue, GLclampf alpha) override
{
mLastClearColor.r = red;
mLastClearColor.g = green;
return mLastClearColor;
}
- inline void ClearDepthf(GLclampf depth)
+ inline void ClearDepthf(GLclampf depth) override
{
}
- inline void ClearStencil(GLint s)
+ inline void ClearStencil(GLint s) override
{
std::stringstream out;
out << s;
TraceCallStack::NamedParams namedParams;
- namedParams["s"] = ToString( s );
+ namedParams["s"] = ToString(s);
- mStencilFunctionTrace.PushCall( "ClearStencil", out.str(), namedParams );
+ mStencilFunctionTrace.PushCall("ClearStencil", out.str(), namedParams);
}
- inline void ColorMask(GLboolean red, GLboolean green, GLboolean blue, GLboolean alpha)
+ inline void ColorMask(GLboolean red, GLboolean green, GLboolean blue, GLboolean alpha) override
{
- mColorMaskParams.red = red;
+ mColorMaskParams.red = red;
mColorMaskParams.green = green;
- mColorMaskParams.blue = blue;
+ mColorMaskParams.blue = blue;
mColorMaskParams.alpha = alpha;
}
- inline void CompileShader(GLuint shader)
+ inline void CompileShader(GLuint shader) override
{
std::stringstream out;
out << shader;
mShaderTrace.PushCall("CompileShader", out.str(), namedParams);
}
- inline void CompressedTexImage2D(GLenum target, GLint level, GLenum internalformat, GLsizei width, GLsizei height, GLint border, GLsizei imageSize, const void* data)
+ inline void CompressedTexImage2D(GLenum target, GLint level, GLenum internalformat, GLsizei width, GLsizei height, GLint border, GLsizei imageSize, const void* data) override
{
std::stringstream out;
- out << target<<", "<<level<<", "<<width << ", " << height;
+ out << target << ", " << level << ", " << width << ", " << height;
TraceCallStack::NamedParams namedParams;
- namedParams["target"] = ToString(target);
- namedParams["level"] = ToString(level);
+ namedParams["target"] = ToString(target);
+ namedParams["level"] = ToString(level);
namedParams["internalformat"] = ToString(internalformat);
- namedParams["width"] = ToString(width);
- namedParams["height"] = ToString(height);
- namedParams["border"] = ToString(border);
- namedParams["size"] = ToString(imageSize);
+ namedParams["width"] = ToString(width);
+ namedParams["height"] = ToString(height);
+ namedParams["border"] = ToString(border);
+ namedParams["size"] = ToString(imageSize);
mTextureTrace.PushCall("CompressedTexImage2D", out.str(), namedParams);
}
- inline void CompressedTexSubImage2D(GLenum target, GLint level, GLint xoffset, GLint yoffset, GLsizei width, GLsizei height, GLenum format, GLsizei imageSize, const void* data)
+ inline void CompressedTexSubImage2D(GLenum target, GLint level, GLint xoffset, GLint yoffset, GLsizei width, GLsizei height, GLenum format, GLsizei imageSize, const void* data) override
{
std::stringstream out;
- out << target << ", "<<level <<", " << xoffset << ", " << yoffset << ", " << width << ", " << height;
+ out << target << ", " << level << ", " << xoffset << ", " << yoffset << ", " << width << ", " << height;
TraceCallStack::NamedParams namedParams;
- namedParams["target"] = ToString(target);
- namedParams["level"] = ToString(level);
+ namedParams["target"] = ToString(target);
+ namedParams["level"] = ToString(level);
namedParams["xoffset"] = ToString(xoffset);
namedParams["yoffset"] = ToString(yoffset);
- namedParams["width"] = ToString(width);
- namedParams["height"] = ToString(height);
+ namedParams["width"] = ToString(width);
+ namedParams["height"] = ToString(height);
mTextureTrace.PushCall("CompressedTexSubImage2D", out.str(), namedParams);
}
- inline void CopyTexImage2D(GLenum target, GLint level, GLenum internalformat, GLint x, GLint y, GLsizei width, GLsizei height, GLint border)
+ inline void CopyTexImage2D(GLenum target, GLint level, GLenum internalformat, GLint x, GLint y, GLsizei width, GLsizei height, GLint border) override
{
}
- inline void CopyTexSubImage2D(GLenum target, GLint level, GLint xoffset, GLint yoffset, GLint x, GLint y, GLsizei width, GLsizei height)
+ inline void CopyTexSubImage2D(GLenum target, GLint level, GLint xoffset, GLint yoffset, GLint x, GLint y, GLsizei width, GLsizei height) override
{
}
- inline GLuint CreateProgram(void)
+ inline GLuint CreateProgram(void) override
{
mShaderTrace.PushCall("CreateProgram", "");
return mLastProgramIdUsed;
}
- inline GLuint CreateShader(GLenum type)
+ inline GLuint CreateShader(GLenum type) override
{
std::stringstream out;
out << type;
return ++mLastShaderIdUsed;
}
- inline void CullFace(GLenum mode)
+ inline void CullFace(GLenum mode) override
{
std::stringstream out;
out << mode;
mCullFaceTrace.PushCall("CullFace", out.str(), namedParams);
}
- inline void DeleteBuffers(GLsizei n, const GLuint* buffers)
+ inline void DeleteBuffers(GLsizei n, const GLuint* buffers) override
{
}
- inline void DeleteFramebuffers(GLsizei n, const GLuint* framebuffers)
+ inline void DeleteFramebuffers(GLsizei n, const GLuint* framebuffers) override
{
}
- inline void DeleteProgram(GLuint program)
+ inline void DeleteProgram(GLuint program) override
{
std::stringstream out;
out << program;
mShaderTrace.PushCall("DeleteProgram", out.str(), namedParams);
}
- inline void DeleteRenderbuffers(GLsizei n, const GLuint* renderbuffers)
+ inline void DeleteRenderbuffers(GLsizei n, const GLuint* renderbuffers) override
{
}
- inline void DeleteShader(GLuint shader)
+ inline void DeleteShader(GLuint shader) override
{
std::stringstream out;
out << shader;
mShaderTrace.PushCall("DeleteShader", out.str(), namedParams);
}
- inline void DeleteTextures(GLsizei n, const GLuint* textures)
+ inline void DeleteTextures(GLsizei n, const GLuint* textures) override
{
std::stringstream out;
out << n << ", " << textures << " = [";
TraceCallStack::NamedParams namedParams;
- for(GLsizei i=0; i<n; i++)
+ for(GLsizei i = 0; i < n; i++)
{
out << textures[i] << ", ";
std::stringstream paramName;
- paramName<<"texture["<<i<<"]";
+ paramName << "texture[" << i << "]";
namedParams[paramName.str()] = ToString(textures[i]);
mDeletedTextureIds.push_back(textures[i]);
mNumGeneratedTextures--;
return mDeletedTextureIds.size() == 0;
}
- inline bool CheckTextureDeleted( GLuint textureId )
+ inline bool CheckTextureDeleted(GLuint textureId)
{
bool found = false;
- for(std::vector<GLuint>::iterator iter=mDeletedTextureIds.begin(); iter != mDeletedTextureIds.end(); ++iter)
+ for(std::vector<GLuint>::iterator iter = mDeletedTextureIds.begin(); iter != mDeletedTextureIds.end(); ++iter)
{
if(*iter == textureId)
{
mDeletedTextureIds.clear();
}
- inline void DepthFunc(GLenum func)
+ inline void DepthFunc(GLenum func) override
{
std::stringstream out;
out << func;
mDepthFunctionTrace.PushCall("DepthFunc", out.str(), namedParams);
}
- inline void DepthMask(GLboolean flag)
+ inline void DepthMask(GLboolean flag) override
{
mLastDepthMask = flag;
}
return mLastDepthMask;
}
- inline void DepthRangef(GLclampf zNear, GLclampf zFar)
+ inline void DepthRangef(GLclampf zNear, GLclampf zFar) override
{
}
- inline void DetachShader(GLuint program, GLuint shader)
+ inline void DetachShader(GLuint program, GLuint shader) override
{
std::stringstream out;
out << program << ", " << shader;
TraceCallStack::NamedParams namedParams;
namedParams["program"] = ToString(program);
- namedParams["shader"] = ToString(shader);
+ namedParams["shader"] = ToString(shader);
mShaderTrace.PushCall("DetachShader", out.str(), namedParams);
}
- inline void Disable(GLenum cap)
+ inline void Disable(GLenum cap) override
{
std::stringstream out;
out << cap;
mEnableDisableTrace.PushCall("Disable", out.str(), namedParams);
}
- inline void DisableVertexAttribArray(GLuint index)
+ inline void DisableVertexAttribArray(GLuint index) override
{
- SetVertexAttribArray( index, false );
+ SetVertexAttribArray(index, false);
}
- inline void DrawArrays(GLenum mode, GLint first, GLsizei count)
+ inline void DrawArrays(GLenum mode, GLint first, GLsizei count) override
{
std::stringstream out;
out << mode << ", " << first << ", " << count;
TraceCallStack::NamedParams namedParams;
- namedParams["mode"] = ToString(mode);
+ namedParams["mode"] = ToString(mode);
namedParams["first"] = ToString(first);
namedParams["count"] = ToString(count);
mDrawTrace.PushCall("DrawArrays", out.str(), namedParams);
}
- inline void DrawElements(GLenum mode, GLsizei count, GLenum type, const void* indices)
+ inline void DrawElements(GLenum mode, GLsizei count, GLenum type, const void* indices) override
{
std::stringstream out;
out << mode << ", " << count << ", " << type << ", indices";
TraceCallStack::NamedParams namedParams;
- namedParams["mode"] = ToString(mode);
+ namedParams["mode"] = ToString(mode);
namedParams["count"] = ToString(count);
- namedParams["type"] = ToString(type);
+ namedParams["type"] = ToString(type);
// Skip void pointers - are they of any use?
mDrawTrace.PushCall("DrawElements", out.str(), namedParams);
}
- inline void Enable(GLenum cap)
+ inline void Enable(GLenum cap) override
{
std::stringstream out;
out << cap;
mEnableDisableTrace.PushCall("Enable", out.str(), namedParams);
}
- inline void EnableVertexAttribArray(GLuint index)
+ inline void EnableVertexAttribArray(GLuint index) override
{
- SetVertexAttribArray( index, true);
+ SetVertexAttribArray(index, true);
}
- inline void Finish(void)
+ inline void Finish(void) override
{
}
- inline void Flush(void)
+ inline void Flush(void) override
{
}
- inline void FramebufferRenderbuffer(GLenum target, GLenum attachment, GLenum renderbuffertarget, GLuint renderbuffer)
+ inline void FramebufferRenderbuffer(GLenum target, GLenum attachment, GLenum renderbuffertarget, GLuint renderbuffer) override
{
- if (attachment == GL_DEPTH_ATTACHMENT)
+ if(attachment == GL_DEPTH_ATTACHMENT)
{
mFramebufferDepthAttached = true;
}
- else if (attachment == GL_STENCIL_ATTACHMENT)
+ else if(attachment == GL_STENCIL_ATTACHMENT)
{
mFramebufferStencilAttached = true;
}
}
- inline void FramebufferTexture2D(GLenum target, GLenum attachment, GLenum textarget, GLuint texture, GLint level)
+ inline void FramebufferTexture2D(GLenum target, GLenum attachment, GLenum textarget, GLuint texture, GLint level) override
{
//Add 100 bit;
mFramebufferStatus |= 4;
//We check 4 attachment colors
- if ((attachment >= GL_COLOR_ATTACHMENT0) && (attachment < GL_COLOR_ATTACHMENT0 + Dali::DevelFrameBuffer::MAX_COLOR_ATTACHMENTS))
+ if((attachment >= GL_COLOR_ATTACHMENT0) && (attachment < GL_COLOR_ATTACHMENT0 + Dali::DevelFrameBuffer::MAX_COLOR_ATTACHMENTS))
{
uint8_t mask = 1 << (attachment - GL_COLOR_ATTACHMENT0);
- if ((mFrameBufferColorStatus & mask) == 0)
+ if((mFrameBufferColorStatus & mask) == 0)
{
mFrameBufferColorStatus |= mask;
++mFramebufferColorAttachmentCount;
}
}
- inline void FrontFace(GLenum mode)
+ inline void FrontFace(GLenum mode) override
{
}
- inline void GenBuffers(GLsizei n, GLuint* buffers)
+ inline void GenBuffers(GLsizei n, GLuint* buffers) override
{
// avoids an assert in GpuBuffers
*buffers = 1u;
}
- inline void GenerateMipmap(GLenum target)
+ inline void GenerateMipmap(GLenum target) override
{
std::stringstream out;
- out<<target;
+ out << target;
TraceCallStack::NamedParams namedParams;
namedParams["target"] = ToString(target);
mTextureTrace.PushCall("GenerateMipmap", out.str(), namedParams);
}
- inline void GenFramebuffers(GLsizei n, GLuint* framebuffers)
+ inline void GenFramebuffers(GLsizei n, GLuint* framebuffers) override
{
- for( int i = 0; i < n; i++ )
+ for(int i = 0; i < n; i++)
{
framebuffers[i] = i + 1;
}
mFramebufferStatus = 1;
}
- inline void GenRenderbuffers(GLsizei n, GLuint* renderbuffers)
+ inline void GenRenderbuffers(GLsizei n, GLuint* renderbuffers) override
{
- for( int i = 0; i < n; i++ )
+ for(int i = 0; i < n; i++)
{
renderbuffers[i] = i + 1;
}
* This method can be used by test cases, to manipulate the texture IDs generated by GenTextures.
* @param[in] ids A vector containing the next IDs to be generated
*/
- inline void SetNextTextureIds( const std::vector<GLuint>& ids )
+ inline void SetNextTextureIds(const std::vector<GLuint>& ids)
{
mNextTextureIds = ids;
}
return mNextTextureIds;
}
- inline void GenTextures(GLsizei count, GLuint* textures)
+ inline void GenTextures(GLsizei count, GLuint* textures) override
{
- for( int i=0; i<count; ++i )
+ for(int i = 0; i < count; ++i)
{
- if( !mNextTextureIds.empty() )
+ if(!mNextTextureIds.empty())
{
- *(textures+i) = mNextTextureIds[0];
- mNextTextureIds.erase( mNextTextureIds.begin() );
+ *(textures + i) = mNextTextureIds[0];
+ mNextTextureIds.erase(mNextTextureIds.begin());
}
else
{
- *(textures+i) = ++mLastAutoTextureIdUsed;
+ *(textures + i) = ++mLastAutoTextureIdUsed;
}
mNumGeneratedTextures++;
}
namedParams["count"] = ToString(count);
std::stringstream out;
- for(int i=0; i<count; i++)
+ for(int i = 0; i < count; i++)
{
out << textures[i];
- if(i<count-1)
+ if(i < count - 1)
{
out << ", ";
}
std::ostringstream oss;
- oss<<"indices["<<i<<"]";
+ oss << "indices[" << i << "]";
namedParams[oss.str()] = ToString(textures[i]);
}
{
return mLastAutoTextureIdUsed;
}
+
inline GLuint GetNumGeneratedTextures()
{
return mNumGeneratedTextures;
}
- inline void GetActiveAttrib(GLuint program, GLuint index, GLsizei bufsize, GLsizei* length, GLint* size, GLenum* type, char* name)
+ inline void GetActiveAttrib(GLuint program, GLuint index, GLsizei bufsize, GLsizei* length, GLint* size, GLenum* type, char* name) override
{
}
- inline void GetActiveUniform(GLuint program, GLuint index, GLsizei bufsize, GLsizei* length, GLint* size, GLenum* type, char* name)
+ inline void GetActiveUniform(GLuint program, GLuint index, GLsizei bufsize, GLsizei* length, GLint* size, GLenum* type, char* name) override
{
switch(index)
{
case 0:
*length = snprintf(name, bufsize, "sTexture");
- *type = GL_SAMPLER_2D;
- *size = 1;
+ *type = GL_SAMPLER_2D;
+ *size = 1;
break;
case 1:
*length = snprintf(name, bufsize, "sEffect");
- *type = GL_SAMPLER_2D;
- *size = 1;
+ *type = GL_SAMPLER_2D;
+ *size = 1;
break;
case 2:
*length = snprintf(name, bufsize, "sGloss");
- *type = GL_SAMPLER_2D;
- *size = 1;
+ *type = GL_SAMPLER_2D;
+ *size = 1;
break;
default:
break;
}
}
- inline void GetAttachedShaders(GLuint program, GLsizei maxcount, GLsizei* count, GLuint* shaders)
+ inline void GetAttachedShaders(GLuint program, GLsizei maxcount, GLsizei* count, GLuint* shaders) override
{
}
- inline int GetAttribLocation(GLuint program, const char* name)
+ inline int GetAttribLocation(GLuint program, const char* name) override
{
std::string attribName(name);
- for( unsigned int i = 0; i < ATTRIB_TYPE_LAST; ++i )
+ for(unsigned int i = 0; i < ATTRIB_TYPE_LAST; ++i)
{
- if( mStdAttribs[i] == attribName )
+ if(mStdAttribs[i] == attribName)
{
return i;
}
return 0;
}
- inline void GetBooleanv(GLenum pname, GLboolean* params)
+ inline void GetBooleanv(GLenum pname, GLboolean* params) override
{
}
- inline void GetBufferParameteriv(GLenum target, GLenum pname, GLint* params)
+ inline void GetBufferParameteriv(GLenum target, GLenum pname, GLint* params) override
{
}
- inline GLenum GetError(void)
+ inline GLenum GetError(void) override
{
return mGetErrorResult;
}
- inline void GetFloatv(GLenum pname, GLfloat* params)
+ inline void GetFloatv(GLenum pname, GLfloat* params) override
{
}
- inline void GetFramebufferAttachmentParameteriv(GLenum target, GLenum attachment, GLenum pname, GLint* params)
+ inline void GetFramebufferAttachmentParameteriv(GLenum target, GLenum attachment, GLenum pname, GLint* params) override
{
}
- inline void GetIntegerv(GLenum pname, GLint* params)
+ inline void GetIntegerv(GLenum pname, GLint* params) override
{
- switch( pname )
+ switch(pname)
{
case GL_MAX_TEXTURE_SIZE:
*params = 2048;
}
}
- inline void GetProgramiv(GLuint program, GLenum pname, GLint* params)
+ inline void GetProgramiv(GLuint program, GLenum pname, GLint* params) override
{
- switch( pname )
+ switch(pname)
{
case GL_LINK_STATUS:
*params = mLinkStatus;
}
}
- inline void GetProgramInfoLog(GLuint program, GLsizei bufsize, GLsizei* length, char* infolog)
+ inline void GetProgramInfoLog(GLuint program, GLsizei bufsize, GLsizei* length, char* infolog) override
{
}
- inline void GetRenderbufferParameteriv(GLenum target, GLenum pname, GLint* params)
+ inline void GetRenderbufferParameteriv(GLenum target, GLenum pname, GLint* params) override
{
}
- inline void GetShaderiv(GLuint shader, GLenum pname, GLint* params)
+ inline void GetShaderiv(GLuint shader, GLenum pname, GLint* params) override
{
- switch( pname ) {
+ switch(pname)
+ {
case GL_COMPILE_STATUS:
*params = mCompileStatus;
break;
}
}
- inline void GetShaderInfoLog(GLuint shader, GLsizei bufsize, GLsizei* length, char* infolog)
+ inline void GetShaderInfoLog(GLuint shader, GLsizei bufsize, GLsizei* length, char* infolog) override
{
}
- inline void GetShaderPrecisionFormat(GLenum shadertype, GLenum precisiontype, GLint* range, GLint* precision)
+ inline void GetShaderPrecisionFormat(GLenum shadertype, GLenum precisiontype, GLint* range, GLint* precision) override
{
}
- inline const GLubyte* GetString(GLenum name)
+ inline const GLubyte* GetString(GLenum name) override
{
return mGetStringResult;
}
- inline void GetTexParameterfv(GLenum target, GLenum pname, GLfloat* params)
+ inline void GetTexParameterfv(GLenum target, GLenum pname, GLfloat* params) override
{
}
- inline void GetTexParameteriv(GLenum target, GLenum pname, GLint* params)
+ inline void GetTexParameteriv(GLenum target, GLenum pname, GLint* params) override
{
}
- inline void GetUniformfv(GLuint program, GLint location, GLfloat* params)
+ inline void GetUniformfv(GLuint program, GLint location, GLfloat* params) override
{
}
- inline void GetUniformiv(GLuint program, GLint location, GLint* params)
+ inline void GetUniformiv(GLuint program, GLint location, GLint* params) override
{
}
- inline GLint GetUniformLocation(GLuint program, const char* name)
+ inline GLint GetUniformLocation(GLuint program, const char* name) override
{
ProgramUniformMap::iterator it = mUniforms.find(program);
- if( it == mUniforms.end() )
+ if(it == mUniforms.end())
{
// Not a valid program ID
mGetErrorResult = GL_INVALID_OPERATION;
return -1;
}
- UniformIDMap& uniformIDs = it->second;
- UniformIDMap::iterator it2 = uniformIDs.find( name );
- if( it2 == uniformIDs.end() )
+ UniformIDMap& uniformIDs = it->second;
+ UniformIDMap::iterator it2 = uniformIDs.find(name);
+ if(it2 == uniformIDs.end())
{
// Uniform not found, so add it...
uniformIDs[name] = ++mLastUniformIdUsed;
return it2->second;
}
- inline void GetVertexAttribfv(GLuint index, GLenum pname, GLfloat* params)
+ inline void GetVertexAttribfv(GLuint index, GLenum pname, GLfloat* params) override
{
}
- inline void GetVertexAttribiv(GLuint index, GLenum pname, GLint* params)
+ inline void GetVertexAttribiv(GLuint index, GLenum pname, GLint* params) override
{
}
- inline void GetVertexAttribPointerv(GLuint index, GLenum pname, void** pointer)
+ inline void GetVertexAttribPointerv(GLuint index, GLenum pname, void** pointer) override
{
}
- inline void Hint(GLenum target, GLenum mode)
+ inline void Hint(GLenum target, GLenum mode) override
{
}
- inline GLboolean IsBuffer(GLuint buffer)
+ inline GLboolean IsBuffer(GLuint buffer) override
{
return mIsBufferResult;
}
- inline GLboolean IsEnabled(GLenum cap)
+ inline GLboolean IsEnabled(GLenum cap) override
{
return mIsEnabledResult;
}
- inline GLboolean IsFramebuffer(GLuint framebuffer)
+ inline GLboolean IsFramebuffer(GLuint framebuffer) override
{
return mIsFramebufferResult;
}
- inline GLboolean IsProgram(GLuint program)
+ inline GLboolean IsProgram(GLuint program) override
{
return mIsProgramResult;
}
- inline GLboolean IsRenderbuffer(GLuint renderbuffer)
+ inline GLboolean IsRenderbuffer(GLuint renderbuffer) override
{
return mIsRenderbufferResult;
}
- inline GLboolean IsShader(GLuint shader)
+ inline GLboolean IsShader(GLuint shader) override
{
return mIsShaderResult;
}
- inline GLboolean IsTexture(GLuint texture)
+ inline GLboolean IsTexture(GLuint texture) override
{
return mIsTextureResult;
}
- inline void LineWidth(GLfloat width)
+ inline void LineWidth(GLfloat width) override
{
}
- inline void LinkProgram(GLuint program)
+ inline void LinkProgram(GLuint program) override
{
std::stringstream out;
out << program;
namedParams["program"] = ToString(program);
mShaderTrace.PushCall("LinkProgram", out.str(), namedParams);
- mNumberOfActiveUniforms=3;
+ mNumberOfActiveUniforms = 3;
GetUniformLocation(program, "sTexture");
GetUniformLocation(program, "sEffect");
GetUniformLocation(program, "sGloss");
}
- inline void PixelStorei(GLenum pname, GLint param)
+ inline void PixelStorei(GLenum pname, GLint param) override
{
}
- inline void PolygonOffset(GLfloat factor, GLfloat units)
+ inline void PolygonOffset(GLfloat factor, GLfloat units) override
{
}
- inline void ReadPixels(GLint x, GLint y, GLsizei width, GLsizei height, GLenum format, GLenum type, void* pixels)
+ inline void ReadPixels(GLint x, GLint y, GLsizei width, GLsizei height, GLenum format, GLenum type, void* pixels) override
{
}
- inline void ReleaseShaderCompiler(void)
+ inline void ReleaseShaderCompiler(void) override
{
}
- inline void RenderbufferStorage(GLenum target, GLenum internalformat, GLsizei width, GLsizei height)
+ inline void RenderbufferStorage(GLenum target, GLenum internalformat, GLsizei width, GLsizei height) override
{
}
- inline void SampleCoverage(GLclampf value, GLboolean invert)
+ inline void SampleCoverage(GLclampf value, GLboolean invert) override
{
}
- inline void Scissor(GLint x, GLint y, GLsizei width, GLsizei height)
+ inline void Scissor(GLint x, GLint y, GLsizei width, GLsizei height) override
{
- mScissorParams.x = x;
- mScissorParams.y = y;
- mScissorParams.width = width;
+ mScissorParams.x = x;
+ mScissorParams.y = y;
+ mScissorParams.width = width;
mScissorParams.height = height;
std::stringstream out;
out << x << ", " << y << ", " << width << ", " << height;
TraceCallStack::NamedParams namedParams;
- namedParams["x"] = ToString( x );
- namedParams["y"] = ToString( y );
- namedParams["width"] = ToString( width );
- namedParams["height"] = ToString( height );
- mScissorTrace.PushCall( "Scissor", out.str(), namedParams );
+ namedParams["x"] = ToString(x);
+ namedParams["y"] = ToString(y);
+ namedParams["width"] = ToString(width);
+ namedParams["height"] = ToString(height);
+ mScissorTrace.PushCall("Scissor", out.str(), namedParams);
}
- inline void ShaderBinary(GLsizei n, const GLuint* shaders, GLenum binaryformat, const void* binary, GLsizei length)
+ inline void ShaderBinary(GLsizei n, const GLuint* shaders, GLenum binaryformat, const void* binary, GLsizei length) override
{
}
- inline void ShaderSource(GLuint shader, GLsizei count, const char** string, const GLint* length)
+ inline void ShaderSource(GLuint shader, GLsizei count, const char** string, const GLint* length) override
{
std::string stringBuilder;
for(int i = 0; i < count; ++i)
stringBuilder += string[i];
}
mShaderSources[shader] = stringBuilder;
- mLastShaderCompiled = shader;
+ mLastShaderCompiled = shader;
}
- inline void GetShaderSource(GLuint shader, GLsizei bufsize, GLsizei* length, char* source)
+ inline void GetShaderSource(GLuint shader, GLsizei bufsize, GLsizei* length, char* source) override
{
- const std::string shaderSource = mShaderSources[shader];
- const int shaderSourceLength = static_cast<int>(shaderSource.length());
- if( shaderSourceLength < bufsize )
+ const std::string shaderSource = mShaderSources[shader];
+ const int shaderSourceLength = static_cast<int>(shaderSource.length());
+ if(shaderSourceLength < bufsize)
{
- strncpy( source, shaderSource.c_str(), shaderSourceLength );
+ strncpy(source, shaderSource.c_str(), shaderSourceLength);
*length = shaderSourceLength;
}
else
{
- *length = bufsize -1;
+ *length = bufsize - 1;
strncpy(source, shaderSource.c_str(), *length);
source[*length] = 0x0;
}
return mShaderSources[shader];
}
- inline void StencilFunc(GLenum func, GLint ref, GLuint mask)
+ inline void StencilFunc(GLenum func, GLint ref, GLuint mask) override
{
std::stringstream out;
out << func << ", " << ref << ", " << mask;
TraceCallStack::NamedParams namedParams;
- namedParams["func"] = ToString( func );
- namedParams["ref"] = ToString( ref );
- namedParams["mask"] = ToString( mask );
+ namedParams["func"] = ToString(func);
+ namedParams["ref"] = ToString(ref);
+ namedParams["mask"] = ToString(mask);
- mStencilFunctionTrace.PushCall( "StencilFunc", out.str(), namedParams );
+ mStencilFunctionTrace.PushCall("StencilFunc", out.str(), namedParams);
}
- inline void StencilFuncSeparate(GLenum face, GLenum func, GLint ref, GLuint mask)
+ inline void StencilFuncSeparate(GLenum face, GLenum func, GLint ref, GLuint mask) override
{
std::stringstream out;
out << face << ", " << func << ", " << ref << ", " << mask;
TraceCallStack::NamedParams namedParams;
- namedParams["face"] = ToString( face );
- namedParams["func"] = ToString( func );
- namedParams["ref"] = ToString( ref );
- namedParams["mask"] = ToString( mask );
+ namedParams["face"] = ToString(face);
+ namedParams["func"] = ToString(func);
+ namedParams["ref"] = ToString(ref);
+ namedParams["mask"] = ToString(mask);
- mStencilFunctionTrace.PushCall( "StencilFuncSeparate", out.str(), namedParams );
+ mStencilFunctionTrace.PushCall("StencilFuncSeparate", out.str(), namedParams);
}
- inline void StencilMask(GLuint mask)
+ inline void StencilMask(GLuint mask) override
{
std::stringstream out;
out << mask;
TraceCallStack::NamedParams namedParams;
- namedParams["mask"] = ToString( mask );
+ namedParams["mask"] = ToString(mask);
- mStencilFunctionTrace.PushCall( "StencilMask", out.str(), namedParams );
+ mStencilFunctionTrace.PushCall("StencilMask", out.str(), namedParams);
}
- inline void StencilMaskSeparate(GLenum face, GLuint mask)
+ inline void StencilMaskSeparate(GLenum face, GLuint mask) override
{
std::stringstream out;
out << face << ", " << mask;
TraceCallStack::NamedParams namedParams;
- namedParams["face"] = ToString( face );
- namedParams["mask"] = ToString( mask );
+ namedParams["face"] = ToString(face);
+ namedParams["mask"] = ToString(mask);
- mStencilFunctionTrace.PushCall( "StencilMaskSeparate", out.str(), namedParams );
+ mStencilFunctionTrace.PushCall("StencilMaskSeparate", out.str(), namedParams);
}
- inline void StencilOp(GLenum fail, GLenum zfail, GLenum zpass)
+ inline void StencilOp(GLenum fail, GLenum zfail, GLenum zpass) override
{
std::stringstream out;
out << fail << ", " << zfail << ", " << zpass;
TraceCallStack::NamedParams namedParams;
- namedParams["fail"] = ToString( fail );
- namedParams["zfail"] = ToString( zfail );
- namedParams["zpass"] = ToString( zpass );
+ namedParams["fail"] = ToString(fail);
+ namedParams["zfail"] = ToString(zfail);
+ namedParams["zpass"] = ToString(zpass);
- mStencilFunctionTrace.PushCall( "StencilOp", out.str(), namedParams );
+ mStencilFunctionTrace.PushCall("StencilOp", out.str(), namedParams);
}
- inline void StencilOpSeparate(GLenum face, GLenum fail, GLenum zfail, GLenum zpass)
+ inline void StencilOpSeparate(GLenum face, GLenum fail, GLenum zfail, GLenum zpass) override
{
std::stringstream out;
out << face << ", " << fail << ", " << zfail << "," << zpass;
TraceCallStack::NamedParams namedParams;
- namedParams["face"] = ToString( face );
- namedParams["fail"] = ToString( fail );
- namedParams["zfail"] = ToString( zfail );
- namedParams["zpass"] = ToString( zpass );
+ namedParams["face"] = ToString(face);
+ namedParams["fail"] = ToString(fail);
+ namedParams["zfail"] = ToString(zfail);
+ namedParams["zpass"] = ToString(zpass);
- mStencilFunctionTrace.PushCall( "StencilOpSeparate", out.str(), namedParams );
+ mStencilFunctionTrace.PushCall("StencilOpSeparate", out.str(), namedParams);
}
- inline void TexImage2D(GLenum target, GLint level, GLint internalformat, GLsizei width, GLsizei height, GLint border, GLenum format, GLenum type, const void* pixels)
+ inline void TexImage2D(GLenum target, GLint level, GLint internalformat, GLsizei width, GLsizei height, GLint border, GLenum format, GLenum type, const void* pixels) override
{
std::stringstream out;
- out << target<<", "<<level<<", "<<width << ", " << height;
+ out << target << ", " << level << ", " << width << ", " << height;
TraceCallStack::NamedParams namedParams;
- namedParams["target"] = ToString(target);
- namedParams["level"] = ToString(level);
+ namedParams["target"] = ToString(target);
+ namedParams["level"] = ToString(level);
namedParams["internalformat"] = ToString(internalformat);
- namedParams["width"] = ToString(width);
- namedParams["height"] = ToString(height);
- namedParams["border"] = ToString(border);
- namedParams["format"] = ToString(format);
- namedParams["type"] = ToString(type);
+ namedParams["width"] = ToString(width);
+ namedParams["height"] = ToString(height);
+ namedParams["border"] = ToString(border);
+ namedParams["format"] = ToString(format);
+ namedParams["type"] = ToString(type);
mTextureTrace.PushCall("TexImage2D", out.str(), namedParams);
}
- inline void TexParameterf(GLenum target, GLenum pname, GLfloat param)
+ inline void TexParameterf(GLenum target, GLenum pname, GLfloat param) override
{
std::stringstream out;
out << target << ", " << pname << ", " << param;
TraceCallStack::NamedParams namedParams;
namedParams["target"] = ToString(target);
- namedParams["pname"] = ToString(pname);
- namedParams["param"] = ToString(param);
+ namedParams["pname"] = ToString(pname);
+ namedParams["param"] = ToString(param);
mTexParamaterTrace.PushCall("TexParameterf", out.str(), namedParams);
}
- inline void TexParameterfv(GLenum target, GLenum pname, const GLfloat* params)
+ inline void TexParameterfv(GLenum target, GLenum pname, const GLfloat* params) override
{
std::stringstream out;
out << target << ", " << pname << ", " << params[0];
TraceCallStack::NamedParams namedParams;
- namedParams["target"] = ToString(target);
- namedParams["pname"] = ToString(pname);
+ namedParams["target"] = ToString(target);
+ namedParams["pname"] = ToString(pname);
namedParams["params[0]"] = ToString(params[0]);
mTexParamaterTrace.PushCall("TexParameterfv", out.str(), namedParams);
}
- inline void TexParameteri(GLenum target, GLenum pname, GLint param)
+ inline void TexParameteri(GLenum target, GLenum pname, GLint param) override
{
std::stringstream out;
out << target << ", " << pname << ", " << param;
TraceCallStack::NamedParams namedParams;
namedParams["target"] = ToString(target);
- namedParams["pname"] = ToString(pname);
- namedParams["param"] = ToString(param);
+ namedParams["pname"] = ToString(pname);
+ namedParams["param"] = ToString(param);
mTexParamaterTrace.PushCall("TexParameteri", out.str(), namedParams);
}
- inline void TexParameteriv(GLenum target, GLenum pname, const GLint* params)
+ inline void TexParameteriv(GLenum target, GLenum pname, const GLint* params) override
{
std::stringstream out;
out << target << ", " << pname << ", " << params[0];
TraceCallStack::NamedParams namedParams;
- namedParams["target"] = ToString(target);
- namedParams["pname"] = ToString(pname);
+ namedParams["target"] = ToString(target);
+ namedParams["pname"] = ToString(pname);
namedParams["params[0]"] = ToString(params[0]);
mTexParamaterTrace.PushCall("TexParameteriv", out.str(), namedParams);
}
- inline void TexSubImage2D(GLenum target, GLint level, GLint xoffset, GLint yoffset, GLsizei width, GLsizei height, GLenum format, GLenum type, const void* pixels)
+ inline void TexSubImage2D(GLenum target, GLint level, GLint xoffset, GLint yoffset, GLsizei width, GLsizei height, GLenum format, GLenum type, const void* pixels) override
{
std::stringstream out;
- out << target << ", "<<level <<", " << xoffset << ", " << yoffset << ", " << width << ", " << height;
+ out << target << ", " << level << ", " << xoffset << ", " << yoffset << ", " << width << ", " << height;
TraceCallStack::NamedParams namedParams;
- namedParams["target"] = ToString(target);
- namedParams["level"] = ToString(level);
+ namedParams["target"] = ToString(target);
+ namedParams["level"] = ToString(level);
namedParams["xoffset"] = ToString(xoffset);
namedParams["yoffset"] = ToString(yoffset);
- namedParams["width"] = ToString(width);
- namedParams["height"] = ToString(height);
+ namedParams["width"] = ToString(width);
+ namedParams["height"] = ToString(height);
mTextureTrace.PushCall("TexSubImage2D", out.str(), namedParams);
}
- inline void Uniform1f(GLint location, GLfloat value )
+ inline void Uniform1f(GLint location, GLfloat value) override
{
- std::string params = ToString( value );
- AddUniformCallToTraceStack( location, params );
+ std::string params = ToString(value);
+ AddUniformCallToTraceStack(location, params);
- if( ! mProgramUniforms1f.SetUniformValue( mCurrentProgram, location, value ) )
+ if(!mProgramUniforms1f.SetUniformValue(mCurrentProgram, location, value))
{
mGetErrorResult = GL_INVALID_OPERATION;
}
}
- inline void Uniform1fv(GLint location, GLsizei count, const GLfloat* v)
+ inline void Uniform1fv(GLint location, GLsizei count, const GLfloat* v) override
{
std::string params;
- for( int i = 0; i < count; ++i )
+ for(int i = 0; i < count; ++i)
{
- params = params + ToString( v[i] ) + ",";
+ params = params + ToString(v[i]) + ",";
}
- AddUniformCallToTraceStack( location, params );
+ AddUniformCallToTraceStack(location, params);
- for( int i = 0; i < count; ++i )
+ for(int i = 0; i < count; ++i)
{
- if( ! mProgramUniforms1f.SetUniformValue( mCurrentProgram, location, v[i] ) )
+ if(!mProgramUniforms1f.SetUniformValue(mCurrentProgram, location, v[i]))
{
mGetErrorResult = GL_INVALID_OPERATION;
break;
}
}
- inline void Uniform1i(GLint location, GLint x)
+ inline void Uniform1i(GLint location, GLint x) override
{
- std::string params = ToString( x );
+ std::string params = ToString(x);
- AddUniformCallToTraceStack( location, params );
+ AddUniformCallToTraceStack(location, params);
- if( ! mProgramUniforms1i.SetUniformValue( mCurrentProgram, location, x ) )
+ if(!mProgramUniforms1i.SetUniformValue(mCurrentProgram, location, x))
{
mGetErrorResult = GL_INVALID_OPERATION;
}
}
- inline void Uniform1iv(GLint location, GLsizei count, const GLint* v)
+ inline void Uniform1iv(GLint location, GLsizei count, const GLint* v) override
{
- std::string params = ToString( v );
- AddUniformCallToTraceStack( location, params );
+ std::string params = ToString(v);
+ AddUniformCallToTraceStack(location, params);
- for( int i = 0; i < count; ++i )
+ for(int i = 0; i < count; ++i)
{
- if( ! mProgramUniforms1i.SetUniformValue( mCurrentProgram,
- location,
- v[i] ) )
+ if(!mProgramUniforms1i.SetUniformValue(mCurrentProgram,
+ location,
+ v[i]))
{
mGetErrorResult = GL_INVALID_OPERATION;
break;
}
}
- inline void Uniform2f(GLint location, GLfloat x, GLfloat y)
+ inline void Uniform2f(GLint location, GLfloat x, GLfloat y) override
{
- std::string params = ToString( x ) + "," + ToString( y );
- AddUniformCallToTraceStack( location, params );
+ std::string params = ToString(x) + "," + ToString(y);
+ AddUniformCallToTraceStack(location, params);
- if( ! mProgramUniforms2f.SetUniformValue( mCurrentProgram,
- location,
- Vector2( x, y ) ) )
+ if(!mProgramUniforms2f.SetUniformValue(mCurrentProgram,
+ location,
+ Vector2(x, y)))
{
mGetErrorResult = GL_INVALID_OPERATION;
}
}
- inline void Uniform2fv(GLint location, GLsizei count, const GLfloat* v)
+ inline void Uniform2fv(GLint location, GLsizei count, const GLfloat* v) override
{
- std::string params = ToString( v );
- AddUniformCallToTraceStack( location, params );
+ std::string params = ToString(v);
+ AddUniformCallToTraceStack(location, params);
- for( int i = 0; i < count; ++i )
+ for(int i = 0; i < count; ++i)
{
- if( ! mProgramUniforms2f.SetUniformValue( mCurrentProgram,
- location,
- Vector2( v[2*i], v[2*i+1] ) ) )
+ if(!mProgramUniforms2f.SetUniformValue(mCurrentProgram,
+ location,
+ Vector2(v[2 * i], v[2 * i + 1])))
{
mGetErrorResult = GL_INVALID_OPERATION;
break;
}
}
- inline void Uniform2i(GLint location, GLint x, GLint y)
+ inline void Uniform2i(GLint location, GLint x, GLint y) override
{
- std::string params = ToString( x ) + "," + ToString( y );
- AddUniformCallToTraceStack( location, params );
+ std::string params = ToString(x) + "," + ToString(y);
+ AddUniformCallToTraceStack(location, params);
}
- inline void Uniform2iv(GLint location, GLsizei count, const GLint* v)
+ inline void Uniform2iv(GLint location, GLsizei count, const GLint* v) override
{
- std::string params = ToString( v );
- AddUniformCallToTraceStack( location, params );
+ std::string params = ToString(v);
+ AddUniformCallToTraceStack(location, params);
}
- inline void Uniform3f(GLint location, GLfloat x, GLfloat y, GLfloat z)
+ inline void Uniform3f(GLint location, GLfloat x, GLfloat y, GLfloat z) override
{
- std::string params = ToString( x ) + "," + ToString( y ) + "," + ToString( z );
- AddUniformCallToTraceStack( location, params );
+ std::string params = ToString(x) + "," + ToString(y) + "," + ToString(z);
+ AddUniformCallToTraceStack(location, params);
- if( ! mProgramUniforms3f.SetUniformValue( mCurrentProgram,
- location,
- Vector3( x, y, z ) ) )
+ if(!mProgramUniforms3f.SetUniformValue(mCurrentProgram,
+ location,
+ Vector3(x, y, z)))
{
mGetErrorResult = GL_INVALID_OPERATION;
}
}
- inline void Uniform3fv(GLint location, GLsizei count, const GLfloat* v)
+ inline void Uniform3fv(GLint location, GLsizei count, const GLfloat* v) override
{
- std::string params = ToString( v );
- AddUniformCallToTraceStack( location, params );
+ std::string params = ToString(v);
+ AddUniformCallToTraceStack(location, params);
- for( int i = 0; i < count; ++i )
+ for(int i = 0; i < count; ++i)
{
- if( ! mProgramUniforms3f.SetUniformValue(
- mCurrentProgram,
- location,
- Vector3( v[3*i], v[3*i+1], v[3*i+2] ) ) )
+ if(!mProgramUniforms3f.SetUniformValue(
+ mCurrentProgram,
+ location,
+ Vector3(v[3 * i], v[3 * i + 1], v[3 * i + 2])))
{
mGetErrorResult = GL_INVALID_OPERATION;
break;
}
}
- inline void Uniform3i(GLint location, GLint x, GLint y, GLint z)
+ inline void Uniform3i(GLint location, GLint x, GLint y, GLint z) override
{
- std::string params = ToString( x ) + "," + ToString( y ) + "," + ToString( z );
- AddUniformCallToTraceStack( location, params );
+ std::string params = ToString(x) + "," + ToString(y) + "," + ToString(z);
+ AddUniformCallToTraceStack(location, params);
}
- inline void Uniform3iv(GLint location, GLsizei count, const GLint* v)
+ inline void Uniform3iv(GLint location, GLsizei count, const GLint* v) override
{
- std::string params = ToString( v );
- AddUniformCallToTraceStack( location, params );
+ std::string params = ToString(v);
+ AddUniformCallToTraceStack(location, params);
}
- inline void Uniform4f(GLint location, GLfloat x, GLfloat y, GLfloat z, GLfloat w)
+ inline void Uniform4f(GLint location, GLfloat x, GLfloat y, GLfloat z, GLfloat w) override
{
- std::string params = ToString( x ) + "," + ToString( y ) + "," + ToString( z ) + "," + ToString( w );
- AddUniformCallToTraceStack( location, params );
+ std::string params = ToString(x) + "," + ToString(y) + "," + ToString(z) + "," + ToString(w);
+ AddUniformCallToTraceStack(location, params);
- if( ! mProgramUniforms4f.SetUniformValue( mCurrentProgram,
- location,
- Vector4( x, y, z, w ) ) )
+ if(!mProgramUniforms4f.SetUniformValue(mCurrentProgram,
+ location,
+ Vector4(x, y, z, w)))
{
mGetErrorResult = GL_INVALID_OPERATION;
}
}
- inline void Uniform4fv(GLint location, GLsizei count, const GLfloat* v)
+ inline void Uniform4fv(GLint location, GLsizei count, const GLfloat* v) override
{
- std::string params = ToString( v );
- AddUniformCallToTraceStack( location, params );
+ std::string params = ToString(v);
+ AddUniformCallToTraceStack(location, params);
- for( int i = 0; i < count; ++i )
+ for(int i = 0; i < count; ++i)
{
- if( ! mProgramUniforms4f.SetUniformValue(
- mCurrentProgram,
- location,
- Vector4( v[4*i], v[4*i+1], v[4*i+2], v[4*i+3] ) ) )
+ if(!mProgramUniforms4f.SetUniformValue(
+ mCurrentProgram,
+ location,
+ Vector4(v[4 * i], v[4 * i + 1], v[4 * i + 2], v[4 * i + 3])))
{
mGetErrorResult = GL_INVALID_OPERATION;
break;
}
}
- inline void Uniform4i(GLint location, GLint x, GLint y, GLint z, GLint w)
+ inline void Uniform4i(GLint location, GLint x, GLint y, GLint z, GLint w) override
{
- std::string params = ToString( x ) + "," + ToString( y ) + "," + ToString( z ) + "," + ToString( w );
- AddUniformCallToTraceStack( location, params );
+ std::string params = ToString(x) + "," + ToString(y) + "," + ToString(z) + "," + ToString(w);
+ AddUniformCallToTraceStack(location, params);
}
- inline void Uniform4iv(GLint location, GLsizei count, const GLint* v)
+ inline void Uniform4iv(GLint location, GLsizei count, const GLint* v) override
{
- std::string params = ToString( v );
- AddUniformCallToTraceStack( location, params );
+ std::string params = ToString(v);
+ AddUniformCallToTraceStack(location, params);
}
- inline void UniformMatrix2fv(GLint location, GLsizei count, GLboolean transpose, const GLfloat* value)
+ inline void UniformMatrix2fv(GLint location, GLsizei count, GLboolean transpose, const GLfloat* value) override
{
- std::string params = ToString( value );
- AddUniformCallToTraceStack( location, params );
+ std::string params = ToString(value);
+ AddUniformCallToTraceStack(location, params);
}
- inline void UniformMatrix3fv(GLint location, GLsizei count, GLboolean transpose, const GLfloat* value)
+ inline void UniformMatrix3fv(GLint location, GLsizei count, GLboolean transpose, const GLfloat* value) override
{
- std::string params = ToString( value );
- AddUniformCallToTraceStack( location, params );
+ std::string params = ToString(value);
+ AddUniformCallToTraceStack(location, params);
- for( int i = 0; i < count; ++i )
+ for(int i = 0; i < count; ++i)
{
- if( ! mProgramUniformsMat3.SetUniformValue(
- mCurrentProgram,
- location,
- Matrix3( value[0], value[1], value[2], value[3], value[4], value[5], value[6], value[7], value[8] ) ) )
+ if(!mProgramUniformsMat3.SetUniformValue(
+ mCurrentProgram,
+ location,
+ Matrix3(value[0], value[1], value[2], value[3], value[4], value[5], value[6], value[7], value[8])))
{
mGetErrorResult = GL_INVALID_OPERATION;
break;
}
}
- inline void UniformMatrix4fv(GLint location, GLsizei count, GLboolean transpose, const GLfloat* value)
+ inline void UniformMatrix4fv(GLint location, GLsizei count, GLboolean transpose, const GLfloat* value) override
{
- std::string params = ToString( value );
- AddUniformCallToTraceStack( location, params );
+ std::string params = ToString(value);
+ AddUniformCallToTraceStack(location, params);
- for( int i = 0; i < count; ++i )
+ for(int i = 0; i < count; ++i)
{
- if( ! mProgramUniformsMat4.SetUniformValue(
- mCurrentProgram,
- location,
- Matrix( value ) ) )
+ if(!mProgramUniformsMat4.SetUniformValue(
+ mCurrentProgram,
+ location,
+ Matrix(value)))
{
mGetErrorResult = GL_INVALID_OPERATION;
break;
}
}
- inline void UseProgram(GLuint program)
+ inline void UseProgram(GLuint program) override
{
mCurrentProgram = program;
}
- inline void ValidateProgram(GLuint program)
+ inline void ValidateProgram(GLuint program) override
{
}
- inline void VertexAttrib1f(GLuint indx, GLfloat x)
+ inline void VertexAttrib1f(GLuint indx, GLfloat x) override
{
}
- inline void VertexAttrib1fv(GLuint indx, const GLfloat* values)
+ inline void VertexAttrib1fv(GLuint indx, const GLfloat* values) override
{
}
- inline void VertexAttrib2f(GLuint indx, GLfloat x, GLfloat y)
+ inline void VertexAttrib2f(GLuint indx, GLfloat x, GLfloat y) override
{
}
- inline void VertexAttrib2fv(GLuint indx, const GLfloat* values)
+ inline void VertexAttrib2fv(GLuint indx, const GLfloat* values) override
{
}
- inline void VertexAttrib3f(GLuint indx, GLfloat x, GLfloat y, GLfloat z)
+ inline void VertexAttrib3f(GLuint indx, GLfloat x, GLfloat y, GLfloat z) override
{
}
- inline void VertexAttrib3fv(GLuint indx, const GLfloat* values)
+ inline void VertexAttrib3fv(GLuint indx, const GLfloat* values) override
{
}
- inline void VertexAttrib4f(GLuint indx, GLfloat x, GLfloat y, GLfloat z, GLfloat w)
+ inline void VertexAttrib4f(GLuint indx, GLfloat x, GLfloat y, GLfloat z, GLfloat w) override
{
}
- inline void VertexAttrib4fv(GLuint indx, const GLfloat* values)
+ inline void VertexAttrib4fv(GLuint indx, const GLfloat* values) override
{
}
- inline void VertexAttribPointer(GLuint indx, GLint size, GLenum type, GLboolean normalized, GLsizei stride, const void* ptr)
+ inline void VertexAttribPointer(GLuint indx, GLint size, GLenum type, GLboolean normalized, GLsizei stride, const void* ptr) override
{
}
- inline void Viewport(GLint x, GLint y, GLsizei width, GLsizei height)
+ inline void Viewport(GLint x, GLint y, GLsizei width, GLsizei height) override
{
std::string commaString(", ");
- std::string params( std::to_string(x) + commaString + std::to_string(y) + commaString + std::to_string(width) + commaString + std::to_string(height) );
+ std::string params(std::to_string(x) + commaString + std::to_string(y) + commaString + std::to_string(width) + commaString + std::to_string(height));
mViewportTrace.PushCall("Viewport", params);
}
/* OpenGL ES 3.0 */
- inline void ReadBuffer(GLenum mode)
+ inline void ReadBuffer(GLenum mode) override
{
}
- inline void DrawRangeElements(GLenum mode, GLuint start, GLuint end, GLsizei count, GLenum type, const GLvoid* indices)
+ inline void DrawRangeElements(GLenum mode, GLuint start, GLuint end, GLsizei count, GLenum type, const GLvoid* indices) override
{
}
- inline void TexImage3D(GLenum target, GLint level, GLint internalformat, GLsizei width, GLsizei height, GLsizei depth, GLint border, GLenum format, GLenum type, const GLvoid* pixels)
+ inline void TexImage3D(GLenum target, GLint level, GLint internalformat, GLsizei width, GLsizei height, GLsizei depth, GLint border, GLenum format, GLenum type, const GLvoid* pixels) override
{
}
- inline void TexSubImage3D(GLenum target, GLint level, GLint xoffset, GLint yoffset, GLint zoffset, GLsizei width, GLsizei height, GLsizei depth, GLenum format, GLenum type, const GLvoid* pixels)
+ inline void TexSubImage3D(GLenum target, GLint level, GLint xoffset, GLint yoffset, GLint zoffset, GLsizei width, GLsizei height, GLsizei depth, GLenum format, GLenum type, const GLvoid* pixels) override
{
}
- inline void CopyTexSubImage3D(GLenum target, GLint level, GLint xoffset, GLint yoffset, GLint zoffset, GLint x, GLint y, GLsizei width, GLsizei height)
+ inline void CopyTexSubImage3D(GLenum target, GLint level, GLint xoffset, GLint yoffset, GLint zoffset, GLint x, GLint y, GLsizei width, GLsizei height) override
{
}
- inline void CompressedTexImage3D(GLenum target, GLint level, GLenum internalformat, GLsizei width, GLsizei height, GLsizei depth, GLint border, GLsizei imageSize, const GLvoid* data)
+ inline void CompressedTexImage3D(GLenum target, GLint level, GLenum internalformat, GLsizei width, GLsizei height, GLsizei depth, GLint border, GLsizei imageSize, const GLvoid* data) override
{
}
- inline void CompressedTexSubImage3D(GLenum target, GLint level, GLint xoffset, GLint yoffset, GLint zoffset, GLsizei width, GLsizei height, GLsizei depth, GLenum format, GLsizei imageSize, const GLvoid* data)
+ inline void CompressedTexSubImage3D(GLenum target, GLint level, GLint xoffset, GLint yoffset, GLint zoffset, GLsizei width, GLsizei height, GLsizei depth, GLenum format, GLsizei imageSize, const GLvoid* data) override
{
}
- inline void GenQueries(GLsizei n, GLuint* ids)
+ inline void GenQueries(GLsizei n, GLuint* ids) override
{
}
- inline void DeleteQueries(GLsizei n, const GLuint* ids)
+ inline void DeleteQueries(GLsizei n, const GLuint* ids) override
{
}
- inline GLboolean IsQuery(GLuint id)
+ inline GLboolean IsQuery(GLuint id) override
{
return false;
}
- inline void BeginQuery(GLenum target, GLuint id)
+ inline void BeginQuery(GLenum target, GLuint id) override
{
}
- inline void EndQuery(GLenum target)
+ inline void EndQuery(GLenum target) override
{
}
- inline void GetQueryiv(GLenum target, GLenum pname, GLint* params)
+ inline void GetQueryiv(GLenum target, GLenum pname, GLint* params) override
{
}
- inline void GetQueryObjectuiv(GLuint id, GLenum pname, GLuint* params)
+ inline void GetQueryObjectuiv(GLuint id, GLenum pname, GLuint* params) override
{
}
- inline GLboolean UnmapBuffer(GLenum target)
+ inline GLboolean UnmapBuffer(GLenum target) override
{
return false;
}
- inline void GetBufferPointerv(GLenum target, GLenum pname, GLvoid** params)
+ inline void GetBufferPointerv(GLenum target, GLenum pname, GLvoid** params) override
{
}
- inline void DrawBuffers(GLsizei n, const GLenum* bufs)
+ inline void DrawBuffers(GLsizei n, const GLenum* bufs) override
{
}
- inline void UniformMatrix2x3fv(GLint location, GLsizei count, GLboolean transpose, const GLfloat* value)
+ inline void UniformMatrix2x3fv(GLint location, GLsizei count, GLboolean transpose, const GLfloat* value) override
{
}
- inline void UniformMatrix3x2fv(GLint location, GLsizei count, GLboolean transpose, const GLfloat* value)
+ inline void UniformMatrix3x2fv(GLint location, GLsizei count, GLboolean transpose, const GLfloat* value) override
{
}
- inline void UniformMatrix2x4fv(GLint location, GLsizei count, GLboolean transpose, const GLfloat* value)
+ inline void UniformMatrix2x4fv(GLint location, GLsizei count, GLboolean transpose, const GLfloat* value) override
{
}
- inline void UniformMatrix4x2fv(GLint location, GLsizei count, GLboolean transpose, const GLfloat* value)
+ inline void UniformMatrix4x2fv(GLint location, GLsizei count, GLboolean transpose, const GLfloat* value) override
{
}
- inline void UniformMatrix3x4fv(GLint location, GLsizei count, GLboolean transpose, const GLfloat* value)
+ inline void UniformMatrix3x4fv(GLint location, GLsizei count, GLboolean transpose, const GLfloat* value) override
{
}
- inline void UniformMatrix4x3fv(GLint location, GLsizei count, GLboolean transpose, const GLfloat* value)
+ inline void UniformMatrix4x3fv(GLint location, GLsizei count, GLboolean transpose, const GLfloat* value) override
{
}
- inline void BlitFramebuffer(GLint srcX0, GLint srcY0, GLint srcX1, GLint srcY1, GLint dstX0, GLint dstY0, GLint dstX1, GLint dstY1, GLbitfield mask, GLenum filter)
+ inline void BlitFramebuffer(GLint srcX0, GLint srcY0, GLint srcX1, GLint srcY1, GLint dstX0, GLint dstY0, GLint dstX1, GLint dstY1, GLbitfield mask, GLenum filter) override
{
}
- inline void RenderbufferStorageMultisample(GLenum target, GLsizei samples, GLenum internalformat, GLsizei width, GLsizei height)
+ inline void RenderbufferStorageMultisample(GLenum target, GLsizei samples, GLenum internalformat, GLsizei width, GLsizei height) override
{
}
- inline void FramebufferTextureLayer(GLenum target, GLenum attachment, GLuint texture, GLint level, GLint layer)
+ inline void FramebufferTextureLayer(GLenum target, GLenum attachment, GLuint texture, GLint level, GLint layer) override
{
}
- inline GLvoid* MapBufferRange(GLenum target, GLintptr offset, GLsizeiptr length, GLbitfield access)
+ inline GLvoid* MapBufferRange(GLenum target, GLintptr offset, GLsizeiptr length, GLbitfield access) override
{
return NULL;
}
- inline void FlushMappedBufferRange(GLenum target, GLintptr offset, GLsizeiptr length)
+ inline void FlushMappedBufferRange(GLenum target, GLintptr offset, GLsizeiptr length) override
{
}
- inline void BindVertexArray(GLuint array)
+ inline void BindVertexArray(GLuint array) override
{
}
- inline void DeleteVertexArrays(GLsizei n, const GLuint* arrays)
+ inline void DeleteVertexArrays(GLsizei n, const GLuint* arrays) override
{
}
- inline void GenVertexArrays(GLsizei n, GLuint* arrays)
+ inline void GenVertexArrays(GLsizei n, GLuint* arrays) override
{
}
- inline GLboolean IsVertexArray(GLuint array)
+ inline GLboolean IsVertexArray(GLuint array) override
{
return false;
}
- inline void GetIntegeri_v(GLenum target, GLuint index, GLint* data)
+ inline void GetIntegeri_v(GLenum target, GLuint index, GLint* data) override
{
}
- inline void BeginTransformFeedback(GLenum primitiveMode)
+ inline void BeginTransformFeedback(GLenum primitiveMode) override
{
}
- inline void EndTransformFeedback(void)
+ inline void EndTransformFeedback(void) override
{
}
- inline void BindBufferRange(GLenum target, GLuint index, GLuint buffer, GLintptr offset, GLsizeiptr size)
+ inline void BindBufferRange(GLenum target, GLuint index, GLuint buffer, GLintptr offset, GLsizeiptr size) override
{
}
- inline void BindBufferBase(GLenum target, GLuint index, GLuint buffer)
+ inline void BindBufferBase(GLenum target, GLuint index, GLuint buffer) override
{
}
- inline void TransformFeedbackVaryings(GLuint program, GLsizei count, const GLchar* const* varyings, GLenum bufferMode)
+ inline void TransformFeedbackVaryings(GLuint program, GLsizei count, const GLchar* const* varyings, GLenum bufferMode) override
{
}
- inline void GetTransformFeedbackVarying(GLuint program, GLuint index, GLsizei bufSize, GLsizei* length, GLsizei* size, GLenum* type, GLchar* name)
+ inline void GetTransformFeedbackVarying(GLuint program, GLuint index, GLsizei bufSize, GLsizei* length, GLsizei* size, GLenum* type, GLchar* name) override
{
}
- inline void VertexAttribIPointer(GLuint index, GLint size, GLenum type, GLsizei stride, const GLvoid* pointer)
+ inline void VertexAttribIPointer(GLuint index, GLint size, GLenum type, GLsizei stride, const GLvoid* pointer) override
{
}
- inline void GetVertexAttribIiv(GLuint index, GLenum pname, GLint* params)
+ inline void GetVertexAttribIiv(GLuint index, GLenum pname, GLint* params) override
{
}
- inline void GetVertexAttribIuiv(GLuint index, GLenum pname, GLuint* params)
+ inline void GetVertexAttribIuiv(GLuint index, GLenum pname, GLuint* params) override
{
}
- inline void VertexAttribI4i(GLuint index, GLint x, GLint y, GLint z, GLint w)
+ inline void VertexAttribI4i(GLuint index, GLint x, GLint y, GLint z, GLint w) override
{
}
- inline void VertexAttribI4ui(GLuint index, GLuint x, GLuint y, GLuint z, GLuint w)
+ inline void VertexAttribI4ui(GLuint index, GLuint x, GLuint y, GLuint z, GLuint w) override
{
}
- inline void VertexAttribI4iv(GLuint index, const GLint* v)
+ inline void VertexAttribI4iv(GLuint index, const GLint* v) override
{
}
- inline void VertexAttribI4uiv(GLuint index, const GLuint* v)
+ inline void VertexAttribI4uiv(GLuint index, const GLuint* v) override
{
}
- inline void GetUniformuiv(GLuint program, GLint location, GLuint* params)
+ inline void GetUniformuiv(GLuint program, GLint location, GLuint* params) override
{
}
- inline GLint GetFragDataLocation(GLuint program, const GLchar *name)
+ inline GLint GetFragDataLocation(GLuint program, const GLchar* name) override
{
return -1;
}
- inline void Uniform1ui(GLint location, GLuint v0)
+ inline void Uniform1ui(GLint location, GLuint v0) override
{
}
- inline void Uniform2ui(GLint location, GLuint v0, GLuint v1)
+ inline void Uniform2ui(GLint location, GLuint v0, GLuint v1) override
{
}
- inline void Uniform3ui(GLint location, GLuint v0, GLuint v1, GLuint v2)
+ inline void Uniform3ui(GLint location, GLuint v0, GLuint v1, GLuint v2) override
{
}
- inline void Uniform4ui(GLint location, GLuint v0, GLuint v1, GLuint v2, GLuint v3)
+ inline void Uniform4ui(GLint location, GLuint v0, GLuint v1, GLuint v2, GLuint v3) override
{
}
- inline void Uniform1uiv(GLint location, GLsizei count, const GLuint* value)
+ inline void Uniform1uiv(GLint location, GLsizei count, const GLuint* value) override
{
}
- inline void Uniform2uiv(GLint location, GLsizei count, const GLuint* value)
+ inline void Uniform2uiv(GLint location, GLsizei count, const GLuint* value) override
{
}
- inline void Uniform3uiv(GLint location, GLsizei count, const GLuint* value)
+ inline void Uniform3uiv(GLint location, GLsizei count, const GLuint* value) override
{
}
- inline void Uniform4uiv(GLint location, GLsizei count, const GLuint* value)
+ inline void Uniform4uiv(GLint location, GLsizei count, const GLuint* value) override
{
}
- inline void ClearBufferiv(GLenum buffer, GLint drawbuffer, const GLint* value)
+ inline void ClearBufferiv(GLenum buffer, GLint drawbuffer, const GLint* value) override
{
}
- inline void ClearBufferuiv(GLenum buffer, GLint drawbuffer, const GLuint* value)
+ inline void ClearBufferuiv(GLenum buffer, GLint drawbuffer, const GLuint* value) override
{
}
- inline void ClearBufferfv(GLenum buffer, GLint drawbuffer, const GLfloat* value)
+ inline void ClearBufferfv(GLenum buffer, GLint drawbuffer, const GLfloat* value) override
{
}
- inline void ClearBufferfi(GLenum buffer, GLint drawbuffer, GLfloat depth, GLint stencil)
+ inline void ClearBufferfi(GLenum buffer, GLint drawbuffer, GLfloat depth, GLint stencil) override
{
}
- inline const GLubyte* GetStringi(GLenum name, GLuint index)
+ inline const GLubyte* GetStringi(GLenum name, GLuint index) override
{
return NULL;
}
- inline void CopyBufferSubData(GLenum readTarget, GLenum writeTarget, GLintptr readOffset, GLintptr writeOffset, GLsizeiptr size)
+ inline void CopyBufferSubData(GLenum readTarget, GLenum writeTarget, GLintptr readOffset, GLintptr writeOffset, GLsizeiptr size) override
{
}
- inline void GetUniformIndices(GLuint program, GLsizei uniformCount, const GLchar* const* uniformNames, GLuint* uniformIndices)
+ inline void GetUniformIndices(GLuint program, GLsizei uniformCount, const GLchar* const* uniformNames, GLuint* uniformIndices) override
{
}
- inline void GetActiveUniformsiv(GLuint program, GLsizei uniformCount, const GLuint* uniformIndices, GLenum pname, GLint* params)
+ inline void GetActiveUniformsiv(GLuint program, GLsizei uniformCount, const GLuint* uniformIndices, GLenum pname, GLint* params) override
{
}
- inline GLuint GetUniformBlockIndex(GLuint program, const GLchar* uniformBlockName)
+ inline GLuint GetUniformBlockIndex(GLuint program, const GLchar* uniformBlockName) override
{
return GL_INVALID_INDEX;
}
- inline void GetActiveUniformBlockiv(GLuint program, GLuint uniformBlockIndex, GLenum pname, GLint* params)
+ inline void GetActiveUniformBlockiv(GLuint program, GLuint uniformBlockIndex, GLenum pname, GLint* params) override
{
}
- inline void GetActiveUniformBlockName(GLuint program, GLuint uniformBlockIndex, GLsizei bufSize, GLsizei* length, GLchar* uniformBlockName)
+ inline void GetActiveUniformBlockName(GLuint program, GLuint uniformBlockIndex, GLsizei bufSize, GLsizei* length, GLchar* uniformBlockName) override
{
}
- inline void UniformBlockBinding(GLuint program, GLuint uniformBlockIndex, GLuint uniformBlockBinding)
+ inline void UniformBlockBinding(GLuint program, GLuint uniformBlockIndex, GLuint uniformBlockBinding) override
{
}
- inline void DrawArraysInstanced(GLenum mode, GLint first, GLsizei count, GLsizei instanceCount)
+ inline void DrawArraysInstanced(GLenum mode, GLint first, GLsizei count, GLsizei instanceCount) override
{
}
- inline void DrawElementsInstanced(GLenum mode, GLsizei count, GLenum type, const GLvoid* indices, GLsizei instanceCount)
+ inline void DrawElementsInstanced(GLenum mode, GLsizei count, GLenum type, const GLvoid* indices, GLsizei instanceCount) override
{
}
- inline GLsync FenceSync(GLenum condition, GLbitfield flags)
+ inline GLsync FenceSync(GLenum condition, GLbitfield flags) override
{
return NULL;
}
- inline GLboolean IsSync(GLsync sync)
+ inline GLboolean IsSync(GLsync sync) override
{
return false;
}
- inline void DeleteSync(GLsync sync)
+ inline void DeleteSync(GLsync sync) override
{
}
- inline GLenum ClientWaitSync(GLsync sync, GLbitfield flags, GLuint64 timeout)
+ inline GLenum ClientWaitSync(GLsync sync, GLbitfield flags, GLuint64 timeout) override
{
return 0;
}
- inline void WaitSync(GLsync sync, GLbitfield flags, GLuint64 timeout)
+ inline void WaitSync(GLsync sync, GLbitfield flags, GLuint64 timeout) override
{
}
- inline void GetInteger64v(GLenum pname, GLint64* params)
+ inline void GetInteger64v(GLenum pname, GLint64* params) override
{
}
- inline void GetSynciv(GLsync sync, GLenum pname, GLsizei bufSize, GLsizei* length, GLint* values)
+ inline void GetSynciv(GLsync sync, GLenum pname, GLsizei bufSize, GLsizei* length, GLint* values) override
{
}
- inline void GetInteger64i_v(GLenum target, GLuint index, GLint64* data)
+ inline void GetInteger64i_v(GLenum target, GLuint index, GLint64* data) override
{
}
- inline void GetBufferParameteri64v(GLenum target, GLenum pname, GLint64* params)
+ inline void GetBufferParameteri64v(GLenum target, GLenum pname, GLint64* params) override
{
}
- inline void GenSamplers(GLsizei count, GLuint* samplers)
+ inline void GenSamplers(GLsizei count, GLuint* samplers) override
{
}
- inline void DeleteSamplers(GLsizei count, const GLuint* samplers)
+ inline void DeleteSamplers(GLsizei count, const GLuint* samplers) override
{
}
- inline GLboolean IsSampler(GLuint sampler)
+ inline GLboolean IsSampler(GLuint sampler) override
{
return false;
}
- inline void BindSampler(GLuint unit, GLuint sampler)
+ inline void BindSampler(GLuint unit, GLuint sampler) override
{
}
- inline void SamplerParameteri(GLuint sampler, GLenum pname, GLint param)
+ inline void SamplerParameteri(GLuint sampler, GLenum pname, GLint param) override
{
}
- inline void SamplerParameteriv(GLuint sampler, GLenum pname, const GLint* param)
+ inline void SamplerParameteriv(GLuint sampler, GLenum pname, const GLint* param) override
{
}
- inline void SamplerParameterf(GLuint sampler, GLenum pname, GLfloat param)
+ inline void SamplerParameterf(GLuint sampler, GLenum pname, GLfloat param) override
{
}
- inline void SamplerParameterfv(GLuint sampler, GLenum pname, const GLfloat* param)
+ inline void SamplerParameterfv(GLuint sampler, GLenum pname, const GLfloat* param) override
{
}
- inline void GetSamplerParameteriv(GLuint sampler, GLenum pname, GLint* params)
+ inline void GetSamplerParameteriv(GLuint sampler, GLenum pname, GLint* params) override
{
}
- inline void GetSamplerParameterfv(GLuint sampler, GLenum pname, GLfloat* params)
+ inline void GetSamplerParameterfv(GLuint sampler, GLenum pname, GLfloat* params) override
{
}
- inline void VertexAttribDivisor(GLuint index, GLuint divisor)
+ inline void VertexAttribDivisor(GLuint index, GLuint divisor) override
{
}
- inline void BindTransformFeedback(GLenum target, GLuint id)
+ inline void BindTransformFeedback(GLenum target, GLuint id) override
{
}
- inline void DeleteTransformFeedbacks(GLsizei n, const GLuint* ids)
+ inline void DeleteTransformFeedbacks(GLsizei n, const GLuint* ids) override
{
}
- inline void GenTransformFeedbacks(GLsizei n, GLuint* ids)
+ inline void GenTransformFeedbacks(GLsizei n, GLuint* ids) override
{
}
- inline GLboolean IsTransformFeedback(GLuint id)
+ inline GLboolean IsTransformFeedback(GLuint id) override
{
return false;
}
- inline void PauseTransformFeedback(void)
+ inline void PauseTransformFeedback(void) override
{
}
- inline void ResumeTransformFeedback(void)
+ inline void ResumeTransformFeedback(void) override
{
}
- inline void GetProgramBinary(GLuint program, GLsizei bufSize, GLsizei* length, GLenum* binaryFormat, GLvoid* binary)
+ inline void GetProgramBinary(GLuint program, GLsizei bufSize, GLsizei* length, GLenum* binaryFormat, GLvoid* binary) override
{
mGetProgramBinaryCalled = true;
}
- inline void ProgramBinary(GLuint program, GLenum binaryFormat, const GLvoid* binary, GLsizei length)
+ inline void ProgramBinary(GLuint program, GLenum binaryFormat, const GLvoid* binary, GLsizei length) override
{
}
- inline void ProgramParameteri(GLuint program, GLenum pname, GLint value)
+ inline void ProgramParameteri(GLuint program, GLenum pname, GLint value) override
{
}
- inline void InvalidateFramebuffer(GLenum target, GLsizei numAttachments, const GLenum* attachments)
+ inline void InvalidateFramebuffer(GLenum target, GLsizei numAttachments, const GLenum* attachments) override
{
}
- inline void InvalidateSubFramebuffer(GLenum target, GLsizei numAttachments, const GLenum* attachments, GLint x, GLint y, GLsizei width, GLsizei height)
+ inline void InvalidateSubFramebuffer(GLenum target, GLsizei numAttachments, const GLenum* attachments, GLint x, GLint y, GLsizei width, GLsizei height) override
{
}
- inline void TexStorage2D(GLenum target, GLsizei levels, GLenum internalformat, GLsizei width, GLsizei height)
+ inline void TexStorage2D(GLenum target, GLsizei levels, GLenum internalformat, GLsizei width, GLsizei height) override
{
}
- inline void TexStorage3D(GLenum target, GLsizei levels, GLenum internalformat, GLsizei width, GLsizei height, GLsizei depth)
+ inline void TexStorage3D(GLenum target, GLsizei levels, GLenum internalformat, GLsizei width, GLsizei height, GLsizei depth) override
{
}
- inline void GetInternalformativ(GLenum target, GLenum internalformat, GLenum pname, GLsizei bufSize, GLint* params)
+ inline void GetInternalformativ(GLenum target, GLenum internalformat, GLenum pname, GLsizei bufSize, GLint* params) override
{
}
private:
-
- inline void AddUniformCallToTraceStack( GLint location, std::string& value )
- {
- std::string name = "<not found>";
- bool matched = false;
+ inline void AddUniformCallToTraceStack(GLint location, std::string& value)
+ {
+ std::string name = "<not found>";
+ bool matched = false;
UniformIDMap& map = mUniforms[mCurrentProgram];
- for (UniformIDMap::iterator it=map.begin(); it!=map.end(); ++it)
+ for(UniformIDMap::iterator it = map.begin(); it != map.end(); ++it)
{
- if( it->second == location )
+ if(it->second == location)
{
- name = it->first;
+ name = it->first;
matched = true;
break;
}
}
- if ( matched )
+ if(matched)
{
- mSetUniformTrace.PushCall( name, value );
+ mSetUniformTrace.PushCall(name, value);
}
}
-
public: // TEST FUNCTIONS
- inline void SetCompileStatus( GLuint value ) { mCompileStatus = value; }
- inline void SetLinkStatus( GLuint value ) { mLinkStatus = value; }
- inline void SetGetAttribLocationResult( int result) { mGetAttribLocationResult = result; }
- inline void SetGetErrorResult( GLenum result) { mGetErrorResult = result; }
- inline void SetGetStringResult( GLubyte* result) { mGetStringResult = result; }
- inline void SetIsBufferResult( GLboolean result) { mIsBufferResult = result; }
- inline void SetIsEnabledResult( GLboolean result) { mIsEnabledResult = result; }
- inline void SetIsFramebufferResult( GLboolean result) { mIsFramebufferResult = result; }
- inline void SetIsProgramResult( GLboolean result) { mIsProgramResult = result; }
- inline void SetIsRenderbufferResult( GLboolean result) { mIsRenderbufferResult = result; }
- inline void SetIsShaderResult( GLboolean result) { mIsShaderResult = result; }
- inline void SetIsTextureResult( GLboolean result) { mIsTextureResult = result; }
- inline void SetCheckFramebufferStatusResult( GLenum result) { mCheckFramebufferStatusResult = result; }
- inline void SetNumBinaryFormats( GLint numFormats ) { mNumBinaryFormats = numFormats; }
- inline void SetBinaryFormats( GLint binaryFormats ) { mBinaryFormats = binaryFormats; }
- inline void SetProgramBinaryLength( GLint length ) { mProgramBinaryLength = length; }
+ inline void SetCompileStatus(GLuint value)
+ {
+ mCompileStatus = value;
+ }
+ inline void SetLinkStatus(GLuint value)
+ {
+ mLinkStatus = value;
+ }
+ inline void SetGetAttribLocationResult(int result)
+ {
+ mGetAttribLocationResult = result;
+ }
+ inline void SetGetErrorResult(GLenum result)
+ {
+ mGetErrorResult = result;
+ }
+ inline void SetGetStringResult(GLubyte* result)
+ {
+ mGetStringResult = result;
+ }
+ inline void SetIsBufferResult(GLboolean result)
+ {
+ mIsBufferResult = result;
+ }
+ inline void SetIsEnabledResult(GLboolean result)
+ {
+ mIsEnabledResult = result;
+ }
+ inline void SetIsFramebufferResult(GLboolean result)
+ {
+ mIsFramebufferResult = result;
+ }
+ inline void SetIsProgramResult(GLboolean result)
+ {
+ mIsProgramResult = result;
+ }
+ inline void SetIsRenderbufferResult(GLboolean result)
+ {
+ mIsRenderbufferResult = result;
+ }
+ inline void SetIsShaderResult(GLboolean result)
+ {
+ mIsShaderResult = result;
+ }
+ inline void SetIsTextureResult(GLboolean result)
+ {
+ mIsTextureResult = result;
+ }
+ inline void SetCheckFramebufferStatusResult(GLenum result)
+ {
+ mCheckFramebufferStatusResult = result;
+ }
+ inline void SetNumBinaryFormats(GLint numFormats)
+ {
+ mNumBinaryFormats = numFormats;
+ }
+ inline void SetBinaryFormats(GLint binaryFormats)
+ {
+ mBinaryFormats = binaryFormats;
+ }
+ inline void SetProgramBinaryLength(GLint length)
+ {
+ mProgramBinaryLength = length;
+ }
inline bool GetVertexAttribArrayState(GLuint index)
{
- if( index >= MAX_ATTRIBUTE_CACHE_SIZE )
+ if(index >= MAX_ATTRIBUTE_CACHE_SIZE)
{
// out of range
return false;
}
- return mVertexAttribArrayState[ index ];
+ return mVertexAttribArrayState[index];
+ }
+ inline void ClearVertexAttribArrayChanged()
+ {
+ mVertexAttribArrayChanged = false;
+ }
+ inline bool GetVertexAttribArrayChanged()
+ {
+ return mVertexAttribArrayChanged;
}
- inline void ClearVertexAttribArrayChanged() { mVertexAttribArrayChanged = false; }
- inline bool GetVertexAttribArrayChanged() { return mVertexAttribArrayChanged; }
//Methods for CullFace verification
- inline void EnableCullFaceCallTrace(bool enable) { mCullFaceTrace.Enable(enable); }
- inline void ResetCullFaceCallStack() { mCullFaceTrace.Reset(); }
- inline TraceCallStack& GetCullFaceTrace() { return mCullFaceTrace; }
+ inline void EnableCullFaceCallTrace(bool enable)
+ {
+ mCullFaceTrace.Enable(enable);
+ }
+ inline void ResetCullFaceCallStack()
+ {
+ mCullFaceTrace.Reset();
+ }
+ inline TraceCallStack& GetCullFaceTrace()
+ {
+ return mCullFaceTrace;
+ }
//Methods for Enable/Disable call verification
- inline void EnableEnableDisableCallTrace(bool enable) { mEnableDisableTrace.Enable(enable); }
- inline void ResetEnableDisableCallStack() { mEnableDisableTrace.Reset(); }
- inline TraceCallStack& GetEnableDisableTrace() { return mEnableDisableTrace; }
+ inline void EnableEnableDisableCallTrace(bool enable)
+ {
+ mEnableDisableTrace.Enable(enable);
+ }
+ inline void ResetEnableDisableCallStack()
+ {
+ mEnableDisableTrace.Reset();
+ }
+ inline TraceCallStack& GetEnableDisableTrace()
+ {
+ return mEnableDisableTrace;
+ }
//Methods for Shader verification
- inline void EnableShaderCallTrace(bool enable) { mShaderTrace.Enable(enable); }
- inline void ResetShaderCallStack() { mShaderTrace.Reset(); }
- inline TraceCallStack& GetShaderTrace() { return mShaderTrace; }
+ inline void EnableShaderCallTrace(bool enable)
+ {
+ mShaderTrace.Enable(enable);
+ }
+ inline void ResetShaderCallStack()
+ {
+ mShaderTrace.Reset();
+ }
+ inline TraceCallStack& GetShaderTrace()
+ {
+ return mShaderTrace;
+ }
//Methods for Texture verification
- inline void EnableTextureCallTrace(bool enable) { mTextureTrace.Enable(enable); }
- inline void ResetTextureCallStack() { mTextureTrace.Reset(); }
- inline TraceCallStack& GetTextureTrace() { return mTextureTrace; }
+ inline void EnableTextureCallTrace(bool enable)
+ {
+ mTextureTrace.Enable(enable);
+ }
+ inline void ResetTextureCallStack()
+ {
+ mTextureTrace.Reset();
+ }
+ inline TraceCallStack& GetTextureTrace()
+ {
+ return mTextureTrace;
+ }
//Methods for Texture verification
- inline void EnableTexParameterCallTrace(bool enable) { mTexParamaterTrace.Enable(enable); }
- inline void ResetTexParameterCallStack() { mTexParamaterTrace.Reset(); }
- inline TraceCallStack& GetTexParameterTrace() { return mTexParamaterTrace; }
+ inline void EnableTexParameterCallTrace(bool enable)
+ {
+ mTexParamaterTrace.Enable(enable);
+ }
+ inline void ResetTexParameterCallStack()
+ {
+ mTexParamaterTrace.Reset();
+ }
+ inline TraceCallStack& GetTexParameterTrace()
+ {
+ return mTexParamaterTrace;
+ }
//Methods for Draw verification
- inline void EnableDrawCallTrace(bool enable) { mDrawTrace.Enable(enable); }
- inline void ResetDrawCallStack() { mDrawTrace.Reset(); }
- inline TraceCallStack& GetDrawTrace() { return mDrawTrace; }
+ inline void EnableDrawCallTrace(bool enable)
+ {
+ mDrawTrace.Enable(enable);
+ }
+ inline void ResetDrawCallStack()
+ {
+ mDrawTrace.Reset();
+ }
+ inline TraceCallStack& GetDrawTrace()
+ {
+ return mDrawTrace;
+ }
//Methods for Depth function verification
- inline void EnableDepthFunctionCallTrace(bool enable) { mDepthFunctionTrace.Enable(enable); }
- inline void ResetDepthFunctionCallStack() { mDepthFunctionTrace.Reset(); }
- inline TraceCallStack& GetDepthFunctionTrace() { return mDepthFunctionTrace; }
+ inline void EnableDepthFunctionCallTrace(bool enable)
+ {
+ mDepthFunctionTrace.Enable(enable);
+ }
+ inline void ResetDepthFunctionCallStack()
+ {
+ mDepthFunctionTrace.Reset();
+ }
+ inline TraceCallStack& GetDepthFunctionTrace()
+ {
+ return mDepthFunctionTrace;
+ }
//Methods for Stencil function verification
- inline void EnableStencilFunctionCallTrace(bool enable) { mStencilFunctionTrace.Enable(enable); }
- inline void ResetStencilFunctionCallStack() { mStencilFunctionTrace.Reset(); }
- inline TraceCallStack& GetStencilFunctionTrace() { return mStencilFunctionTrace; }
+ inline void EnableStencilFunctionCallTrace(bool enable)
+ {
+ mStencilFunctionTrace.Enable(enable);
+ }
+ inline void ResetStencilFunctionCallStack()
+ {
+ mStencilFunctionTrace.Reset();
+ }
+ inline TraceCallStack& GetStencilFunctionTrace()
+ {
+ return mStencilFunctionTrace;
+ }
//Methods for Scissor verification
- inline void EnableScissorCallTrace(bool enable) { mScissorTrace.Enable(enable); }
- inline void ResetScissorCallStack() { mScissorTrace.Reset(); }
- inline TraceCallStack& GetScissorTrace() { return mScissorTrace; }
+ inline void EnableScissorCallTrace(bool enable)
+ {
+ mScissorTrace.Enable(enable);
+ }
+ inline void ResetScissorCallStack()
+ {
+ mScissorTrace.Reset();
+ }
+ inline TraceCallStack& GetScissorTrace()
+ {
+ return mScissorTrace;
+ }
//Methods for Uniform function verification
- inline void EnableSetUniformCallTrace(bool enable) { mSetUniformTrace.Enable(enable); }
- inline void ResetSetUniformCallStack() { mSetUniformTrace.Reset(); }
- inline TraceCallStack& GetSetUniformTrace() { return mSetUniformTrace; }
+ inline void EnableSetUniformCallTrace(bool enable)
+ {
+ mSetUniformTrace.Enable(enable);
+ }
+ inline void ResetSetUniformCallStack()
+ {
+ mSetUniformTrace.Reset();
+ }
+ inline TraceCallStack& GetSetUniformTrace()
+ {
+ return mSetUniformTrace;
+ }
//Methods for Viewport verification
- inline void EnableViewportCallTrace(bool enable) { mViewportTrace.Enable(enable); }
- inline void ResetViewportCallStack() { mViewportTrace.Reset(); }
- inline TraceCallStack& GetViewportTrace() { return mViewportTrace; }
+ inline void EnableViewportCallTrace(bool enable)
+ {
+ mViewportTrace.Enable(enable);
+ }
+ inline void ResetViewportCallStack()
+ {
+ mViewportTrace.Reset();
+ }
+ inline TraceCallStack& GetViewportTrace()
+ {
+ return mViewportTrace;
+ }
- template <typename T>
- inline bool GetUniformValue( const char* name, T& value ) const
+ template<typename T>
+ inline bool GetUniformValue(const char* name, T& value) const
{
- for( ProgramUniformMap::const_iterator program_it = mUniforms.begin();
- program_it != mUniforms.end();
- ++program_it )
+ for(ProgramUniformMap::const_iterator program_it = mUniforms.begin();
+ program_it != mUniforms.end();
+ ++program_it)
{
- const UniformIDMap &uniformIDs = program_it->second;
+ const UniformIDMap& uniformIDs = program_it->second;
- UniformIDMap::const_iterator uniform_it = uniformIDs.find( name );
- if( uniform_it != uniformIDs.end() )
+ UniformIDMap::const_iterator uniform_it = uniformIDs.find(name);
+ if(uniform_it != uniformIDs.end())
{
// found one matching uniform name, lets check the value...
GLuint programId = program_it->first;
- GLint uniformId = uniform_it->second;
+ GLint uniformId = uniform_it->second;
- const ProgramUniformValue<T> &mProgramUniforms = GetProgramUniformsForType( value );
- return mProgramUniforms.GetUniformValue( programId, uniformId, value );
+ const ProgramUniformValue<T>& mProgramUniforms = GetProgramUniformsForType(value);
+ return mProgramUniforms.GetUniformValue(programId, uniformId, value);
}
}
return false;
}
-
- template <typename T>
- inline bool CheckUniformValue( const char* name, const T& value ) const
+ template<typename T>
+ inline bool CheckUniformValue(const char* name, const T& value) const
{
- for( ProgramUniformMap::const_iterator program_it = mUniforms.begin();
- program_it != mUniforms.end();
- ++program_it )
+ for(ProgramUniformMap::const_iterator program_it = mUniforms.begin();
+ program_it != mUniforms.end();
+ ++program_it)
{
- const UniformIDMap &uniformIDs = program_it->second;
+ const UniformIDMap& uniformIDs = program_it->second;
- UniformIDMap::const_iterator uniform_it = uniformIDs.find( name );
- if( uniform_it != uniformIDs.end() )
+ UniformIDMap::const_iterator uniform_it = uniformIDs.find(name);
+ if(uniform_it != uniformIDs.end())
{
// found one matching uniform name, lets check the value...
GLuint programId = program_it->first;
- GLint uniformId = uniform_it->second;
+ GLint uniformId = uniform_it->second;
- const ProgramUniformValue<T> &mProgramUniforms = GetProgramUniformsForType( value );
- if( mProgramUniforms.CheckUniformValue( programId, uniformId, value ) )
+ const ProgramUniformValue<T>& mProgramUniforms = GetProgramUniformsForType(value);
+ if(mProgramUniforms.CheckUniformValue(programId, uniformId, value))
{
// the value matches
return true;
}
}
- fprintf(stderr, "Not found, printing possible values:\n" );
- for( ProgramUniformMap::const_iterator program_it = mUniforms.begin();
- program_it != mUniforms.end();
- ++program_it )
+ fprintf(stderr, "Not found, printing possible values:\n");
+ for(ProgramUniformMap::const_iterator program_it = mUniforms.begin();
+ program_it != mUniforms.end();
+ ++program_it)
{
- const UniformIDMap &uniformIDs = program_it->second;
+ const UniformIDMap& uniformIDs = program_it->second;
- UniformIDMap::const_iterator uniform_it = uniformIDs.find( name );
- if( uniform_it != uniformIDs.end() )
+ UniformIDMap::const_iterator uniform_it = uniformIDs.find(name);
+ if(uniform_it != uniformIDs.end())
{
// found one matching uniform name, lets check the value...
GLuint programId = program_it->first;
- GLint uniformId = uniform_it->second;
+ GLint uniformId = uniform_it->second;
- const ProgramUniformValue<T> &mProgramUniforms = GetProgramUniformsForType( value );
- T origValue;
- if ( mProgramUniforms.GetUniformValue(programId, uniformId, origValue) )
+ const ProgramUniformValue<T>& mProgramUniforms = GetProgramUniformsForType(value);
+ T origValue;
+ if(mProgramUniforms.GetUniformValue(programId, uniformId, origValue))
{
std::stringstream out;
out << uniform_it->first << ": " << origValue;
- fprintf(stderr, "%s\n", out.str().c_str() );
+ fprintf(stderr, "%s\n", out.str().c_str());
}
}
}
return false;
}
- template <typename T>
- inline bool GetUniformValue( GLuint programId, GLuint uniformId, T& outValue) const
+ template<typename T>
+ inline bool GetUniformValue(GLuint programId, GLuint uniformId, T& outValue) const
{
- const ProgramUniformValue<T> &mProgramUniforms = GetProgramUniformsForType( outValue );
- return mProgramUniforms.GetUniformValue( programId, uniformId, outValue );
+ const ProgramUniformValue<T>& mProgramUniforms = GetProgramUniformsForType(outValue);
+ return mProgramUniforms.GetUniformValue(programId, uniformId, outValue);
}
- inline bool GetUniformIds( const char* name, GLuint& programId, GLuint& uniformId ) const
+ inline bool GetUniformIds(const char* name, GLuint& programId, GLuint& uniformId) const
{
- for( ProgramUniformMap::const_iterator program_it = mUniforms.begin();
- program_it != mUniforms.end();
- ++program_it )
+ for(ProgramUniformMap::const_iterator program_it = mUniforms.begin();
+ program_it != mUniforms.end();
+ ++program_it)
{
- const UniformIDMap &uniformIDs = program_it->second;
+ const UniformIDMap& uniformIDs = program_it->second;
- UniformIDMap::const_iterator uniform_it = uniformIDs.find( name );
- if( uniform_it != uniformIDs.end() )
+ UniformIDMap::const_iterator uniform_it = uniformIDs.find(name);
+ if(uniform_it != uniformIDs.end())
{
programId = program_it->first;
uniformId = uniform_it->second;
struct ScissorParams
{
- GLint x;
- GLint y;
+ GLint x;
+ GLint y;
GLsizei width;
GLsizei height;
- ScissorParams() : x( 0 ), y( 0 ), width( 0 ), height( 0 ) { }
+ ScissorParams()
+ : x(0),
+ y(0),
+ width(0),
+ height(0)
+ {
+ }
};
// Methods to check scissor tests
- inline const ScissorParams& GetScissorParams() const { return mScissorParams; }
+ inline const ScissorParams& GetScissorParams() const
+ {
+ return mScissorParams;
+ }
struct ColorMaskParams
{
GLboolean blue;
GLboolean alpha;
- ColorMaskParams() : red( true ), green( true ), blue( true ), alpha( true ) { }
+ ColorMaskParams()
+ : red(true),
+ green(true),
+ blue(true),
+ alpha(true)
+ {
+ }
};
- inline bool GetProgramBinaryCalled() const { return mGetProgramBinaryCalled; }
+ inline bool GetProgramBinaryCalled() const
+ {
+ return mGetProgramBinaryCalled;
+ }
- inline unsigned int GetClearCountCalled() const { return mClearCount; }
+ inline unsigned int GetClearCountCalled() const
+ {
+ return mClearCount;
+ }
- inline const ColorMaskParams& GetColorMaskParams() const { return mColorMaskParams; }
+ inline const ColorMaskParams& GetColorMaskParams() const
+ {
+ return mColorMaskParams;
+ }
- typedef std::vector<size_t> BufferDataCalls;
- inline const BufferDataCalls& GetBufferDataCalls() const { return mBufferDataCalls; }
- inline void ResetBufferDataCalls() { mBufferDataCalls.clear(); }
+ typedef std::vector<size_t> BufferDataCalls;
+ inline const BufferDataCalls& GetBufferDataCalls() const
+ {
+ return mBufferDataCalls;
+ }
+ inline void ResetBufferDataCalls()
+ {
+ mBufferDataCalls.clear();
+ }
- typedef std::vector<size_t> BufferSubDataCalls;
- inline const BufferSubDataCalls& GetBufferSubDataCalls() const { return mBufferSubDataCalls; }
- inline void ResetBufferSubDataCalls() { mBufferSubDataCalls.clear(); }
+ typedef std::vector<size_t> BufferSubDataCalls;
+ inline const BufferSubDataCalls& GetBufferSubDataCalls() const
+ {
+ return mBufferSubDataCalls;
+ }
+ inline void ResetBufferSubDataCalls()
+ {
+ mBufferSubDataCalls.clear();
+ }
private:
- GLuint mCurrentProgram;
- GLuint mCompileStatus;
- BufferDataCalls mBufferDataCalls;
- BufferSubDataCalls mBufferSubDataCalls;
- GLuint mLinkStatus;
- GLint mNumberOfActiveUniforms;
- GLint mGetAttribLocationResult;
- GLenum mGetErrorResult;
- GLubyte* mGetStringResult;
- GLboolean mIsBufferResult;
- GLboolean mIsEnabledResult;
- GLboolean mIsFramebufferResult;
- GLboolean mIsProgramResult;
- GLboolean mIsRenderbufferResult;
- GLboolean mIsShaderResult;
- GLboolean mIsTextureResult;
- GLenum mActiveTextureUnit;
- GLenum mCheckFramebufferStatusResult;
- GLint mFramebufferStatus;
- GLenum mFramebufferDepthAttached;
- GLenum mFramebufferStencilAttached;
- GLuint mFramebufferColorAttachmentCount;
- GLuint mFrameBufferColorStatus;
- GLint mNumBinaryFormats;
- GLint mBinaryFormats;
- GLint mProgramBinaryLength;
- bool mVertexAttribArrayState[MAX_ATTRIBUTE_CACHE_SIZE];
- bool mVertexAttribArrayChanged; // whether the vertex attrib array has been changed
- bool mGetProgramBinaryCalled;
- typedef std::map< GLuint, std::string> ShaderSourceMap;
- ShaderSourceMap mShaderSources;
- GLuint mLastShaderCompiled;
- GLbitfield mLastClearBitMask;
- Vector4 mLastClearColor;
- unsigned int mClearCount;
+ GLuint mCurrentProgram;
+ GLuint mCompileStatus;
+ BufferDataCalls mBufferDataCalls;
+ BufferSubDataCalls mBufferSubDataCalls;
+ GLuint mLinkStatus;
+ GLint mNumberOfActiveUniforms;
+ GLint mGetAttribLocationResult;
+ GLenum mGetErrorResult;
+ GLubyte* mGetStringResult;
+ GLboolean mIsBufferResult;
+ GLboolean mIsEnabledResult;
+ GLboolean mIsFramebufferResult;
+ GLboolean mIsProgramResult;
+ GLboolean mIsRenderbufferResult;
+ GLboolean mIsShaderResult;
+ GLboolean mIsTextureResult;
+ GLenum mActiveTextureUnit;
+ GLenum mCheckFramebufferStatusResult;
+ GLint mFramebufferStatus;
+ GLenum mFramebufferDepthAttached;
+ GLenum mFramebufferStencilAttached;
+ GLuint mFramebufferColorAttachmentCount;
+ GLuint mFrameBufferColorStatus;
+ GLint mNumBinaryFormats;
+ GLint mBinaryFormats;
+ GLint mProgramBinaryLength;
+ bool mVertexAttribArrayState[MAX_ATTRIBUTE_CACHE_SIZE];
+ bool mVertexAttribArrayChanged; // whether the vertex attrib array has been changed
+ bool mGetProgramBinaryCalled;
+ typedef std::map<GLuint, std::string> ShaderSourceMap;
+ ShaderSourceMap mShaderSources;
+ GLuint mLastShaderCompiled;
+ GLbitfield mLastClearBitMask;
+ Vector4 mLastClearColor;
+ unsigned int mClearCount;
Vector4 mLastBlendColor;
GLenum mLastBlendEquationRgb;
GLboolean mLastDepthMask;
// Data for manipulating the IDs returned by GenTextures
- GLuint mLastAutoTextureIdUsed;
- GLuint mNumGeneratedTextures;
+ GLuint mLastAutoTextureIdUsed;
+ GLuint mNumGeneratedTextures;
std::vector<GLuint> mNextTextureIds;
std::vector<GLuint> mDeletedTextureIds;
std::vector<GLuint> mBoundTextures;
std::vector<GLuint> mBoundTextures;
};
- ActiveTextureType mActiveTextures[ MIN_TEXTURE_UNIT_LIMIT ];
+ ActiveTextureType mActiveTextures[MIN_TEXTURE_UNIT_LIMIT];
TraceCallStack mCullFaceTrace;
TraceCallStack mEnableDisableTrace;
TraceCallStack mViewportTrace;
// Shaders & Uniforms
- GLuint mLastShaderIdUsed;
- GLuint mLastProgramIdUsed;
- GLuint mLastUniformIdUsed;
- typedef std::map< std::string, GLint > UniformIDMap;
- typedef std::map< GLuint, UniformIDMap > ProgramUniformMap;
- ProgramUniformMap mUniforms;
+ GLuint mLastShaderIdUsed;
+ GLuint mLastProgramIdUsed;
+ GLuint mLastUniformIdUsed;
+ typedef std::map<std::string, GLint> UniformIDMap;
+ typedef std::map<GLuint, UniformIDMap> ProgramUniformMap;
+ ProgramUniformMap mUniforms;
- template <typename T>
- struct ProgramUniformValue : public std::map< GLuint, std::map< GLint, T > >
+ template<typename T>
+ struct ProgramUniformValue : public std::map<GLuint, std::map<GLint, T> >
{
public:
- typedef std::map< GLint, T > UniformValueMap;
- typedef std::map< GLuint, UniformValueMap > Map;
+ typedef std::map<GLint, T> UniformValueMap;
+ typedef std::map<GLuint, UniformValueMap> Map;
- bool SetUniformValue( GLuint program, GLuint uniform, const T& value )
+ bool SetUniformValue(GLuint program, GLuint uniform, const T& value)
{
- if( program == 0 )
+ if(program == 0)
{
return false;
}
- typename Map::iterator it = Map::find( program );
- if( it == Map::end() )
+ typename Map::iterator it = Map::find(program);
+ if(it == Map::end())
{
// if its the first uniform for this program add it
- std::pair< typename Map::iterator, bool > result =
- Map::insert( typename Map::value_type( program, UniformValueMap() ) );
+ std::pair<typename Map::iterator, bool> result =
+ Map::insert(typename Map::value_type(program, UniformValueMap()));
it = result.first;
}
UniformValueMap& uniforms = it->second;
- uniforms[uniform] = value;
+ uniforms[uniform] = value;
return true;
}
- bool CheckUniformValue( GLuint program, GLuint uniform, const T& value ) const
+ bool CheckUniformValue(GLuint program, GLuint uniform, const T& value) const
{
T uniformValue;
- if ( GetUniformValue( program, uniform, uniformValue ) )
+ if(GetUniformValue(program, uniform, uniformValue))
{
return CompareType<T>(value, uniformValue, Math::MACHINE_EPSILON_10);
}
return false;
}
- bool GetUniformValue( GLuint program, GLuint uniform, T& value ) const
+ bool GetUniformValue(GLuint program, GLuint uniform, T& value) const
{
- if( program == 0 )
+ if(program == 0)
{
return false;
}
- typename Map::const_iterator it = Map::find( program );
- if( it == Map::end() )
+ typename Map::const_iterator it = Map::find(program);
+ if(it == Map::end())
{
// Uniform values always initialised as 0
value = GetZero();
return true;
}
- const UniformValueMap& uniforms = it->second;
- typename UniformValueMap::const_iterator it2 = uniforms.find( uniform );
- if( it2 == uniforms.end() )
+ const UniformValueMap& uniforms = it->second;
+ typename UniformValueMap::const_iterator it2 = uniforms.find(uniform);
+ if(it2 == uniforms.end())
{
// Uniform values always initialised as 0
value = GetZero();
T GetZero() const;
};
- ProgramUniformValue<int> mProgramUniforms1i;
- ProgramUniformValue<float> mProgramUniforms1f;
+ ProgramUniformValue<int> mProgramUniforms1i;
+ ProgramUniformValue<float> mProgramUniforms1f;
ProgramUniformValue<Vector2> mProgramUniforms2f;
ProgramUniformValue<Vector3> mProgramUniforms3f;
ProgramUniformValue<Vector4> mProgramUniforms4f;
- ProgramUniformValue<Matrix> mProgramUniformsMat4;
+ ProgramUniformValue<Matrix> mProgramUniformsMat4;
ProgramUniformValue<Matrix3> mProgramUniformsMat3;
- inline const ProgramUniformValue<int>& GetProgramUniformsForType( const int ) const
+ inline const ProgramUniformValue<int>& GetProgramUniformsForType(const int) const
{
return mProgramUniforms1i;
}
- inline const ProgramUniformValue<float>& GetProgramUniformsForType( const float ) const
+ inline const ProgramUniformValue<float>& GetProgramUniformsForType(const float) const
{
return mProgramUniforms1f;
}
- inline const ProgramUniformValue<Vector2>& GetProgramUniformsForType( const Vector2& ) const
+ inline const ProgramUniformValue<Vector2>& GetProgramUniformsForType(const Vector2&) const
{
return mProgramUniforms2f;
}
- inline const ProgramUniformValue<Vector3>& GetProgramUniformsForType( const Vector3& ) const
+ inline const ProgramUniformValue<Vector3>& GetProgramUniformsForType(const Vector3&) const
{
return mProgramUniforms3f;
}
- inline const ProgramUniformValue<Vector4>& GetProgramUniformsForType( const Vector4& ) const
+ inline const ProgramUniformValue<Vector4>& GetProgramUniformsForType(const Vector4&) const
{
return mProgramUniforms4f;
}
- inline const ProgramUniformValue<Matrix>& GetProgramUniformsForType( const Matrix& ) const
+ inline const ProgramUniformValue<Matrix>& GetProgramUniformsForType(const Matrix&) const
{
return mProgramUniformsMat4;
}
- inline const ProgramUniformValue<Matrix3>& GetProgramUniformsForType( const Matrix3& ) const
+ inline const ProgramUniformValue<Matrix3>& GetProgramUniformsForType(const Matrix3&) const
{
return mProgramUniformsMat3;
}
inline void SetVertexAttribArray(GLuint index, bool state)
{
- if( index >= MAX_ATTRIBUTE_CACHE_SIZE )
+ if(index >= MAX_ATTRIBUTE_CACHE_SIZE)
{
// out of range
return;
}
- mVertexAttribArrayState[ index ] = state;
- mVertexAttribArrayChanged = true;
+ mVertexAttribArrayState[index] = state;
+ mVertexAttribArrayChanged = true;
}
- ScissorParams mScissorParams;
+ ScissorParams mScissorParams;
ColorMaskParams mColorMaskParams;
};
-template <>
+template<>
inline int TestGlAbstraction::ProgramUniformValue<int>::GetZero() const
{
return 0;
}
-template <>
+template<>
inline float TestGlAbstraction::ProgramUniformValue<float>::GetZero() const
{
return 0.0f;
}
-template <>
+template<>
inline Vector2 TestGlAbstraction::ProgramUniformValue<Vector2>::GetZero() const
{
return Vector2::ZERO;
}
-template <>
+template<>
inline Vector3 TestGlAbstraction::ProgramUniformValue<Vector3>::GetZero() const
{
return Vector3::ZERO;
}
-template <>
+template<>
inline Vector4 TestGlAbstraction::ProgramUniformValue<Vector4>::GetZero() const
{
return Vector4::ZERO;
}
-template <>
+template<>
inline Matrix TestGlAbstraction::ProgramUniformValue<Matrix>::GetZero() const
{
return Matrix();
}
-template <>
+template<>
inline Matrix3 TestGlAbstraction::ProgramUniformValue<Matrix3>::GetZero() const
{
- return Matrix3( Matrix() );
+ return Matrix3(Matrix());
}
} // namespace Dali
bool BlendEnabled(const Dali::TraceCallStack& callStack);
bool BlendDisabled(const Dali::TraceCallStack& callStack);
-
#endif // TEST_GL_ABSTRACTION_H
namespace Dali
{
-
/**
* Class to emulate the GL context helper
*/
-class DALI_CORE_API TestGlContextHelperAbstraction: public Integration::GlContextHelperAbstraction
+class DALI_CORE_API TestGlContextHelperAbstraction : public Integration::GlContextHelperAbstraction
{
public:
/**
* Constructor
*/
- TestGlContextHelperAbstraction() {};
+ TestGlContextHelperAbstraction(){};
/**
* Destructor
*/
- ~TestGlContextHelperAbstraction() {};
+ ~TestGlContextHelperAbstraction() override{};
/**
* @brief Switch to the surfaceless GL context
*/
- virtual void MakeSurfacelessContextCurrent() {};
+ void MakeSurfacelessContextCurrent() override{};
/**
* @brief Clear the GL context
*/
- virtual void MakeContextNull() {};
+ void MakeContextNull() override{};
/**
* @brief Wait until all GL rendering calls for the current GL context are executed
*/
- virtual void WaitClient() {};
-private:
+ void WaitClient() override{};
- TestGlContextHelperAbstraction( const TestGlContextHelperAbstraction& ); ///< Undefined
- TestGlContextHelperAbstraction& operator=( const TestGlContextHelperAbstraction& ); ///< Undefined
+private:
+ TestGlContextHelperAbstraction(const TestGlContextHelperAbstraction&); ///< Undefined
+ TestGlContextHelperAbstraction& operator=(const TestGlContextHelperAbstraction&); ///< Undefined
};
-} // Dali
+} // namespace Dali
#endif // TEST_GL_CONTEXT_HELPER_ABSTRACTION_H
namespace Dali
{
-
TestSyncObject::TestSyncObject(TraceCallStack& trace)
: synced(false),
mTrace(trace)
return synced;
}
-
-
TestGlSyncAbstraction::TestGlSyncAbstraction()
{
Initialize();
*/
TestGlSyncAbstraction::~TestGlSyncAbstraction()
{
- for( SyncIter iter=mSyncObjects.begin(), end=mSyncObjects.end(); iter != end; ++iter )
+ for(SyncIter iter = mSyncObjects.begin(), end = mSyncObjects.end(); iter != end; ++iter)
{
delete *iter;
}
* Create a sync object
* @return the sync object
*/
-Integration::GlSyncAbstraction::SyncObject* TestGlSyncAbstraction::CreateSyncObject( )
+Integration::GlSyncAbstraction::SyncObject* TestGlSyncAbstraction::CreateSyncObject()
{
mTrace.PushCall("CreateSyncObject", ""); // Trace the method
TestSyncObject* syncObject = new TestSyncObject(mTrace);
- mSyncObjects.push_back( syncObject );
+ mSyncObjects.push_back(syncObject);
return syncObject;
}
* Destroy a sync object
* @param[in] syncObject The object to destroy
*/
-void TestGlSyncAbstraction::DestroySyncObject( Integration::GlSyncAbstraction::SyncObject* syncObject )
+void TestGlSyncAbstraction::DestroySyncObject(Integration::GlSyncAbstraction::SyncObject* syncObject)
{
std::stringstream out;
out << syncObject;
mTrace.PushCall("DestroySyncObject", out.str()); // Trace the method
- for( SyncIter iter=mSyncObjects.begin(), end=mSyncObjects.end(); iter != end; ++iter )
+ for(SyncIter iter = mSyncObjects.begin(), end = mSyncObjects.end(); iter != end; ++iter)
{
- if( *iter == syncObject )
+ if(*iter == syncObject)
{
delete *iter;
mSyncObjects.erase(iter);
}
}
-
-Integration::GlSyncAbstraction::SyncObject* TestGlSyncAbstraction::GetLastSyncObject( )
+Integration::GlSyncAbstraction::SyncObject* TestGlSyncAbstraction::GetLastSyncObject()
{
- if( !mSyncObjects.empty() )
+ if(!mSyncObjects.empty())
{
return mSyncObjects.back();
}
* @param[in]
* @param[in] sync The sync value to set
*/
-void TestGlSyncAbstraction::SetObjectSynced( Integration::GlSyncAbstraction::SyncObject* syncObject, bool sync )
+void TestGlSyncAbstraction::SetObjectSynced(Integration::GlSyncAbstraction::SyncObject* syncObject, bool sync)
{
TestSyncObject* testSyncObject = static_cast<TestSyncObject*>(syncObject);
- testSyncObject->synced = sync;
+ testSyncObject->synced = sync;
}
/**
* Turn trace on
*/
-void TestGlSyncAbstraction::EnableTrace(bool enable) { mTrace.Enable(enable); }
+void TestGlSyncAbstraction::EnableTrace(bool enable)
+{
+ mTrace.Enable(enable);
+}
/**
* Reset the trace callstack
*/
-void TestGlSyncAbstraction::ResetTrace() { mTrace.Reset(); }
+void TestGlSyncAbstraction::ResetTrace()
+{
+ mTrace.Reset();
+}
/**
* Get the trace object (allows test case to find methods on it)
*/
-TraceCallStack& TestGlSyncAbstraction::GetTrace() { return mTrace; }
+TraceCallStack& TestGlSyncAbstraction::GetTrace()
+{
+ return mTrace;
+}
int32_t TestGlSyncAbstraction::GetNumberOfSyncObjects()
{
- return static_cast<int32_t>( mSyncObjects.size() );
+ return static_cast<int32_t>(mSyncObjects.size());
}
-
-} // Dali
+} // namespace Dali
#define TEST_GL_SYNC_ABSTRACTION_H
/*
- * Copyright (c) 2019 Samsung Electronics Co., Ltd.
+ * Copyright (c) 2020 Samsung Electronics Co., Ltd.
*
* Licensed under the Apache License, Version 2.0 (the "License");
* you may not use this file except in compliance with the License.
*/
// EXTERNAL INCLUDES
+#include <map>
#include <sstream>
#include <string>
-#include <map>
// INTERNAL INCLUDES
#include <dali/integration-api/core.h>
#include <dali/integration-api/gl-sync-abstraction.h>
+
#include "test-trace-call-stack.h"
namespace Dali
{
-
class DALI_CORE_API TestSyncObject : public Integration::GlSyncAbstraction::SyncObject
{
public:
TestSyncObject(TraceCallStack& trace);
- ~TestSyncObject();
- bool IsSynced();
- bool synced;
+ ~TestSyncObject() override;
+ bool IsSynced() override;
+ bool synced;
TraceCallStack& mTrace;
};
/**
* Class to emulate the GL sync functions with tracing
*/
-class DALI_CORE_API TestGlSyncAbstraction: public Integration::GlSyncAbstraction
+class DALI_CORE_API TestGlSyncAbstraction : public Integration::GlSyncAbstraction
{
public:
/**
/**
* Destructor
*/
- ~TestGlSyncAbstraction();
+ ~TestGlSyncAbstraction() override;
/**
* Initialize the sync objects - clear down the map
* Create a sync object
* @return the sync object
*/
- virtual Integration::GlSyncAbstraction::SyncObject* CreateSyncObject( );
+ Integration::GlSyncAbstraction::SyncObject* CreateSyncObject() override;
/**
* Destroy a sync object
* @param[in] syncObject The object to destroy
*/
- virtual void DestroySyncObject( Integration::GlSyncAbstraction::SyncObject* syncObject );
-
+ void DestroySyncObject(Integration::GlSyncAbstraction::SyncObject* syncObject) override;
public: // TEST FUNCTIONS
- Integration::GlSyncAbstraction::SyncObject* GetLastSyncObject( );
+ Integration::GlSyncAbstraction::SyncObject* GetLastSyncObject();
/**
* Test method to trigger the object sync behaviour.
* @param[in]
* @param[in] sync The sync value to set
*/
- void SetObjectSynced( Integration::GlSyncAbstraction::SyncObject* syncObject, bool sync );
+ void SetObjectSynced(Integration::GlSyncAbstraction::SyncObject* syncObject, bool sync);
/**
* Turn trace on
int32_t GetNumberOfSyncObjects();
private:
+ TestGlSyncAbstraction(const TestGlSyncAbstraction&); ///< Undefined
+ TestGlSyncAbstraction& operator=(const TestGlSyncAbstraction&); ///< Undefined
- TestGlSyncAbstraction( const TestGlSyncAbstraction& ); ///< Undefined
- TestGlSyncAbstraction& operator=( const TestGlSyncAbstraction& ); ///< Undefined
-
- typedef std::vector<TestSyncObject*> SyncContainer;
- typedef SyncContainer::iterator SyncIter;
- SyncContainer mSyncObjects; ///< The sync objects
- TraceCallStack mTrace; ///< the trace call stack for testing
+ typedef std::vector<TestSyncObject*> SyncContainer;
+ typedef SyncContainer::iterator SyncIter;
+ SyncContainer mSyncObjects; ///< The sync objects
+ TraceCallStack mTrace; ///< the trace call stack for testing
};
-} // Dali
+} // namespace Dali
#endif // TEST_GL_SYNC_ABSTRACTION_H
*/
#include "test-harness.h"
+
+#include <fcntl.h>
#include <stdlib.h>
#include <sys/types.h>
#include <sys/wait.h>
+#include <testcase.h>
#include <unistd.h>
-#include <vector>
-#include <map>
+
#include <cstring>
-#include <testcase.h>
-#include <fcntl.h>
+#include <map>
+#include <vector>
namespace TestHarness
{
-
typedef std::map<int32_t, TestCase> RunningTestCases;
const char* basename(const char* path)
{
- const char* ptr=path;
- const char* slash=NULL;
- for( ; *ptr != '\0' ; ++ptr )
+ const char* ptr = path;
+ const char* slash = NULL;
+ for(; *ptr != '\0'; ++ptr)
{
- if(*ptr == '/') slash=ptr;
+ if(*ptr == '/') slash = ptr;
}
if(slash != NULL) ++slash;
return slash;
open("/dev/null", O_RDWR); // Redirect file descriptor number 2 (i.e. stderr) to /dev/null
}
-int32_t RunTestCase( struct ::testcase_s& testCase )
+int32_t RunTestCase(struct ::testcase_s& testCase)
{
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
-// by default tests should all always pass with no exceptions
- if( testCase.startup )
+ // dont want to catch exception as we want to be able to get
+ // gdb stack trace from the first error
+ // by default tests should all always pass with no exceptions
+ if(testCase.startup)
{
testCase.startup();
}
{
result = testCase.function();
}
- catch( const char* )
+ catch(const char*)
{
// just catch test fail exception, return is already set to EXIT_STATUS_TESTCASE_FAILED
}
- if( testCase.cleanup )
+ if(testCase.cleanup)
{
testCase.cleanup();
}
return result;
}
-
-int32_t RunTestCaseInChildProcess( struct ::testcase_s& testCase, bool suppressOutput )
+int32_t RunTestCaseInChildProcess(struct ::testcase_s& testCase, bool suppressOutput)
{
int32_t testResult = EXIT_STATUS_TESTCASE_FAILED;
int32_t pid = fork();
- if( pid == 0 ) // Child process
+ if(pid == 0) // Child process
{
- if( suppressOutput )
+ if(suppressOutput)
{
SuppressLogOutput();
}
else
{
printf("\n");
- for(int32_t i=0; i<80; ++i) printf("#");
+ for(int32_t i = 0; i < 80; ++i) printf("#");
printf("\nTC: %s\n", testCase.name);
fflush(stdout);
}
- int32_t status = RunTestCase( testCase );
+ int32_t status = RunTestCase(testCase);
- if( ! suppressOutput )
+ if(!suppressOutput)
{
fflush(stdout);
fflush(stderr);
fclose(stdout);
fclose(stderr);
}
- exit( status );
+ exit(status);
}
else if(pid == -1)
{
}
else // Parent process
{
- int32_t status = 0;
+ int32_t status = 0;
int32_t childPid = waitpid(pid, &status, 0);
- if( childPid == -1 )
+ if(childPid == -1)
{
perror("waitpid");
exit(EXIT_STATUS_WAITPID_FAILED);
}
- if( WIFEXITED(status) )
+ if(WIFEXITED(status))
{
- if( childPid > 0 )
+ if(childPid > 0)
{
testResult = WEXITSTATUS(status);
- if( testResult )
+ if(testResult)
{
printf("Test case %s failed: %d\n", testCase.name, testResult);
}
}
}
- else if(WIFSIGNALED(status) )
+ else if(WIFSIGNALED(status))
{
int32_t signal = WTERMSIG(status);
- testResult = EXIT_STATUS_TESTCASE_ABORTED;
- if( signal == SIGABRT )
+ testResult = EXIT_STATUS_TESTCASE_ABORTED;
+ if(signal == SIGABRT)
{
- printf("Test case %s failed: test case asserted\n", testCase.name );
+ printf("Test case %s failed: test case asserted\n", testCase.name);
}
else
{
return testResult;
}
-void OutputStatistics( const char* processName, int32_t numPasses, int32_t numFailures )
+void OutputStatistics(const char* processName, int32_t numPasses, int32_t numFailures)
{
- FILE* fp=fopen("summary.xml", "a");
- if( fp != NULL )
+ FILE* fp = fopen("summary.xml", "a");
+ if(fp != NULL)
{
- fprintf( fp,
- " <suite name=\"%s\">\n"
- " <total_case>%d</total_case>\n"
- " <pass_case>%d</pass_case>\n"
- " <pass_rate>%5.2f</pass_rate>\n"
- " <fail_case>%d</fail_case>\n"
- " <fail_rate>%5.2f</fail_rate>\n"
- " <block_case>0</block_case>\n"
- " <block_rate>0.00</block_rate>\n"
- " <na_case>0</na_case>\n"
- " <na_rate>0.00</na_rate>\n"
- " </suite>\n",
- basename(processName),
- numPasses+numFailures,
- numPasses,
- (float)numPasses/(numPasses+numFailures),
- numFailures,
- (float)numFailures/(numPasses+numFailures) );
+ fprintf(fp,
+ " <suite name=\"%s\">\n"
+ " <total_case>%d</total_case>\n"
+ " <pass_case>%d</pass_case>\n"
+ " <pass_rate>%5.2f</pass_rate>\n"
+ " <fail_case>%d</fail_case>\n"
+ " <fail_rate>%5.2f</fail_rate>\n"
+ " <block_case>0</block_case>\n"
+ " <block_rate>0.00</block_rate>\n"
+ " <na_case>0</na_case>\n"
+ " <na_rate>0.00</na_rate>\n"
+ " </suite>\n",
+ basename(processName),
+ numPasses + numFailures,
+ numPasses,
+ (float)numPasses / (numPasses + numFailures),
+ numFailures,
+ (float)numFailures / (numPasses + numFailures));
fclose(fp);
}
}
-int32_t RunAll( const char* processName, ::testcase tc_array[] )
+int32_t RunAll(const char* processName, ::testcase tc_array[])
{
int32_t numFailures = 0;
- int32_t numPasses = 0;
+ int32_t numPasses = 0;
// Run test cases in child process( to kill output/handle signals ), but run serially.
- for( uint32_t i=0; tc_array[i].name; i++)
+ for(uint32_t i = 0; tc_array[i].name; i++)
{
- int32_t result = RunTestCaseInChildProcess( tc_array[i], false );
- if( result == 0 )
+ int32_t result = RunTestCaseInChildProcess(tc_array[i], false);
+ if(result == 0)
{
numPasses++;
}
}
}
- OutputStatistics( processName, numPasses, numFailures);
+ OutputStatistics(processName, numPasses, numFailures);
return numFailures;
}
// Constantly runs up to MAX_NUM_CHILDREN processes
-int32_t RunAllInParallel( const char* processName, ::testcase tc_array[], bool reRunFailed)
+int32_t RunAllInParallel(const char* processName, ::testcase tc_array[], bool reRunFailed)
{
int32_t numFailures = 0;
- int32_t numPasses = 0;
+ int32_t numPasses = 0;
- RunningTestCases children;
+ RunningTestCases children;
std::vector<int32_t> failedTestCases;
// Fork up to MAX_NUM_CHILDREN processes, then
// wait. As soon as a proc completes, fork the next.
- int32_t nextTestCase = 0;
+ int32_t nextTestCase = 0;
int32_t numRunningChildren = 0;
- while( tc_array[nextTestCase].name || 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 )
+ while(numRunningChildren < MAX_NUM_CHILDREN && tc_array[nextTestCase].name)
{
int32_t pid = fork();
- if( pid == 0 ) // Child process
+ if(pid == 0) // Child process
{
SuppressLogOutput();
- exit( RunTestCase( tc_array[nextTestCase] ) );
+ exit(RunTestCase(tc_array[nextTestCase]));
}
else if(pid == -1)
{
// Wait for the next child to finish
- int32_t status=0;
+ int32_t status = 0;
int32_t childPid = waitpid(-1, &status, 0);
- if( childPid == -1 )
+ if(childPid == -1)
{
perror("waitpid");
exit(EXIT_STATUS_WAITPID_FAILED);
}
- if( WIFEXITED(status) )
+ if(WIFEXITED(status))
{
- if( childPid > 0 )
+ if(childPid > 0)
{
int32_t testResult = WEXITSTATUS(status);
- if( testResult )
+ if(testResult)
{
printf("Test case %s failed: %d\n", children[childPid].testCaseName, testResult);
failedTestCases.push_back(children[childPid].testCase);
}
}
- else if( WIFSIGNALED(status) || WIFSTOPPED(status))
+ else if(WIFSIGNALED(status) || WIFSTOPPED(status))
{
- status = WIFSIGNALED(status)?WTERMSIG(status):WSTOPSIG(status);
+ status = WIFSIGNALED(status) ? WTERMSIG(status) : WSTOPSIG(status);
- if( childPid > 0 )
+ if(childPid > 0)
{
RunningTestCases::iterator iter = children.find(childPid);
- if( iter != children.end() )
+ if(iter != children.end())
{
printf("Test case %s exited with signal %s\n", iter->second.testCaseName, strsignal(status));
failedTestCases.push_back(iter->second.testCase);
}
}
- OutputStatistics( processName, numPasses, numFailures );
+ OutputStatistics(processName, numPasses, numFailures);
- if( reRunFailed )
+ if(reRunFailed)
{
- for( uint32_t i=0; i<failedTestCases.size(); i++)
+ for(uint32_t i = 0; i < failedTestCases.size(); i++)
{
- char* testCaseStrapline;
- int32_t numChars = asprintf(&testCaseStrapline, "Test case %s", tc_array[failedTestCases[i]].name );
+ char* testCaseStrapline;
+ int32_t numChars = asprintf(&testCaseStrapline, "Test case %s", tc_array[failedTestCases[i]].name);
printf("\n%s\n", testCaseStrapline);
- for(int32_t j=0; j<numChars; j++)
+ for(int32_t j = 0; j < numChars; j++)
{
printf("=");
}
printf("\n");
- RunTestCaseInChildProcess( tc_array[failedTestCases[i] ], false );
+ RunTestCaseInChildProcess(tc_array[failedTestCases[i]], false);
}
}
return numFailures;
}
-
-
int32_t FindAndRunTestCase(::testcase tc_array[], const char* testCaseName)
{
int32_t result = EXIT_STATUS_TESTCASE_NOT_FOUND;
- for( int32_t i = 0; tc_array[i].name; i++ )
+ for(int32_t i = 0; tc_array[i].name; i++)
{
- if( !strcmp(testCaseName, tc_array[i].name) )
+ if(!strcmp(testCaseName, tc_array[i].name))
{
- return RunTestCase( tc_array[i] );
+ return RunTestCase(tc_array[i]);
}
}
void Usage(const char* program)
{
- printf("Usage: \n"
- " %s <testcase name>\t\t Execute a test case\n"
- " %s \t\t Execute all test cases in parallel\n"
- " %s -r\t\t Execute all test cases in parallel, rerunning failed test cases\n"
- " %s -s\t\t Execute all test cases serially\n",
- program, program, program, program);
+ printf(
+ "Usage: \n"
+ " %s <testcase name>\t\t Execute a test case\n"
+ " %s \t\t Execute all test cases in parallel\n"
+ " %s -r\t\t Execute all test cases in parallel, rerunning failed test cases\n"
+ " %s -s\t\t Execute all test cases serially\n",
+ program,
+ program,
+ program,
+ program);
}
-} // namespace
+} // namespace TestHarness
#define TEST_HARNESS_H
/*
- * Copyright (c) 2018 Samsung Electronics Co., Ltd.
+ * Copyright (c) 2020 Samsung Electronics Co., Ltd.
*
* Licensed under the Apache License, Version 2.0 (the "License");
* you may not use this file except in compliance with the License.
#include <stdio.h>
#include <testcase.h>
+
#include <cstdint>
namespace TestHarness
{
-
enum ExitStatus
{
- EXIT_STATUS_TESTCASE_SUCCEEDED, // 0
- EXIT_STATUS_TESTCASE_FAILED, // 1
- EXIT_STATUS_TESTCASE_ABORTED, // 2
- EXIT_STATUS_FORK_FAILED, // 3
- EXIT_STATUS_WAITPID_FAILED, // 4
- EXIT_STATUS_BAD_ARGUMENT, // 5
- EXIT_STATUS_TESTCASE_NOT_FOUND // 6
+ EXIT_STATUS_TESTCASE_SUCCEEDED, // 0
+ EXIT_STATUS_TESTCASE_FAILED, // 1
+ EXIT_STATUS_TESTCASE_ABORTED, // 2
+ EXIT_STATUS_FORK_FAILED, // 3
+ EXIT_STATUS_WAITPID_FAILED, // 4
+ EXIT_STATUS_BAD_ARGUMENT, // 5
+ EXIT_STATUS_TESTCASE_NOT_FOUND // 6
};
const int32_t MAX_NUM_CHILDREN(16);
struct TestCase
{
- int32_t testCase;
+ int32_t testCase;
const char* testCaseName;
TestCase()
}
TestCase& operator=(const TestCase& rhs)
{
- testCase = rhs.testCase;
+ testCase = rhs.testCase;
testCaseName = rhs.testCaseName;
return *this;
-
}
};
* Run a test case
* @param[in] testCase The Testkit-lite test case to run
*/
-int32_t RunTestCase( struct testcase_s& testCase );
+int32_t RunTestCase(struct testcase_s& testCase);
/**
* Run all test cases in parallel
* @param[in] tc_array The array of auto-generated testkit-lite test cases
* @return 0 on success
*/
-int32_t 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
#define TEST_INTRUSIVE_PTR_H
/*
- * Copyright (c) 2019 Samsung Electronics Co., Ltd.
+ * Copyright (c) 2020 Samsung Electronics Co., Ltd.
*
* Licensed under the Apache License, Version 2.0 (the "License");
* you may not use this file except in compliance with the License.
*/
// INTERNAL INCLUDES
-#include <iostream>
-#include <stdlib.h>
-#include <dali/public-api/dali-core.h>
#include <dali-test-suite-utils.h>
+#include <dali/public-api/dali-core.h>
+#include <stdlib.h>
+
+#include <iostream>
namespace Dali
{
-
-template <typename T>
+template<typename T>
struct UtcCoverageIntrusivePtr
{
typedef IntrusivePtr<T> (*Creator)();
- void Check( Creator creator)
+ void Check(Creator creator)
{
IntrusivePtr<T> a = creator();
IntrusivePtr<T> b = creator();
- DALI_TEST_CHECK( a.Get() );
+ DALI_TEST_CHECK(a.Get());
a.Reset();
DALI_TEST_CHECK(a);
a.Reset();
-
};
-
};
-} // Dali
+} // namespace Dali
#endif // TEST_INTRUSIVE_PTR_H
-
-
/*
- * Copyright (c) 2018 Samsung Electronics Co., Ltd.
+ * Copyright (c) 2020 Samsung Electronics Co., Ltd.
*
* Licensed under the Apache License, Version 2.0 (the "License");
* you may not use this file except in compliance with the License.
*
*/
-
#include "test-application.h"
-#include "test-native-image.h"
+#include "test-native-image.h"
namespace Dali
{
-
TestNativeImagePointer TestNativeImage::New(uint32_t width, uint32_t height)
{
return new TestNativeImage(width, height);
}
TestNativeImage::TestNativeImage(uint32_t width, uint32_t height)
-: mWidth(width), mHeight(height), mExtensionCreateCalls(0), mExtensionDestroyCalls(0), mTargetTextureCalls(0),createResult(true)
+: mWidth(width),
+ mHeight(height),
+ mExtensionCreateCalls(0),
+ mExtensionDestroyCalls(0),
+ mTargetTextureCalls(0),
+ createResult(true)
{
}
{
}
-} // namespace dali
+} // namespace Dali
#define TEST_NATIVE_IMAGE_H
/*
- * Copyright (c) 2019 Samsung Electronics Co., Ltd.
+ * Copyright (c) 2020 Samsung Electronics Co., Ltd.
*
* Licensed under the Apache License, Version 2.0 (the "License");
* you may not use this file except in compliance with the License.
// INTERNAL INCLUDES
#include <dali/public-api/images/native-image-interface.h>
+
#include <dali/integration-api/gl-defines.h>
namespace Dali
public:
static TestNativeImagePointer New(uint32_t width, uint32_t height);
- inline void SetGlExtensionCreateResult(bool result){ createResult = result;}
- inline virtual bool CreateResource() { ++mExtensionCreateCalls; return createResult;};
- inline virtual void DestroyResource() { ++mExtensionDestroyCalls; };
- inline virtual GLenum TargetTexture() { ++mTargetTextureCalls; return mTargetTextureError;};
- inline virtual void PrepareTexture() {};
- 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 int GetTextureTarget() const {return GL_TEXTURE_EXTERNAL_OES;};
- inline virtual const char* GetCustomFragmentPrefix() const {return "#extension GL_OES_EGL_image_external:require\n";};
- inline const char* GetCustomSamplerTypename() const override { return "samplerExternalOES"; };
+ inline void SetGlExtensionCreateResult(bool result)
+ {
+ createResult = result;
+ }
+ inline virtual bool CreateResource()
+ {
+ ++mExtensionCreateCalls;
+ return createResult;
+ };
+ inline virtual void DestroyResource()
+ {
+ ++mExtensionDestroyCalls;
+ };
+ inline virtual GLenum TargetTexture()
+ {
+ ++mTargetTextureCalls;
+ return mTargetTextureError;
+ };
+ inline virtual void PrepareTexture(){};
+ 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 int GetTextureTarget() const
+ {
+ return GL_TEXTURE_EXTERNAL_OES;
+ };
+ inline virtual const char* GetCustomFragmentPrefix() const
+ {
+ return "#extension GL_OES_EGL_image_external:require\n";
+ };
+ inline const char* GetCustomSamplerTypename() const override
+ {
+ return "samplerExternalOES";
+ };
- inline Any GetNativeImageHandle() const override { return nullptr; };
- inline bool SourceChanged() const override { return false; };
+ inline Any GetNativeImageHandle() const override
+ {
+ return nullptr;
+ };
+ inline bool SourceChanged() const override
+ {
+ return false;
+ };
- inline virtual Dali::NativeImageInterface::Extension* GetExtension() {return nullptr;}
+ inline virtual Dali::NativeImageInterface::Extension* GetExtension()
+ {
+ return nullptr;
+ }
private:
TestNativeImage(uint32_t width, uint32_t height);
uint32_t mWidth;
uint32_t mHeight;
+
public:
- int32_t mExtensionCreateCalls;
- int32_t mExtensionDestroyCalls;
- int32_t mTargetTextureCalls;
- uint32_t mTargetTextureError=0u;
- bool createResult;
+ int32_t mExtensionCreateCalls;
+ int32_t mExtensionDestroyCalls;
+ int32_t mTargetTextureCalls;
+ uint32_t mTargetTextureError = 0u;
+ bool createResult;
};
-
-
-} // Dali
+} // namespace Dali
#endif // TEST_NATIVE_IMAGE_H
/*
- * Copyright (c) 2019 Samsung Electronics Co., Ltd.
+ * Copyright (c) 2020 Samsung Electronics Co., Ltd.
*
* Licensed under the Apache License, Version 2.0 (the "License");
* you may not use this file except in compliance with the License.
*/
#include "test-platform-abstraction.h"
-#include "dali-test-suite-utils.h"
+
#include <dali/integration-api/bitmap.h>
+#include "dali-test-suite-utils.h"
+
namespace Dali
{
-
TestPlatformAbstraction::TestPlatformAbstraction()
: mTrace(),
- mIsLoadingResult( false ),
+ mIsLoadingResult(false),
mClosestSize(),
mLoadFileResult(),
- mSaveFileResult( false ),
+ mSaveFileResult(false),
mSynchronouslyLoadedResource(),
mTimerId(0),
mCallbackFunction(nullptr)
{
}
-ImageDimensions TestPlatformAbstraction::GetClosestImageSize( const std::string& filename,
- ImageDimensions size,
- FittingMode::Type fittingMode,
- SamplingMode::Type samplingMode,
- bool orientationCorrection )
+ImageDimensions TestPlatformAbstraction::GetClosestImageSize(const std::string& filename,
+ ImageDimensions size,
+ FittingMode::Type fittingMode,
+ SamplingMode::Type samplingMode,
+ bool orientationCorrection)
{
- ImageDimensions closestSize = ImageDimensions( mClosestSize );
+ ImageDimensions closestSize = ImageDimensions(mClosestSize);
mTrace.PushCall("GetClosestImageSize", "");
return closestSize;
}
-ImageDimensions TestPlatformAbstraction::GetClosestImageSize( Integration::ResourcePointer resourceBuffer,
- ImageDimensions size,
- FittingMode::Type fittingMode,
- SamplingMode::Type samplingMode,
- bool orientationCorrection )
+ImageDimensions TestPlatformAbstraction::GetClosestImageSize(Integration::ResourcePointer resourceBuffer,
+ ImageDimensions size,
+ FittingMode::Type fittingMode,
+ SamplingMode::Type samplingMode,
+ bool orientationCorrection)
{
- ImageDimensions closestSize = ImageDimensions( mClosestSize );
+ ImageDimensions closestSize = ImageDimensions(mClosestSize);
mTrace.PushCall("GetClosestImageSize", "");
return closestSize;
}
-Integration::ResourcePointer TestPlatformAbstraction::LoadImageSynchronously( const Integration::BitmapResourceType& resourceType, const std::string& resourcePath )
+Integration::ResourcePointer TestPlatformAbstraction::LoadImageSynchronously(const Integration::BitmapResourceType& resourceType, const std::string& resourcePath)
{
mTrace.PushCall("LoadResourceSynchronously", "");
return mSynchronouslyLoadedResource;
}
-Integration::BitmapPtr TestPlatformAbstraction::DecodeBuffer( const Integration::BitmapResourceType& resourceType, uint8_t * buffer, size_t size )
+Integration::BitmapPtr TestPlatformAbstraction::DecodeBuffer(const Integration::BitmapResourceType& resourceType, uint8_t* buffer, size_t size)
{
mTrace.PushCall("DecodeBuffer", "");
return mDecodedBitmap;
}
-bool TestPlatformAbstraction::LoadShaderBinaryFile( const std::string& filename, Dali::Vector< unsigned char >& buffer ) const
+bool TestPlatformAbstraction::LoadShaderBinaryFile(const std::string& filename, Dali::Vector<unsigned char>& buffer) const
{
mTrace.PushCall("LoadShaderBinaryFile", "");
- if( mLoadFileResult.loadResult )
+ if(mLoadFileResult.loadResult)
{
buffer = mLoadFileResult.buffer;
}
{
mTrace.Reset();
mTrace.Enable(true);
- mIsLoadingResult=false;
+ mIsLoadingResult = false;
mSynchronouslyLoadedResource.Reset();
mDecodedBitmap.Reset();
}
{
switch(func)
{
- case LoadResourceSynchronouslyFunc: return mTrace.FindMethod("LoadResourceSynchronously");
- case LoadShaderBinaryFileFunc: return mTrace.FindMethod("LoadShaderBinaryFile");
- case SaveShaderBinaryFileFunc: return mTrace.FindMethod("SaveShaderBinaryFile");
+ case LoadResourceSynchronouslyFunc:
+ return mTrace.FindMethod("LoadResourceSynchronously");
+ case LoadShaderBinaryFileFunc:
+ return mTrace.FindMethod("LoadShaderBinaryFile");
+ case SaveShaderBinaryFileFunc:
+ return mTrace.FindMethod("SaveShaderBinaryFile");
}
return false;
}
mDecodedBitmap.Reset();
}
-void TestPlatformAbstraction::SetClosestImageSize( const Vector2& size )
+void TestPlatformAbstraction::SetClosestImageSize(const Vector2& size)
{
- mClosestSize = ImageDimensions( static_cast<uint32_t>( size.x ), static_cast<uint32_t>( size.y ) );
+ mClosestSize = ImageDimensions(static_cast<uint32_t>(size.x), static_cast<uint32_t>(size.y));
}
-void TestPlatformAbstraction::SetLoadFileResult( bool result, Dali::Vector< unsigned char >& buffer )
+void TestPlatformAbstraction::SetLoadFileResult(bool result, Dali::Vector<unsigned char>& buffer)
{
mLoadFileResult.loadResult = result;
- if( result )
+ if(result)
{
mLoadFileResult.buffer = buffer;
}
}
-void TestPlatformAbstraction::SetSaveFileResult( bool result )
+void TestPlatformAbstraction::SetSaveFileResult(bool result)
{
mSaveFileResult = result;
}
-void TestPlatformAbstraction::SetSynchronouslyLoadedResource( Integration::ResourcePointer resource )
+void TestPlatformAbstraction::SetSynchronouslyLoadedResource(Integration::ResourcePointer resource)
{
mSynchronouslyLoadedResource = resource;
}
-void TestPlatformAbstraction::SetDecodedBitmap( Integration::BitmapPtr bitmap )
+void TestPlatformAbstraction::SetDecodedBitmap(Integration::BitmapPtr bitmap)
{
mDecodedBitmap = bitmap;
}
-uint32_t TestPlatformAbstraction::StartTimer( uint32_t milliseconds, CallbackBase* callback )
+uint32_t TestPlatformAbstraction::StartTimer(uint32_t milliseconds, CallbackBase* callback)
{
mCallbackFunction = callback;
mTimerId++;
void TestPlatformAbstraction::TriggerTimer()
{
- if (mCallbackFunction != nullptr)
+ if(mCallbackFunction != nullptr)
{
- CallbackBase::Execute( *mCallbackFunction );
+ CallbackBase::Execute(*mCallbackFunction);
}
}
-void TestPlatformAbstraction::CancelTimer ( uint32_t timerId )
+void TestPlatformAbstraction::CancelTimer(uint32_t timerId)
{
mCallbackFunction = nullptr;
}
#define DALI_TEST_PLATFORM_ABSTRACTION_H
/*
- * Copyright (c) 2019 Samsung Electronics Co., Ltd.
+ * Copyright (c) 2020 Samsung Electronics Co., Ltd.
*
* Licensed under the Apache License, Version 2.0 (the "License");
* you may not use this file except in compliance with the License.
// EXTERNAL INCLUDES
#include <stdint.h>
+
#include <cstring>
#include <string>
#include <vector>
namespace Dali
{
-
/**
* Concrete implementation of the platform abstraction class.
*/
class DALI_CORE_API TestPlatformAbstraction : public Dali::Integration::PlatformAbstraction
{
-
public:
-
/**
* Constructor
*/
/**
* Destructor
*/
- virtual ~TestPlatformAbstraction();
+ ~TestPlatformAbstraction() override;
/**
* @copydoc PlatformAbstraction::GetClosestImageSize()
*/
- virtual ImageDimensions GetClosestImageSize( const std::string& filename,
- ImageDimensions size,
- FittingMode::Type fittingMode,
- SamplingMode::Type samplingMode,
- bool orientationCorrection );
+ ImageDimensions GetClosestImageSize(const std::string& filename,
+ ImageDimensions size,
+ FittingMode::Type fittingMode,
+ SamplingMode::Type samplingMode,
+ bool orientationCorrection) override;
/**
* @copydoc PlatformAbstraction::GetClosestImageSize()
*/
- virtual ImageDimensions GetClosestImageSize( Integration::ResourcePointer resourceBuffer,
- ImageDimensions size,
- FittingMode::Type fittingMode,
- SamplingMode::Type samplingMode,
- bool orientationCorrection );
+ ImageDimensions GetClosestImageSize(Integration::ResourcePointer resourceBuffer,
+ ImageDimensions size,
+ FittingMode::Type fittingMode,
+ SamplingMode::Type samplingMode,
+ bool orientationCorrection) override;
/**
* @copydoc PlatformAbstraction::LoadResourceSynchronously()
*/
- virtual Integration::ResourcePointer LoadImageSynchronously( const Integration::BitmapResourceType& resourceType, const std::string& resourcePath );
+ Integration::ResourcePointer LoadImageSynchronously(const Integration::BitmapResourceType& resourceType, const std::string& resourcePath) override;
/**
* @copydoc PlatformAbstraction::DecodeBuffer()
*/
- virtual Integration::BitmapPtr DecodeBuffer( const Dali::Integration::BitmapResourceType& resourceType, uint8_t * buffer, size_t size );
+ Integration::BitmapPtr DecodeBuffer(const Dali::Integration::BitmapResourceType& resourceType, uint8_t* buffer, size_t size) override;
/**
* @copydoc PlatformAbstraction::LoadShaderBinaryFile()
*/
- virtual bool LoadShaderBinaryFile( const std::string& filename, Dali::Vector< unsigned char >& buffer ) const;
+ bool LoadShaderBinaryFile(const std::string& filename, Dali::Vector<unsigned char>& buffer) const override;
/**
* @copydoc PlatformAbstraction::SaveShaderBinaryFile()
*/
- virtual bool SaveShaderBinaryFile( const std::string& filename, const unsigned char * buffer, unsigned int numBytes ) const { return true; }
+ virtual bool SaveShaderBinaryFile(const std::string& filename, const unsigned char* buffer, unsigned int numBytes) const override
+ {
+ return true;
+ }
/**
* @copydoc PlatformAbstraction::StartTimer()
*/
- virtual uint32_t StartTimer( uint32_t milliseconds, CallbackBase* callback );
+ uint32_t StartTimer(uint32_t milliseconds, CallbackBase* callback) override;
/*
* @copydoc PlatformAbstraction::CancelTimer()
*/
- virtual void CancelTimer ( uint32_t timerId );
+ void CancelTimer(uint32_t timerId) override;
public: // TEST FUNCTIONS
-
// Enumeration of Platform Abstraction methods
typedef enum
{
/** Call this every test */
void Initialize();
- inline void EnableTrace(bool enable) { mTrace.Enable(enable); }
- inline void ResetTrace() { mTrace.Reset(); }
- inline TraceCallStack& GetTrace() { return mTrace; }
+ inline void EnableTrace(bool enable)
+ {
+ mTrace.Enable(enable);
+ }
+ inline void ResetTrace()
+ {
+ mTrace.Reset();
+ }
+ inline TraceCallStack& GetTrace()
+ {
+ return mTrace;
+ }
/**
* @brief Checks if a platform function was called
* @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.
* @param[in] result The value that LoadFile should return.
* @param[in] buffer The buffer of the loaded file.
*/
- void SetLoadFileResult( bool result, Dali::Vector< unsigned char >& buffer );
+ void SetLoadFileResult(bool result, Dali::Vector<unsigned char>& buffer);
/**
* @brief Sets the SaveFile result
* @param[in] result The value that SaveFile should return
*/
- void SetSaveFileResult( bool result );
+ void SetSaveFileResult(bool result);
/**
* @brief Sets the resource loaded by LoadResourceSynchronously
* @param[in] resource The loaded resource
*/
- void SetSynchronouslyLoadedResource( Integration::ResourcePointer resource );
+ void SetSynchronouslyLoadedResource(Integration::ResourcePointer resource);
/**
* @brief Sets the bitmap returned by DecodeBuffer()
* @param[in] bitmap The decoded bitmap
*/
- void SetDecodedBitmap( Integration::BitmapPtr bitmap );
+ void SetDecodedBitmap(Integration::BitmapPtr bitmap);
/**
* @brief Triggers the previously stored callback function
void TriggerTimer();
private:
-
- TestPlatformAbstraction( const TestPlatformAbstraction& ); ///< Undefined
- TestPlatformAbstraction& operator=( const TestPlatformAbstraction& ); ///< Undefined
+ TestPlatformAbstraction(const TestPlatformAbstraction&); ///< Undefined
+ TestPlatformAbstraction& operator=(const TestPlatformAbstraction&); ///< Undefined
private:
-
struct LoadFileResult
{
inline LoadFileResult()
: loadResult(false)
{
-
}
- bool loadResult;
- Dali::Vector< unsigned char> buffer;
+ bool loadResult;
+ Dali::Vector<unsigned char> buffer;
};
- mutable TraceCallStack mTrace;
- bool mIsLoadingResult;
- ImageDimensions mClosestSize;
+ mutable TraceCallStack mTrace;
+ bool mIsLoadingResult;
+ ImageDimensions mClosestSize;
- LoadFileResult mLoadFileResult;
- bool mSaveFileResult;
+ LoadFileResult mLoadFileResult;
+ bool mSaveFileResult;
- Integration::ResourcePointer mSynchronouslyLoadedResource;
- Integration::BitmapPtr mDecodedBitmap;
+ Integration::ResourcePointer mSynchronouslyLoadedResource;
+ Integration::BitmapPtr mDecodedBitmap;
- uint32_t mTimerId;
- CallbackBase* mCallbackFunction;
+ uint32_t mTimerId;
+ CallbackBase* mCallbackFunction;
};
-} // Dali
+} // namespace Dali
#endif /* DALI_TEST_PLATFORM_ABSTRACTION_H */
/*
- * Copyright (c) 2017 Samsung Electronics Co., Ltd.
+ * Copyright (c) 2020 Samsung Electronics Co., Ltd.
*
* Licensed under the Apache License, Version 2.0 (the "License");
* you may not use this file except in compliance with the License.
namespace Dali
{
-
TestRenderController::TestRenderController()
{
Initialize();
{
}
-void TestRenderController::RequestUpdate( bool forceUpdate )
+void TestRenderController::RequestUpdate(bool forceUpdate)
{
mRequestUpdateCalled = true;
}
-void TestRenderController::RequestProcessEventsOnIdle( bool forceProcess )
+void TestRenderController::RequestProcessEventsOnIdle(bool forceProcess)
{
mRequestProcessEventsOnIdleCalled = true;
}
{
switch(func)
{
- case RequestUpdateFunc: return mRequestUpdateCalled;
- case RequestProcessEventsOnIdleFunc: return mRequestProcessEventsOnIdleCalled;
+ case RequestUpdateFunc:
+ return mRequestUpdateCalled;
+ case RequestProcessEventsOnIdleFunc:
+ return mRequestProcessEventsOnIdleCalled;
}
return false;
void TestRenderController::Initialize()
{
- mRequestUpdateCalled = false;
+ mRequestUpdateCalled = false;
mRequestProcessEventsOnIdleCalled = false;
}
-
-} // namespace dali
+} // namespace Dali
#define TEST_RENDER_CONTROLLER_H
/*
- * Copyright (c) 2019 Samsung Electronics Co., Ltd.
+ * Copyright (c) 2020 Samsung Electronics Co., Ltd.
*
* Licensed under the Apache License, Version 2.0 (the "License");
* you may not use this file except in compliance with the License.
*/
// INTERNAL INCLUDES
-#include <dali/public-api/common/dali-common.h>
#include <dali/integration-api/render-controller.h>
+#include <dali/public-api/common/dali-common.h>
namespace Dali
{
-
class DALI_CORE_API TestRenderController : public Dali::Integration::RenderController
{
public:
TestRenderController();
- ~TestRenderController();
+ ~TestRenderController() override;
- virtual void RequestUpdate( bool forceUpdate );
- virtual void RequestProcessEventsOnIdle( bool forceProcess );
+ void RequestUpdate(bool forceUpdate) override;
+ void RequestProcessEventsOnIdle(bool forceProcess) override;
typedef enum
{
bool WasCalled(TestRenderControllerFuncEnum func);
void Initialize();
-
private:
bool mRequestUpdateCalled;
bool mRequestProcessEventsOnIdleCalled;
};
-} // Dali
+} // namespace Dali
#endif // TEST_RENDER_CONTROLLER_H
/*
- * Copyright (c) 2017 Samsung Electronics Co., Ltd.
+ * Copyright (c) 2020 Samsung Electronics Co., Ltd.
*
* Licensed under the Apache License, Version 2.0 (the "License");
* you may not use this file except in compliance with the License.
*/
#include "test-trace-call-stack.h"
+
#include <sstream>
namespace Dali
{
-
std::string ToString(int x)
{
std::stringstream out;
/**
* Constructor
*/
-TraceCallStack::TraceCallStack() : mTraceActive(false) { }
+TraceCallStack::TraceCallStack()
+: mTraceActive(false)
+{
+}
/**
* Destructor
*/
-TraceCallStack::~TraceCallStack() { }
+TraceCallStack::~TraceCallStack()
+{
+}
/**
* Turn on / off tracing
*/
-void TraceCallStack::Enable(bool enable) { mTraceActive = enable; }
+void TraceCallStack::Enable(bool enable)
+{
+ mTraceActive = enable;
+}
-bool TraceCallStack::IsEnabled() { return mTraceActive; }
+bool TraceCallStack::IsEnabled()
+{
+ return mTraceActive;
+}
/**
* Push a call onto the stack if the trace is active
if(mTraceActive)
{
FunctionCall stackFrame(method, params);
- mCallStack.push_back( stackFrame );
+ mCallStack.push_back(stackFrame);
}
}
if(mTraceActive)
{
FunctionCall stackFrame(method, params, altParams);
- mCallStack.push_back( stackFrame );
+ mCallStack.push_back(stackFrame);
}
}
bool TraceCallStack::FindMethod(std::string method) const
{
bool found = false;
- for( size_t i=0; i < mCallStack.size(); i++ )
+ for(size_t i = 0; i < mCallStack.size(); i++)
{
- if( 0 == mCallStack[i].method.compare(method) )
+ if(0 == mCallStack[i].method.compare(method))
{
found = true;
break;
return found;
}
-bool TraceCallStack::FindMethodAndGetParameters(std::string method, std::string& params ) const
+bool TraceCallStack::FindMethodAndGetParameters(std::string method, std::string& params) const
{
bool found = false;
- for( size_t i=0; i < mCallStack.size(); i++ )
+ for(size_t i = 0; i < mCallStack.size(); i++)
{
- if( 0 == mCallStack[i].method.compare(method) )
+ if(0 == mCallStack[i].method.compare(method))
{
- found = true;
+ found = true;
params = mCallStack[i].paramList;
break;
}
int TraceCallStack::CountMethod(std::string method) const
{
int numCalls = 0;
- for( size_t i=0; i < mCallStack.size(); i++ )
+ for(size_t i = 0; i < mCallStack.size(); i++)
{
- if( 0 == mCallStack[i].method.compare(method) )
+ if(0 == mCallStack[i].method.compare(method))
{
numCalls++;
}
*/
bool TraceCallStack::FindMethodAndParams(std::string method, std::string params) const
{
- return FindIndexFromMethodAndParams( method, params ) > -1;
+ return FindIndexFromMethodAndParams(method, params) > -1;
}
bool TraceCallStack::FindMethodAndParams(std::string method, const NamedParams& params) const
{
- return FindIndexFromMethodAndParams( method, params ) > -1;
+ return FindIndexFromMethodAndParams(method, params) > -1;
}
-bool TraceCallStack::FindMethodAndParamsFromStartIndex( std::string method, std::string params, size_t& startIndex ) const
+bool TraceCallStack::FindMethodAndParamsFromStartIndex(std::string method, std::string params, size_t& startIndex) const
{
- for( size_t i = startIndex; i < mCallStack.size(); ++i )
+ for(size_t i = startIndex; i < mCallStack.size(); ++i)
{
- if( ( mCallStack[i].method.compare( method ) == 0 ) && ( mCallStack[i].paramList.compare( params ) == 0 ) )
+ if((mCallStack[i].method.compare(method) == 0) && (mCallStack[i].paramList.compare(params) == 0))
{
startIndex = i;
return true;
int32_t TraceCallStack::FindIndexFromMethodAndParams(std::string method, std::string params) const
{
int32_t index = -1;
- for( size_t i=0; i < mCallStack.size(); i++ )
+ for(size_t i = 0; i < mCallStack.size(); i++)
{
- if( 0 == mCallStack[i].method.compare(method) && 0 == mCallStack[i].paramList.compare(params) )
+ if(0 == mCallStack[i].method.compare(method) && 0 == mCallStack[i].paramList.compare(params))
{
- index = static_cast<int32_t>( i );
+ index = static_cast<int32_t>(i);
break;
}
}
int TraceCallStack::FindIndexFromMethodAndParams(std::string method, const TraceCallStack::NamedParams& params) const
{
int32_t index = -1;
- for( size_t i=0; i < mCallStack.size(); i++ )
+ for(size_t i = 0; i < mCallStack.size(); i++)
{
- if( 0 == mCallStack[i].method.compare(method) )
+ if(0 == mCallStack[i].method.compare(method))
{
// Test each of the passed in parameters:
bool match = true;
- for( NamedParams::const_iterator iter = params.begin() ; iter != params.end() ; ++iter )
+ for(NamedParams::const_iterator iter = params.begin(); iter != params.end(); ++iter)
{
NamedParams::const_iterator paramIter = mCallStack[i].namedParams.find(iter->first);
- if( paramIter == params.end() || paramIter->second.compare(iter->second) != 0 )
+ if(paramIter == params.end() || paramIter->second.compare(iter->second) != 0)
{
match = false;
break;
}
}
- if( match == true )
+ if(match == true)
{
- index = static_cast<int32_t>( i );
+ index = static_cast<int32_t>(i);
break;
}
}
return index;
}
-
/**
* Test if the given method and parameters are at a given index in the stack
* @param[in] index Index in the call stack
*/
bool TraceCallStack::TestMethodAndParams(int index, std::string method, std::string params) const
{
- return ( 0 == mCallStack[index].method.compare(method) && 0 == mCallStack[index].paramList.compare(params) );
+ return (0 == mCallStack[index].method.compare(method) && 0 == mCallStack[index].paramList.compare(params));
}
/**
mCallStack.clear();
}
-
} // namespace Dali
#define TEST_TRACE_CALL_STACK_H
/*
- * Copyright (c) 2016 Samsung Electronics Co., Ltd.
+ * Copyright (c) 2020 Samsung Electronics Co., Ltd.
*
* Licensed under the Apache License, Version 2.0 (the "License");
* you may not use this file except in compliance with the License.
*
*/
-#include <string>
-#include <vector>
#include <map>
#include <sstream>
+#include <string>
+#include <vector>
namespace Dali
{
-
template<typename T>
std::string ToString(const T& x)
{
class TraceCallStack
{
public:
-
/// Typedef for passing and storing named parameters
- typedef std::map< std::string, std::string > NamedParams;
+ typedef std::map<std::string, std::string> NamedParams;
/**
* Constructor
* @param[out] params of the method
* @return true if the method was in the stack
*/
- bool FindMethodAndGetParameters(std::string method, std::string& params ) const;
+ bool FindMethodAndGetParameters(std::string method, std::string& params) const;
/**
* Count how many times a method was called
* calls can search for methods occuring after this one.
* @return True if the method was in the stack
*/
- bool FindMethodAndParamsFromStartIndex( std::string method, std::string params, size_t& startIndex ) const;
+ bool FindMethodAndParamsFromStartIndex(std::string method, std::string params, size_t& startIndex) const;
/**
* Search for a method in the stack with the given parameter list
std::string GetTraceString()
{
std::stringstream traceStream;
- std::size_t functionCount = mCallStack.size();
- for( std::size_t 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 ];
+ Dali::TraceCallStack::FunctionCall functionCall = mCallStack[i];
traceStream << "StackTrace: Index:" << i << ", Function:" << functionCall.method << ", ParamList:" << functionCall.paramList << std::endl;
}
std::string method;
std::string paramList;
NamedParams namedParams;
- FunctionCall( const std::string& aMethod, const std::string& aParamList )
- : method( aMethod ), paramList( aParamList )
+ FunctionCall(const std::string& aMethod, const std::string& aParamList)
+ : method(aMethod),
+ paramList(aParamList)
{
}
- FunctionCall( const std::string& aMethod, const std::string& aParamList, const NamedParams& altParams )
- : method( aMethod ), paramList( aParamList ), namedParams( altParams )
+ FunctionCall(const std::string& aMethod, const std::string& aParamList, const NamedParams& altParams)
+ : method(aMethod),
+ paramList(aParamList),
+ namedParams(altParams)
{
}
};
- std::vector< FunctionCall > mCallStack; ///< The call stack
+ std::vector<FunctionCall> mCallStack; ///< The call stack
};
-} // namespace dali
+} // namespace Dali
#endif // TEST_TRACE_CALL_STACK_H
-#include <string.h>
#include <getopt.h>
#include <stdlib.h>
+#include <string.h>
#include <test-harness.h>
+
#include "tct-dali-adaptor-core.h"
-int main(int argc, char * const argv[])
+int main(int argc, char* const argv[])
{
int result = TestHarness::EXIT_STATUS_BAD_ARGUMENT;
const char* optString = "sf";
- bool optRerunFailed(true);
- bool optRunSerially(false);
+ bool optRerunFailed(true);
+ bool optRunSerially(false);
int nextOpt = 0;
do
{
- nextOpt = getopt( argc, argv, optString );
+ nextOpt = getopt(argc, argv, optString);
switch(nextOpt)
{
case 'f':
exit(TestHarness::EXIT_STATUS_BAD_ARGUMENT);
break;
}
- } while( nextOpt != -1 );
+ } while(nextOpt != -1);
- if( optind == argc ) // no testcase name in argument list
+ if(optind == argc) // no testcase name in argument list
{
- if( optRunSerially )
+ if(optRunSerially)
{
- result = TestHarness::RunAll( argv[0], tc_array );
+ result = TestHarness::RunAll(argv[0], tc_array);
}
else
{
- result = TestHarness::RunAllInParallel( argv[0], tc_array, optRerunFailed );
+ result = TestHarness::RunAllInParallel(argv[0], tc_array, optRerunFailed);
}
}
else
*
*/
-#include <dali/dali.h>
#include <dali-test-suite-utils.h>
+#include <dali/dali.h>
using namespace Dali;
namespace
{
-
struct MyTestApp : public ConnectionTracker
{
- MyTestApp( Application& app)
- : initCalled( false ),
- application( app )
+ MyTestApp(Application& app)
+ : initCalled(false),
+ application(app)
{
- application.InitSignal().Connect( this, &MyTestApp::Create );
+ application.InitSignal().Connect(this, &MyTestApp::Create);
}
void Create(Application& app)
}
// Data
- bool initCalled;
+ bool initCalled;
Application& application;
};
-void ApplicationSignalCallback( Application& app )
+void ApplicationSignalCallback(Application& app)
{
}
-void ApplicationControlSignalCallback(Application&, void *)
+void ApplicationControlSignalCallback(Application&, void*)
{
}
} // unnamed namespace
-void LowBatterySignalCallback( Dali::DeviceStatus::Battery::Status status )
+void LowBatterySignalCallback(Dali::DeviceStatus::Battery::Status status)
{
}
-void LowMemorySignalCallback( Dali::DeviceStatus::Memory::Status status )
+void LowMemorySignalCallback(Dali::DeviceStatus::Memory::Status status)
{
}
{
Application application = Application::New();
- MyTestApp testApp( application );
+ MyTestApp testApp(application);
- DALI_TEST_CHECK( application );
+ DALI_TEST_CHECK(application);
END_TEST;
}
int UtcDaliApplicationNew02(void)
{
- int argc( 1 );
- const char* argList[1] = { "program" };
- char** argv = const_cast<char**>(argList);
+ int argc(1);
+ const char* argList[1] = {"program"};
+ char** argv = const_cast<char**>(argList);
- Application application = Application::New( &argc, &argv );
+ Application application = Application::New(&argc, &argv);
- MyTestApp testApp( application );
+ MyTestApp testApp(application);
- DALI_TEST_CHECK( application );
+ DALI_TEST_CHECK(application);
END_TEST;
}
int UtcDaliApplicationNew03(void)
{
- int argc( 1 );
- const char* argList[1] = { "program" };
- char** argv = const_cast<char**>(argList);
+ int argc(1);
+ const char* argList[1] = {"program"};
+ char** argv = const_cast<char**>(argList);
- Application application = Application::New( &argc, &argv, "stylesheet" );
+ Application application = Application::New(&argc, &argv, "stylesheet");
- MyTestApp testApp( application );
+ MyTestApp testApp(application);
- DALI_TEST_CHECK( application );
+ DALI_TEST_CHECK(application);
END_TEST;
}
int UtcDaliApplicationNew04(void)
{
- int argc( 1 );
- const char* argList[1] = { "program" };
- char** argv = const_cast<char**>(argList);
+ int argc(1);
+ const char* argList[1] = {"program"};
+ char** argv = const_cast<char**>(argList);
- Application application = Application::New( &argc, &argv, "stylesheet", Application::TRANSPARENT );
+ Application application = Application::New(&argc, &argv, "stylesheet", Application::TRANSPARENT);
- MyTestApp testApp( application );
+ MyTestApp testApp(application);
- DALI_TEST_CHECK( application );
+ DALI_TEST_CHECK(application);
END_TEST;
}
int UtcDaliApplicationCopyAndAssignment(void)
{
Application application = Application::New();
- Application copy( application );
- DALI_TEST_CHECK( copy == application );
+ Application copy(application);
+ DALI_TEST_CHECK(copy == application);
Application assigned;
- DALI_TEST_CHECK( !assigned );
+ DALI_TEST_CHECK(!assigned);
assigned = application;
- DALI_TEST_CHECK( copy == assigned );
+ DALI_TEST_CHECK(copy == assigned);
END_TEST;
}
int UtcDaliApplicationMoveConstructor(void)
{
Application application = Application::New();
- DALI_TEST_CHECK( application );
- DALI_TEST_EQUALS( 1, application.GetBaseObject().ReferenceCount(), TEST_LOCATION );
+ DALI_TEST_CHECK(application);
+ DALI_TEST_EQUALS(1, application.GetBaseObject().ReferenceCount(), TEST_LOCATION);
- Application moved = std::move( application );
- DALI_TEST_CHECK( moved );
- DALI_TEST_EQUALS( 1, moved.GetBaseObject().ReferenceCount(), TEST_LOCATION );
- DALI_TEST_CHECK( !application );
+ Application moved = std::move(application);
+ DALI_TEST_CHECK(moved);
+ DALI_TEST_EQUALS(1, moved.GetBaseObject().ReferenceCount(), TEST_LOCATION);
+ DALI_TEST_CHECK(!application);
END_TEST;
}
int UtcDaliApplicationMoveAssignment(void)
{
Application application = Application::New();
- DALI_TEST_CHECK( application );
- DALI_TEST_EQUALS( 1, application.GetBaseObject().ReferenceCount(), TEST_LOCATION );
+ DALI_TEST_CHECK(application);
+ DALI_TEST_EQUALS(1, application.GetBaseObject().ReferenceCount(), TEST_LOCATION);
Application moved;
- moved = std::move( application );
- DALI_TEST_CHECK( moved );
- DALI_TEST_EQUALS( 1, moved.GetBaseObject().ReferenceCount(), TEST_LOCATION );
- DALI_TEST_CHECK( !application );
+ moved = std::move(application);
+ DALI_TEST_CHECK(moved);
+ DALI_TEST_EQUALS(1, moved.GetBaseObject().ReferenceCount(), TEST_LOCATION);
+ DALI_TEST_CHECK(!application);
END_TEST;
}
try
{
application.MainLoop();
- DALI_TEST_CHECK( false ); // Should not get here
+ DALI_TEST_CHECK(false); // Should not get here
}
- catch( ... )
+ catch(...)
{
- DALI_TEST_CHECK( true );
+ DALI_TEST_CHECK(true);
}
END_TEST;
}
-
int UtcDaliApplicationLowerN(void)
{
Application application;
try
{
application.Lower();
- DALI_TEST_CHECK( false ); // Should not get here
+ DALI_TEST_CHECK(false); // Should not get here
}
- catch( ... )
+ catch(...)
{
- DALI_TEST_CHECK( true );
+ DALI_TEST_CHECK(true);
}
END_TEST;
try
{
application.Quit();
- DALI_TEST_CHECK( false ); // Should not get here
+ DALI_TEST_CHECK(false); // Should not get here
}
- catch( ... )
+ catch(...)
{
- DALI_TEST_CHECK( true );
+ DALI_TEST_CHECK(true);
}
END_TEST;
try
{
CallbackBase* callback = NULL;
- application.AddIdle( callback );
- DALI_TEST_CHECK( false ); // Should not get here
+ application.AddIdle(callback);
+ DALI_TEST_CHECK(false); // Should not get here
}
- catch( ... )
+ catch(...)
{
- DALI_TEST_CHECK( true );
+ DALI_TEST_CHECK(true);
}
END_TEST;
try
{
- (void) application.GetWindow();
- DALI_TEST_CHECK( false ); // Should not get here
+ (void)application.GetWindow();
+ DALI_TEST_CHECK(false); // Should not get here
}
- catch( ... )
+ catch(...)
{
- DALI_TEST_CHECK( true );
+ DALI_TEST_CHECK(true);
}
END_TEST;
int UtcDaliApplicationInitSignalP(void)
{
Application application = Application::New();
- application.InitSignal().Connect( &ApplicationSignalCallback );
- DALI_TEST_CHECK( application );
+ application.InitSignal().Connect(&ApplicationSignalCallback);
+ DALI_TEST_CHECK(application);
END_TEST;
}
try
{
- application.InitSignal().Connect( &ApplicationSignalCallback );
- DALI_TEST_CHECK( false ); // Should not get here
+ application.InitSignal().Connect(&ApplicationSignalCallback);
+ DALI_TEST_CHECK(false); // Should not get here
}
- catch( ... )
+ catch(...)
{
- DALI_TEST_CHECK( true );
+ DALI_TEST_CHECK(true);
}
END_TEST;
int UtcDaliApplicationTerminateSignalP(void)
{
Application application = Application::New();
- application.TerminateSignal().Connect( &ApplicationSignalCallback );
- DALI_TEST_CHECK( application );
+ application.TerminateSignal().Connect(&ApplicationSignalCallback);
+ DALI_TEST_CHECK(application);
END_TEST;
}
try
{
- application.TerminateSignal().Connect( &ApplicationSignalCallback );
- DALI_TEST_CHECK( false ); // Should not get here
+ application.TerminateSignal().Connect(&ApplicationSignalCallback);
+ DALI_TEST_CHECK(false); // Should not get here
}
- catch( ... )
+ catch(...)
{
- DALI_TEST_CHECK( true );
+ DALI_TEST_CHECK(true);
}
END_TEST;
int UtcDaliApplicationPauseSignalP(void)
{
Application application = Application::New();
- application.PauseSignal().Connect( &ApplicationSignalCallback );
- DALI_TEST_CHECK( application );
+ application.PauseSignal().Connect(&ApplicationSignalCallback);
+ DALI_TEST_CHECK(application);
END_TEST;
}
try
{
- application.PauseSignal().Connect( &ApplicationSignalCallback );
- DALI_TEST_CHECK( false ); // Should not get here
+ application.PauseSignal().Connect(&ApplicationSignalCallback);
+ DALI_TEST_CHECK(false); // Should not get here
}
- catch( ... )
+ catch(...)
{
- DALI_TEST_CHECK( true );
+ DALI_TEST_CHECK(true);
}
END_TEST;
int UtcDaliApplicationResumeSignalP(void)
{
Application application = Application::New();
- application.ResumeSignal().Connect( &ApplicationSignalCallback );
- DALI_TEST_CHECK( application );
+ application.ResumeSignal().Connect(&ApplicationSignalCallback);
+ DALI_TEST_CHECK(application);
END_TEST;
}
try
{
- application.ResumeSignal().Connect( &ApplicationSignalCallback );
- DALI_TEST_CHECK( false ); // Should not get here
+ application.ResumeSignal().Connect(&ApplicationSignalCallback);
+ DALI_TEST_CHECK(false); // Should not get here
}
- catch( ... )
+ catch(...)
{
- DALI_TEST_CHECK( true );
+ DALI_TEST_CHECK(true);
}
END_TEST;
int UtcDaliApplicationResetSignalP(void)
{
Application application = Application::New();
- application.ResetSignal().Connect( &ApplicationSignalCallback );
- DALI_TEST_CHECK( application );
+ application.ResetSignal().Connect(&ApplicationSignalCallback);
+ DALI_TEST_CHECK(application);
END_TEST;
}
try
{
- application.ResetSignal().Connect( &ApplicationSignalCallback );
- DALI_TEST_CHECK( false ); // Should not get here
+ application.ResetSignal().Connect(&ApplicationSignalCallback);
+ DALI_TEST_CHECK(false); // Should not get here
}
- catch( ... )
+ catch(...)
{
- DALI_TEST_CHECK( true );
+ DALI_TEST_CHECK(true);
}
END_TEST;
int UtcDaliApplicationlControlSignalP(void)
{
Application application = Application::New();
- application.AppControlSignal().Connect( &ApplicationControlSignalCallback );
- DALI_TEST_CHECK( application );
+ application.AppControlSignal().Connect(&ApplicationControlSignalCallback);
+ DALI_TEST_CHECK(application);
END_TEST;
}
try
{
- application.AppControlSignal().Connect( &ApplicationControlSignalCallback );
- DALI_TEST_CHECK( false ); // Should not get here
+ application.AppControlSignal().Connect(&ApplicationControlSignalCallback);
+ DALI_TEST_CHECK(false); // Should not get here
}
- catch( ... )
+ catch(...)
{
- DALI_TEST_CHECK( true );
+ DALI_TEST_CHECK(true);
}
END_TEST;
int UtcDaliApplicationLanguageChangedSignalP(void)
{
Application application = Application::New();
- application.LanguageChangedSignal().Connect( &ApplicationSignalCallback );
- DALI_TEST_CHECK( application );
+ application.LanguageChangedSignal().Connect(&ApplicationSignalCallback);
+ DALI_TEST_CHECK(application);
END_TEST;
}
try
{
- application.LanguageChangedSignal().Connect( &ApplicationSignalCallback );
- DALI_TEST_CHECK( false ); // Should not get here
+ application.LanguageChangedSignal().Connect(&ApplicationSignalCallback);
+ DALI_TEST_CHECK(false); // Should not get here
}
- catch( ... )
+ catch(...)
{
- DALI_TEST_CHECK( true );
+ DALI_TEST_CHECK(true);
}
END_TEST;
int UtcDaliApplicationRegionChangedSignalP(void)
{
Application application = Application::New();
- application.RegionChangedSignal().Connect( &ApplicationSignalCallback );
- DALI_TEST_CHECK( application );
+ application.RegionChangedSignal().Connect(&ApplicationSignalCallback);
+ DALI_TEST_CHECK(application);
END_TEST;
}
try
{
- application.RegionChangedSignal().Connect( &ApplicationSignalCallback );
- DALI_TEST_CHECK( false ); // Should not get here
+ application.RegionChangedSignal().Connect(&ApplicationSignalCallback);
+ DALI_TEST_CHECK(false); // Should not get here
}
- catch( ... )
+ catch(...)
{
- DALI_TEST_CHECK( true );
+ DALI_TEST_CHECK(true);
}
END_TEST;
int UtcDaliApplicationLowBatterySignalP(void)
{
Application application = Application::New();
- application.LowBatterySignal().Connect( &LowBatterySignalCallback );
- DALI_TEST_CHECK( application );
+ application.LowBatterySignal().Connect(&LowBatterySignalCallback);
+ DALI_TEST_CHECK(application);
END_TEST;
}
try
{
- application.LowBatterySignal().Connect( &LowBatterySignalCallback );
- DALI_TEST_CHECK( false ); // Should not get here
+ application.LowBatterySignal().Connect(&LowBatterySignalCallback);
+ DALI_TEST_CHECK(false); // Should not get here
}
- catch( ... )
+ catch(...)
{
- DALI_TEST_CHECK( true );
+ DALI_TEST_CHECK(true);
}
END_TEST;
int UtcDaliApplicationLowMemorySignalP(void)
{
Application application = Application::New();
- application.LowMemorySignal().Connect( &LowMemorySignalCallback );
- DALI_TEST_CHECK( application );
+ application.LowMemorySignal().Connect(&LowMemorySignalCallback);
+ DALI_TEST_CHECK(application);
END_TEST;
}
try
{
- application.LowMemorySignal().Connect( &LowMemorySignalCallback );
- DALI_TEST_CHECK( false ); // Should not get here
+ application.LowMemorySignal().Connect(&LowMemorySignalCallback);
+ DALI_TEST_CHECK(false); // Should not get here
}
- catch( ... )
+ catch(...)
{
- DALI_TEST_CHECK( true );
+ DALI_TEST_CHECK(true);
}
END_TEST;
int UtcDaliApplicationGetResourcePathP(void)
{
Application application = Application::New();
- std::string result ("**invalid path**"); // Calling GetResourcePath should replace this with a system dependent path or "".
+ std::string result("**invalid path**"); // Calling GetResourcePath should replace this with a system dependent path or "".
result = application.GetResourcePath();
- DALI_TEST_CHECK( result !="**invalid path**" );
+ DALI_TEST_CHECK(result != "**invalid path**");
END_TEST;
}
Application application = Application::New();
std::string result;
result = application.GetRegion();
- DALI_TEST_CHECK( result == "NOT_SUPPORTED" ); // Not supported in UBUNTU
+ DALI_TEST_CHECK(result == "NOT_SUPPORTED"); // Not supported in UBUNTU
END_TEST;
}
Application application = Application::New();
std::string result;
result = application.GetLanguage();
- DALI_TEST_CHECK( result == "NOT_SUPPORTED" ); // Not supported in UBUNTU
+ DALI_TEST_CHECK(result == "NOT_SUPPORTED"); // Not supported in UBUNTU
END_TEST;
}
int UtcDaliApplicationGetObjectRegistryN(void)
{
Application application = Application::New();
- DALI_TEST_CHECK( !application.GetObjectRegistry() );
+ DALI_TEST_CHECK(!application.GetObjectRegistry());
END_TEST;
}
*
*/
-#include <dali/dali.h>
#include <dali-test-suite-utils.h>
+#include <dali/dali.h>
#include <dali/devel-api/adaptor-framework/file-loader.h>
-
-
using namespace Dali;
-
void utc_dali_file_loader_startup(void)
{
test_return_value = TET_UNDEF;
int UtcDaliReadFileNew1(void)
{
- int errorCode;
+ int errorCode;
Dali::Vector<char> buffer;
//negative case
- errorCode = FileLoader::ReadFile( TEST_RESOURCE_DIR "/not_exist.txt", buffer, FileLoader::TEXT );
+ errorCode = FileLoader::ReadFile(TEST_RESOURCE_DIR "/not_exist.txt", buffer, FileLoader::TEXT);
- DALI_TEST_CHECK( errorCode == 0 );
+ DALI_TEST_CHECK(errorCode == 0);
- DALI_TEST_CHECK( buffer.Size() == 0 );
+ DALI_TEST_CHECK(buffer.Size() == 0);
//positive case
- errorCode = FileLoader::ReadFile( TEST_RESOURCE_DIR "/test.txt", buffer, FileLoader::TEXT );
+ errorCode = FileLoader::ReadFile(TEST_RESOURCE_DIR "/test.txt", buffer, FileLoader::TEXT);
- DALI_TEST_CHECK( errorCode != 0 );
+ DALI_TEST_CHECK(errorCode != 0);
- DALI_TEST_CHECK( buffer.Size() > 0 );
+ DALI_TEST_CHECK(buffer.Size() > 0);
END_TEST;
}
int UtcDaliReadFileNew2(void)
{
- int errorCode;
+ int errorCode;
Dali::Vector<char> buffer;
- std::streampos fileSize = 0;
+ std::streampos fileSize = 0;
//negative case
- errorCode = FileLoader::ReadFile( TEST_RESOURCE_DIR "/not_exist.txt", fileSize, buffer, FileLoader::TEXT );
+ errorCode = FileLoader::ReadFile(TEST_RESOURCE_DIR "/not_exist.txt", fileSize, buffer, FileLoader::TEXT);
- DALI_TEST_CHECK( errorCode == 0 );
+ DALI_TEST_CHECK(errorCode == 0);
- DALI_TEST_CHECK( buffer.Size() == 0 );
+ DALI_TEST_CHECK(buffer.Size() == 0);
- DALI_TEST_CHECK( fileSize == 0 );
+ DALI_TEST_CHECK(fileSize == 0);
//positive case
- errorCode = FileLoader::ReadFile( TEST_RESOURCE_DIR "/test.txt", fileSize, buffer, FileLoader::TEXT );
+ errorCode = FileLoader::ReadFile(TEST_RESOURCE_DIR "/test.txt", fileSize, buffer, FileLoader::TEXT);
- DALI_TEST_CHECK( errorCode != 0 );
+ DALI_TEST_CHECK(errorCode != 0);
- DALI_TEST_CHECK( buffer.Size() > 0 );
+ DALI_TEST_CHECK(buffer.Size() > 0);
- DALI_TEST_CHECK( fileSize != 0 );
+ DALI_TEST_CHECK(fileSize != 0);
END_TEST;
}
std::streampos fileSize = 0;
//negative case
- fileSize = FileLoader::GetFileSize( TEST_RESOURCE_DIR "/not_exist.txt" );
+ fileSize = FileLoader::GetFileSize(TEST_RESOURCE_DIR "/not_exist.txt");
- DALI_TEST_CHECK( fileSize == 0 );
+ DALI_TEST_CHECK(fileSize == 0);
//positive case
- fileSize = FileLoader::GetFileSize( TEST_RESOURCE_DIR "/test.txt" );
+ fileSize = FileLoader::GetFileSize(TEST_RESOURCE_DIR "/test.txt");
- DALI_TEST_CHECK( fileSize != 0 );
+ DALI_TEST_CHECK(fileSize != 0);
END_TEST;
}
/*
- * Copyright (c) 2017 Samsung Electronics Co., Ltd.
+ * Copyright (c) 2020 Samsung Electronics Co., Ltd.
*
* Licensed under the Apache License, Version 2.0 (the "License");
* you may not use this file except in compliance with the License.
*
*/
-#include <stdlib.h>
-#include <dali/dali.h>
#include <dali-test-suite-utils.h>
+#include <dali/dali.h>
#include <dali/devel-api/adaptor-framework/animated-image-loading.h>
+#include <stdlib.h>
using namespace Dali;
// this image if not exist, for negative test
static const char* gGifNonExist = "non-exist.gif";
-void VerifyLoad( std::vector<Dali::PixelData>& pixelDataList, Dali::Vector<uint32_t>& frameDelayList,
- uint32_t frameCount, uint32_t width, uint32_t height, uint32_t delay )
+void VerifyLoad(std::vector<Dali::PixelData>& pixelDataList, Dali::Vector<uint32_t>& frameDelayList, uint32_t frameCount, uint32_t width, uint32_t height, uint32_t delay)
{
- DALI_TEST_EQUALS( pixelDataList.size(), frameCount, TEST_LOCATION );
- DALI_TEST_EQUALS( frameDelayList.Size(), frameCount, TEST_LOCATION );
+ DALI_TEST_EQUALS(pixelDataList.size(), frameCount, TEST_LOCATION);
+ DALI_TEST_EQUALS(frameDelayList.Size(), frameCount, TEST_LOCATION);
- for( uint32_t idx = 0; idx<frameCount; idx++ )
+ for(uint32_t idx = 0; idx < frameCount; idx++)
{
// Check the image size and delay of each frame
- DALI_TEST_EQUALS( pixelDataList[idx].GetWidth(), width, TEST_LOCATION );
- DALI_TEST_EQUALS( pixelDataList[idx].GetHeight(), height, TEST_LOCATION );
- DALI_TEST_EQUALS( frameDelayList[idx], delay, TEST_LOCATION );
+ DALI_TEST_EQUALS(pixelDataList[idx].GetWidth(), width, TEST_LOCATION);
+ DALI_TEST_EQUALS(pixelDataList[idx].GetHeight(), height, TEST_LOCATION);
+ DALI_TEST_EQUALS(frameDelayList[idx], delay, TEST_LOCATION);
}
}
-}
+} // namespace
void utc_dali_animated_image_loader_startup(void)
{
int UtcDaliAnimatedImageLoadingP(void)
{
std::vector<Dali::PixelData> pixelDataList;
- Dali::Vector<uint32_t> frameDelayList;
+ Dali::Vector<uint32_t> frameDelayList;
- Dali::AnimatedImageLoading animatedImageLoading = Dali::AnimatedImageLoading::New( gGif_100_None, true );
- bool succeed = animatedImageLoading.LoadNextNFrames( 0u, animatedImageLoading.GetImageCount(), pixelDataList );
+ Dali::AnimatedImageLoading animatedImageLoading = Dali::AnimatedImageLoading::New(gGif_100_None, true);
+ bool succeed = animatedImageLoading.LoadNextNFrames(0u, animatedImageLoading.GetImageCount(), pixelDataList);
frameDelayList.Clear();
- frameDelayList.Resize( animatedImageLoading.GetImageCount(), 0 );
- for( uint32_t i = 0; i < animatedImageLoading.GetImageCount(); ++i )
+ frameDelayList.Resize(animatedImageLoading.GetImageCount(), 0);
+ for(uint32_t i = 0; i < animatedImageLoading.GetImageCount(); ++i)
{
- frameDelayList[i] = animatedImageLoading.GetFrameInterval( i );
+ frameDelayList[i] = animatedImageLoading.GetFrameInterval(i);
}
// Check that the loading succeed
- DALI_TEST_CHECK( succeed );
- VerifyLoad( pixelDataList, frameDelayList, 5u, 100u, 100u, 1000u );
+ DALI_TEST_CHECK(succeed);
+ VerifyLoad(pixelDataList, frameDelayList, 5u, 100u, 100u, 1000u);
pixelDataList.clear();
- animatedImageLoading = Dali::AnimatedImageLoading::New( gGif_100_Prev, true );
- succeed = animatedImageLoading.LoadNextNFrames( 0u, animatedImageLoading.GetImageCount(), pixelDataList );
+ animatedImageLoading = Dali::AnimatedImageLoading::New(gGif_100_Prev, true);
+ succeed = animatedImageLoading.LoadNextNFrames(0u, animatedImageLoading.GetImageCount(), pixelDataList);
frameDelayList.Clear();
- frameDelayList.Resize( animatedImageLoading.GetImageCount(), 0 );
- for( uint32_t i = 0; i < animatedImageLoading.GetImageCount(); ++i )
+ frameDelayList.Resize(animatedImageLoading.GetImageCount(), 0);
+ for(uint32_t i = 0; i < animatedImageLoading.GetImageCount(); ++i)
{
- frameDelayList[i] = animatedImageLoading.GetFrameInterval( i );
+ frameDelayList[i] = animatedImageLoading.GetFrameInterval(i);
}
// Check that the loading succeed
- DALI_TEST_CHECK( succeed );
- VerifyLoad( pixelDataList, frameDelayList, 5u, 100u, 100u, 1000u );
+ DALI_TEST_CHECK(succeed);
+ VerifyLoad(pixelDataList, frameDelayList, 5u, 100u, 100u, 1000u);
pixelDataList.clear();
- animatedImageLoading = Dali::AnimatedImageLoading::New( gGif_100_Bgnd, true );
- succeed = animatedImageLoading.LoadNextNFrames( 0u, animatedImageLoading.GetImageCount(), pixelDataList );
+ animatedImageLoading = Dali::AnimatedImageLoading::New(gGif_100_Bgnd, true);
+ succeed = animatedImageLoading.LoadNextNFrames(0u, animatedImageLoading.GetImageCount(), pixelDataList);
frameDelayList.Clear();
- frameDelayList.Resize( animatedImageLoading.GetImageCount(), 0 );
- for( uint32_t i = 0; i < animatedImageLoading.GetImageCount(); ++i )
+ frameDelayList.Resize(animatedImageLoading.GetImageCount(), 0);
+ for(uint32_t i = 0; i < animatedImageLoading.GetImageCount(); ++i)
{
- frameDelayList[i] = animatedImageLoading.GetFrameInterval( i );
+ frameDelayList[i] = animatedImageLoading.GetFrameInterval(i);
}
// Check that the loading succeed
- DALI_TEST_CHECK( succeed );
- VerifyLoad( pixelDataList, frameDelayList, 5u, 100u, 100u, 1000u );
+ DALI_TEST_CHECK(succeed);
+ VerifyLoad(pixelDataList, frameDelayList, 5u, 100u, 100u, 1000u);
END_TEST;
}
int UtcDaliAnimatedImageLoadingN(void)
{
std::vector<Dali::PixelData> pixelDataList;
- Dali::Vector<uint32_t> frameDelayList;
+ Dali::Vector<uint32_t> frameDelayList;
- Dali::AnimatedImageLoading animatedImageLoading = Dali::AnimatedImageLoading::New( gGifNonExist, true );
- bool succeed = animatedImageLoading.LoadNextNFrames( 0u, animatedImageLoading.GetImageCount(), pixelDataList );
+ Dali::AnimatedImageLoading animatedImageLoading = Dali::AnimatedImageLoading::New(gGifNonExist, true);
+ bool succeed = animatedImageLoading.LoadNextNFrames(0u, animatedImageLoading.GetImageCount(), pixelDataList);
// Check that the loading failed
- DALI_TEST_CHECK( !succeed );
+ DALI_TEST_CHECK(!succeed);
// Check that both pixelDataList and frameDelayList are empty
- DALI_TEST_EQUALS( pixelDataList.size(), 0u, TEST_LOCATION );
+ DALI_TEST_EQUALS(pixelDataList.size(), 0u, TEST_LOCATION);
END_TEST;
}
int UtcDaliAnimatedImageLoadingGetImageSizeP(void)
{
- Dali::AnimatedImageLoading animatedImageLoading = Dali::AnimatedImageLoading::New( gGif_100_None, true );
- ImageDimensions imageSize = animatedImageLoading.GetImageSize();
+ Dali::AnimatedImageLoading animatedImageLoading = Dali::AnimatedImageLoading::New(gGif_100_None, true);
+ ImageDimensions imageSize = animatedImageLoading.GetImageSize();
// Check that the image size is [100, 100]
- DALI_TEST_EQUALS( imageSize.GetWidth(), 100u, TEST_LOCATION );
- DALI_TEST_EQUALS( imageSize.GetHeight(), 100u, TEST_LOCATION );
+ DALI_TEST_EQUALS(imageSize.GetWidth(), 100u, TEST_LOCATION);
+ DALI_TEST_EQUALS(imageSize.GetHeight(), 100u, TEST_LOCATION);
END_TEST;
}
int UtcDaliAnimatedImageLoadingGetImageSizeN(void)
{
- Dali::AnimatedImageLoading animatedImageLoading = Dali::AnimatedImageLoading::New( gGifNonExist, true );
- ImageDimensions imageSize = animatedImageLoading.GetImageSize();
+ Dali::AnimatedImageLoading animatedImageLoading = Dali::AnimatedImageLoading::New(gGifNonExist, true);
+ ImageDimensions imageSize = animatedImageLoading.GetImageSize();
// Check that it returns zero size when the animated image is not valid
- DALI_TEST_EQUALS( imageSize.GetWidth(), 0u, TEST_LOCATION );
- DALI_TEST_EQUALS( imageSize.GetHeight(), 0u, TEST_LOCATION );
+ DALI_TEST_EQUALS(imageSize.GetWidth(), 0u, TEST_LOCATION);
+ DALI_TEST_EQUALS(imageSize.GetHeight(), 0u, TEST_LOCATION);
END_TEST;
}
*
*/
-#include <stdlib.h>
-#include <dali/dali.h>
-#include <dali-test-suite-utils.h>
#include <dali-test-img-utils.h>
+#include <dali-test-suite-utils.h>
+
+#include <dali/dali.h>
#include <dali/devel-api/adaptor-framework/image-loading.h>
+#include <stdlib.h>
using namespace Dali;
// resolution: 50*64, pixel format: RGB888
const char* IMAGE_WIDTH_EVEN_EXIF8_RGB = TEST_RESOURCE_DIR "/f-even-exif-8.jpg";
-
// this is image is not exist, for negative test
const char* IMAGENONEXIST = "non-exist.jpg";
-}
+} // namespace
void utc_dali_load_image_startup(void)
{
int UtcDaliLoadImageP(void)
{
- Devel::PixelBuffer pixelBuffer = Dali::LoadImageFromFile( IMAGE_34_RGBA );
- DALI_TEST_CHECK( pixelBuffer );
- DALI_TEST_EQUALS( pixelBuffer.GetWidth(), 34u, TEST_LOCATION );
- DALI_TEST_EQUALS( pixelBuffer.GetHeight(), 34u, TEST_LOCATION );
- DALI_TEST_EQUALS( pixelBuffer.GetPixelFormat(), Pixel::RGBA8888, TEST_LOCATION );
-
- Devel::PixelBuffer pixelBuffer2 = Dali::LoadImageFromFile( IMAGE_128_RGB );
- DALI_TEST_CHECK( pixelBuffer2 );
- DALI_TEST_EQUALS( pixelBuffer2.GetWidth(), 128u, TEST_LOCATION );
- DALI_TEST_EQUALS( pixelBuffer2.GetHeight(), 128u, TEST_LOCATION );
- DALI_TEST_EQUALS( pixelBuffer2.GetPixelFormat(), Pixel::RGB888, TEST_LOCATION );
-
- Devel::PixelBuffer pixelBufferJpeg = Dali::LoadImageFromFile( IMAGE_LARGE_EXIF3_RGB );
- DALI_TEST_CHECK( pixelBufferJpeg );
- DALI_TEST_EQUALS( pixelBufferJpeg.GetWidth(), 2000u, TEST_LOCATION );
- DALI_TEST_EQUALS( pixelBufferJpeg.GetHeight(), 2560u, TEST_LOCATION );
- DALI_TEST_EQUALS( pixelBufferJpeg.GetPixelFormat(), Pixel::RGB888, TEST_LOCATION );
-
- Devel::PixelBuffer BufferJpeg1 = Dali::LoadImageFromFile( IMAGE_WIDTH_ODD_EXIF1_RGB );
- DALI_TEST_CHECK( BufferJpeg1 );
- DALI_TEST_EQUALS( BufferJpeg1.GetWidth(), 55u, TEST_LOCATION );
- DALI_TEST_EQUALS( BufferJpeg1.GetHeight(), 64u, TEST_LOCATION );
- DALI_TEST_EQUALS( BufferJpeg1.GetPixelFormat(), Pixel::RGB888, TEST_LOCATION );
-
- pixelBufferJpeg = Dali::LoadImageFromFile( IMAGE_WIDTH_ODD_EXIF2_RGB );
- DALI_TEST_CHECK( pixelBufferJpeg );
- DALI_TEST_EQUALS( pixelBufferJpeg.GetWidth(), 55u, TEST_LOCATION );
- DALI_TEST_EQUALS( pixelBufferJpeg.GetHeight(), 64u, TEST_LOCATION );
- DALI_TEST_EQUALS( pixelBufferJpeg.GetPixelFormat(), Pixel::RGB888, TEST_LOCATION );
- DALI_IMAGE_TEST_EQUALS( BufferJpeg1, pixelBufferJpeg, 8, TEST_LOCATION);
-
- pixelBufferJpeg = Dali::LoadImageFromFile( IMAGE_WIDTH_ODD_EXIF3_RGB );
- DALI_TEST_CHECK( pixelBufferJpeg );
- DALI_TEST_EQUALS( pixelBufferJpeg.GetWidth(), 55u, TEST_LOCATION );
- DALI_TEST_EQUALS( pixelBufferJpeg.GetHeight(), 64u, TEST_LOCATION );
- DALI_TEST_EQUALS( pixelBufferJpeg.GetPixelFormat(), Pixel::RGB888, TEST_LOCATION );
- DALI_IMAGE_TEST_EQUALS( BufferJpeg1, pixelBufferJpeg, 8, TEST_LOCATION);
-
- pixelBufferJpeg = Dali::LoadImageFromFile( IMAGE_WIDTH_ODD_EXIF4_RGB );
- DALI_TEST_CHECK( pixelBufferJpeg );
- DALI_TEST_EQUALS( pixelBufferJpeg.GetWidth(), 55u, TEST_LOCATION );
- DALI_TEST_EQUALS( pixelBufferJpeg.GetHeight(), 64u, TEST_LOCATION );
- DALI_TEST_EQUALS( pixelBufferJpeg.GetPixelFormat(), Pixel::RGB888, TEST_LOCATION );
- DALI_IMAGE_TEST_EQUALS( BufferJpeg1, pixelBufferJpeg, 8, TEST_LOCATION);
-
- pixelBufferJpeg = Dali::LoadImageFromFile( IMAGE_WIDTH_ODD_EXIF5_RGB );
- DALI_TEST_CHECK( pixelBufferJpeg );
- DALI_TEST_EQUALS( pixelBufferJpeg.GetWidth(), 55u, TEST_LOCATION );
- DALI_TEST_EQUALS( pixelBufferJpeg.GetHeight(), 64u, TEST_LOCATION );
- DALI_TEST_EQUALS( pixelBufferJpeg.GetPixelFormat(), Pixel::RGB888, TEST_LOCATION );
- DALI_IMAGE_TEST_EQUALS( BufferJpeg1, pixelBufferJpeg, 8, TEST_LOCATION);
-
- pixelBufferJpeg = Dali::LoadImageFromFile( IMAGE_WIDTH_ODD_EXIF6_RGB );
- DALI_TEST_CHECK( pixelBufferJpeg );
- DALI_TEST_EQUALS( pixelBufferJpeg.GetWidth(), 55u, TEST_LOCATION );
- DALI_TEST_EQUALS( pixelBufferJpeg.GetHeight(), 64u, TEST_LOCATION );
- DALI_TEST_EQUALS( pixelBufferJpeg.GetPixelFormat(), Pixel::RGB888, TEST_LOCATION );
- DALI_IMAGE_TEST_EQUALS( BufferJpeg1, pixelBufferJpeg, 8, TEST_LOCATION);
-
- pixelBufferJpeg = Dali::LoadImageFromFile( IMAGE_WIDTH_ODD_EXIF7_RGB );
- DALI_TEST_CHECK( pixelBufferJpeg );
- DALI_TEST_EQUALS( pixelBufferJpeg.GetWidth(), 55u, TEST_LOCATION );
- DALI_TEST_EQUALS( pixelBufferJpeg.GetHeight(), 64u, TEST_LOCATION );
- DALI_TEST_EQUALS( pixelBufferJpeg.GetPixelFormat(), Pixel::RGB888, TEST_LOCATION );
- DALI_IMAGE_TEST_EQUALS( BufferJpeg1, pixelBufferJpeg, 8, TEST_LOCATION);
-
- pixelBufferJpeg = Dali::LoadImageFromFile( IMAGE_WIDTH_ODD_EXIF8_RGB );
- DALI_TEST_CHECK( pixelBufferJpeg );
- DALI_TEST_EQUALS( pixelBufferJpeg.GetWidth(), 55u, TEST_LOCATION );
- DALI_TEST_EQUALS( pixelBufferJpeg.GetHeight(), 64u, TEST_LOCATION );
- DALI_TEST_EQUALS( pixelBufferJpeg.GetPixelFormat(), Pixel::RGB888, TEST_LOCATION );
- DALI_IMAGE_TEST_EQUALS( BufferJpeg1, pixelBufferJpeg, 8, TEST_LOCATION);
-
- BufferJpeg1 = Dali::LoadImageFromFile( IMAGE_WIDTH_EVEN_EXIF1_RGB );
- DALI_TEST_CHECK( BufferJpeg1 );
- DALI_TEST_EQUALS( BufferJpeg1.GetWidth(), 50u, TEST_LOCATION );
- DALI_TEST_EQUALS( BufferJpeg1.GetHeight(), 64u, TEST_LOCATION );
- DALI_TEST_EQUALS( BufferJpeg1.GetPixelFormat(), Pixel::RGB888, TEST_LOCATION );
-
- pixelBufferJpeg = Dali::LoadImageFromFile( IMAGE_WIDTH_EVEN_EXIF2_RGB );
- DALI_TEST_CHECK( pixelBufferJpeg );
- DALI_TEST_EQUALS( pixelBufferJpeg.GetWidth(), 50u, TEST_LOCATION );
- DALI_TEST_EQUALS( pixelBufferJpeg.GetHeight(), 64u, TEST_LOCATION );
- DALI_TEST_EQUALS( pixelBufferJpeg.GetPixelFormat(), Pixel::RGB888, TEST_LOCATION );
- DALI_IMAGE_TEST_EQUALS( BufferJpeg1, pixelBufferJpeg, 8, TEST_LOCATION);
-
- pixelBufferJpeg = Dali::LoadImageFromFile( IMAGE_WIDTH_EVEN_EXIF3_RGB );
- DALI_TEST_CHECK( pixelBufferJpeg );
- DALI_TEST_EQUALS( pixelBufferJpeg.GetWidth(), 50u, TEST_LOCATION );
- DALI_TEST_EQUALS( pixelBufferJpeg.GetHeight(), 64u, TEST_LOCATION );
- DALI_TEST_EQUALS( pixelBufferJpeg.GetPixelFormat(), Pixel::RGB888, TEST_LOCATION );
- DALI_IMAGE_TEST_EQUALS( BufferJpeg1, pixelBufferJpeg, 8, TEST_LOCATION);
-
- pixelBufferJpeg = Dali::LoadImageFromFile( IMAGE_WIDTH_EVEN_EXIF4_RGB );
- DALI_TEST_CHECK( pixelBufferJpeg );
- DALI_TEST_EQUALS( pixelBufferJpeg.GetWidth(), 50u, TEST_LOCATION );
- DALI_TEST_EQUALS( pixelBufferJpeg.GetHeight(), 64u, TEST_LOCATION );
- DALI_TEST_EQUALS( pixelBufferJpeg.GetPixelFormat(), Pixel::RGB888, TEST_LOCATION );
- DALI_IMAGE_TEST_EQUALS( BufferJpeg1, pixelBufferJpeg, 8, TEST_LOCATION);
-
- pixelBufferJpeg = Dali::LoadImageFromFile( IMAGE_WIDTH_EVEN_EXIF5_RGB );
- DALI_TEST_CHECK( pixelBufferJpeg );
- DALI_TEST_EQUALS( pixelBufferJpeg.GetWidth(), 50u, TEST_LOCATION );
- DALI_TEST_EQUALS( pixelBufferJpeg.GetHeight(), 64u, TEST_LOCATION );
- DALI_TEST_EQUALS( pixelBufferJpeg.GetPixelFormat(), Pixel::RGB888, TEST_LOCATION );
- DALI_IMAGE_TEST_EQUALS( BufferJpeg1, pixelBufferJpeg, 8, TEST_LOCATION);
-
- pixelBufferJpeg = Dali::LoadImageFromFile( IMAGE_WIDTH_EVEN_EXIF6_RGB );
- DALI_TEST_CHECK( pixelBufferJpeg );
- DALI_TEST_EQUALS( pixelBufferJpeg.GetWidth(), 50u, TEST_LOCATION );
- DALI_TEST_EQUALS( pixelBufferJpeg.GetHeight(), 64u, TEST_LOCATION );
- DALI_TEST_EQUALS( pixelBufferJpeg.GetPixelFormat(), Pixel::RGB888, TEST_LOCATION );
- DALI_IMAGE_TEST_EQUALS( BufferJpeg1, pixelBufferJpeg, 8, TEST_LOCATION);
-
- pixelBufferJpeg = Dali::LoadImageFromFile( IMAGE_WIDTH_EVEN_EXIF7_RGB );
- DALI_TEST_CHECK( pixelBufferJpeg );
- DALI_TEST_EQUALS( pixelBufferJpeg.GetWidth(), 50u, TEST_LOCATION );
- DALI_TEST_EQUALS( pixelBufferJpeg.GetHeight(), 64u, TEST_LOCATION );
- DALI_TEST_EQUALS( pixelBufferJpeg.GetPixelFormat(), Pixel::RGB888, TEST_LOCATION );
- DALI_IMAGE_TEST_EQUALS( BufferJpeg1, pixelBufferJpeg, 8, TEST_LOCATION);
-
- pixelBufferJpeg = Dali::LoadImageFromFile( IMAGE_WIDTH_EVEN_EXIF8_RGB );
- DALI_TEST_CHECK( pixelBufferJpeg );
- DALI_TEST_EQUALS( pixelBufferJpeg.GetWidth(), 50u, TEST_LOCATION );
- DALI_TEST_EQUALS( pixelBufferJpeg.GetHeight(), 64u, TEST_LOCATION );
- DALI_TEST_EQUALS( pixelBufferJpeg.GetPixelFormat(), Pixel::RGB888, TEST_LOCATION );
- DALI_IMAGE_TEST_EQUALS( BufferJpeg1, pixelBufferJpeg, 8, TEST_LOCATION);
+ Devel::PixelBuffer pixelBuffer = Dali::LoadImageFromFile(IMAGE_34_RGBA);
+ DALI_TEST_CHECK(pixelBuffer);
+ DALI_TEST_EQUALS(pixelBuffer.GetWidth(), 34u, TEST_LOCATION);
+ DALI_TEST_EQUALS(pixelBuffer.GetHeight(), 34u, TEST_LOCATION);
+ DALI_TEST_EQUALS(pixelBuffer.GetPixelFormat(), Pixel::RGBA8888, TEST_LOCATION);
+
+ Devel::PixelBuffer pixelBuffer2 = Dali::LoadImageFromFile(IMAGE_128_RGB);
+ DALI_TEST_CHECK(pixelBuffer2);
+ DALI_TEST_EQUALS(pixelBuffer2.GetWidth(), 128u, TEST_LOCATION);
+ DALI_TEST_EQUALS(pixelBuffer2.GetHeight(), 128u, TEST_LOCATION);
+ DALI_TEST_EQUALS(pixelBuffer2.GetPixelFormat(), Pixel::RGB888, TEST_LOCATION);
+
+ Devel::PixelBuffer pixelBufferJpeg = Dali::LoadImageFromFile(IMAGE_LARGE_EXIF3_RGB);
+ DALI_TEST_CHECK(pixelBufferJpeg);
+ DALI_TEST_EQUALS(pixelBufferJpeg.GetWidth(), 2000u, TEST_LOCATION);
+ DALI_TEST_EQUALS(pixelBufferJpeg.GetHeight(), 2560u, TEST_LOCATION);
+ DALI_TEST_EQUALS(pixelBufferJpeg.GetPixelFormat(), Pixel::RGB888, TEST_LOCATION);
+
+ Devel::PixelBuffer BufferJpeg1 = Dali::LoadImageFromFile(IMAGE_WIDTH_ODD_EXIF1_RGB);
+ DALI_TEST_CHECK(BufferJpeg1);
+ DALI_TEST_EQUALS(BufferJpeg1.GetWidth(), 55u, TEST_LOCATION);
+ DALI_TEST_EQUALS(BufferJpeg1.GetHeight(), 64u, TEST_LOCATION);
+ DALI_TEST_EQUALS(BufferJpeg1.GetPixelFormat(), Pixel::RGB888, TEST_LOCATION);
+
+ pixelBufferJpeg = Dali::LoadImageFromFile(IMAGE_WIDTH_ODD_EXIF2_RGB);
+ DALI_TEST_CHECK(pixelBufferJpeg);
+ DALI_TEST_EQUALS(pixelBufferJpeg.GetWidth(), 55u, TEST_LOCATION);
+ DALI_TEST_EQUALS(pixelBufferJpeg.GetHeight(), 64u, TEST_LOCATION);
+ DALI_TEST_EQUALS(pixelBufferJpeg.GetPixelFormat(), Pixel::RGB888, TEST_LOCATION);
+ DALI_IMAGE_TEST_EQUALS(BufferJpeg1, pixelBufferJpeg, 8, TEST_LOCATION);
+
+ pixelBufferJpeg = Dali::LoadImageFromFile(IMAGE_WIDTH_ODD_EXIF3_RGB);
+ DALI_TEST_CHECK(pixelBufferJpeg);
+ DALI_TEST_EQUALS(pixelBufferJpeg.GetWidth(), 55u, TEST_LOCATION);
+ DALI_TEST_EQUALS(pixelBufferJpeg.GetHeight(), 64u, TEST_LOCATION);
+ DALI_TEST_EQUALS(pixelBufferJpeg.GetPixelFormat(), Pixel::RGB888, TEST_LOCATION);
+ DALI_IMAGE_TEST_EQUALS(BufferJpeg1, pixelBufferJpeg, 8, TEST_LOCATION);
+
+ pixelBufferJpeg = Dali::LoadImageFromFile(IMAGE_WIDTH_ODD_EXIF4_RGB);
+ DALI_TEST_CHECK(pixelBufferJpeg);
+ DALI_TEST_EQUALS(pixelBufferJpeg.GetWidth(), 55u, TEST_LOCATION);
+ DALI_TEST_EQUALS(pixelBufferJpeg.GetHeight(), 64u, TEST_LOCATION);
+ DALI_TEST_EQUALS(pixelBufferJpeg.GetPixelFormat(), Pixel::RGB888, TEST_LOCATION);
+ DALI_IMAGE_TEST_EQUALS(BufferJpeg1, pixelBufferJpeg, 8, TEST_LOCATION);
+
+ pixelBufferJpeg = Dali::LoadImageFromFile(IMAGE_WIDTH_ODD_EXIF5_RGB);
+ DALI_TEST_CHECK(pixelBufferJpeg);
+ DALI_TEST_EQUALS(pixelBufferJpeg.GetWidth(), 55u, TEST_LOCATION);
+ DALI_TEST_EQUALS(pixelBufferJpeg.GetHeight(), 64u, TEST_LOCATION);
+ DALI_TEST_EQUALS(pixelBufferJpeg.GetPixelFormat(), Pixel::RGB888, TEST_LOCATION);
+ DALI_IMAGE_TEST_EQUALS(BufferJpeg1, pixelBufferJpeg, 8, TEST_LOCATION);
+
+ pixelBufferJpeg = Dali::LoadImageFromFile(IMAGE_WIDTH_ODD_EXIF6_RGB);
+ DALI_TEST_CHECK(pixelBufferJpeg);
+ DALI_TEST_EQUALS(pixelBufferJpeg.GetWidth(), 55u, TEST_LOCATION);
+ DALI_TEST_EQUALS(pixelBufferJpeg.GetHeight(), 64u, TEST_LOCATION);
+ DALI_TEST_EQUALS(pixelBufferJpeg.GetPixelFormat(), Pixel::RGB888, TEST_LOCATION);
+ DALI_IMAGE_TEST_EQUALS(BufferJpeg1, pixelBufferJpeg, 8, TEST_LOCATION);
+
+ pixelBufferJpeg = Dali::LoadImageFromFile(IMAGE_WIDTH_ODD_EXIF7_RGB);
+ DALI_TEST_CHECK(pixelBufferJpeg);
+ DALI_TEST_EQUALS(pixelBufferJpeg.GetWidth(), 55u, TEST_LOCATION);
+ DALI_TEST_EQUALS(pixelBufferJpeg.GetHeight(), 64u, TEST_LOCATION);
+ DALI_TEST_EQUALS(pixelBufferJpeg.GetPixelFormat(), Pixel::RGB888, TEST_LOCATION);
+ DALI_IMAGE_TEST_EQUALS(BufferJpeg1, pixelBufferJpeg, 8, TEST_LOCATION);
+
+ pixelBufferJpeg = Dali::LoadImageFromFile(IMAGE_WIDTH_ODD_EXIF8_RGB);
+ DALI_TEST_CHECK(pixelBufferJpeg);
+ DALI_TEST_EQUALS(pixelBufferJpeg.GetWidth(), 55u, TEST_LOCATION);
+ DALI_TEST_EQUALS(pixelBufferJpeg.GetHeight(), 64u, TEST_LOCATION);
+ DALI_TEST_EQUALS(pixelBufferJpeg.GetPixelFormat(), Pixel::RGB888, TEST_LOCATION);
+ DALI_IMAGE_TEST_EQUALS(BufferJpeg1, pixelBufferJpeg, 8, TEST_LOCATION);
+
+ BufferJpeg1 = Dali::LoadImageFromFile(IMAGE_WIDTH_EVEN_EXIF1_RGB);
+ DALI_TEST_CHECK(BufferJpeg1);
+ DALI_TEST_EQUALS(BufferJpeg1.GetWidth(), 50u, TEST_LOCATION);
+ DALI_TEST_EQUALS(BufferJpeg1.GetHeight(), 64u, TEST_LOCATION);
+ DALI_TEST_EQUALS(BufferJpeg1.GetPixelFormat(), Pixel::RGB888, TEST_LOCATION);
+
+ pixelBufferJpeg = Dali::LoadImageFromFile(IMAGE_WIDTH_EVEN_EXIF2_RGB);
+ DALI_TEST_CHECK(pixelBufferJpeg);
+ DALI_TEST_EQUALS(pixelBufferJpeg.GetWidth(), 50u, TEST_LOCATION);
+ DALI_TEST_EQUALS(pixelBufferJpeg.GetHeight(), 64u, TEST_LOCATION);
+ DALI_TEST_EQUALS(pixelBufferJpeg.GetPixelFormat(), Pixel::RGB888, TEST_LOCATION);
+ DALI_IMAGE_TEST_EQUALS(BufferJpeg1, pixelBufferJpeg, 8, TEST_LOCATION);
+
+ pixelBufferJpeg = Dali::LoadImageFromFile(IMAGE_WIDTH_EVEN_EXIF3_RGB);
+ DALI_TEST_CHECK(pixelBufferJpeg);
+ DALI_TEST_EQUALS(pixelBufferJpeg.GetWidth(), 50u, TEST_LOCATION);
+ DALI_TEST_EQUALS(pixelBufferJpeg.GetHeight(), 64u, TEST_LOCATION);
+ DALI_TEST_EQUALS(pixelBufferJpeg.GetPixelFormat(), Pixel::RGB888, TEST_LOCATION);
+ DALI_IMAGE_TEST_EQUALS(BufferJpeg1, pixelBufferJpeg, 8, TEST_LOCATION);
+
+ pixelBufferJpeg = Dali::LoadImageFromFile(IMAGE_WIDTH_EVEN_EXIF4_RGB);
+ DALI_TEST_CHECK(pixelBufferJpeg);
+ DALI_TEST_EQUALS(pixelBufferJpeg.GetWidth(), 50u, TEST_LOCATION);
+ DALI_TEST_EQUALS(pixelBufferJpeg.GetHeight(), 64u, TEST_LOCATION);
+ DALI_TEST_EQUALS(pixelBufferJpeg.GetPixelFormat(), Pixel::RGB888, TEST_LOCATION);
+ DALI_IMAGE_TEST_EQUALS(BufferJpeg1, pixelBufferJpeg, 8, TEST_LOCATION);
+
+ pixelBufferJpeg = Dali::LoadImageFromFile(IMAGE_WIDTH_EVEN_EXIF5_RGB);
+ DALI_TEST_CHECK(pixelBufferJpeg);
+ DALI_TEST_EQUALS(pixelBufferJpeg.GetWidth(), 50u, TEST_LOCATION);
+ DALI_TEST_EQUALS(pixelBufferJpeg.GetHeight(), 64u, TEST_LOCATION);
+ DALI_TEST_EQUALS(pixelBufferJpeg.GetPixelFormat(), Pixel::RGB888, TEST_LOCATION);
+ DALI_IMAGE_TEST_EQUALS(BufferJpeg1, pixelBufferJpeg, 8, TEST_LOCATION);
+
+ pixelBufferJpeg = Dali::LoadImageFromFile(IMAGE_WIDTH_EVEN_EXIF6_RGB);
+ DALI_TEST_CHECK(pixelBufferJpeg);
+ DALI_TEST_EQUALS(pixelBufferJpeg.GetWidth(), 50u, TEST_LOCATION);
+ DALI_TEST_EQUALS(pixelBufferJpeg.GetHeight(), 64u, TEST_LOCATION);
+ DALI_TEST_EQUALS(pixelBufferJpeg.GetPixelFormat(), Pixel::RGB888, TEST_LOCATION);
+ DALI_IMAGE_TEST_EQUALS(BufferJpeg1, pixelBufferJpeg, 8, TEST_LOCATION);
+
+ pixelBufferJpeg = Dali::LoadImageFromFile(IMAGE_WIDTH_EVEN_EXIF7_RGB);
+ DALI_TEST_CHECK(pixelBufferJpeg);
+ DALI_TEST_EQUALS(pixelBufferJpeg.GetWidth(), 50u, TEST_LOCATION);
+ DALI_TEST_EQUALS(pixelBufferJpeg.GetHeight(), 64u, TEST_LOCATION);
+ DALI_TEST_EQUALS(pixelBufferJpeg.GetPixelFormat(), Pixel::RGB888, TEST_LOCATION);
+ DALI_IMAGE_TEST_EQUALS(BufferJpeg1, pixelBufferJpeg, 8, TEST_LOCATION);
+
+ pixelBufferJpeg = Dali::LoadImageFromFile(IMAGE_WIDTH_EVEN_EXIF8_RGB);
+ DALI_TEST_CHECK(pixelBufferJpeg);
+ DALI_TEST_EQUALS(pixelBufferJpeg.GetWidth(), 50u, TEST_LOCATION);
+ DALI_TEST_EQUALS(pixelBufferJpeg.GetHeight(), 64u, TEST_LOCATION);
+ DALI_TEST_EQUALS(pixelBufferJpeg.GetPixelFormat(), Pixel::RGB888, TEST_LOCATION);
+ DALI_IMAGE_TEST_EQUALS(BufferJpeg1, pixelBufferJpeg, 8, TEST_LOCATION);
END_TEST;
}
int UtcDaliLoadImageN(void)
{
- Devel::PixelBuffer pixelBuffer = Dali::LoadImageFromFile( IMAGENONEXIST );
- DALI_TEST_CHECK( !pixelBuffer );
+ Devel::PixelBuffer pixelBuffer = Dali::LoadImageFromFile(IMAGENONEXIST);
+ DALI_TEST_CHECK(!pixelBuffer);
END_TEST;
}
-
int UtcDaliDownloadImageP(void)
{
std::string url("file://");
- url.append( IMAGE_34_RGBA );
+ url.append(IMAGE_34_RGBA);
std::string url2("file://");
- url2.append( IMAGE_128_RGB );
+ url2.append(IMAGE_128_RGB);
- Devel::PixelBuffer pixelBuffer = Dali::DownloadImageSynchronously( url );
- DALI_TEST_CHECK( pixelBuffer );
- DALI_TEST_EQUALS( pixelBuffer.GetWidth(), 34u, TEST_LOCATION );
- DALI_TEST_EQUALS( pixelBuffer.GetHeight(), 34u, TEST_LOCATION );
- DALI_TEST_EQUALS( pixelBuffer.GetPixelFormat(), Pixel::RGBA8888, TEST_LOCATION );
+ Devel::PixelBuffer pixelBuffer = Dali::DownloadImageSynchronously(url);
+ DALI_TEST_CHECK(pixelBuffer);
+ DALI_TEST_EQUALS(pixelBuffer.GetWidth(), 34u, TEST_LOCATION);
+ DALI_TEST_EQUALS(pixelBuffer.GetHeight(), 34u, TEST_LOCATION);
+ DALI_TEST_EQUALS(pixelBuffer.GetPixelFormat(), Pixel::RGBA8888, TEST_LOCATION);
- Devel::PixelBuffer pixelBuffer2 = Dali::DownloadImageSynchronously( url2 );
- DALI_TEST_CHECK( pixelBuffer2 );
- DALI_TEST_EQUALS( pixelBuffer2.GetWidth(), 128u, TEST_LOCATION );
- DALI_TEST_EQUALS( pixelBuffer2.GetHeight(), 128u, TEST_LOCATION );
- DALI_TEST_EQUALS( pixelBuffer2.GetPixelFormat(), Pixel::RGB888, TEST_LOCATION );
+ Devel::PixelBuffer pixelBuffer2 = Dali::DownloadImageSynchronously(url2);
+ DALI_TEST_CHECK(pixelBuffer2);
+ DALI_TEST_EQUALS(pixelBuffer2.GetWidth(), 128u, TEST_LOCATION);
+ DALI_TEST_EQUALS(pixelBuffer2.GetHeight(), 128u, TEST_LOCATION);
+ DALI_TEST_EQUALS(pixelBuffer2.GetPixelFormat(), Pixel::RGB888, TEST_LOCATION);
END_TEST;
}
int UtcDaliDownloadImageN(void)
{
- Devel::PixelBuffer pixelBuffer = Dali::DownloadImageSynchronously( IMAGENONEXIST );
- DALI_TEST_CHECK( !pixelBuffer );
+ Devel::PixelBuffer pixelBuffer = Dali::DownloadImageSynchronously(IMAGENONEXIST);
+ DALI_TEST_CHECK(!pixelBuffer);
END_TEST;
}
-
int UtcDaliDownloadRemoteChunkedImage(void)
{
std::string url("http://d2k43l0oslhof9.cloudfront.net/platform/image/contents/vc/20/01/58/20170629100630071189_0bf6b911-a847-cba4-e518-be40fe2f579420170629192203240.jpg");
- Devel::PixelBuffer pixelBuffer = Dali::DownloadImageSynchronously( url );
- DALI_TEST_CHECK( pixelBuffer );
- DALI_TEST_EQUALS( pixelBuffer.GetWidth(), 279u, TEST_LOCATION );
- DALI_TEST_EQUALS( pixelBuffer.GetHeight(), 156u, TEST_LOCATION );
- DALI_TEST_EQUALS( pixelBuffer.GetPixelFormat(), Pixel::RGBA8888, TEST_LOCATION );
+ Devel::PixelBuffer pixelBuffer = Dali::DownloadImageSynchronously(url);
+ DALI_TEST_CHECK(pixelBuffer);
+ DALI_TEST_EQUALS(pixelBuffer.GetWidth(), 279u, TEST_LOCATION);
+ DALI_TEST_EQUALS(pixelBuffer.GetHeight(), 156u, TEST_LOCATION);
+ DALI_TEST_EQUALS(pixelBuffer.GetPixelFormat(), Pixel::RGBA8888, TEST_LOCATION);
END_TEST;
}
*/
// EXTERNAL INCLUDES
-#include <map>
#include <string.h>
#include <iostream>
+#include <map>
// CLASS HEADER
-#include <stdlib.h>
-#include <iostream>
+#include <dali-test-suite-utils.h>
#include <dali.h>
#include <dali/devel-api/events/key-event-devel.h>
-#include <dali-test-suite-utils.h>
+#include <stdlib.h>
+#include <iostream>
using namespace Dali;
// Copied from key-impl.h
struct KeyLookup
{
- const char* keyName; ///< XF86 key name
+ const char* keyName; ///< XF86 key name
const Dali::KEY daliKeyCode; ///< Dali key code
- const bool deviceButton; ///< Whether the key is from a button on the device
+ const bool deviceButton; ///< Whether the key is from a button on the device
};
// Common keys for all platforms
-KeyLookup KeyLookupTable[]=
-{
- { "Escape", DALI_KEY_ESCAPE, false }, // item not defined in utilX
- { "Menu", DALI_KEY_MENU, false }, // item not defined in utilX
+KeyLookup KeyLookupTable[] =
+ {
+ {"Escape", DALI_KEY_ESCAPE, false}, // item not defined in utilX
+ {"Menu", DALI_KEY_MENU, false}, // item not defined in utilX
- // Now the key names are used as literal string not defined symbols,
- // since these definition in utilX.h is deprecated and we're guided not to use them
- { "XF86Camera", DALI_KEY_CAMERA, false },
- { "XF86Camera_Full", DALI_KEY_CONFIG, false },
- { "XF86PowerOff", DALI_KEY_POWER, true },
- { "XF86Standby", DALI_KEY_PAUSE, false },
- { "Cancel", DALI_KEY_CANCEL, false },
- { "XF86AudioPlay", DALI_KEY_PLAY_CD, false },
- { "XF86AudioStop", DALI_KEY_STOP_CD, false },
- { "XF86AudioPause", DALI_KEY_PAUSE_CD, false },
- { "XF86AudioNext", DALI_KEY_NEXT_SONG, false },
- { "XF86AudioPrev", DALI_KEY_PREVIOUS_SONG, false },
- { "XF86AudioRewind", DALI_KEY_REWIND, false },
- { "XF86AudioForward", DALI_KEY_FASTFORWARD, false },
- { "XF86AudioMedia", DALI_KEY_MEDIA, false },
- { "XF86AudioPlayPause", DALI_KEY_PLAY_PAUSE, false },
- { "XF86AudioMute", DALI_KEY_MUTE, false },
- { "XF86Menu", DALI_KEY_MENU, true },
- { "XF86Home", DALI_KEY_HOME, true },
- { "XF86Back", DALI_KEY_BACK, true },
- { "XF86Send", DALI_KEY_MENU, true },
- { "XF86Phone", DALI_KEY_HOME, true },
- { "XF86Stop", DALI_KEY_BACK, true },
- { "XF86HomePage", DALI_KEY_HOMEPAGE, false },
- { "XF86WWW", DALI_KEY_WEBPAGE, false },
- { "XF86Mail", DALI_KEY_MAIL, false },
- { "XF86ScreenSaver", DALI_KEY_SCREENSAVER, false },
- { "XF86MonBrightnessUp", DALI_KEY_BRIGHTNESS_UP, false },
- { "XF86MonBrightnessDown", DALI_KEY_BRIGHTNESS_DOWN, false },
- { "XF86SoftKBD", DALI_KEY_SOFT_KBD, false },
- { "XF86QuickPanel", DALI_KEY_QUICK_PANEL, false },
- { "XF86TaskPane", DALI_KEY_TASK_SWITCH, false },
- { "XF86Apps", DALI_KEY_APPS, false },
- { "XF86Search", DALI_KEY_SEARCH, false },
- { "XF86Voice", DALI_KEY_VOICE, false },
- { "Hangul", DALI_KEY_LANGUAGE, false },
- { "XF86AudioRaiseVolume", DALI_KEY_VOLUME_UP, true },
- { "XF86AudioLowerVolume", DALI_KEY_VOLUME_DOWN, true },
+ // Now the key names are used as literal string not defined symbols,
+ // since these definition in utilX.h is deprecated and we're guided not to use them
+ {"XF86Camera", DALI_KEY_CAMERA, false},
+ {"XF86Camera_Full", DALI_KEY_CONFIG, false},
+ {"XF86PowerOff", DALI_KEY_POWER, true},
+ {"XF86Standby", DALI_KEY_PAUSE, false},
+ {"Cancel", DALI_KEY_CANCEL, false},
+ {"XF86AudioPlay", DALI_KEY_PLAY_CD, false},
+ {"XF86AudioStop", DALI_KEY_STOP_CD, false},
+ {"XF86AudioPause", DALI_KEY_PAUSE_CD, false},
+ {"XF86AudioNext", DALI_KEY_NEXT_SONG, false},
+ {"XF86AudioPrev", DALI_KEY_PREVIOUS_SONG, false},
+ {"XF86AudioRewind", DALI_KEY_REWIND, false},
+ {"XF86AudioForward", DALI_KEY_FASTFORWARD, false},
+ {"XF86AudioMedia", DALI_KEY_MEDIA, false},
+ {"XF86AudioPlayPause", DALI_KEY_PLAY_PAUSE, false},
+ {"XF86AudioMute", DALI_KEY_MUTE, false},
+ {"XF86Menu", DALI_KEY_MENU, true},
+ {"XF86Home", DALI_KEY_HOME, true},
+ {"XF86Back", DALI_KEY_BACK, true},
+ {"XF86Send", DALI_KEY_MENU, true},
+ {"XF86Phone", DALI_KEY_HOME, true},
+ {"XF86Stop", DALI_KEY_BACK, true},
+ {"XF86HomePage", DALI_KEY_HOMEPAGE, false},
+ {"XF86WWW", DALI_KEY_WEBPAGE, false},
+ {"XF86Mail", DALI_KEY_MAIL, false},
+ {"XF86ScreenSaver", DALI_KEY_SCREENSAVER, false},
+ {"XF86MonBrightnessUp", DALI_KEY_BRIGHTNESS_UP, false},
+ {"XF86MonBrightnessDown", DALI_KEY_BRIGHTNESS_DOWN, false},
+ {"XF86SoftKBD", DALI_KEY_SOFT_KBD, false},
+ {"XF86QuickPanel", DALI_KEY_QUICK_PANEL, false},
+ {"XF86TaskPane", DALI_KEY_TASK_SWITCH, false},
+ {"XF86Apps", DALI_KEY_APPS, false},
+ {"XF86Search", DALI_KEY_SEARCH, false},
+ {"XF86Voice", DALI_KEY_VOICE, false},
+ {"Hangul", DALI_KEY_LANGUAGE, false},
+ {"XF86AudioRaiseVolume", DALI_KEY_VOLUME_UP, true},
+ {"XF86AudioLowerVolume", DALI_KEY_VOLUME_DOWN, true},
};
-const std::size_t KEY_LOOKUP_COUNT = (sizeof( KeyLookupTable))/ (sizeof(KeyLookup));
-
+const std::size_t KEY_LOOKUP_COUNT = (sizeof(KeyLookupTable)) / (sizeof(KeyLookup));
// Generate a KeyPressEvent to send to Core
-Dali::KeyEvent GenerateKeyPress( const std::string& keyName )
+Dali::KeyEvent GenerateKeyPress(const std::string& keyName)
{
- Dali::KeyEvent keyPress = DevelKeyEvent::New(keyName, "", "", -1, 0, 0lu, Dali::KeyEvent::DOWN, "", "", Device::Class::NONE, Device::Subclass::NONE); // set name to test, key string to i and modifier to shift
+ Dali::KeyEvent keyPress = DevelKeyEvent::New(keyName, "", "", -1, 0, 0lu, Dali::KeyEvent::DOWN, "", "", Device::Class::NONE, Device::Subclass::NONE); // set name to test, key string to i and modifier to shift
return keyPress;
}
{
TestApplication application;
- for ( std::size_t i = 0; i < KEY_LOOKUP_COUNT; ++i )
+ for(std::size_t i = 0; i < KEY_LOOKUP_COUNT; ++i)
{
- tet_printf( "Checking %s", KeyLookupTable[i].keyName );
- DALI_TEST_CHECK( IsKey( GenerateKeyPress( KeyLookupTable[i].keyName ), KeyLookupTable[i].daliKeyCode ) );
+ tet_printf("Checking %s", KeyLookupTable[i].keyName);
+ DALI_TEST_CHECK(IsKey(GenerateKeyPress(KeyLookupTable[i].keyName), KeyLookupTable[i].daliKeyCode));
}
END_TEST;
}
TestApplication application;
// Random value
- DALI_TEST_CHECK( IsKey( GenerateKeyPress( "invalid-key-name" ), DALI_KEY_MUTE ) == false );
+ DALI_TEST_CHECK(IsKey(GenerateKeyPress("invalid-key-name"), DALI_KEY_MUTE) == false);
// Compare with another key value
- for ( std::size_t i = 0; i < KEY_LOOKUP_COUNT; ++i )
+ for(std::size_t i = 0; i < KEY_LOOKUP_COUNT; ++i)
{
- tet_printf( "Checking %s", KeyLookupTable[i].keyName );
- DALI_TEST_CHECK( IsKey( GenerateKeyPress( KeyLookupTable[i].keyName ), KeyLookupTable[ ( i + 1 ) % KEY_LOOKUP_COUNT ].daliKeyCode ) == false );
+ tet_printf("Checking %s", KeyLookupTable[i].keyName);
+ DALI_TEST_CHECK(IsKey(GenerateKeyPress(KeyLookupTable[i].keyName), KeyLookupTable[(i + 1) % KEY_LOOKUP_COUNT].daliKeyCode) == false);
}
END_TEST;
}
/*
- * Copyright (c) 2015 Samsung Electronics Co., Ltd.
+ * Copyright (c) 2020 Samsung Electronics Co., Ltd.
*
* Licensed under the Apache License, Version 2.0 (the "License");
* you may not use this file except in compliance with the License.
*/
// EXTERNAL INCLUDES
-#include <map>
#include <string.h>
#include <iostream>
+#include <map>
// CLASS HEADER
-#include <stdlib.h>
-#include <iostream>
-#include <dali.h>
#include <dali-test-suite-utils.h>
+#include <dali.h>
#include <dali/public-api/adaptor-framework/key-grab.h>
+#include <stdlib.h>
+#include <iostream>
-extern int gArgc;
-extern char ** gArgv;
+extern int gArgc;
+extern char** gArgv;
using namespace Dali;
};
// Taken from key-impl.cpp
-KeyLookup TestKeyLookupTable[]=
-{
- { "Escape", DALI_KEY_ESCAPE, false }, // item not defined in utilX
- { "Menu", DALI_KEY_MENU, false }, // item not defined in utilX
-
- // Now the key names are used as literal string not defined symbols,
- // since these definition in utilX.h is deprecated and we're guided not to use them
- { "XF86Camera", DALI_KEY_CAMERA, false },
- { "XF86Camera_Full", DALI_KEY_CONFIG, false },
- { "XF86PowerOff", DALI_KEY_POWER, true },
- { "Cancel", DALI_KEY_CANCEL, false },
- { "XF86AudioPlay", DALI_KEY_PLAY_CD, false },
- { "XF86AudioStop", DALI_KEY_STOP_CD, false },
- { "XF86AudioPause", DALI_KEY_PAUSE_CD, false },
- { "XF86AudioNext", DALI_KEY_NEXT_SONG, false },
- { "XF86AudioPrev", DALI_KEY_PREVIOUS_SONG, false },
- { "XF86AudioRewind", DALI_KEY_REWIND, false },
- { "XF86AudioForward", DALI_KEY_FASTFORWARD, false },
- { "XF86AudioMedia", DALI_KEY_MEDIA, false },
- { "XF86AudioPlayPause", DALI_KEY_PLAY_PAUSE, false },
- { "XF86AudioMute", DALI_KEY_MUTE, false },
- { "XF86Menu", DALI_KEY_MENU, true },
- { "XF86Send", DALI_KEY_MENU, true },
- { "XF86HomePage", DALI_KEY_HOMEPAGE, false },
- { "XF86WWW", DALI_KEY_WEBPAGE, false },
- { "XF86Mail", DALI_KEY_MAIL, false },
- { "XF86ScreenSaver", DALI_KEY_SCREENSAVER, false },
- { "XF86MonBrightnessUp", DALI_KEY_BRIGHTNESS_UP, false },
- { "XF86MonBrightnessDown", DALI_KEY_BRIGHTNESS_DOWN, false },
- { "XF86SoftKBD", DALI_KEY_SOFT_KBD, false },
- { "XF86QuickPanel", DALI_KEY_QUICK_PANEL, false },
- { "XF86TaskPane", DALI_KEY_TASK_SWITCH, false },
- { "XF86Apps", DALI_KEY_APPS, false },
- { "XF86Search", DALI_KEY_SEARCH, false },
- { "XF86Voice", DALI_KEY_VOICE, false },
- { "Hangul", DALI_KEY_LANGUAGE, false },
- { "XF86AudioRaiseVolume", DALI_KEY_VOLUME_UP, true },
- { "XF86AudioLowerVolume", DALI_KEY_VOLUME_DOWN, true },
-
- { "BackSpace", DALI_KEY_BACKSPACE, false },
- { "Left", DALI_KEY_CURSOR_LEFT, false },
- { "Right", DALI_KEY_CURSOR_RIGHT, false }
-};
-
-const std::size_t KEY_LOOKUP_COUNT = (sizeof( TestKeyLookupTable))/ (sizeof(KeyLookup));
+KeyLookup TestKeyLookupTable[] =
+ {
+ {"Escape", DALI_KEY_ESCAPE, false}, // item not defined in utilX
+ {"Menu", DALI_KEY_MENU, false}, // item not defined in utilX
+
+ // Now the key names are used as literal string not defined symbols,
+ // since these definition in utilX.h is deprecated and we're guided not to use them
+ {"XF86Camera", DALI_KEY_CAMERA, false},
+ {"XF86Camera_Full", DALI_KEY_CONFIG, false},
+ {"XF86PowerOff", DALI_KEY_POWER, true},
+ {"Cancel", DALI_KEY_CANCEL, false},
+ {"XF86AudioPlay", DALI_KEY_PLAY_CD, false},
+ {"XF86AudioStop", DALI_KEY_STOP_CD, false},
+ {"XF86AudioPause", DALI_KEY_PAUSE_CD, false},
+ {"XF86AudioNext", DALI_KEY_NEXT_SONG, false},
+ {"XF86AudioPrev", DALI_KEY_PREVIOUS_SONG, false},
+ {"XF86AudioRewind", DALI_KEY_REWIND, false},
+ {"XF86AudioForward", DALI_KEY_FASTFORWARD, false},
+ {"XF86AudioMedia", DALI_KEY_MEDIA, false},
+ {"XF86AudioPlayPause", DALI_KEY_PLAY_PAUSE, false},
+ {"XF86AudioMute", DALI_KEY_MUTE, false},
+ {"XF86Menu", DALI_KEY_MENU, true},
+ {"XF86Send", DALI_KEY_MENU, true},
+ {"XF86HomePage", DALI_KEY_HOMEPAGE, false},
+ {"XF86WWW", DALI_KEY_WEBPAGE, false},
+ {"XF86Mail", DALI_KEY_MAIL, false},
+ {"XF86ScreenSaver", DALI_KEY_SCREENSAVER, false},
+ {"XF86MonBrightnessUp", DALI_KEY_BRIGHTNESS_UP, false},
+ {"XF86MonBrightnessDown", DALI_KEY_BRIGHTNESS_DOWN, false},
+ {"XF86SoftKBD", DALI_KEY_SOFT_KBD, false},
+ {"XF86QuickPanel", DALI_KEY_QUICK_PANEL, false},
+ {"XF86TaskPane", DALI_KEY_TASK_SWITCH, false},
+ {"XF86Apps", DALI_KEY_APPS, false},
+ {"XF86Search", DALI_KEY_SEARCH, false},
+ {"XF86Voice", DALI_KEY_VOICE, false},
+ {"Hangul", DALI_KEY_LANGUAGE, false},
+ {"XF86AudioRaiseVolume", DALI_KEY_VOLUME_UP, true},
+ {"XF86AudioLowerVolume", DALI_KEY_VOLUME_DOWN, true},
+
+ {"BackSpace", DALI_KEY_BACKSPACE, false},
+ {"Left", DALI_KEY_CURSOR_LEFT, false},
+ {"Right", DALI_KEY_CURSOR_RIGHT, false}};
+
+const std::size_t KEY_LOOKUP_COUNT = (sizeof(TestKeyLookupTable)) / (sizeof(KeyLookup));
enum TEST_TYPE
{
struct MyTestApp : public ConnectionTracker
{
- MyTestApp( Application& app, int type )
- : mApplication( app ),
- mTestType( type )
+ MyTestApp(Application& app, int type)
+ : mApplication(app),
+ mTestType(type)
{
- mApplication.InitSignal().Connect( this, &MyTestApp::OnInit );
+ mApplication.InitSignal().Connect(this, &MyTestApp::OnInit);
}
void OnInit(Application& app)
{
- mTimer = Timer::New( 500 );
- mTimer.TickSignal().Connect( this, &MyTestApp::Tick );
+ mTimer = Timer::New(500);
+ mTimer.TickSignal().Connect(this, &MyTestApp::Tick);
mTimer.Start();
ExcuteTest();
void ExcuteTest()
{
- switch (mTestType)
+ switch(mTestType)
{
case GRAB_KEY_TOPMOST_P:
TestGrabKeyTopmostP();
void TestGrabKeyTopmostP()
{
- for ( std::size_t i = 0; i < KEY_LOOKUP_COUNT; ++i )
+ for(std::size_t i = 0; i < KEY_LOOKUP_COUNT; ++i)
{
- DALI_TEST_CHECK( KeyGrab::GrabKeyTopmost( mApplication.GetWindow(), TestKeyLookupTable[i].daliKeyCode ) );
+ DALI_TEST_CHECK(KeyGrab::GrabKeyTopmost(mApplication.GetWindow(), TestKeyLookupTable[i].daliKeyCode));
}
}
void TestUngrabKeyTopmostP()
{
- for ( std::size_t i = 0; i < KEY_LOOKUP_COUNT; ++i )
+ for(std::size_t i = 0; i < KEY_LOOKUP_COUNT; ++i)
{
- DALI_TEST_CHECK( KeyGrab::GrabKeyTopmost( mApplication.GetWindow(), TestKeyLookupTable[i].daliKeyCode ) );
- DALI_TEST_CHECK( KeyGrab::UngrabKeyTopmost( mApplication.GetWindow(), TestKeyLookupTable[i].daliKeyCode ) );
+ DALI_TEST_CHECK(KeyGrab::GrabKeyTopmost(mApplication.GetWindow(), TestKeyLookupTable[i].daliKeyCode));
+ DALI_TEST_CHECK(KeyGrab::UngrabKeyTopmost(mApplication.GetWindow(), TestKeyLookupTable[i].daliKeyCode));
}
}
// Data
Application& mApplication;
- int mTestType;
- Timer mTimer;
+ int mTestType;
+ Timer mTimer;
};
int UtcDaliKeyGrabGrabKeyTopmostP(void)
{
- Application application = Application::New( &gArgc, &gArgv );
- MyTestApp testApp( application, GRAB_KEY_TOPMOST_P );
+ Application application = Application::New(&gArgc, &gArgv);
+ MyTestApp testApp(application, GRAB_KEY_TOPMOST_P);
application.MainLoop();
END_TEST;
}
int UtcDaliKeyGrabUngrabKeyTopmostP(void)
{
- Application application = Application::New( &gArgc, &gArgv );
- MyTestApp testApp( application, UNGRAB_KEY_TOPMOST_P );
+ Application application = Application::New(&gArgc, &gArgv);
+ MyTestApp testApp(application, UNGRAB_KEY_TOPMOST_P);
application.MainLoop();
END_TEST;
}
*
*/
-#include <dali/dali.h>
#include <dali-test-suite-utils.h>
+#include <dali/dali.h>
using namespace Dali;
-
void utc_dali_native_image_source_startup(void)
{
test_return_value = TET_UNDEF;
int UtcDaliNativeImageSourceNewN(void)
{
- unsigned int width = 256u;
+ unsigned int width = 256u;
unsigned int heigth = 256u;
try
{
- NativeImageSourcePtr nativeImageSource = NativeImageSource::New(width, heigth, NativeImageSource::COLOR_DEPTH_DEFAULT );
+ NativeImageSourcePtr nativeImageSource = NativeImageSource::New(width, heigth, NativeImageSource::COLOR_DEPTH_DEFAULT);
}
catch(Dali::DaliException& e)
{
- DALI_TEST_PRINT_ASSERT( e );
+ DALI_TEST_PRINT_ASSERT(e);
DALI_TEST_ASSERT(e, "Adaptor::IsAvailable()", TEST_LOCATION);
}
catch(...)
{
- tet_printf("Assertion test failed - wrong Exception\n" );
+ tet_printf("Assertion test failed - wrong Exception\n");
tet_result(TET_FAIL);
}
* limitations under the License.
*/
-#include <dali/dali.h>
#include <dali-test-suite-utils.h>
+#include <dali/dali.h>
#include <dali/devel-api/adaptor-framework/pixel-buffer.h>
#include "mesh-builder.h"
using namespace Dali;
{
TestApplication application;
- unsigned int width = 20u;
- unsigned int height = 20u;
- Devel::PixelBuffer imageData = Devel::PixelBuffer::New( width, height, Pixel::RGB888 );
+ unsigned int width = 20u;
+ unsigned int height = 20u;
+ Devel::PixelBuffer imageData = Devel::PixelBuffer::New(width, height, Pixel::RGB888);
PixelData pixelData = imageData.CreatePixelData();
- DALI_TEST_EQUALS( true, (bool)pixelData, TEST_LOCATION );
+ DALI_TEST_EQUALS(true, (bool)pixelData, TEST_LOCATION);
END_TEST;
}
-
-void Mask1stQuadrant( Devel::PixelBuffer maskData )
+void Mask1stQuadrant(Devel::PixelBuffer maskData)
{
- int width = maskData.GetWidth();
- int height = maskData.GetHeight();
+ int width = maskData.GetWidth();
+ int height = maskData.GetHeight();
Pixel::Format pixelFormat = maskData.GetPixelFormat();
- int bpp = Pixel::GetBytesPerPixel(pixelFormat);
+ int bpp = Pixel::GetBytesPerPixel(pixelFormat);
unsigned char* maskBuffer = maskData.GetBuffer();
- memset( maskBuffer, 0, width*height*bpp );
- int offset=0;
- for( int x=0; x<width; ++x)
+ memset(maskBuffer, 0, width * height * bpp);
+ int offset = 0;
+ for(int x = 0; x < width; ++x)
{
- for( int y=0; y<height; ++y)
+ for(int y = 0; y < height; ++y)
{
- if(x>=width/2 || y>=height/2)
+ if(x >= width / 2 || y >= height / 2)
{
- for(int b=0;b<bpp;++b)
+ for(int b = 0; b < bpp; ++b)
{
- maskBuffer[offset+b] = 0xff;
+ maskBuffer[offset + b] = 0xff;
}
}
- offset+=bpp;
+ offset += bpp;
}
}
}
-void MaskCenterSquare( Devel::PixelBuffer maskData )
+void MaskCenterSquare(Devel::PixelBuffer maskData)
{
- int width = maskData.GetWidth();
- int height = maskData.GetHeight();
+ int width = maskData.GetWidth();
+ int height = maskData.GetHeight();
Pixel::Format pixelFormat = maskData.GetPixelFormat();
- int bpp = Pixel::GetBytesPerPixel(pixelFormat);
+ int bpp = Pixel::GetBytesPerPixel(pixelFormat);
unsigned char* maskBuffer = maskData.GetBuffer();
- memset( maskBuffer, 0, width*height*bpp );
- int offset=0;
- for( int y=0; y<height; ++y)
+ memset(maskBuffer, 0, width * height * bpp);
+ int offset = 0;
+ for(int y = 0; y < height; ++y)
{
- for( int x=0; x<width; ++x)
+ for(int x = 0; x < width; ++x)
{
- if(x>=width/4 && x<3*width/4 &&
- y>=height/4 && y<3*height/4 )
+ if(x >= width / 4 && x < 3 * width / 4 &&
+ y >= height / 4 && y < 3 * height / 4)
{
- for(int b=0;b<bpp;++b)
+ for(int b = 0; b < bpp; ++b)
{
- maskBuffer[offset+b] = 0xff;
+ maskBuffer[offset + b] = 0xff;
}
}
- offset+=bpp;
+ offset += bpp;
}
}
}
-void AlternateQuadrants( Devel::PixelBuffer buffer )
+void AlternateQuadrants(Devel::PixelBuffer buffer)
{
- int width = buffer.GetWidth();
- int height = buffer.GetHeight();
+ int width = buffer.GetWidth();
+ int height = buffer.GetHeight();
Pixel::Format pixelFormat = buffer.GetPixelFormat();
- int bpp = Pixel::GetBytesPerPixel(pixelFormat);
- int stride=width*bpp;
+ int bpp = Pixel::GetBytesPerPixel(pixelFormat);
+ int stride = width * bpp;
unsigned char* pixels = buffer.GetBuffer();
- memset( pixels, 0, width*height*bpp );
+ memset(pixels, 0, width * height * bpp);
- for( int x=0; x<width; ++x)
+ for(int x = 0; x < width; ++x)
{
- for( int y=0; y<height; ++y)
+ for(int y = 0; y < height; ++y)
{
- if( ( x < width/2 && y >= height/2 ) ||
- ( x >= width/2 && y < height/2 ) )
+ if((x < width / 2 && y >= height / 2) ||
+ (x >= width / 2 && y < height / 2))
{
- for(int b=0;b<bpp;++b)
+ for(int b = 0; b < bpp; ++b)
{
- pixels[y*stride+x*bpp+b] = 0xff;
+ pixels[y * stride + x * bpp + b] = 0xff;
}
}
}
}
}
-
-void FillCheckerboard( Devel::PixelBuffer imageData )
+void FillCheckerboard(Devel::PixelBuffer imageData)
{
- int width = imageData.GetWidth();
- int height = imageData.GetHeight();
+ int width = imageData.GetWidth();
+ int height = imageData.GetHeight();
Pixel::Format pixelFormat = imageData.GetPixelFormat();
- int bpp = Pixel::GetBytesPerPixel(pixelFormat);
+ int bpp = Pixel::GetBytesPerPixel(pixelFormat);
unsigned char* imageBuffer = imageData.GetBuffer();
- memset( imageBuffer, 0, width*height*bpp );
- int offset=0;
- for( int x=0; x<width; ++x)
+ memset(imageBuffer, 0, width * height * bpp);
+ int offset = 0;
+ for(int x = 0; x < width; ++x)
{
- for( int y=0; y<height; ++y)
+ for(int y = 0; y < height; ++y)
{
// on even lines, odd pixels, or on odd lines, even pixels
- if( (x%2 && y%2==0) || (x%2==0 && y%2) )
+ if((x % 2 && y % 2 == 0) || (x % 2 == 0 && y % 2))
{
switch(pixelFormat)
{
case Pixel::RGBA5551:
- imageBuffer[offset] = 0xFF;
- imageBuffer[offset+1] = 0xFF;
+ imageBuffer[offset] = 0xFF;
+ imageBuffer[offset + 1] = 0xFF;
break;
case Pixel::RGBA4444:
- imageBuffer[offset] = 0xFF;
- imageBuffer[offset+1] = 0xFF;
+ imageBuffer[offset] = 0xFF;
+ imageBuffer[offset + 1] = 0xFF;
break;
case Pixel::RGB565:
- imageBuffer[offset] = 0xFF;
- imageBuffer[offset+1] = 0xFF;
+ imageBuffer[offset] = 0xFF;
+ imageBuffer[offset + 1] = 0xFF;
break;
case Pixel::RGB888:
- imageBuffer[offset] = 0xFF;
- imageBuffer[offset+1] = 0xFF;
- imageBuffer[offset+2] = 0xFF;
+ imageBuffer[offset] = 0xFF;
+ imageBuffer[offset + 1] = 0xFF;
+ imageBuffer[offset + 2] = 0xFF;
break;
case Pixel::RGBA8888:
- imageBuffer[offset] = 0xFF;
- imageBuffer[offset+1] = 0xFF;
- imageBuffer[offset+2] = 0xFF;
- imageBuffer[offset+3] = 0xFF;
+ imageBuffer[offset] = 0xFF;
+ imageBuffer[offset + 1] = 0xFF;
+ imageBuffer[offset + 2] = 0xFF;
+ imageBuffer[offset + 3] = 0xFF;
break;
default:
break;
}
}
- offset+=bpp;
+ offset += bpp;
}
}
}
-int GetAlphaAt( Devel::PixelBuffer buffer, int x, int y )
+int GetAlphaAt(Devel::PixelBuffer buffer, int x, int y)
{
unsigned char* pixels = buffer.GetBuffer();
- int bpp = Pixel::GetBytesPerPixel(buffer.GetPixelFormat());
- int stride = buffer.GetWidth() * bpp;
- int byteOffset;
- int bitMask;
- GetAlphaOffsetAndMask( buffer.GetPixelFormat(), byteOffset, bitMask );
- return int(pixels[stride * y + x*bpp + byteOffset]) & bitMask;
+ int bpp = Pixel::GetBytesPerPixel(buffer.GetPixelFormat());
+ int stride = buffer.GetWidth() * bpp;
+ int byteOffset;
+ int bitMask;
+ GetAlphaOffsetAndMask(buffer.GetPixelFormat(), byteOffset, bitMask);
+ return int(pixels[stride * y + x * bpp + byteOffset]) & bitMask;
}
int UtcDaliPixelBufferNew01P(void)
{
- TestApplication application;
- Devel::PixelBuffer pixbuf = Devel::PixelBuffer::New( 10, 10, Pixel::RGBA8888 );
- DALI_TEST_CHECK( pixbuf );
- DALI_TEST_CHECK( pixbuf.GetBuffer() != NULL );
+ TestApplication application;
+ Devel::PixelBuffer pixbuf = Devel::PixelBuffer::New(10, 10, Pixel::RGBA8888);
+ DALI_TEST_CHECK(pixbuf);
+ DALI_TEST_CHECK(pixbuf.GetBuffer() != NULL);
END_TEST;
}
int UtcDaliPixelBufferNew01N(void)
{
- TestApplication application;
- Devel::PixelBuffer pixbuf = Devel::PixelBuffer::New( 0, 0, Pixel::RGBA8888 );
- DALI_TEST_CHECK( pixbuf );
- DALI_TEST_CHECK( pixbuf.GetBuffer() == NULL );
+ TestApplication application;
+ Devel::PixelBuffer pixbuf = Devel::PixelBuffer::New(0, 0, Pixel::RGBA8888);
+ DALI_TEST_CHECK(pixbuf);
+ DALI_TEST_CHECK(pixbuf.GetBuffer() == NULL);
END_TEST;
}
int UtcDaliPixelBufferConvert(void)
{
- TestApplication application;
- TestGlAbstraction& gl=application.GetGlAbstraction();
- TraceCallStack& textureTrace=gl.GetTextureTrace();
+ TestApplication application;
+ TestGlAbstraction& gl = application.GetGlAbstraction();
+ TraceCallStack& textureTrace = gl.GetTextureTrace();
textureTrace.Enable(true);
- Devel::PixelBuffer pixbuf = Devel::PixelBuffer::New( 10, 10, Pixel::RGB565 );
+ Devel::PixelBuffer pixbuf = Devel::PixelBuffer::New(10, 10, Pixel::RGB565);
FillCheckerboard(pixbuf);
{
Devel::PixelBuffer pixbufPrime = pixbuf; // store a second handle to the data
- Dali::PixelData pixelData = Devel::PixelBuffer::Convert( pixbuf );
- DALI_TEST_CHECK( !pixbuf );
+ Dali::PixelData pixelData = Devel::PixelBuffer::Convert(pixbuf);
+ DALI_TEST_CHECK(!pixbuf);
// check the buffer in the second handle is empty
- DALI_TEST_CHECK( pixbufPrime.GetBuffer() == NULL );
+ DALI_TEST_CHECK(pixbufPrime.GetBuffer() == NULL);
- DALI_TEST_CHECK( pixelData );
- DALI_TEST_EQUALS( pixelData.GetWidth(), 10, TEST_LOCATION );
- DALI_TEST_EQUALS( pixelData.GetHeight(), 10, TEST_LOCATION );
- DALI_TEST_EQUALS( pixelData.GetPixelFormat(), Pixel::RGB565, TEST_LOCATION );
+ DALI_TEST_CHECK(pixelData);
+ DALI_TEST_EQUALS(pixelData.GetWidth(), 10, TEST_LOCATION);
+ DALI_TEST_EQUALS(pixelData.GetHeight(), 10, TEST_LOCATION);
+ DALI_TEST_EQUALS(pixelData.GetPixelFormat(), Pixel::RGB565, TEST_LOCATION);
// Try drawing it
Texture t = Texture::New(TextureType::TEXTURE_2D, Pixel::RGB565, 10, 10);
- t.Upload( pixelData );
+ t.Upload(pixelData);
TextureSet ts = TextureSet::New();
ts.SetTexture(0, t);
Geometry g = CreateQuadGeometry();
- Shader s = Shader::New("v", "f");
- Renderer r = Renderer::New( g, s );
+ Shader s = Shader::New("v", "f");
+ Renderer r = Renderer::New(g, s);
r.SetTextures(ts);
Actor a = Actor::New();
a.AddRenderer(r);
- a.SetProperty( Actor::Property::SIZE, Vector2(10, 10) );
- a.SetProperty( Actor::Property::PARENT_ORIGIN, ParentOrigin::CENTER );
+ a.SetProperty(Actor::Property::SIZE, Vector2(10, 10));
+ a.SetProperty(Actor::Property::PARENT_ORIGIN, ParentOrigin::CENTER);
application.GetScene().Add(a);
application.SendNotification();
application.Render();
- DALI_TEST_EQUALS( textureTrace.FindMethod("BindTexture"), true, TEST_LOCATION );
+ DALI_TEST_EQUALS(textureTrace.FindMethod("BindTexture"), true, TEST_LOCATION);
// Let secondary scope destroy pixbufPrime
}
int UtcDaliPixelBufferGetWidth(void)
{
- TestApplication application;
- Devel::PixelBuffer pixbuf = Devel::PixelBuffer::New( 10, 10, Pixel::RGB565 );
+ TestApplication application;
+ Devel::PixelBuffer pixbuf = Devel::PixelBuffer::New(10, 10, Pixel::RGB565);
FillCheckerboard(pixbuf);
- DALI_TEST_EQUALS( pixbuf.GetWidth(), 10, TEST_LOCATION ) ;
+ DALI_TEST_EQUALS(pixbuf.GetWidth(), 10, TEST_LOCATION);
END_TEST;
}
int UtcDaliPixelBufferGetHeight(void)
{
- TestApplication application;
- Devel::PixelBuffer pixbuf = Devel::PixelBuffer::New( 10, 10, Pixel::RGB565 );
+ TestApplication application;
+ Devel::PixelBuffer pixbuf = Devel::PixelBuffer::New(10, 10, Pixel::RGB565);
FillCheckerboard(pixbuf);
- DALI_TEST_EQUALS( pixbuf.GetHeight(), 10, TEST_LOCATION ) ;
+ DALI_TEST_EQUALS(pixbuf.GetHeight(), 10, TEST_LOCATION);
END_TEST;
}
int UtcDaliPixelBufferGetPixelFormat(void)
{
- TestApplication application;
- Devel::PixelBuffer pixbuf = Devel::PixelBuffer::New( 10, 10, Pixel::RGB565 );
+ TestApplication application;
+ Devel::PixelBuffer pixbuf = Devel::PixelBuffer::New(10, 10, Pixel::RGB565);
FillCheckerboard(pixbuf);
- DALI_TEST_EQUALS( pixbuf.GetPixelFormat(), Pixel::RGB565, TEST_LOCATION ) ;
+ DALI_TEST_EQUALS(pixbuf.GetPixelFormat(), Pixel::RGB565, TEST_LOCATION);
END_TEST;
}
-
-
int UtcDaliPixelBufferMask01(void)
{
TestApplication application;
- unsigned int width = 10u;
- unsigned int height = 10u;
- Pixel::Format pixelFormat = Pixel::L8;
- Devel::PixelBuffer maskData = Devel::PixelBuffer::New( width, height, pixelFormat );
+ unsigned int width = 10u;
+ unsigned int height = 10u;
+ Pixel::Format pixelFormat = Pixel::L8;
+ Devel::PixelBuffer maskData = Devel::PixelBuffer::New(width, height, pixelFormat);
Mask1stQuadrant(maskData);
- width = 20u;
- height = 20u;
+ width = 20u;
+ height = 20u;
pixelFormat = Pixel::RGBA5551;
- Devel::PixelBuffer imageData = Devel::PixelBuffer::New( width, height, pixelFormat );
+ Devel::PixelBuffer imageData = Devel::PixelBuffer::New(width, height, pixelFormat);
FillCheckerboard(imageData);
- imageData.ApplyMask( maskData, 1.0f, false );
+ imageData.ApplyMask(maskData, 1.0f, false);
// Test that the pixel format has been promoted to RGBA8888
- DALI_TEST_EQUALS( imageData.GetPixelFormat(), Pixel::RGBA8888, TEST_LOCATION );
+ DALI_TEST_EQUALS(imageData.GetPixelFormat(), Pixel::RGBA8888, TEST_LOCATION);
// Test that a pixel in the first quadrant has no alpha value
unsigned char* buffer = imageData.GetBuffer();
- DALI_TEST_EQUALS( buffer[3], 0x00u, TEST_LOCATION );
- DALI_TEST_EQUALS( buffer[7], 0x00u, TEST_LOCATION );
+ DALI_TEST_EQUALS(buffer[3], 0x00u, TEST_LOCATION);
+ DALI_TEST_EQUALS(buffer[7], 0x00u, TEST_LOCATION);
// Test that an even pixel in the second quadrant has a full alpha value
- DALI_TEST_EQUALS( buffer[43], 0x00u, TEST_LOCATION );
+ DALI_TEST_EQUALS(buffer[43], 0x00u, TEST_LOCATION);
// Test that an odd pixel in the second quadrant has full alpha value
- DALI_TEST_EQUALS( buffer[47], 0xffu, TEST_LOCATION );
+ DALI_TEST_EQUALS(buffer[47], 0xffu, TEST_LOCATION);
END_TEST;
}
-
int UtcDaliPixelBufferMask02(void)
{
TestApplication application;
- unsigned int width = 10u;
- unsigned int height = 10u;
- Pixel::Format pixelFormat = Pixel::L8;
- Devel::PixelBuffer maskData = Devel::PixelBuffer::New( width, height, pixelFormat );
+ unsigned int width = 10u;
+ unsigned int height = 10u;
+ Pixel::Format pixelFormat = Pixel::L8;
+ Devel::PixelBuffer maskData = Devel::PixelBuffer::New(width, height, pixelFormat);
Mask1stQuadrant(maskData);
- width = 20u;
- height = 20u;
+ width = 20u;
+ height = 20u;
pixelFormat = Pixel::RGBA4444;
- Devel::PixelBuffer imageData = Devel::PixelBuffer::New( width, height, pixelFormat );
+ Devel::PixelBuffer imageData = Devel::PixelBuffer::New(width, height, pixelFormat);
FillCheckerboard(imageData);
- imageData.ApplyMask( maskData, 1.0f, false );
+ imageData.ApplyMask(maskData, 1.0f, false);
// Test that the pixel format has been promoted to RGBA8888
- DALI_TEST_EQUALS( imageData.GetPixelFormat(), Pixel::RGBA8888, TEST_LOCATION );
+ DALI_TEST_EQUALS(imageData.GetPixelFormat(), Pixel::RGBA8888, TEST_LOCATION);
// Test that a pixel in the first quadrant has no alpha value
unsigned char* buffer = imageData.GetBuffer();
- DALI_TEST_EQUALS( buffer[3], 0x00u, TEST_LOCATION );
- DALI_TEST_EQUALS( buffer[7], 0x00u, TEST_LOCATION );
+ DALI_TEST_EQUALS(buffer[3], 0x00u, TEST_LOCATION);
+ DALI_TEST_EQUALS(buffer[7], 0x00u, TEST_LOCATION);
// Test that an even pixel in the second quadrant has no alpha value
- DALI_TEST_EQUALS( buffer[43], 0x00u, TEST_LOCATION );
+ DALI_TEST_EQUALS(buffer[43], 0x00u, TEST_LOCATION);
// Test that an odd pixel in the second quadrant has full alpha value
- DALI_TEST_EQUALS( buffer[47], 0xffu, TEST_LOCATION );
+ DALI_TEST_EQUALS(buffer[47], 0xffu, TEST_LOCATION);
END_TEST;
}
TestApplication application;
tet_infoline("Test application of alpha mask to smaller RGB565 image");
- unsigned int width = 20u;
- unsigned int height = 20u;
- Devel::PixelBuffer maskData = Devel::PixelBuffer::New( width, height, Pixel::L8 );
+ unsigned int width = 20u;
+ unsigned int height = 20u;
+ Devel::PixelBuffer maskData = Devel::PixelBuffer::New(width, height, Pixel::L8);
Mask1stQuadrant(maskData);
- width = 10u;
- height = 10u;
- Pixel::Format format = Pixel::RGB565;
- Devel::PixelBuffer imageData = Devel::PixelBuffer::New( width, height, format );
+ width = 10u;
+ height = 10u;
+ Pixel::Format format = Pixel::RGB565;
+ Devel::PixelBuffer imageData = Devel::PixelBuffer::New(width, height, format);
FillCheckerboard(imageData);
- imageData.ApplyMask( maskData, 1.0f, false );
+ imageData.ApplyMask(maskData, 1.0f, false);
// Test that the pixel format has been promoted to RGBA8888
- DALI_TEST_EQUALS( imageData.GetPixelFormat(), Pixel::RGBA8888, TEST_LOCATION );
+ DALI_TEST_EQUALS(imageData.GetPixelFormat(), Pixel::RGBA8888, TEST_LOCATION);
// Test that a pixel in the first quadrant has no alpha value
unsigned char* buffer = imageData.GetBuffer();
- DALI_TEST_EQUALS( buffer[3], 0x00u, TEST_LOCATION );
- DALI_TEST_EQUALS( buffer[7], 0x00u, TEST_LOCATION );
+ DALI_TEST_EQUALS(buffer[3], 0x00u, TEST_LOCATION);
+ DALI_TEST_EQUALS(buffer[7], 0x00u, TEST_LOCATION);
// Test that an odd pixel in the fourth quadrant has full alpha value
- DALI_TEST_EQUALS( buffer[(6*10+7)*4+3], 0xffu, TEST_LOCATION );
+ DALI_TEST_EQUALS(buffer[(6 * 10 + 7) * 4 + 3], 0xffu, TEST_LOCATION);
// Test that an even pixel in the fourth quadrant has full alpha value
- DALI_TEST_EQUALS( buffer[(6*10+8)*4+3], 0xffu, TEST_LOCATION );
+ DALI_TEST_EQUALS(buffer[(6 * 10 + 8) * 4 + 3], 0xffu, TEST_LOCATION);
END_TEST;
}
-
int UtcDaliPixelBufferMask04(void)
{
TestApplication application;
tet_infoline("Test application of alpha mask to larger RGBA8888 image");
- unsigned int width = 10u;
- unsigned int height = 10u;
- Devel::PixelBuffer maskData = Devel::PixelBuffer::New( width, height, Pixel::L8 );
+ unsigned int width = 10u;
+ unsigned int height = 10u;
+ Devel::PixelBuffer maskData = Devel::PixelBuffer::New(width, height, Pixel::L8);
Mask1stQuadrant(maskData);
- width = 20u;
- height = 20u;
- Devel::PixelBuffer imageData = Devel::PixelBuffer::New( width, height, Pixel::RGBA8888 );
+ width = 20u;
+ height = 20u;
+ Devel::PixelBuffer imageData = Devel::PixelBuffer::New(width, height, Pixel::RGBA8888);
FillCheckerboard(imageData);
- imageData.ApplyMask( maskData, 1.0f, false );
+ imageData.ApplyMask(maskData, 1.0f, false);
// Test that the pixel format has been promoted to RGBA8888
- DALI_TEST_EQUALS( imageData.GetPixelFormat(), Pixel::RGBA8888, TEST_LOCATION );
+ DALI_TEST_EQUALS(imageData.GetPixelFormat(), Pixel::RGBA8888, TEST_LOCATION);
// Test that a pixel in the first quadrant has no alpha value
unsigned char* buffer = imageData.GetBuffer();
- DALI_TEST_EQUALS( buffer[3], 0x00u, TEST_LOCATION );
- DALI_TEST_EQUALS( buffer[7], 0x00u, TEST_LOCATION );
+ DALI_TEST_EQUALS(buffer[3], 0x00u, TEST_LOCATION);
+ DALI_TEST_EQUALS(buffer[7], 0x00u, TEST_LOCATION);
// Test that an even pixel in the second quadrant has no alpha value
- DALI_TEST_EQUALS( buffer[43], 0x00u, TEST_LOCATION );
+ DALI_TEST_EQUALS(buffer[43], 0x00u, TEST_LOCATION);
// Test that an odd pixel in the second quadrant has full alpha value
- DALI_TEST_EQUALS( buffer[47], 0xffu, TEST_LOCATION );
+ DALI_TEST_EQUALS(buffer[47], 0xffu, TEST_LOCATION);
END_TEST;
}
TestApplication application;
tet_infoline("Test application of alpha mask to smaller RGBA8888 image");
- unsigned int width = 20u;
- unsigned int height = 20u;
- Devel::PixelBuffer maskData = Devel::PixelBuffer::New( width, height, Pixel::RGBA8888 );
+ unsigned int width = 20u;
+ unsigned int height = 20u;
+ Devel::PixelBuffer maskData = Devel::PixelBuffer::New(width, height, Pixel::RGBA8888);
Mask1stQuadrant(maskData);
- width = 10u;
- height = 10u;
- Devel::PixelBuffer imageData = Devel::PixelBuffer::New( width, height, Pixel::RGBA8888 );
+ width = 10u;
+ height = 10u;
+ Devel::PixelBuffer imageData = Devel::PixelBuffer::New(width, height, Pixel::RGBA8888);
FillCheckerboard(imageData);
- imageData.ApplyMask( maskData, 1.0f, false );
+ imageData.ApplyMask(maskData, 1.0f, false);
// Test that the pixel format has been promoted to RGBA8888
- DALI_TEST_EQUALS( imageData.GetPixelFormat(), Pixel::RGBA8888, TEST_LOCATION );
+ DALI_TEST_EQUALS(imageData.GetPixelFormat(), Pixel::RGBA8888, TEST_LOCATION);
// Test that a pixel in the first quadrant has no alpha value
unsigned char* buffer = imageData.GetBuffer();
- DALI_TEST_EQUALS( buffer[3], 0x00u, TEST_LOCATION );
- DALI_TEST_EQUALS( buffer[7], 0x00u, TEST_LOCATION );
+ DALI_TEST_EQUALS(buffer[3], 0x00u, TEST_LOCATION);
+ DALI_TEST_EQUALS(buffer[7], 0x00u, TEST_LOCATION);
// Test that an odd pixel in the second quadrant has full alpha value
- DALI_TEST_EQUALS( buffer[39], 0xffu, TEST_LOCATION );
+ DALI_TEST_EQUALS(buffer[39], 0xffu, TEST_LOCATION);
// Test that an even pixel in the second quadrant has no alpha value
- DALI_TEST_EQUALS( buffer[27], 0x00u, TEST_LOCATION );
+ DALI_TEST_EQUALS(buffer[27], 0x00u, TEST_LOCATION);
END_TEST;
}
TestApplication application;
tet_infoline("Test application of alpha mask to same size RGBA8888 image");
- unsigned int width = 10u;
- unsigned int height = 10u;
- Devel::PixelBuffer maskData = Devel::PixelBuffer::New( width, height, Pixel::RGBA8888 );
+ unsigned int width = 10u;
+ unsigned int height = 10u;
+ Devel::PixelBuffer maskData = Devel::PixelBuffer::New(width, height, Pixel::RGBA8888);
Mask1stQuadrant(maskData);
- width = 10u;
- height = 10u;
- Devel::PixelBuffer imageData = Devel::PixelBuffer::New( width, height, Pixel::RGBA8888 );
+ width = 10u;
+ height = 10u;
+ Devel::PixelBuffer imageData = Devel::PixelBuffer::New(width, height, Pixel::RGBA8888);
FillCheckerboard(imageData);
- imageData.ApplyMask( maskData, 1.0f, false );
+ imageData.ApplyMask(maskData, 1.0f, false);
// Test that the pixel format has been promoted to RGBA8888
- DALI_TEST_EQUALS( imageData.GetPixelFormat(), Pixel::RGBA8888, TEST_LOCATION );
+ DALI_TEST_EQUALS(imageData.GetPixelFormat(), Pixel::RGBA8888, TEST_LOCATION);
// Test that a pixel in the first quadrant has no alpha value
unsigned char* buffer = imageData.GetBuffer();
- DALI_TEST_EQUALS( buffer[3], 0x00u, TEST_LOCATION );
- DALI_TEST_EQUALS( buffer[7], 0x00u, TEST_LOCATION );
+ DALI_TEST_EQUALS(buffer[3], 0x00u, TEST_LOCATION);
+ DALI_TEST_EQUALS(buffer[7], 0x00u, TEST_LOCATION);
// Test that an odd pixel in the second quadrant has full alpha value
- DALI_TEST_EQUALS( buffer[39], 0xffu, TEST_LOCATION );
+ DALI_TEST_EQUALS(buffer[39], 0xffu, TEST_LOCATION);
// Test that an even pixel in the second quadrant has no alpha value
- DALI_TEST_EQUALS( buffer[27], 0x00u, TEST_LOCATION );
+ DALI_TEST_EQUALS(buffer[27], 0x00u, TEST_LOCATION);
END_TEST;
}
-
int UtcDaliPixelBufferMask07(void)
{
TestApplication application;
- tet_infoline("Test scaling of source image to match alpha mask" );
+ tet_infoline("Test scaling of source image to match alpha mask");
- unsigned int width = 20u;
- unsigned int height = 20u;
- Devel::PixelBuffer maskData = Devel::PixelBuffer::New( width, height, Pixel::RGBA8888 );
+ unsigned int width = 20u;
+ unsigned int height = 20u;
+ Devel::PixelBuffer maskData = Devel::PixelBuffer::New(width, height, Pixel::RGBA8888);
MaskCenterSquare(maskData);
// +----------+
// | XXXXXX |
// *----------+
- width = 10u;
- height = 10u;
- Devel::PixelBuffer imageData = Devel::PixelBuffer::New( width, height, Pixel::RGBA8888 );
- AlternateQuadrants( imageData );
+ width = 10u;
+ height = 10u;
+ Devel::PixelBuffer imageData = Devel::PixelBuffer::New(width, height, Pixel::RGBA8888);
+ AlternateQuadrants(imageData);
// +-----XXXXX+
// | XXXXX|
// |XXXXX |
// *XXXXX-----+
- imageData.ApplyMask( maskData, 2.0f, true );
+ imageData.ApplyMask(maskData, 2.0f, true);
// +----------+
// | XXX |
// | XXX |
// *----------+
- tet_infoline("Test that the image has been scaled to match the alpha mask" );
- DALI_TEST_EQUALS( imageData.GetWidth(), 20, TEST_LOCATION );
- DALI_TEST_EQUALS( imageData.GetHeight(), 20, TEST_LOCATION );
+ tet_infoline("Test that the image has been scaled to match the alpha mask");
+ DALI_TEST_EQUALS(imageData.GetWidth(), 20, TEST_LOCATION);
+ DALI_TEST_EQUALS(imageData.GetHeight(), 20, TEST_LOCATION);
- tet_infoline( "Test that pixels in the outer eighths have no alpha\n" );
+ tet_infoline("Test that pixels in the outer eighths have no alpha\n");
- DALI_TEST_EQUALS( GetAlphaAt(imageData, 0, 0), 0x00u, TEST_LOCATION );
- DALI_TEST_EQUALS( GetAlphaAt(imageData, 9, 4), 0x00u, TEST_LOCATION );
- DALI_TEST_EQUALS( GetAlphaAt(imageData, 15, 4), 0x00u, TEST_LOCATION );
- DALI_TEST_EQUALS( GetAlphaAt(imageData, 19, 4), 0x00u, TEST_LOCATION );
+ DALI_TEST_EQUALS(GetAlphaAt(imageData, 0, 0), 0x00u, TEST_LOCATION);
+ DALI_TEST_EQUALS(GetAlphaAt(imageData, 9, 4), 0x00u, TEST_LOCATION);
+ DALI_TEST_EQUALS(GetAlphaAt(imageData, 15, 4), 0x00u, TEST_LOCATION);
+ DALI_TEST_EQUALS(GetAlphaAt(imageData, 19, 4), 0x00u, TEST_LOCATION);
- DALI_TEST_EQUALS( GetAlphaAt(imageData, 0, 19), 0x00u, TEST_LOCATION );
- DALI_TEST_EQUALS( GetAlphaAt(imageData, 8, 18), 0x00u, TEST_LOCATION );
- DALI_TEST_EQUALS( GetAlphaAt(imageData, 15,17), 0x00u, TEST_LOCATION );
- DALI_TEST_EQUALS( GetAlphaAt(imageData, 19,16), 0x00u, TEST_LOCATION );
+ DALI_TEST_EQUALS(GetAlphaAt(imageData, 0, 19), 0x00u, TEST_LOCATION);
+ DALI_TEST_EQUALS(GetAlphaAt(imageData, 8, 18), 0x00u, TEST_LOCATION);
+ DALI_TEST_EQUALS(GetAlphaAt(imageData, 15, 17), 0x00u, TEST_LOCATION);
+ DALI_TEST_EQUALS(GetAlphaAt(imageData, 19, 16), 0x00u, TEST_LOCATION);
- DALI_TEST_EQUALS( GetAlphaAt(imageData, 0, 1), 0x00u, TEST_LOCATION );
- DALI_TEST_EQUALS( GetAlphaAt(imageData, 1, 7), 0x00u, TEST_LOCATION );
- DALI_TEST_EQUALS( GetAlphaAt(imageData, 2, 10), 0x00u, TEST_LOCATION );
- DALI_TEST_EQUALS( GetAlphaAt(imageData, 3, 19), 0x00u, TEST_LOCATION );
+ DALI_TEST_EQUALS(GetAlphaAt(imageData, 0, 1), 0x00u, TEST_LOCATION);
+ DALI_TEST_EQUALS(GetAlphaAt(imageData, 1, 7), 0x00u, TEST_LOCATION);
+ DALI_TEST_EQUALS(GetAlphaAt(imageData, 2, 10), 0x00u, TEST_LOCATION);
+ DALI_TEST_EQUALS(GetAlphaAt(imageData, 3, 19), 0x00u, TEST_LOCATION);
- DALI_TEST_EQUALS( GetAlphaAt(imageData, 19, 1), 0x00u, TEST_LOCATION );
- DALI_TEST_EQUALS( GetAlphaAt(imageData, 18, 7), 0x00u, TEST_LOCATION );
- DALI_TEST_EQUALS( GetAlphaAt(imageData, 17, 10), 0x00u, TEST_LOCATION );
- DALI_TEST_EQUALS( GetAlphaAt(imageData, 16, 19), 0x00u, TEST_LOCATION );
+ DALI_TEST_EQUALS(GetAlphaAt(imageData, 19, 1), 0x00u, TEST_LOCATION);
+ DALI_TEST_EQUALS(GetAlphaAt(imageData, 18, 7), 0x00u, TEST_LOCATION);
+ DALI_TEST_EQUALS(GetAlphaAt(imageData, 17, 10), 0x00u, TEST_LOCATION);
+ DALI_TEST_EQUALS(GetAlphaAt(imageData, 16, 19), 0x00u, TEST_LOCATION);
- tet_infoline( "Test that pixels in the center have full alpha\n" );
+ tet_infoline("Test that pixels in the center have full alpha\n");
- DALI_TEST_EQUALS( GetAlphaAt(imageData, 12, 8), 0xffu, TEST_LOCATION );
- DALI_TEST_EQUALS( GetAlphaAt(imageData, 8, 12), 0xffu, TEST_LOCATION );
+ DALI_TEST_EQUALS(GetAlphaAt(imageData, 12, 8), 0xffu, TEST_LOCATION);
+ DALI_TEST_EQUALS(GetAlphaAt(imageData, 8, 12), 0xffu, TEST_LOCATION);
END_TEST;
}
int UtcDaliPixelBufferMask08(void)
{
TestApplication application;
- tet_infoline("Test scaling of source image to larger than the alpha mask" );
+ tet_infoline("Test scaling of source image to larger than the alpha mask");
- unsigned int width = 32u;
- unsigned int height = 20u;
- Devel::PixelBuffer maskData = Devel::PixelBuffer::New( width, height, Pixel::RGBA8888 );
- AlternateQuadrants( maskData );
+ unsigned int width = 32u;
+ unsigned int height = 20u;
+ Devel::PixelBuffer maskData = Devel::PixelBuffer::New(width, height, Pixel::RGBA8888);
+ AlternateQuadrants(maskData);
// +-----XXXXX+
// | XXXXX|
// |XXXXX |
// *XXXXX-----+
- width = 20u;
- height = 16u;
- Devel::PixelBuffer imageData = Devel::PixelBuffer::New( width, height, Pixel::RGBA8888 );
+ width = 20u;
+ height = 16u;
+ Devel::PixelBuffer imageData = Devel::PixelBuffer::New(width, height, Pixel::RGBA8888);
MaskCenterSquare(imageData);
// +----------+
// | XXXXXX |
// *----------+
- imageData.ApplyMask( maskData, 4.0f, true );
+ imageData.ApplyMask(maskData, 4.0f, true);
// +-----XXXXX+ quadrant
// | XXXXX| 1 2
// |XXXXX |
// *XXXXX-----+
- tet_infoline("Test that the image has been scaled and cropped to match the alpha mask" );
- DALI_TEST_EQUALS( imageData.GetWidth(), 32, TEST_LOCATION );
- DALI_TEST_EQUALS( imageData.GetHeight(), 20, TEST_LOCATION );
-
- tet_infoline( "Test that the image has been resized (the center square should now fill the image)\n");
- tet_infoline( "Test that the first quadrant has no alpha");
- DALI_TEST_EQUALS( GetAlphaAt(imageData, 0, 0), 0x00u, TEST_LOCATION );
- DALI_TEST_EQUALS( GetAlphaAt(imageData, 5, 4), 0x00u, TEST_LOCATION );
- DALI_TEST_EQUALS( GetAlphaAt(imageData, 5, 8), 0x00u, TEST_LOCATION );
- DALI_TEST_EQUALS( GetAlphaAt(imageData, 14, 8), 0x00u, TEST_LOCATION );
-
- tet_infoline( "Test that the second quadrant has alpha and data");
- DALI_TEST_EQUALS( GetAlphaAt(imageData, 18, 0), 0xffu, TEST_LOCATION );
- DALI_TEST_EQUALS( GetAlphaAt(imageData, 30, 1), 0xffu, TEST_LOCATION );
- DALI_TEST_EQUALS( GetAlphaAt(imageData, 30, 8), 0xffu, TEST_LOCATION );
- DALI_TEST_EQUALS( GetAlphaAt(imageData, 19, 8), 0xffu, TEST_LOCATION );
-
- tet_infoline( "Test that the third quadrant has no alpha");
- DALI_TEST_EQUALS( GetAlphaAt(imageData, 18, 12), 0x00u, TEST_LOCATION );
- DALI_TEST_EQUALS( GetAlphaAt(imageData, 31, 12), 0x00u, TEST_LOCATION );
- DALI_TEST_EQUALS( GetAlphaAt(imageData, 31, 19), 0x00u, TEST_LOCATION );
- DALI_TEST_EQUALS( GetAlphaAt(imageData, 18, 19), 0x00u, TEST_LOCATION );
-
- tet_infoline( "Test that the fourth quadrant has alpha and data");
- DALI_TEST_EQUALS( GetAlphaAt(imageData, 1, 12), 0xffu, TEST_LOCATION );
- DALI_TEST_EQUALS( GetAlphaAt(imageData, 7, 12), 0xffu, TEST_LOCATION );
- DALI_TEST_EQUALS( GetAlphaAt(imageData, 7, 19), 0xffu, TEST_LOCATION );
- DALI_TEST_EQUALS( GetAlphaAt(imageData, 1, 19), 0xffu, TEST_LOCATION );
+ tet_infoline("Test that the image has been scaled and cropped to match the alpha mask");
+ DALI_TEST_EQUALS(imageData.GetWidth(), 32, TEST_LOCATION);
+ DALI_TEST_EQUALS(imageData.GetHeight(), 20, TEST_LOCATION);
+
+ tet_infoline("Test that the image has been resized (the center square should now fill the image)\n");
+ tet_infoline("Test that the first quadrant has no alpha");
+ DALI_TEST_EQUALS(GetAlphaAt(imageData, 0, 0), 0x00u, TEST_LOCATION);
+ DALI_TEST_EQUALS(GetAlphaAt(imageData, 5, 4), 0x00u, TEST_LOCATION);
+ DALI_TEST_EQUALS(GetAlphaAt(imageData, 5, 8), 0x00u, TEST_LOCATION);
+ DALI_TEST_EQUALS(GetAlphaAt(imageData, 14, 8), 0x00u, TEST_LOCATION);
+
+ tet_infoline("Test that the second quadrant has alpha and data");
+ DALI_TEST_EQUALS(GetAlphaAt(imageData, 18, 0), 0xffu, TEST_LOCATION);
+ DALI_TEST_EQUALS(GetAlphaAt(imageData, 30, 1), 0xffu, TEST_LOCATION);
+ DALI_TEST_EQUALS(GetAlphaAt(imageData, 30, 8), 0xffu, TEST_LOCATION);
+ DALI_TEST_EQUALS(GetAlphaAt(imageData, 19, 8), 0xffu, TEST_LOCATION);
+
+ tet_infoline("Test that the third quadrant has no alpha");
+ DALI_TEST_EQUALS(GetAlphaAt(imageData, 18, 12), 0x00u, TEST_LOCATION);
+ DALI_TEST_EQUALS(GetAlphaAt(imageData, 31, 12), 0x00u, TEST_LOCATION);
+ DALI_TEST_EQUALS(GetAlphaAt(imageData, 31, 19), 0x00u, TEST_LOCATION);
+ DALI_TEST_EQUALS(GetAlphaAt(imageData, 18, 19), 0x00u, TEST_LOCATION);
+
+ tet_infoline("Test that the fourth quadrant has alpha and data");
+ DALI_TEST_EQUALS(GetAlphaAt(imageData, 1, 12), 0xffu, TEST_LOCATION);
+ DALI_TEST_EQUALS(GetAlphaAt(imageData, 7, 12), 0xffu, TEST_LOCATION);
+ DALI_TEST_EQUALS(GetAlphaAt(imageData, 7, 19), 0xffu, TEST_LOCATION);
+ DALI_TEST_EQUALS(GetAlphaAt(imageData, 1, 19), 0xffu, TEST_LOCATION);
END_TEST;
}
-
int UtcDaliPixelBufferMask09(void)
{
TestApplication application;
- tet_infoline("Test scaling of large source image to larger than the alpha mask" );
+ tet_infoline("Test scaling of large source image to larger than the alpha mask");
- unsigned int width = 32u;
- unsigned int height = 20u;
- Devel::PixelBuffer maskData = Devel::PixelBuffer::New( width, height, Pixel::RGBA8888 );
- AlternateQuadrants( maskData );
+ unsigned int width = 32u;
+ unsigned int height = 20u;
+ Devel::PixelBuffer maskData = Devel::PixelBuffer::New(width, height, Pixel::RGBA8888);
+ AlternateQuadrants(maskData);
// +-----XXXXX+
// | XXXXX|
// |XXXXX |
// *XXXXX-----+
- width = 40u;
- height = 50u;
- Devel::PixelBuffer imageData = Devel::PixelBuffer::New( width, height, Pixel::RGBA8888 );
+ width = 40u;
+ height = 50u;
+ Devel::PixelBuffer imageData = Devel::PixelBuffer::New(width, height, Pixel::RGBA8888);
MaskCenterSquare(imageData);
// +----------+
// | XXXXXX |
// *----------+
- imageData.ApplyMask( maskData, 1.6f, true );
+ imageData.ApplyMask(maskData, 1.6f, true);
// +-----XXXXX+ quadrant
// | XXXXX| 1 2
// |XXXXX |
// *XXXXX-----+
- tet_infoline("Test that the image has been scaled and cropped to match the alpha mask" );
- DALI_TEST_EQUALS( imageData.GetWidth(), 32, TEST_LOCATION );
- DALI_TEST_EQUALS( imageData.GetHeight(), 20, TEST_LOCATION );
-
- tet_infoline( "Test that the image has been resized (the center square should now fill the image)\n");
- tet_infoline( "Test that the first quadrant has no alpha");
- DALI_TEST_EQUALS( GetAlphaAt(imageData, 0, 0), 0x00u, TEST_LOCATION );
- DALI_TEST_EQUALS( GetAlphaAt(imageData, 5, 4), 0x00u, TEST_LOCATION );
- DALI_TEST_EQUALS( GetAlphaAt(imageData, 5, 8), 0x00u, TEST_LOCATION );
- DALI_TEST_EQUALS( GetAlphaAt(imageData, 14, 8), 0x00u, TEST_LOCATION );
-
- tet_infoline( "Test that the second quadrant has alpha and data");
- DALI_TEST_EQUALS( GetAlphaAt(imageData, 18, 0), 0xffu, TEST_LOCATION );
- DALI_TEST_EQUALS( GetAlphaAt(imageData, 30, 1), 0xffu, TEST_LOCATION );
- DALI_TEST_EQUALS( GetAlphaAt(imageData, 30, 8), 0xffu, TEST_LOCATION );
- DALI_TEST_EQUALS( GetAlphaAt(imageData, 19, 8), 0xffu, TEST_LOCATION );
-
- tet_infoline( "Test that the third quadrant has no alpha");
- DALI_TEST_EQUALS( GetAlphaAt(imageData, 18, 12), 0x00u, TEST_LOCATION );
- DALI_TEST_EQUALS( GetAlphaAt(imageData, 31, 12), 0x00u, TEST_LOCATION );
- DALI_TEST_EQUALS( GetAlphaAt(imageData, 31, 19), 0x00u, TEST_LOCATION );
- DALI_TEST_EQUALS( GetAlphaAt(imageData, 18, 19), 0x00u, TEST_LOCATION );
-
- tet_infoline( "Test that the fourth quadrant has alpha and data");
- DALI_TEST_EQUALS( GetAlphaAt(imageData, 1, 12), 0xffu, TEST_LOCATION );
- DALI_TEST_EQUALS( GetAlphaAt(imageData, 7, 12), 0xffu, TEST_LOCATION );
- DALI_TEST_EQUALS( GetAlphaAt(imageData, 7, 19), 0xffu, TEST_LOCATION );
- DALI_TEST_EQUALS( GetAlphaAt(imageData, 1, 19), 0xffu, TEST_LOCATION );
+ tet_infoline("Test that the image has been scaled and cropped to match the alpha mask");
+ DALI_TEST_EQUALS(imageData.GetWidth(), 32, TEST_LOCATION);
+ DALI_TEST_EQUALS(imageData.GetHeight(), 20, TEST_LOCATION);
+
+ tet_infoline("Test that the image has been resized (the center square should now fill the image)\n");
+ tet_infoline("Test that the first quadrant has no alpha");
+ DALI_TEST_EQUALS(GetAlphaAt(imageData, 0, 0), 0x00u, TEST_LOCATION);
+ DALI_TEST_EQUALS(GetAlphaAt(imageData, 5, 4), 0x00u, TEST_LOCATION);
+ DALI_TEST_EQUALS(GetAlphaAt(imageData, 5, 8), 0x00u, TEST_LOCATION);
+ DALI_TEST_EQUALS(GetAlphaAt(imageData, 14, 8), 0x00u, TEST_LOCATION);
+
+ tet_infoline("Test that the second quadrant has alpha and data");
+ DALI_TEST_EQUALS(GetAlphaAt(imageData, 18, 0), 0xffu, TEST_LOCATION);
+ DALI_TEST_EQUALS(GetAlphaAt(imageData, 30, 1), 0xffu, TEST_LOCATION);
+ DALI_TEST_EQUALS(GetAlphaAt(imageData, 30, 8), 0xffu, TEST_LOCATION);
+ DALI_TEST_EQUALS(GetAlphaAt(imageData, 19, 8), 0xffu, TEST_LOCATION);
+
+ tet_infoline("Test that the third quadrant has no alpha");
+ DALI_TEST_EQUALS(GetAlphaAt(imageData, 18, 12), 0x00u, TEST_LOCATION);
+ DALI_TEST_EQUALS(GetAlphaAt(imageData, 31, 12), 0x00u, TEST_LOCATION);
+ DALI_TEST_EQUALS(GetAlphaAt(imageData, 31, 19), 0x00u, TEST_LOCATION);
+ DALI_TEST_EQUALS(GetAlphaAt(imageData, 18, 19), 0x00u, TEST_LOCATION);
+
+ tet_infoline("Test that the fourth quadrant has alpha and data");
+ DALI_TEST_EQUALS(GetAlphaAt(imageData, 1, 12), 0xffu, TEST_LOCATION);
+ DALI_TEST_EQUALS(GetAlphaAt(imageData, 7, 12), 0xffu, TEST_LOCATION);
+ DALI_TEST_EQUALS(GetAlphaAt(imageData, 7, 19), 0xffu, TEST_LOCATION);
+ DALI_TEST_EQUALS(GetAlphaAt(imageData, 1, 19), 0xffu, TEST_LOCATION);
END_TEST;
}
{
TestApplication application;
- Devel::PixelBuffer imageData = Devel::PixelBuffer::New( 10, 10, Pixel::RGBA8888 );
+ Devel::PixelBuffer imageData = Devel::PixelBuffer::New(10, 10, Pixel::RGBA8888);
FillCheckerboard(imageData);
- DALI_TEST_EQUALS( imageData.GetWidth(), 10, TEST_LOCATION ) ;
- DALI_TEST_EQUALS( imageData.GetHeight(), 10, TEST_LOCATION ) ;
+ DALI_TEST_EQUALS(imageData.GetWidth(), 10, TEST_LOCATION);
+ DALI_TEST_EQUALS(imageData.GetHeight(), 10, TEST_LOCATION);
unsigned char* buffer = imageData.GetBuffer();
// Test that an even pixel in the odd row has full alpha value
- DALI_TEST_EQUALS( buffer[43], 0xffu, TEST_LOCATION );
+ DALI_TEST_EQUALS(buffer[43], 0xffu, TEST_LOCATION);
// Test that an even pixel in the even row has no alpha value
- DALI_TEST_EQUALS( buffer[55], 0x00u, TEST_LOCATION );
+ DALI_TEST_EQUALS(buffer[55], 0x00u, TEST_LOCATION);
- imageData.ApplyGaussianBlur( 0.0f );
+ imageData.ApplyGaussianBlur(0.0f);
// Test that the pixels' alpha values are not changed because there is no blur
- DALI_TEST_EQUALS( buffer[43], 0xffu, TEST_LOCATION );
- DALI_TEST_EQUALS( buffer[55], 0x00u, TEST_LOCATION );
+ DALI_TEST_EQUALS(buffer[43], 0xffu, TEST_LOCATION);
+ DALI_TEST_EQUALS(buffer[55], 0x00u, TEST_LOCATION);
- imageData.ApplyGaussianBlur( 1.0f );
+ imageData.ApplyGaussianBlur(1.0f);
// Test that the pixels' alpha values are changed after applying gaussian blur
- DALI_TEST_EQUALS( buffer[43], 0x7Au, TEST_LOCATION );
- DALI_TEST_EQUALS( buffer[55], 0x7Eu, TEST_LOCATION );
+ DALI_TEST_EQUALS(buffer[43], 0x7Au, TEST_LOCATION);
+ DALI_TEST_EQUALS(buffer[55], 0x7Eu, TEST_LOCATION);
END_TEST;
}
*
*/
-#include <iostream>
-#include <stdlib.h>
-#include <stdint.h>
+#include <adaptor-test-application.h>
+#include <dali-test-suite-utils.h>
#include <dali/dali.h>
#include <dali/internal/system/linux/dali-ecore.h>
-#include <dali-test-suite-utils.h>
-#include <adaptor-test-application.h>
+#include <stdint.h>
+#include <stdlib.h>
+#include <iostream>
using namespace Dali;
namespace
{
-bool ecore_timer_running = false;
-Ecore_Task_Cb timer_callback_func=NULL;
-const void* timer_callback_data=NULL;
-bool main_loop_can_run = false;
-intptr_t timerId = 0; // intptr_t has the same size as a pointer and is platform independent so this can be returned as a pointer in ecore_timer_add below without compilation warnings
-}// anon namespace
+bool ecore_timer_running = false;
+Ecore_Task_Cb timer_callback_func = NULL;
+const void* timer_callback_data = NULL;
+bool main_loop_can_run = false;
+intptr_t timerId = 0; // intptr_t has the same size as a pointer and is platform independent so this can be returned as a pointer in ecore_timer_add below without compilation warnings
+} // namespace
extern "C"
{
-Ecore_Timer* ecore_timer_add(double in,
- Ecore_Task_Cb func,
- const void *data)
-{
- ecore_timer_running = true;
- timer_callback_func = func;
- timer_callback_data = data;
- timerId+=8;
- return (Ecore_Timer*)timerId;
-}
-
-void* ecore_timer_del(Ecore_Timer *timer)
-{
- ecore_timer_running = false;
- timer_callback_func = NULL;
- return NULL;
-}
+ Ecore_Timer* ecore_timer_add(double in,
+ Ecore_Task_Cb func,
+ const void* data)
+ {
+ ecore_timer_running = true;
+ timer_callback_func = func;
+ timer_callback_data = data;
+ timerId += 8;
+ return (Ecore_Timer*)timerId;
+ }
+ void* ecore_timer_del(Ecore_Timer* timer)
+ {
+ ecore_timer_running = false;
+ timer_callback_func = NULL;
+ return NULL;
+ }
}
namespace
{
-
void test_ecore_main_loop_begin()
{
if(timer_callback_func != NULL)
{
main_loop_can_run = true;
- while( main_loop_can_run )
+ while(main_loop_can_run)
{
- if( ! timer_callback_func(const_cast<void*>(timer_callback_data)) )
+ if(!timer_callback_func(const_cast<void*>(timer_callback_data)))
break;
}
}
void test_ecore_main_loop_quit()
{
timer_callback_func = NULL;
- main_loop_can_run = false;
+ main_loop_can_run = false;
}
-
/**
* small class to test timer signal
*/
class TimerTestClass : public ConnectionTracker
{
public:
-
- TimerTestClass(bool repeat):mTimerCalled(false),mReturnContiune(repeat) {}
+ TimerTestClass(bool repeat)
+ : mTimerCalled(false),
+ mReturnContiune(repeat)
+ {
+ }
bool Tick()
{
}
bool mTimerCalled; // whether tick has been called or not
bool mReturnContiune; // whether to return true / false to continue
-
};
-} // anon namespace
-
+} // namespace
// Positive test case for a method
int UtcDaliTimerCreation(void)
tet_printf("timer creation \n");
Timer timer = Timer::New(300);
- DALI_TEST_CHECK( timer );
+ DALI_TEST_CHECK(timer);
- DALI_TEST_CHECK( timer.GetInterval() == 300);
+ DALI_TEST_CHECK(timer.GetInterval() == 300);
END_TEST;
}
tet_printf("unintialized timer start \n");
- Timer *timer = new Timer;
+ Timer* timer = new Timer;
DALI_TEST_CHECK(timer != NULL);
try
tet_printf("unintialized timer stop \n");
- Timer *timer = new Timer;
+ Timer* timer = new Timer;
DALI_TEST_CHECK(timer != NULL);
try
tet_printf("unintialized get interval \n");
- Timer *timer = new Timer;
+ Timer* timer = new Timer;
DALI_TEST_CHECK(timer != NULL);
try
tet_printf("unintialized set interval \n");
- Timer *timer = new Timer;
+ Timer* timer = new Timer;
DALI_TEST_CHECK(timer != NULL);
try
tet_printf("unintialized is running \n");
- Timer *timer = new Timer;
+ Timer* timer = new Timer;
DALI_TEST_CHECK(timer != NULL);
try
END_TEST;
}
-
int UtcDaliTimerUnitializedSignalTick(void)
{
AdaptorTestApplication application;
tet_printf("unintialized SignalTick \n");
- Timer *timer = new Timer;
+ Timer* timer = new Timer;
DALI_TEST_CHECK(timer != NULL);
try
{
- TimerTestClass testClass(true);// = new TimerTestClass(true);
+ TimerTestClass testClass(true); // = new TimerTestClass(true);
timer->TickSignal().Connect(&testClass, &TimerTestClass::Tick);
}
tet_printf("timer set interval \n");
Timer timer = Timer::New(10);
- DALI_TEST_CHECK( timer.GetInterval() == 10);
+ DALI_TEST_CHECK(timer.GetInterval() == 10);
timer.SetInterval(5000);
- DALI_TEST_CHECK( timer.GetInterval() == 5000);
+ DALI_TEST_CHECK(timer.GetInterval() == 5000);
END_TEST;
}
Timer timer = Timer::New(10);
timer.SetInterval(20);
- DALI_TEST_CHECK( timer.GetInterval() == 20 );
- DALI_TEST_CHECK( timer.IsRunning() == true );
+ DALI_TEST_CHECK(timer.GetInterval() == 20);
+ DALI_TEST_CHECK(timer.IsRunning() == true);
timer.SetInterval(5000, false);
- DALI_TEST_CHECK( timer.GetInterval() == 5000 );
- DALI_TEST_CHECK( timer.IsRunning() == false );
+ DALI_TEST_CHECK(timer.GetInterval() == 5000);
+ DALI_TEST_CHECK(timer.IsRunning() == false);
END_TEST;
}
Timer timer = Timer::New(10);
timer.SetInterval(20);
- DALI_TEST_CHECK( timer.GetInterval() == 20 );
- DALI_TEST_CHECK( timer.IsRunning() == true );
+ DALI_TEST_CHECK(timer.GetInterval() == 20);
+ DALI_TEST_CHECK(timer.IsRunning() == true);
timer.SetInterval(5000, true);
- DALI_TEST_CHECK( timer.GetInterval() == 5000 );
- DALI_TEST_CHECK( timer.IsRunning() == true );
+ DALI_TEST_CHECK(timer.GetInterval() == 5000);
+ DALI_TEST_CHECK(timer.IsRunning() == true);
END_TEST;
}
tet_printf("timer copy constructor \n");
Timer timer = Timer::New(10);
- Timer anotherTimer( timer );
+ Timer anotherTimer(timer);
- DALI_TEST_CHECK( anotherTimer.GetInterval() == 10);
+ DALI_TEST_CHECK(anotherTimer.GetInterval() == 10);
END_TEST;
}
Timer timer = Timer::New(10);
- DALI_TEST_CHECK( timer );
+ DALI_TEST_CHECK(timer);
Timer anotherTimer = Timer::New(40);
DALI_TEST_CHECK(anotherTimer.GetInterval() == 40);
- tet_printf("timer 1 interval %d, \n",anotherTimer.GetInterval());
- tet_printf("timer 2 interval %d, \n",timer.GetInterval());
+ tet_printf("timer 1 interval %d, \n", anotherTimer.GetInterval());
+ tet_printf("timer 2 interval %d, \n", timer.GetInterval());
DALI_TEST_CHECK(timer != anotherTimer);
DALI_TEST_CHECK(timer == anotherTimer);
- tet_printf("timer 1 interval %d, \n",timer.GetInterval());
- tet_printf("timer 2 interval %d, \n",anotherTimer.GetInterval());
+ tet_printf("timer 1 interval %d, \n", timer.GetInterval());
+ tet_printf("timer 2 interval %d, \n", anotherTimer.GetInterval());
DALI_TEST_CHECK(timer.GetInterval() == 40);
{
AdaptorTestApplication application;
- Timer timer = Timer::New( 40 );
- DALI_TEST_CHECK( timer );
- DALI_TEST_EQUALS( 1, timer.GetBaseObject().ReferenceCount(), TEST_LOCATION );
- DALI_TEST_CHECK( timer.GetInterval() == 40) ;
+ Timer timer = Timer::New(40);
+ DALI_TEST_CHECK(timer);
+ DALI_TEST_EQUALS(1, timer.GetBaseObject().ReferenceCount(), TEST_LOCATION);
+ DALI_TEST_CHECK(timer.GetInterval() == 40);
- Timer moved = std::move( timer );
- DALI_TEST_CHECK( moved );
- DALI_TEST_EQUALS( 1, moved.GetBaseObject().ReferenceCount(), TEST_LOCATION );
- DALI_TEST_CHECK( moved.GetInterval() == 40 );
- DALI_TEST_CHECK( !timer );
+ Timer moved = std::move(timer);
+ DALI_TEST_CHECK(moved);
+ DALI_TEST_EQUALS(1, moved.GetBaseObject().ReferenceCount(), TEST_LOCATION);
+ DALI_TEST_CHECK(moved.GetInterval() == 40);
+ DALI_TEST_CHECK(!timer);
END_TEST;
}
{
AdaptorTestApplication application;
- Timer timer = Timer::New( 40 );
- DALI_TEST_CHECK( timer );
- DALI_TEST_EQUALS( 1, timer.GetBaseObject().ReferenceCount(), TEST_LOCATION );
- DALI_TEST_CHECK( timer.GetInterval() == 40) ;
+ Timer timer = Timer::New(40);
+ DALI_TEST_CHECK(timer);
+ DALI_TEST_EQUALS(1, timer.GetBaseObject().ReferenceCount(), TEST_LOCATION);
+ DALI_TEST_CHECK(timer.GetInterval() == 40);
Timer moved;
- moved = std::move( timer );
- DALI_TEST_CHECK( moved );
- DALI_TEST_EQUALS( 1, moved.GetBaseObject().ReferenceCount(), TEST_LOCATION );
- DALI_TEST_CHECK( moved.GetInterval() == 40 );
- DALI_TEST_CHECK( !timer );
+ moved = std::move(timer);
+ DALI_TEST_CHECK(moved);
+ DALI_TEST_EQUALS(1, moved.GetBaseObject().ReferenceCount(), TEST_LOCATION);
+ DALI_TEST_CHECK(moved.GetInterval() == 40);
+ DALI_TEST_CHECK(!timer);
END_TEST;
}
timer.Start();
- DALI_TEST_CHECK( timer.IsRunning() );
+ DALI_TEST_CHECK(timer.IsRunning());
timer.Stop();
- DALI_TEST_CHECK( timer.IsRunning() == false );
+ DALI_TEST_CHECK(timer.IsRunning() == false);
END_TEST;
}
tet_printf("timer call back\n");
- Timer timer = Timer::New(100);
+ Timer timer = Timer::New(100);
TimerTestClass testClass(true);
timer.TickSignal().Connect(&testClass, &TimerTestClass::Tick);
test_ecore_main_loop_begin();
- DALI_TEST_CHECK( testClass.mTimerCalled );
+ DALI_TEST_CHECK(testClass.mTimerCalled);
END_TEST;
}
{
AdaptorTestApplication application;
- Timer timer = Timer::New(100);
+ Timer timer = Timer::New(100);
TimerTestClass testClass(false);
timer.TickSignal().Connect(&testClass, &TimerTestClass::Tick);
test_ecore_main_loop_begin();
- DALI_TEST_CHECK( testClass.mTimerCalled );
+ DALI_TEST_CHECK(testClass.mTimerCalled);
END_TEST;
}
AdaptorTestApplication application;
Timer timer = Timer::New(100);
- Timer cast = Timer::DownCast( timer );
+ Timer cast = Timer::DownCast(timer);
- DALI_TEST_CHECK( cast );
+ DALI_TEST_CHECK(cast);
END_TEST;
}
AdaptorTestApplication application;
Timer timer;
- Timer cast = Timer::DownCast( timer );
+ Timer cast = Timer::DownCast(timer);
- DALI_TEST_CHECK( ! cast );
+ DALI_TEST_CHECK(!cast);
END_TEST;
}
/*
- * Copyright (c) 2015 Samsung Electronics Co., Ltd.
+ * Copyright (c) 2020 Samsung Electronics Co., Ltd.
*
* Licensed under the Apache License, Version 2.0 (the "License");
* you may not use this file except in compliance with the License.
*
*/
-#include <dali/dali.h>
#include <dali-test-suite-utils.h>
+#include <dali/dali.h>
using namespace Dali;
namespace
{
-
} // unnamed namespace
int UtcDaliTtsPlayerConstructorP(void)
{
Dali::TtsPlayer player;
- DALI_TEST_CHECK( !player );
+ DALI_TEST_CHECK(!player);
END_TEST;
}
int UtcDaliTtsPlayerCopyConstructorP(void)
{
Dali::TtsPlayer player;
- Dali::TtsPlayer copy( player );
- DALI_TEST_CHECK( copy == player );
+ Dali::TtsPlayer copy(player);
+ DALI_TEST_CHECK(copy == player);
END_TEST;
}
{
Dali::TtsPlayer player;
Dali::TtsPlayer copy;
- DALI_TEST_CHECK( ! copy );
+ DALI_TEST_CHECK(!copy);
copy = player;
- DALI_TEST_CHECK( copy == player );
+ DALI_TEST_CHECK(copy == player);
END_TEST;
}
Dali::TtsPlayer* player = new Dali::TtsPlayer();
delete player;
- DALI_TEST_CHECK( true );
+ DALI_TEST_CHECK(true);
END_TEST;
}
int UtcDaliTtsPlayerConstructorFromInternalPointerN(void)
{
Internal::Adaptor::TtsPlayer* internalPlayer = NULL;
- Dali::TtsPlayer player(internalPlayer);
- DALI_TEST_CHECK( !player ); // Should not reach here!
+ Dali::TtsPlayer player(internalPlayer);
+ DALI_TEST_CHECK(!player); // Should not reach here!
END_TEST;
}
int UtcDaliTtsPlayerGetP(void)
{
Dali::TtsPlayer player = Dali::TtsPlayer::Get();
- DALI_TEST_CHECK( !player );
+ DALI_TEST_CHECK(!player);
END_TEST;
}
try
{
player.Play("text");
- DALI_TEST_CHECK( false ); // Should not reach here!
+ DALI_TEST_CHECK(false); // Should not reach here!
}
- catch( ... )
+ catch(...)
{
- DALI_TEST_CHECK( true );
+ DALI_TEST_CHECK(true);
}
END_TEST;
try
{
player.Stop();
- DALI_TEST_CHECK( false ); // Should not reach here!
+ DALI_TEST_CHECK(false); // Should not reach here!
}
- catch( ... )
+ catch(...)
{
- DALI_TEST_CHECK( true );
+ DALI_TEST_CHECK(true);
}
END_TEST;
try
{
player.Pause();
- DALI_TEST_CHECK( false ); // Should not reach here!
+ DALI_TEST_CHECK(false); // Should not reach here!
}
- catch( ... )
+ catch(...)
{
- DALI_TEST_CHECK( true );
+ DALI_TEST_CHECK(true);
}
END_TEST;
try
{
player.Resume();
- DALI_TEST_CHECK( false ); // Should not reach here!
+ DALI_TEST_CHECK(false); // Should not reach here!
}
- catch( ... )
+ catch(...)
{
- DALI_TEST_CHECK( true );
+ DALI_TEST_CHECK(true);
}
END_TEST;
try
{
Dali::TtsPlayer::State state = player.GetState();
- tet_printf( "Error: TtsPlayer state = %d, expected exception\n", (unsigned int)state );
- DALI_TEST_CHECK( false ); // Should not reach here!
+ tet_printf("Error: TtsPlayer state = %d, expected exception\n", (unsigned int)state);
+ DALI_TEST_CHECK(false); // Should not reach here!
}
- catch( ... )
+ catch(...)
{
- DALI_TEST_CHECK( true );
+ DALI_TEST_CHECK(true);
}
END_TEST;
}
-
/*
- * Copyright (c) 2017 Samsung Electronics Co., Ltd.
+ * Copyright (c) 2020 Samsung Electronics Co., Ltd.
*
* Licensed under the Apache License, Version 2.0 (the "License");
* you may not use this file except in compliance with the License.
*
*/
-#include <dali/dali.h>
-#include <dali-test-suite-utils.h>
-#include "public-api/dali-wearable.h"
#include <appcore-watch/watch_app.h>
#include <appcore-watch/watch_app_extension.h>
+#include <dali-test-suite-utils.h>
+#include <dali/dali.h>
#include <stdlib.h>
+#include "public-api/dali-wearable.h"
#define TIMEZONE_BUFFER_MAX 102
using namespace Dali;
namespace
{
-
struct MyTestApp : public ConnectionTracker
{
- MyTestApp( WatchApplication& app)
- : initCalled( false ),
- mApplication( app )
+ MyTestApp(WatchApplication& app)
+ : initCalled(false),
+ mApplication(app)
{
- mApplication.InitSignal().Connect( this, &MyTestApp::Create );
+ mApplication.InitSignal().Connect(this, &MyTestApp::Create);
}
void Create(Application& app)
}
// Data
- bool initCalled;
- WatchApplication& mApplication;
+ bool initCalled;
+ WatchApplication& mApplication;
};
} // unnamed namespace
int UtcDaliWatchTimeNew(void)
{
- WatchTime watchTime;
- WatchTime *watchTimeRef = &watchTime;
+ WatchTime watchTime;
+ WatchTime* watchTimeRef = &watchTime;
- DALI_TEST_CHECK( watchTimeRef );
+ DALI_TEST_CHECK(watchTimeRef);
END_TEST;
}
int UtcDaliWatchTimeGetHour(void)
{
- int ret, hour;
- WatchTime watchTime;
- watch_time_h watch_time = {0,};
+ int ret, hour;
+ WatchTime watchTime;
+ watch_time_h watch_time = {
+ 0,
+ };
ret = watch_time_get_current_time(&watch_time);
- DALI_TEST_CHECK( ret == APP_ERROR_NONE );
+ DALI_TEST_CHECK(ret == APP_ERROR_NONE);
ret = watch_time_get_hour(watch_time, &hour);
- DALI_TEST_CHECK( ret == APP_ERROR_NONE );
+ DALI_TEST_CHECK(ret == APP_ERROR_NONE);
- DALI_TEST_CHECK( watchTime.GetHour() == hour );
+ DALI_TEST_CHECK(watchTime.GetHour() == hour);
END_TEST;
}
int UtcDaliWatchTimeGetHour24(void)
{
- int ret, hour24;
- WatchTime watchTime;
- watch_time_h watch_time = {0,};
+ int ret, hour24;
+ WatchTime watchTime;
+ watch_time_h watch_time = {
+ 0,
+ };
ret = watch_time_get_current_time(&watch_time);
- DALI_TEST_CHECK( ret == APP_ERROR_NONE );
+ DALI_TEST_CHECK(ret == APP_ERROR_NONE);
ret = watch_time_get_hour24(watch_time, &hour24);
- DALI_TEST_CHECK( ret == APP_ERROR_NONE );
+ DALI_TEST_CHECK(ret == APP_ERROR_NONE);
- DALI_TEST_CHECK( watchTime.GetHour24() == hour24 );
+ DALI_TEST_CHECK(watchTime.GetHour24() == hour24);
END_TEST;
}
int UtcDaliWatchTimeGetMinute(void)
{
- int ret, minute;
- WatchTime watchTime;
- watch_time_h watch_time = {0,};
+ int ret, minute;
+ WatchTime watchTime;
+ watch_time_h watch_time = {
+ 0,
+ };
ret = watch_time_get_current_time(&watch_time);
- DALI_TEST_CHECK( ret == APP_ERROR_NONE );
+ DALI_TEST_CHECK(ret == APP_ERROR_NONE);
ret = watch_time_get_minute(watch_time, &minute);
- DALI_TEST_CHECK( ret == APP_ERROR_NONE );
+ DALI_TEST_CHECK(ret == APP_ERROR_NONE);
- DALI_TEST_CHECK( watchTime.GetMinute() == minute );
+ DALI_TEST_CHECK(watchTime.GetMinute() == minute);
END_TEST;
}
int UtcDaliWatchTimeGetSecond(void)
{
- int ret, second;
- WatchTime watchTime;
- watch_time_h watch_time = {0,};
+ int ret, second;
+ WatchTime watchTime;
+ watch_time_h watch_time = {
+ 0,
+ };
ret = watch_time_get_current_time(&watch_time);
- DALI_TEST_CHECK( ret == APP_ERROR_NONE );
+ DALI_TEST_CHECK(ret == APP_ERROR_NONE);
ret = watch_time_get_second(watch_time, &second);
- DALI_TEST_CHECK( ret == APP_ERROR_NONE );
+ DALI_TEST_CHECK(ret == APP_ERROR_NONE);
- DALI_TEST_CHECK( watchTime.GetSecond() == second );
+ DALI_TEST_CHECK(watchTime.GetSecond() == second);
END_TEST;
}
int UtcDaliWatchTimeGetMillisecond(void)
{
- int ret, millisecond;
- WatchTime watchTime;
- watch_time_h watch_time = {0,};
+ int ret, millisecond;
+ WatchTime watchTime;
+ watch_time_h watch_time = {
+ 0,
+ };
ret = watch_time_get_current_time(&watch_time);
- DALI_TEST_CHECK( ret == APP_ERROR_NONE );
+ DALI_TEST_CHECK(ret == APP_ERROR_NONE);
ret = watch_time_get_millisecond(watch_time, &millisecond);
- DALI_TEST_CHECK( ret == APP_ERROR_NONE );
+ DALI_TEST_CHECK(ret == APP_ERROR_NONE);
- DALI_TEST_CHECK( watchTime.GetMillisecond() == millisecond );
+ DALI_TEST_CHECK(watchTime.GetMillisecond() == millisecond);
END_TEST;
}
int UtcDaliWatchTimeGetYear(void)
{
- int ret, year;
- WatchTime watchTime;
- watch_time_h watch_time = {0,};
+ int ret, year;
+ WatchTime watchTime;
+ watch_time_h watch_time = {
+ 0,
+ };
ret = watch_time_get_current_time(&watch_time);
- DALI_TEST_CHECK( ret == APP_ERROR_NONE );
+ DALI_TEST_CHECK(ret == APP_ERROR_NONE);
ret = watch_time_get_year(watch_time, &year);
- DALI_TEST_CHECK( ret == APP_ERROR_NONE );
+ DALI_TEST_CHECK(ret == APP_ERROR_NONE);
- DALI_TEST_CHECK( watchTime.GetYear() == year );
+ DALI_TEST_CHECK(watchTime.GetYear() == year);
END_TEST;
}
int UtcDaliWatchTimeGetMonth(void)
{
- int ret, month;
- WatchTime watchTime;
- watch_time_h watch_time = {0,};
+ int ret, month;
+ WatchTime watchTime;
+ watch_time_h watch_time = {
+ 0,
+ };
ret = watch_time_get_current_time(&watch_time);
- DALI_TEST_CHECK( ret == APP_ERROR_NONE );
+ DALI_TEST_CHECK(ret == APP_ERROR_NONE);
ret = watch_time_get_month(watch_time, &month);
- DALI_TEST_CHECK( ret == APP_ERROR_NONE );
+ DALI_TEST_CHECK(ret == APP_ERROR_NONE);
- DALI_TEST_CHECK( watchTime.GetMonth() == month );
+ DALI_TEST_CHECK(watchTime.GetMonth() == month);
END_TEST;
}
int UtcDaliWatchTimeGetDay(void)
{
- int ret, day;
- WatchTime watchTime;
- watch_time_h watch_time = {0,};
+ int ret, day;
+ WatchTime watchTime;
+ watch_time_h watch_time = {
+ 0,
+ };
ret = watch_time_get_current_time(&watch_time);
- DALI_TEST_CHECK( ret == APP_ERROR_NONE );
+ DALI_TEST_CHECK(ret == APP_ERROR_NONE);
ret = watch_time_get_day(watch_time, &day);
- DALI_TEST_CHECK( ret == APP_ERROR_NONE );
+ DALI_TEST_CHECK(ret == APP_ERROR_NONE);
- DALI_TEST_CHECK( watchTime.GetDay() == day );
+ DALI_TEST_CHECK(watchTime.GetDay() == day);
END_TEST;
}
int UtcDaliWatchTimeGetDayOfWeek(void)
{
- int ret, dayOfWeek;
- WatchTime watchTime;
- watch_time_h watch_time = {0,};
+ int ret, dayOfWeek;
+ WatchTime watchTime;
+ watch_time_h watch_time = {
+ 0,
+ };
ret = watch_time_get_current_time(&watch_time);
- DALI_TEST_CHECK( ret == APP_ERROR_NONE );
+ DALI_TEST_CHECK(ret == APP_ERROR_NONE);
ret = watch_time_get_day_of_week(watch_time, &dayOfWeek);
- DALI_TEST_CHECK( ret == APP_ERROR_NONE );
+ DALI_TEST_CHECK(ret == APP_ERROR_NONE);
- DALI_TEST_CHECK( watchTime.GetDayOfWeek() == dayOfWeek );
+ DALI_TEST_CHECK(watchTime.GetDayOfWeek() == dayOfWeek);
END_TEST;
}
int UtcDaliWatchTimeGetUtcTime(void)
{
- int ret;
- struct tm *utcTime = (struct tm *)calloc( 1, sizeof( struct tm ) );
- WatchTime watchTime;
- watch_time_h watch_time = {0,};
+ int ret;
+ struct tm* utcTime = (struct tm*)calloc(1, sizeof(struct tm));
+ WatchTime watchTime;
+ watch_time_h watch_time = {
+ 0,
+ };
ret = watch_time_get_current_time(&watch_time);
- DALI_TEST_CHECK( ret == APP_ERROR_NONE );
+ DALI_TEST_CHECK(ret == APP_ERROR_NONE);
ret = watch_time_get_day(watch_time, utcTime);
- DALI_TEST_CHECK( ret == APP_ERROR_NONE );
+ DALI_TEST_CHECK(ret == APP_ERROR_NONE);
- DALI_TEST_CHECK( watchTime.GetUtcTime().tm_sec == (*utcTime).tm_sec );
+ DALI_TEST_CHECK(watchTime.GetUtcTime().tm_sec == (*utcTime).tm_sec);
END_TEST;
}
int UtcDaliWatchTimeGetUtcTimeStamp(void)
{
- int ret;
- time_t *timeStamp = (time_t *)calloc( 1, sizeof( time_t ) );
- WatchTime watchTime;
- watch_time_h watch_time = {0,};
+ int ret;
+ time_t* timeStamp = (time_t*)calloc(1, sizeof(time_t));
+ WatchTime watchTime;
+ watch_time_h watch_time = {
+ 0,
+ };
ret = watch_time_get_current_time(&watch_time);
- DALI_TEST_CHECK( ret == APP_ERROR_NONE );
+ DALI_TEST_CHECK(ret == APP_ERROR_NONE);
ret = watch_time_get_day(watch_time, timeStamp);
- DALI_TEST_CHECK( ret == APP_ERROR_NONE );
+ DALI_TEST_CHECK(ret == APP_ERROR_NONE);
- DALI_TEST_CHECK( watchTime.GetUtcTimeStamp() == *timeStamp );
+ DALI_TEST_CHECK(watchTime.GetUtcTimeStamp() == *timeStamp);
END_TEST;
}
int UtcDaliWatchTimeGetTimeZone(void)
{
- int ret;
- char *timeZone[TIMEZONE_BUFFER_MAX] = {0,};
- WatchTime watchTime;
- watch_time_h watch_time = {0,};
+ int ret;
+ char* timeZone[TIMEZONE_BUFFER_MAX] = {
+ 0,
+ };
+ WatchTime watchTime;
+ watch_time_h watch_time = {
+ 0,
+ };
ret = watch_time_get_current_time(&watch_time);
- DALI_TEST_CHECK( ret == APP_ERROR_NONE );
+ DALI_TEST_CHECK(ret == APP_ERROR_NONE);
ret = watch_time_get_day(watch_time, timeZone);
- DALI_TEST_CHECK( ret == APP_ERROR_NONE );
+ DALI_TEST_CHECK(ret == APP_ERROR_NONE);
- DALI_TEST_CHECK( watchTime.GetTimeZone() == timeZone );
+ DALI_TEST_CHECK(watchTime.GetTimeZone() == timeZone);
END_TEST;
}
int UtcDaliWatchTimeGetDaylightSavingTimeStatus(void)
{
- int ret;
- bool daylight;
- WatchTime watchTime;
- watch_time_h watch_time = {0,};
+ int ret;
+ bool daylight;
+ WatchTime watchTime;
+ watch_time_h watch_time = {
+ 0,
+ };
ret = watch_time_get_current_time(&watch_time);
- DALI_TEST_CHECK( ret == APP_ERROR_NONE );
+ DALI_TEST_CHECK(ret == APP_ERROR_NONE);
ret = watch_time_get_day(watch_time, &daylight);
- DALI_TEST_CHECK( ret == APP_ERROR_NONE );
+ DALI_TEST_CHECK(ret == APP_ERROR_NONE);
- DALI_TEST_CHECK( watchTime.GetDaylightSavingTimeStatus() == daylight );
+ DALI_TEST_CHECK(watchTime.GetDaylightSavingTimeStatus() == daylight);
END_TEST;
}
*
*/
-#include <dali/dali.h>
#include <dali-test-suite-utils.h>
+#include <dali/dali.h>
using namespace Dali;
namespace
{
-
struct MyTestApp : public ConnectionTracker
{
- MyTestApp( WatchApplication& app)
- : initCalled( false ),
- mApplication( app )
+ MyTestApp(WatchApplication& app)
+ : initCalled(false),
+ mApplication(app)
{
- mApplication.InitSignal().Connect( this, &MyTestApp::Create );
+ mApplication.InitSignal().Connect(this, &MyTestApp::Create);
}
void Create(Application& app)
}
// Data
- bool initCalled;
- WatchApplication& mApplication;
+ bool initCalled;
+ WatchApplication& mApplication;
};
-void WatchTimeSignalCallback( Application& app, const WatchTime& time)
+void WatchTimeSignalCallback(Application& app, const WatchTime& time)
{
}
-void WatchChangedSignalCallback( Application& app, bool ambient)
+void WatchChangedSignalCallback(Application& app, bool ambient)
{
}
{
WatchApplication application = WatchApplication::New();
- MyTestApp testApp( application );
+ MyTestApp testApp(application);
- DALI_TEST_CHECK( application );
+ DALI_TEST_CHECK(application);
END_TEST;
}
int UtcDaliWatchApplicationNew02(void)
{
- int argc( 1 );
- const char* argList[1] = { "program" };
- char** argv = const_cast<char**>(argList);
+ int argc(1);
+ const char* argList[1] = {"program"};
+ char** argv = const_cast<char**>(argList);
- WatchApplication application = WatchApplication::New( &argc, &argv );
+ WatchApplication application = WatchApplication::New(&argc, &argv);
- MyTestApp testApp( application );
+ MyTestApp testApp(application);
- DALI_TEST_CHECK( application );
+ DALI_TEST_CHECK(application);
END_TEST;
}
int UtcDaliWatchApplicationNew03(void)
{
- int argc( 1 );
- const char* argList[1] = { "program" };
- char** argv = const_cast<char**>(argList);
+ int argc(1);
+ const char* argList[1] = {"program"};
+ char** argv = const_cast<char**>(argList);
- WatchApplication application = WatchApplication::New( &argc, &argv, "stylesheet" );
+ WatchApplication application = WatchApplication::New(&argc, &argv, "stylesheet");
- MyTestApp testApp( application );
+ MyTestApp testApp(application);
- DALI_TEST_CHECK( application );
+ DALI_TEST_CHECK(application);
END_TEST;
}
int UtcDaliWatchApplicationCopyAndAssignment(void)
{
WatchApplication application = WatchApplication::New();
- WatchApplication copy( application );
- DALI_TEST_CHECK( copy == application );
+ WatchApplication copy(application);
+ DALI_TEST_CHECK(copy == application);
WatchApplication assigned;
- DALI_TEST_CHECK( !assigned );
+ DALI_TEST_CHECK(!assigned);
assigned = application;
- DALI_TEST_CHECK( copy == assigned );
+ DALI_TEST_CHECK(copy == assigned);
END_TEST;
}
int UtcDaliWatchApplicationTimeTickSignalP(void)
{
WatchApplication application = WatchApplication::New();
- application.TimeTickSignal().Connect( &WatchTimeSignalCallback );
- DALI_TEST_CHECK( application );
+ application.TimeTickSignal().Connect(&WatchTimeSignalCallback);
+ DALI_TEST_CHECK(application);
END_TEST;
}
try
{
- application.TimeTickSignal().Connect( &WatchTimeSignalCallback );
- DALI_TEST_CHECK( false ); // Should not get here
+ application.TimeTickSignal().Connect(&WatchTimeSignalCallback);
+ DALI_TEST_CHECK(false); // Should not get here
}
- catch( ... )
+ catch(...)
{
- DALI_TEST_CHECK( true );
+ DALI_TEST_CHECK(true);
}
END_TEST;
int UtcDaliWatchApplicationAmbientTickSignalP(void)
{
WatchApplication application = WatchApplication::New();
- application.AmbientTickSignal().Connect( &WatchTimeSignalCallback );
- DALI_TEST_CHECK( application );
+ application.AmbientTickSignal().Connect(&WatchTimeSignalCallback);
+ DALI_TEST_CHECK(application);
END_TEST;
}
try
{
- application.AmbientTickSignal().Connect( &WatchTimeSignalCallback );
- DALI_TEST_CHECK( false ); // Should not get here
+ application.AmbientTickSignal().Connect(&WatchTimeSignalCallback);
+ DALI_TEST_CHECK(false); // Should not get here
}
- catch( ... )
+ catch(...)
{
- DALI_TEST_CHECK( true );
+ DALI_TEST_CHECK(true);
}
END_TEST;
int UtcDaliWatchApplicationAmbientChangedSignalP(void)
{
WatchApplication application = WatchApplication::New();
- application.AmbientChangedSignal().Connect( &WatchChangedSignalCallback );
- DALI_TEST_CHECK( application );
+ application.AmbientChangedSignal().Connect(&WatchChangedSignalCallback);
+ DALI_TEST_CHECK(application);
END_TEST;
}
try
{
- application.AmbientChangedSignal().Connect( &WatchChangedSignalCallback );
- DALI_TEST_CHECK( false ); // Should not get here
+ application.AmbientChangedSignal().Connect(&WatchChangedSignalCallback);
+ DALI_TEST_CHECK(false); // Should not get here
}
- catch( ... )
+ catch(...)
{
- DALI_TEST_CHECK( true );
+ DALI_TEST_CHECK(true);
}
END_TEST;
}
-
*
*/
+#include <dali-test-suite-utils.h>
#include <dali/dali.h>
#include <dali/devel-api/adaptor-framework/window-devel.h>
#include <dali/internal/system/linux/dali-ecore-x.h>
-#include <dali-test-suite-utils.h>
-
using namespace Dali;
namespace
{
-
intptr_t screenId = 0; // intptr_t has the same size as a pointer and is platform independent so this can be returned as a pointer in ecore_x_default_screen_get below without compilation warnings
} // unnamed namespace
extern "C"
{
+ Ecore_X_Screen* ecore_x_default_screen_get(void)
+ {
+ screenId += 8;
+ return (Ecore_X_Screen*)screenId;
+ }
-Ecore_X_Screen* ecore_x_default_screen_get(void)
-{
- screenId += 8;
- return (Ecore_X_Screen*)screenId;
-}
-
-void ecore_x_screen_size_get(const Ecore_X_Screen *screen, int *w, int *h)
-{
- *w = 100;
- *h = 100;
-}
-
-Ecore_X_Window ecore_x_window_argb_new(Ecore_X_Window parent, int x, int y, int w, int h)
-{
- return 0;
-}
+ void ecore_x_screen_size_get(const Ecore_X_Screen* screen, int* w, int* h)
+ {
+ *w = 100;
+ *h = 100;
+ }
+ Ecore_X_Window ecore_x_window_argb_new(Ecore_X_Window parent, int x, int y, int w, int h)
+ {
+ return 0;
+ }
}
int UtcDaliWindowConstructorP(void)
{
Dali::Window window;
- DALI_TEST_CHECK( !window );
+ DALI_TEST_CHECK(!window);
END_TEST;
}
int UtcDaliWindowCopyConstructorP(void)
{
Dali::Window window;
- Dali::Window copy( window );
- DALI_TEST_CHECK( copy == window );
+ Dali::Window copy(window);
+ DALI_TEST_CHECK(copy == window);
END_TEST;
}
int UtcDaliWindowConstructorFromInternalPointerN(void)
{
Internal::Adaptor::Window* internalWindow = NULL;
- Dali::Window window(internalWindow);
- DALI_TEST_CHECK( !window ); // Should not reach here!
+ Dali::Window window(internalWindow);
+ DALI_TEST_CHECK(!window); // Should not reach here!
END_TEST;
}
int UtcDaliWindowAssignmentOperatorP(void)
{
const Dali::Window window;
- Dali::Window copy;
- DALI_TEST_CHECK( ! copy );
+ Dali::Window copy;
+ DALI_TEST_CHECK(!copy);
copy = window;
- DALI_TEST_CHECK( copy == window );
+ DALI_TEST_CHECK(copy == window);
END_TEST;
}
Dali::Window* window = new Dali::Window();
delete window;
- DALI_TEST_CHECK( true );
+ DALI_TEST_CHECK(true);
END_TEST;
}
try
{
PositionSize windowPosition(0, 0, 0, 0);
- Dali::Window window = Dali::Window::New( windowPosition, "test-window", true );
+ Dali::Window window = Dali::Window::New(windowPosition, "test-window", true);
- tet_result( TET_FAIL );
+ tet_result(TET_FAIL);
}
- catch ( DaliException& e )
+ catch(DaliException& e)
{
- DALI_TEST_ASSERT( e, "Failed to create X window", TEST_LOCATION );
+ DALI_TEST_ASSERT(e, "Failed to create X window", TEST_LOCATION);
}
// Attempt to create a new window
try
{
PositionSize windowPosition(0, 0, 0, 0);
- Dali::Window window = Dali::Window::New( windowPosition, "test-window", "test-window-class", true );
+ Dali::Window window = Dali::Window::New(windowPosition, "test-window", "test-window-class", true);
- tet_result( TET_FAIL );
+ tet_result(TET_FAIL);
}
- catch ( DaliException& e )
+ catch(DaliException& e)
{
- DALI_TEST_ASSERT( e, "Failed to create X window", TEST_LOCATION );
+ DALI_TEST_ASSERT(e, "Failed to create X window", TEST_LOCATION);
}
END_TEST;
try
{
window.SetClass("window-name", "window-class");
- DALI_TEST_CHECK( false ); // Should not reach here!
+ DALI_TEST_CHECK(false); // Should not reach here!
}
- catch( ... )
+ catch(...)
{
- DALI_TEST_CHECK( true );
+ DALI_TEST_CHECK(true);
}
END_TEST;
try
{
window.Raise();
- DALI_TEST_CHECK( false ); // Should not reach here!
+ DALI_TEST_CHECK(false); // Should not reach here!
}
- catch( ... )
+ catch(...)
{
- DALI_TEST_CHECK( true );
+ DALI_TEST_CHECK(true);
}
END_TEST;
try
{
window.Lower();
- DALI_TEST_CHECK( false ); // Should not reach here!
+ DALI_TEST_CHECK(false); // Should not reach here!
}
- catch( ... )
+ catch(...)
{
- DALI_TEST_CHECK( true );
+ DALI_TEST_CHECK(true);
}
END_TEST;
try
{
window.Activate();
- DALI_TEST_CHECK( false ); // Should not reach here!
+ DALI_TEST_CHECK(false); // Should not reach here!
}
- catch( ... )
+ catch(...)
{
- DALI_TEST_CHECK( true );
+ DALI_TEST_CHECK(true);
}
END_TEST;
try
{
window.AddAvailableOrientation(Dali::Window::PORTRAIT);
- DALI_TEST_CHECK( false ); // Should not reach here!
+ DALI_TEST_CHECK(false); // Should not reach here!
}
- catch( ... )
+ catch(...)
{
- DALI_TEST_CHECK( true );
+ DALI_TEST_CHECK(true);
}
END_TEST;
try
{
window.RemoveAvailableOrientation(Dali::Window::PORTRAIT);
- DALI_TEST_CHECK( false ); // Should not reach here!
+ DALI_TEST_CHECK(false); // Should not reach here!
}
- catch( ... )
+ catch(...)
{
- DALI_TEST_CHECK( true );
+ DALI_TEST_CHECK(true);
}
END_TEST;
try
{
window.SetPreferredOrientation(Dali::Window::PORTRAIT);
- DALI_TEST_CHECK( false ); // Should not reach here!
+ DALI_TEST_CHECK(false); // Should not reach here!
}
- catch( ... )
+ catch(...)
{
- DALI_TEST_CHECK( true );
+ DALI_TEST_CHECK(true);
}
END_TEST;
try
{
Dali::Window::WindowOrientation orientation = window.GetPreferredOrientation();
- DALI_TEST_CHECK( orientation == Dali::Window::PORTRAIT ); // Should not reach here!
+ DALI_TEST_CHECK(orientation == Dali::Window::PORTRAIT); // Should not reach here!
}
- catch( ... )
+ catch(...)
{
- DALI_TEST_CHECK( true );
+ DALI_TEST_CHECK(true);
}
END_TEST;
try
{
Dali::Any handle = window.GetNativeHandle();
- DALI_TEST_CHECK( false ); // Should not reach here!
+ DALI_TEST_CHECK(false); // Should not reach here!
}
- catch( ... )
+ catch(...)
{
- DALI_TEST_CHECK( true );
+ DALI_TEST_CHECK(true);
}
END_TEST;
Dali::Window window;
try
{
- window.SetAcceptFocus( true );
- DALI_TEST_CHECK( false ); // Should not reach here!
+ window.SetAcceptFocus(true);
+ DALI_TEST_CHECK(false); // Should not reach here!
}
- catch( ... )
+ catch(...)
{
- DALI_TEST_CHECK( true );
+ DALI_TEST_CHECK(true);
}
END_TEST;
try
{
window.IsFocusAcceptable();
- DALI_TEST_CHECK( false ); // Should not reach here!
+ DALI_TEST_CHECK(false); // Should not reach here!
}
- catch( ... )
+ catch(...)
{
- DALI_TEST_CHECK( true );
+ DALI_TEST_CHECK(true);
}
END_TEST;
try
{
window.FocusChangeSignal();
- DALI_TEST_CHECK( false ); // Should not reach here!
- }
- catch( ... )
- {
- DALI_TEST_CHECK( true );
- }
-
- END_TEST;
-}
-
-int UtcDaliWindowPartialUpdate(void)
-{
- Dali::Window window;
- try
- {
- std::vector<Rect<int>> damagedAreas;
- DevelWindow::SetDamagedAreas(window, damagedAreas);
- DALI_TEST_CHECK( false ); // Should not reach here!
+ DALI_TEST_CHECK(false); // Should not reach here!
}
- catch( ... )
+ catch(...)
{
- DALI_TEST_CHECK( true );
+ DALI_TEST_CHECK(true);
}
END_TEST;
-#include <string.h>
#include <getopt.h>
#include <stdlib.h>
+#include <string.h>
#include <test-harness.h>
+
#include "tct-dali-platform-abstraction-core.h"
-int main(int argc, char * const argv[])
+int main(int argc, char* const argv[])
{
int result = TestHarness::EXIT_STATUS_BAD_ARGUMENT;
const char* optString = "sf";
- bool optRerunFailed(true);
- bool optRunSerially(false);
+ bool optRerunFailed(true);
+ bool optRunSerially(false);
int nextOpt = 0;
do
{
- nextOpt = getopt( argc, argv, optString );
+ nextOpt = getopt(argc, argv, optString);
switch(nextOpt)
{
case 'f':
exit(TestHarness::EXIT_STATUS_BAD_ARGUMENT);
break;
}
- } while( nextOpt != -1 );
+ } while(nextOpt != -1);
- if( optind == argc ) // no testcase name in argument list
+ if(optind == argc) // no testcase name in argument list
{
- if( optRunSerially )
+ if(optRunSerially)
{
- result = TestHarness::RunAll( argv[0], tc_array );
+ result = TestHarness::RunAll(argv[0], tc_array);
}
else
{
- result = TestHarness::RunAllInParallel( argv[0], tc_array, optRerunFailed );
+ result = TestHarness::RunAllInParallel(argv[0], tc_array, optRerunFailed);
}
}
else
/*
- * Copyright (c) 2015 Samsung Electronics Co., Ltd.
+ * Copyright (c) 2020 Samsung Electronics Co., Ltd.
*
* Licensed under the Apache License, Version 2.0 (the "License");
* you may not use this file except in compliance with the License.
using Dali::Internal::Platform::ApplyAttributesToBitmap;
-#define ANSI_BLACK "\x1B[0m"
-#define ANSI_RED "\x1B[31m"
-#define ANSI_GREEN "\x1B[32m"
-#define ANSI_YELLOW "\x1B[33m"
-#define ANSI_BLUE "\x1B[34m"
+#define ANSI_BLACK "\x1B[0m"
+#define ANSI_RED "\x1B[31m"
+#define ANSI_GREEN "\x1B[32m"
+#define ANSI_YELLOW "\x1B[33m"
+#define ANSI_BLUE "\x1B[34m"
#define ANSI_MAGENTA "\x1B[35m"
-#define ANSI_CYAN "\x1B[36m"
-#define ANSI_WHITE "\x1B[37m"
-#define ANSI_RESET "\033[0m"
+#define ANSI_CYAN "\x1B[36m"
+#define ANSI_WHITE "\x1B[37m"
+#define ANSI_RESET "\033[0m"
-const unsigned char BORDER_FILL_VALUE = 0xff;
-const char* ASCII_FILL_VALUE = ANSI_YELLOW "#";
-const char* ASCII_PAD_VALUE = ANSI_BLUE "#";
+const unsigned char BORDER_FILL_VALUE = 0xff;
+const char* ASCII_FILL_VALUE = ANSI_YELLOW "#";
+const char* ASCII_PAD_VALUE = ANSI_BLUE "#";
typedef unsigned char PixelBuffer;
-
-void FillBitmap( Dali::Devel::PixelBuffer bitmap )
+void FillBitmap(Dali::Devel::PixelBuffer bitmap)
{
// Fill the given bitmap fully.
- const Pixel::Format pixelFormat = bitmap.GetPixelFormat();
- const unsigned int bytesPerPixel = Pixel::GetBytesPerPixel( pixelFormat );
- PixelBuffer * const targetPixels = bitmap.GetBuffer();
- const int bytesToFill = bitmap.GetWidth() * bitmap.GetHeight() * bytesPerPixel;
+ const Pixel::Format pixelFormat = bitmap.GetPixelFormat();
+ const unsigned int bytesPerPixel = Pixel::GetBytesPerPixel(pixelFormat);
+ PixelBuffer* const targetPixels = bitmap.GetBuffer();
+ const int bytesToFill = bitmap.GetWidth() * bitmap.GetHeight() * bytesPerPixel;
- memset( targetPixels, BORDER_FILL_VALUE, bytesToFill );
+ memset(targetPixels, BORDER_FILL_VALUE, bytesToFill);
}
-typedef Rect< int > ActiveArea;
+typedef Rect<int> ActiveArea;
// This struct defines all information for one test.
struct ImageFittingTestParameters
{
- unsigned int sourceWidth;
- unsigned int sourceHeight;
- unsigned int desiredWidth;
- unsigned int desiredHeight;
+ unsigned int sourceWidth;
+ unsigned int sourceHeight;
+ unsigned int desiredWidth;
+ unsigned int desiredHeight;
FittingMode::Type fittingMode;
unsigned int expectedWidth;
unsigned int expectedHeight;
- ActiveArea expectedActiveImageArea;
-
- ImageFittingTestParameters( unsigned int newSourceWidth, unsigned int newSourceHeight, unsigned int newDesiredWidth, unsigned int newDesiredHeight, FittingMode::Type newFittingMode,
- unsigned int newExpectedWidth, unsigned int newExpectedHeight, ActiveArea newExpectedActiveImageArea )
- : sourceWidth( newSourceWidth ),
- sourceHeight( newSourceHeight ),
- desiredWidth( newDesiredWidth ),
- desiredHeight( newDesiredHeight ),
- fittingMode( newFittingMode ),
- expectedWidth( newExpectedWidth ),
- expectedHeight( newExpectedHeight ),
- expectedActiveImageArea( newExpectedActiveImageArea )
+ ActiveArea expectedActiveImageArea;
+
+ ImageFittingTestParameters(unsigned int newSourceWidth, unsigned int newSourceHeight, unsigned int newDesiredWidth, unsigned int newDesiredHeight, FittingMode::Type newFittingMode, unsigned int newExpectedWidth, unsigned int newExpectedHeight, ActiveArea newExpectedActiveImageArea)
+ : sourceWidth(newSourceWidth),
+ sourceHeight(newSourceHeight),
+ desiredWidth(newDesiredWidth),
+ desiredHeight(newDesiredHeight),
+ fittingMode(newFittingMode),
+ expectedWidth(newExpectedWidth),
+ expectedHeight(newExpectedHeight),
+ expectedActiveImageArea(newExpectedActiveImageArea)
{
}
};
-typedef std::vector< ImageFittingTestParameters > TestContainer;
-
+typedef std::vector<ImageFittingTestParameters> TestContainer;
-void PerformFittingTests( TestContainer& tests )
+void PerformFittingTests(TestContainer& tests)
{
// Iterate through all pre-defined tests.
- for( unsigned int testNumber = 0; testNumber < tests.size(); ++testNumber )
+ for(unsigned int testNumber = 0; testNumber < tests.size(); ++testNumber)
{
// Gather info for this test.
- ImageFittingTestParameters &test = tests[ testNumber ];
+ ImageFittingTestParameters& test = tests[testNumber];
- unsigned int sourceWidth = test.sourceWidth;
- unsigned int sourceHeight = test.sourceHeight;
- unsigned int desiredWidth = test.desiredWidth;
- unsigned int desiredHeight = test.desiredHeight;
- FittingMode::Type fittingMode = test.fittingMode;
+ unsigned int sourceWidth = test.sourceWidth;
+ unsigned int sourceHeight = test.sourceHeight;
+ unsigned int desiredWidth = test.desiredWidth;
+ unsigned int desiredHeight = test.desiredHeight;
+ FittingMode::Type fittingMode = test.fittingMode;
// Create a source bitmap.
- ImageDimensions desiredDimensions( desiredWidth, desiredHeight );
+ ImageDimensions desiredDimensions(desiredWidth, desiredHeight);
SamplingMode::Type samplingMode = SamplingMode::BOX_THEN_LINEAR;
-
- auto sourceBitmap = Dali::Devel::PixelBuffer::New( sourceWidth, sourceHeight, Pixel::Format::RGBA8888 );
- const Pixel::Format pixelFormat = sourceBitmap.GetPixelFormat();
+ auto sourceBitmap = Dali::Devel::PixelBuffer::New(sourceWidth, sourceHeight, Pixel::Format::RGBA8888);
+ const Pixel::Format pixelFormat = sourceBitmap.GetPixelFormat();
// Completely fill the source bitmap (with white).
- FillBitmap( sourceBitmap );
+ FillBitmap(sourceBitmap);
// Perform fitting operations (this is the method we are testing).
- auto newBitmap = ApplyAttributesToBitmap( sourceBitmap, desiredDimensions, fittingMode, samplingMode );
+ auto newBitmap = ApplyAttributesToBitmap(sourceBitmap, desiredDimensions, fittingMode, samplingMode);
- DALI_TEST_CHECK( newBitmap );
+ DALI_TEST_CHECK(newBitmap);
// As we do not need performance within this test, we branch to exit here (for readability, maintainability).
- if( !newBitmap )
+ if(!newBitmap)
{
return;
}
- auto bitmap( newBitmap );
+ auto bitmap(newBitmap);
- unsigned int resultWidth = bitmap.GetWidth();
+ unsigned int resultWidth = bitmap.GetWidth();
unsigned int resultHeight = bitmap.GetHeight();
// Check the dimensions of the modified image match against the expected values defined in the test.
- DALI_TEST_EQUALS( resultWidth, test.expectedWidth, TEST_LOCATION );
- DALI_TEST_EQUALS( resultHeight, test.expectedHeight, TEST_LOCATION );
+ DALI_TEST_EQUALS(resultWidth, test.expectedWidth, TEST_LOCATION);
+ DALI_TEST_EQUALS(resultHeight, test.expectedHeight, TEST_LOCATION);
- PixelBuffer* resultBuffer = bitmap.GetBuffer();
- const unsigned int bytesPerPixel = Pixel::GetBytesPerPixel( pixelFormat );
+ PixelBuffer* resultBuffer = bitmap.GetBuffer();
+ const unsigned int bytesPerPixel = Pixel::GetBytesPerPixel(pixelFormat);
// We generate an ASCII representation of the source, desired and result images to log, purely as a debugging aid.
// (0 = border, 1 = active image area - from the source image).
- std::string xSourceImageString( sourceWidth, '#' );
- std::string xDesiredSizeString( desiredWidth - 2, '-' );
- std::string xDesiredSizePadString( desiredWidth - 2, ' ' );
- tet_printf( "%sRunning test: %d%s\n", ANSI_RED, testNumber + 1, ANSI_RESET );
- tet_printf( "Source image: %s%s%s\n", ANSI_YELLOW, xSourceImageString.c_str(), ANSI_RESET );
- for( unsigned int i = 0; i < sourceHeight - 1; ++i )
+ std::string xSourceImageString(sourceWidth, '#');
+ std::string xDesiredSizeString(desiredWidth - 2, '-');
+ std::string xDesiredSizePadString(desiredWidth - 2, ' ');
+ tet_printf("%sRunning test: %d%s\n", ANSI_RED, testNumber + 1, ANSI_RESET);
+ tet_printf("Source image: %s%s%s\n", ANSI_YELLOW, xSourceImageString.c_str(), ANSI_RESET);
+ for(unsigned int i = 0; i < sourceHeight - 1; ++i)
{
- tet_printf( " %s%s%s\n", ANSI_YELLOW, xSourceImageString.c_str(), ANSI_RESET );
+ tet_printf(" %s%s%s\n", ANSI_YELLOW, xSourceImageString.c_str(), ANSI_RESET);
}
- tet_printf( "Desired size: %s+%s+%s\n", ANSI_YELLOW, xDesiredSizeString.c_str(), ANSI_RESET );
- for( unsigned int i = 0; i < desiredHeight - 2; ++i )
+ tet_printf("Desired size: %s+%s+%s\n", ANSI_YELLOW, xDesiredSizeString.c_str(), ANSI_RESET);
+ for(unsigned int i = 0; i < desiredHeight - 2; ++i)
{
- tet_printf( " %s|%s|%s\n", ANSI_YELLOW, xDesiredSizePadString.c_str(), ANSI_RESET );
+ tet_printf(" %s|%s|%s\n", ANSI_YELLOW, xDesiredSizePadString.c_str(), ANSI_RESET);
}
- tet_printf( " %s+%s+%s\n", ANSI_YELLOW, xDesiredSizeString.c_str(), ANSI_RESET );
+ tet_printf(" %s+%s+%s\n", ANSI_YELLOW, xDesiredSizeString.c_str(), ANSI_RESET);
// We want to calculate the active image area (the area filled with image data as opposed to borders).
// This is so we can determine if the fitting modes worked correctly.
- ActiveArea resultActiveArea( -1, -1, -1, -1 );
+ ActiveArea resultActiveArea(-1, -1, -1, -1);
// Iterate over the result image data to find the active area.
- for( unsigned int y = 0; y < resultHeight; ++y )
+ for(unsigned int y = 0; y < resultHeight; ++y)
{
- int activeStartX = -1;
- int activeEndX = -1;
+ int activeStartX = -1;
+ int activeEndX = -1;
std::string xResultImageString;
- for( unsigned int x = 0; x < resultWidth; ++x )
+ for(unsigned int x = 0; x < resultWidth; ++x)
{
- bool pixelPopulated = resultBuffer[ x * bytesPerPixel ] != 0x00;
+ bool pixelPopulated = resultBuffer[x * bytesPerPixel] != 0x00;
// If the pixel is filled AND we haven't found a filled pixel yet,
// this is the horizontal start of the active pixel area (for this line).
- if( pixelPopulated && ( activeStartX == -1 ) )
+ if(pixelPopulated && (activeStartX == -1))
{
activeStartX = x;
}
- else if( !pixelPopulated && ( activeStartX != -1 ) && ( activeEndX == -1 ) )
+ else if(!pixelPopulated && (activeStartX != -1) && (activeEndX == -1))
{
// If the pixel is NOT filled AND we HAVE rpeviously found a filled pixel,
// then this is the horizontal end of the active pixel area (for this line).
}
// First calculate the X-end span value, if we ran out of image before reaching the end of active image area.
- if( ( activeStartX != -1 ) && ( activeEndX == -1 ) )
+ if((activeStartX != -1) && (activeEndX == -1))
{
activeEndX = resultWidth - activeStartX;
}
// If the X-start pixel on this line is earlier than other lines, the overall active area starts earlier.
// Note: This is ignored if there was no pixels found.
- if( ( activeStartX != -1 ) && ( ( activeStartX < resultActiveArea.x ) || ( resultActiveArea.x == -1 ) ) )
+ if((activeStartX != -1) && ((activeStartX < resultActiveArea.x) || (resultActiveArea.x == -1)))
{
resultActiveArea.x = activeStartX;
}
// If the X-end pixel on this line is later than other lines, the overall active area starts later.
// Note: This is ignored if there was no pixels found.
- if( ( activeEndX != -1 ) && ( ( activeEndX > resultActiveArea.width ) || ( resultActiveArea.width == -1 ) ) )
+ if((activeEndX != -1) && ((activeEndX > resultActiveArea.width) || (resultActiveArea.width == -1)))
{
resultActiveArea.width = activeEndX;
}
// If there was an X-start pixel on this line AND we don't yet have a Y-start, this line IS the Y-start.
- if( ( activeStartX != -1 ) && ( resultActiveArea.y == -1 ) )
+ if((activeStartX != -1) && (resultActiveArea.y == -1))
{
resultActiveArea.y = y;
}
// If there was no X-start pixel on this line AND we already have a Y-start value,
// then the last Y becomes the new Y-end value.
- if( ( activeStartX == -1 ) && ( resultActiveArea.y != -1 ) && ( resultActiveArea.height == -1 ) )
+ if((activeStartX == -1) && (resultActiveArea.y != -1) && (resultActiveArea.height == -1))
{
resultActiveArea.height = y - 1;
}
- if( y == 0 )
+ if(y == 0)
{
- tet_printf( "Result image: %s\n", xResultImageString.c_str() );
+ tet_printf("Result image: %s\n", xResultImageString.c_str());
}
else
{
- tet_printf( " %s\n", xResultImageString.c_str() );
+ tet_printf(" %s\n", xResultImageString.c_str());
}
resultBuffer += resultWidth * bytesPerPixel;
}
// Calculate the Y-end value, if we ran out of image before reaching the end of active image area.
- if( ( resultActiveArea.y != -1 ) && ( resultActiveArea.height == -1 ) )
+ if((resultActiveArea.y != -1) && (resultActiveArea.height == -1))
{
resultActiveArea.height = resultHeight - resultActiveArea.y;
}
- tet_printf( "%s", ANSI_RESET );
- tet_printf( "Test: %d Result image dimensions: %d,%d ActiveArea: %d,%d,%d,%d\n",
- testNumber + 1, resultWidth, resultHeight, resultActiveArea.x, resultActiveArea.y, resultActiveArea.width, resultActiveArea.height );
+ tet_printf("%s", ANSI_RESET);
+ tet_printf("Test: %d Result image dimensions: %d,%d ActiveArea: %d,%d,%d,%d\n",
+ testNumber + 1,
+ resultWidth,
+ resultHeight,
+ resultActiveArea.x,
+ resultActiveArea.y,
+ resultActiveArea.width,
+ resultActiveArea.height);
// Test the result images active area matches the expected active area defined in the test.
- DALI_TEST_EQUALS( resultActiveArea, test.expectedActiveImageArea, TEST_LOCATION );
+ DALI_TEST_EQUALS(resultActiveArea, test.expectedActiveImageArea, TEST_LOCATION);
}
}
// Source Width, Source Height, Desired Width, Desired Height, Fitting Mode, Expected Width, Expected Height, ActiveArea: X-start, Y-start, width, height
// Test Image source size = desired size. Output should be the same.
- tests.push_back( ImageFittingTestParameters( 4, 4, 4, 4, FittingMode::FIT_WIDTH, 4, 4, ActiveArea( 0, 0, 4, 4 ) ) );
+ tests.push_back(ImageFittingTestParameters(4, 4, 4, 4, FittingMode::FIT_WIDTH, 4, 4, ActiveArea(0, 0, 4, 4)));
// Test Image source size > desired size, but aspect same. Should scale size down.
- tests.push_back( ImageFittingTestParameters( 4, 4, 2, 2, FittingMode::FIT_WIDTH, 2, 2, ActiveArea( 0, 0, 2, 2 ) ) );
+ tests.push_back(ImageFittingTestParameters(4, 4, 2, 2, FittingMode::FIT_WIDTH, 2, 2, ActiveArea(0, 0, 2, 2)));
// Test Image source size < desired size, but aspect same. Should not scale size up.
- tests.push_back( ImageFittingTestParameters( 2, 2, 4, 4, FittingMode::FIT_WIDTH, 2, 2, ActiveArea( 0, 0, 2, 2 ) ) );
+ tests.push_back(ImageFittingTestParameters(2, 2, 4, 4, FittingMode::FIT_WIDTH, 2, 2, ActiveArea(0, 0, 2, 2)));
// Test Image source size < desired size, but aspect different. Should crop height, so no borders. No scale up as result has same aspect after crop.
- tests.push_back( ImageFittingTestParameters( 2, 4, 8, 8, FittingMode::FIT_WIDTH, 2, 2, ActiveArea( 0, 0, 2, 2 ) ) );
+ tests.push_back(ImageFittingTestParameters(2, 4, 8, 8, FittingMode::FIT_WIDTH, 2, 2, ActiveArea(0, 0, 2, 2)));
// Test Image source size > desired size, but aspect different (w < h). Should crop height, so no borders. No scale as result is same size as desired size.
- tests.push_back( ImageFittingTestParameters( 4, 8, 4, 4, FittingMode::FIT_WIDTH, 4, 4, ActiveArea( 0, 0, 4, 4 ) ) );
+ tests.push_back(ImageFittingTestParameters(4, 8, 4, 4, FittingMode::FIT_WIDTH, 4, 4, ActiveArea(0, 0, 4, 4)));
// Test Image source size > desired size, but aspect different (w > h). Should add borders, AND scale down to desired size.
- tests.push_back( ImageFittingTestParameters( 8, 4, 4, 4, FittingMode::FIT_WIDTH, 4, 4, ActiveArea( 0, 1, 4, 2 ) ) );
+ tests.push_back(ImageFittingTestParameters(8, 4, 4, 4, FittingMode::FIT_WIDTH, 4, 4, ActiveArea(0, 1, 4, 2)));
- PerformFittingTests( tests );
+ PerformFittingTests(tests);
END_TEST;
}
// Source Width, Source Height, Desired Width, Desired Height, Fitting Mode, Expected Width, Expected Height, ActiveArea: X-start, Y-start, width, height
// Test Image source size = desired size. Output should be the same.
- tests.push_back( ImageFittingTestParameters( 4, 4, 4, 4, FittingMode::FIT_HEIGHT, 4, 4, ActiveArea( 0, 0, 4, 4 ) ) );
+ tests.push_back(ImageFittingTestParameters(4, 4, 4, 4, FittingMode::FIT_HEIGHT, 4, 4, ActiveArea(0, 0, 4, 4)));
// Test Image source size > desired size, but aspect same. Should scale size down.
- tests.push_back( ImageFittingTestParameters( 4, 4, 2, 2, FittingMode::FIT_HEIGHT, 2, 2, ActiveArea( 0, 0, 2, 2 ) ) );
+ tests.push_back(ImageFittingTestParameters(4, 4, 2, 2, FittingMode::FIT_HEIGHT, 2, 2, ActiveArea(0, 0, 2, 2)));
// Test Image source size < desired size, but aspect same. Should not scale size up.
- tests.push_back( ImageFittingTestParameters( 2, 2, 4, 4, FittingMode::FIT_HEIGHT, 2, 2, ActiveArea( 0, 0, 2, 2 ) ) );
+ tests.push_back(ImageFittingTestParameters(2, 2, 4, 4, FittingMode::FIT_HEIGHT, 2, 2, ActiveArea(0, 0, 2, 2)));
// Test Image source size < desired size, but aspect different. Should add borders, but not scale overall size up.
- tests.push_back( ImageFittingTestParameters( 2, 4, 8, 8, FittingMode::FIT_HEIGHT, 4, 4, ActiveArea( 1, 0, 4, 4 ) ) );
+ tests.push_back(ImageFittingTestParameters(2, 4, 8, 8, FittingMode::FIT_HEIGHT, 4, 4, ActiveArea(1, 0, 4, 4)));
// Test Image source size > desired size, but aspect different (w < h). Should add borders, AND scale down to desired size.
- tests.push_back( ImageFittingTestParameters( 4, 8, 4, 4, FittingMode::FIT_HEIGHT, 4, 4, ActiveArea( 1, 0, 4, 4 ) ) );
+ tests.push_back(ImageFittingTestParameters(4, 8, 4, 4, FittingMode::FIT_HEIGHT, 4, 4, ActiveArea(1, 0, 4, 4)));
// Test Image source size > desired size, but aspect different (w > h). Should crop width, so no borders. No scale as result is same size as desired size.
- tests.push_back( ImageFittingTestParameters( 8, 4, 4, 4, FittingMode::FIT_HEIGHT, 4, 4, ActiveArea( 0, 0, 4, 4 ) ) );
+ tests.push_back(ImageFittingTestParameters(8, 4, 4, 4, FittingMode::FIT_HEIGHT, 4, 4, ActiveArea(0, 0, 4, 4)));
- PerformFittingTests( tests );
+ PerformFittingTests(tests);
END_TEST;
}
// Source Width, Source Height, Desired Width, Desired Height, Fitting Mode, Expected Width, Expected Height, ActiveArea: X-start, Y-start, width, height
// Test Image source size = desired size. Output should be the same.
- tests.push_back( ImageFittingTestParameters( 4, 4, 4, 4, FittingMode::SHRINK_TO_FIT, 4, 4, ActiveArea( 0, 0, 4, 4 ) ) );
+ tests.push_back(ImageFittingTestParameters(4, 4, 4, 4, FittingMode::SHRINK_TO_FIT, 4, 4, ActiveArea(0, 0, 4, 4)));
// Test Image source size > desired size, but aspect same. Should scale size down.
- tests.push_back( ImageFittingTestParameters( 4, 4, 2, 2, FittingMode::SHRINK_TO_FIT, 2, 2, ActiveArea( 0, 0, 2, 2 ) ) );
+ tests.push_back(ImageFittingTestParameters(4, 4, 2, 2, FittingMode::SHRINK_TO_FIT, 2, 2, ActiveArea(0, 0, 2, 2)));
// Test Image source size < desired size, but aspect same. Should not scale size up.
- tests.push_back( ImageFittingTestParameters( 2, 2, 4, 4, FittingMode::SHRINK_TO_FIT, 2, 2, ActiveArea( 0, 0, 2, 2 ) ) );
+ tests.push_back(ImageFittingTestParameters(2, 2, 4, 4, FittingMode::SHRINK_TO_FIT, 2, 2, ActiveArea(0, 0, 2, 2)));
// Test Image source size < desired size, but aspect different. Should add borders, but not scale overall size up, as although image is smaller than desired size, aspect is the same.
- tests.push_back( ImageFittingTestParameters( 2, 4, 8, 8, FittingMode::SHRINK_TO_FIT, 4, 4, ActiveArea( 1, 0, 4, 4 ) ) );
+ tests.push_back(ImageFittingTestParameters(2, 4, 8, 8, FittingMode::SHRINK_TO_FIT, 4, 4, ActiveArea(1, 0, 4, 4)));
// Test Image source size > desired size, but aspect different (w < h). Should add borders, AND scale down to desired size.
- tests.push_back( ImageFittingTestParameters( 4, 8, 4, 4, FittingMode::SHRINK_TO_FIT, 4, 4, ActiveArea( 1, 0, 4, 4 ) ) );
+ tests.push_back(ImageFittingTestParameters(4, 8, 4, 4, FittingMode::SHRINK_TO_FIT, 4, 4, ActiveArea(1, 0, 4, 4)));
// Test Image source size > desired size, but aspect different (w > h). Should add borders, AND scale down to desired size.
- tests.push_back( ImageFittingTestParameters( 8, 4, 4, 4, FittingMode::SHRINK_TO_FIT, 4, 4, ActiveArea( 0, 1, 4, 2 ) ) );
+ tests.push_back(ImageFittingTestParameters(8, 4, 4, 4, FittingMode::SHRINK_TO_FIT, 4, 4, ActiveArea(0, 1, 4, 2)));
- PerformFittingTests( tests );
+ PerformFittingTests(tests);
END_TEST;
}
// Source Width, Source Height, Desired Width, Desired Height, Fitting Mode, Expected Width, Expected Height, ActiveArea: X-start, Y-start, width, height
// Test Image source size = desired size. Output should be the same.
- tests.push_back( ImageFittingTestParameters( 4, 4, 4, 4, FittingMode::SCALE_TO_FILL, 4, 4, ActiveArea( 0, 0, 4, 4 ) ) );
+ tests.push_back(ImageFittingTestParameters(4, 4, 4, 4, FittingMode::SCALE_TO_FILL, 4, 4, ActiveArea(0, 0, 4, 4)));
// Test Image source size > desired size, but aspect same. Should scale size down.
- tests.push_back( ImageFittingTestParameters( 4, 4, 2, 2, FittingMode::SCALE_TO_FILL, 2, 2, ActiveArea( 0, 0, 2, 2 ) ) );
+ tests.push_back(ImageFittingTestParameters(4, 4, 2, 2, FittingMode::SCALE_TO_FILL, 2, 2, ActiveArea(0, 0, 2, 2)));
// Test Image source size < desired size, but aspect same. Should not scale size up.
- tests.push_back( ImageFittingTestParameters( 2, 2, 4, 4, FittingMode::SCALE_TO_FILL, 2, 2, ActiveArea( 0, 0, 2, 2 ) ) );
+ tests.push_back(ImageFittingTestParameters(2, 2, 4, 4, FittingMode::SCALE_TO_FILL, 2, 2, ActiveArea(0, 0, 2, 2)));
// Test Image source size < desired size, but aspect different. Should crop height, so no borders. No scale up as result has same aspect after crop.
- tests.push_back( ImageFittingTestParameters( 2, 4, 8, 8, FittingMode::SCALE_TO_FILL, 2, 2, ActiveArea( 0, 0, 2, 2 ) ) );
+ tests.push_back(ImageFittingTestParameters(2, 4, 8, 8, FittingMode::SCALE_TO_FILL, 2, 2, ActiveArea(0, 0, 2, 2)));
// Test Image source size > desired size, but aspect different (w < h). Should crop height, so no borders. No scale as result is same size as desired size.
- tests.push_back( ImageFittingTestParameters( 4, 8, 4, 4, FittingMode::SCALE_TO_FILL, 4, 4, ActiveArea( 0, 0, 4, 4 ) ) );
+ tests.push_back(ImageFittingTestParameters(4, 8, 4, 4, FittingMode::SCALE_TO_FILL, 4, 4, ActiveArea(0, 0, 4, 4)));
// Test Image source size > desired size, but aspect different (w > h). Should crop width, so no borders. No scale as result is same size as desired size.
- tests.push_back( ImageFittingTestParameters( 8, 4, 4, 4, FittingMode::SCALE_TO_FILL, 4, 4, ActiveArea( 0, 0, 4, 4 ) ) );
+ tests.push_back(ImageFittingTestParameters(8, 4, 4, 4, FittingMode::SCALE_TO_FILL, 4, 4, ActiveArea(0, 0, 4, 4)));
- PerformFittingTests( tests );
+ PerformFittingTests(tests);
END_TEST;
}
-
/*
- * Copyright (c) 2017 Samsung Electronics Co., Ltd.
+ * Copyright (c) 2020 Samsung Electronics Co., Ltd.
*
* Licensed under the Apache License, Version 2.0 (the "License");
* you may not use this file except in compliance with the License.
#include "utc-image-loading-common.h"
-double GetTimeMilliseconds( Integration::PlatformAbstraction& abstraction )
+double GetTimeMilliseconds(Integration::PlatformAbstraction& abstraction)
{
timespec timeSpec;
- clock_gettime( CLOCK_MONOTONIC, &timeSpec );
- return ( timeSpec.tv_sec * 1e3 ) + ( timeSpec.tv_nsec / 1e6 );
+ clock_gettime(CLOCK_MONOTONIC, &timeSpec);
+ return (timeSpec.tv_sec * 1e3) + (timeSpec.tv_nsec / 1e6);
}
/** Live platform abstraction recreated for each test case. */
void utc_dali_loading_startup(void)
{
test_return_value = TET_UNDEF;
- gAbstraction = TizenPlatform::CreatePlatformAbstraction();
+ gAbstraction = TizenPlatform::CreatePlatformAbstraction();
// Setup some loading parameters to engage post-processing stages:
ImageParameters scaleToFillAttributes;
scaleToFillAttributes.second.first = FittingMode::SCALE_TO_FILL;
- scaleToFillAttributes.first = ImageDimensions( 160, 120 );
- gCancelAttributes.push_back( scaleToFillAttributes );
+ scaleToFillAttributes.first = ImageDimensions(160, 120);
+ gCancelAttributes.push_back(scaleToFillAttributes);
// Hit the derived dimensions code:
ImageParameters scaleToFillAttributesDeriveWidth = scaleToFillAttributes;
- scaleToFillAttributesDeriveWidth.first = ImageDimensions( 0, 120 );
- gCancelAttributes.push_back( scaleToFillAttributesDeriveWidth );
+ scaleToFillAttributesDeriveWidth.first = ImageDimensions(0, 120);
+ gCancelAttributes.push_back(scaleToFillAttributesDeriveWidth);
ImageParameters scaleToFillAttributesDeriveHeight = scaleToFillAttributes;
- scaleToFillAttributesDeriveHeight.first = ImageDimensions( 160, 0 );
- gCancelAttributes.push_back( scaleToFillAttributesDeriveHeight );
+ scaleToFillAttributesDeriveHeight.first = ImageDimensions(160, 0);
+ gCancelAttributes.push_back(scaleToFillAttributesDeriveHeight);
// Try to push a tall crop:
- ImageParameters scaleToFillAttributesTall = scaleToFillAttributes;
- scaleToFillAttributesTall.first = ImageDimensions( 160, 480 );
+ ImageParameters scaleToFillAttributesTall = scaleToFillAttributes;
+ scaleToFillAttributesTall.first = ImageDimensions(160, 480);
ImageParameters scaleToFillAttributesTall2 = scaleToFillAttributes;
- scaleToFillAttributesTall2.first = ImageDimensions( 160, 509 );
+ scaleToFillAttributesTall2.first = ImageDimensions(160, 509);
ImageParameters scaleToFillAttributesTall3 = scaleToFillAttributes;
- scaleToFillAttributesTall3.first = ImageDimensions( 37, 251 );
- gCancelAttributes.push_back( scaleToFillAttributesTall );
- gCancelAttributes.push_back( scaleToFillAttributesTall2 );
- gCancelAttributes.push_back( scaleToFillAttributesTall3 );
+ scaleToFillAttributesTall3.first = ImageDimensions(37, 251);
+ gCancelAttributes.push_back(scaleToFillAttributesTall);
+ gCancelAttributes.push_back(scaleToFillAttributesTall2);
+ gCancelAttributes.push_back(scaleToFillAttributesTall3);
// Try to push a wide crop:
- ImageParameters scaleToFillAttributesWide = scaleToFillAttributes;
- scaleToFillAttributesWide.first = ImageDimensions( 320, 60 );
+ ImageParameters scaleToFillAttributesWide = scaleToFillAttributes;
+ scaleToFillAttributesWide.first = ImageDimensions(320, 60);
ImageParameters scaleToFillAttributesWide2 = scaleToFillAttributes;
- scaleToFillAttributesWide2.first = ImageDimensions( 317, 60 );
+ scaleToFillAttributesWide2.first = ImageDimensions(317, 60);
ImageParameters scaleToFillAttributesWide3 = scaleToFillAttributes;
- scaleToFillAttributesWide3.first = ImageDimensions( 317, 53 );
- gCancelAttributes.push_back( scaleToFillAttributesWide );
- gCancelAttributes.push_back( scaleToFillAttributesWide2 );
- gCancelAttributes.push_back( scaleToFillAttributesWide3 );
+ scaleToFillAttributesWide3.first = ImageDimensions(317, 53);
+ gCancelAttributes.push_back(scaleToFillAttributesWide);
+ gCancelAttributes.push_back(scaleToFillAttributesWide2);
+ gCancelAttributes.push_back(scaleToFillAttributesWide3);
ImageParameters shrinkToFitAttributes = scaleToFillAttributes;
- shrinkToFitAttributes.second.first = FittingMode::SHRINK_TO_FIT;
- gCancelAttributes.push_back( shrinkToFitAttributes );
+ shrinkToFitAttributes.second.first = FittingMode::SHRINK_TO_FIT;
+ gCancelAttributes.push_back(shrinkToFitAttributes);
ImageParameters fitWidthAttributes = scaleToFillAttributes;
- fitWidthAttributes.second.first = FittingMode::FIT_WIDTH;
- gCancelAttributes.push_back( fitWidthAttributes );
+ fitWidthAttributes.second.first = FittingMode::FIT_WIDTH;
+ gCancelAttributes.push_back(fitWidthAttributes);
ImageParameters fitHeightAttributes = scaleToFillAttributes;
- fitHeightAttributes.second.first = FittingMode::FIT_HEIGHT;
- gCancelAttributes.push_back( fitHeightAttributes );
+ fitHeightAttributes.second.first = FittingMode::FIT_HEIGHT;
+ gCancelAttributes.push_back(fitHeightAttributes);
///@ToDo: Add attribute variants for all scale modes.
///@ToDo: Add attribute variants for all filter modes.
// Pad the array to a prime number to mitigate any accidental periodic
// patterns in which image file has which attributes applied to its load:
- srand48( 104729 );
+ srand48(104729);
const float lastUniques = gCancelAttributes.size() - 0.001f;
- while( gCancelAttributes.size() < 61u )
+ while(gCancelAttributes.size() < 61u)
{
- gCancelAttributes.push_back( gCancelAttributes[unsigned(drand48() * lastUniques)] );
+ gCancelAttributes.push_back(gCancelAttributes[unsigned(drand48() * lastUniques)]);
}
}
#ifndef DALI_TEST_SUITE_IMAGE_LOADING_COMMON_H
#define DALI_TEST_SUITE_IMAGE_LOADING_COMMON_H
-#include <unistd.h>
-#include <iostream>
-#include <stdlib.h>
-#include <ctime>
-#include <dali/dali.h>
#include <dali-test-suite-utils.h>
+#include <dali/dali.h>
#include <dali/internal/legacy/common/tizen-platform-abstraction.h>
+#include <stdlib.h>
+#include <unistd.h>
+#include <ctime>
+#include <iostream>
using namespace Dali;
using namespace Dali::Integration;
TEST_IMAGE_DIR "/fractal-compressed-ETC1_RGB8_OES-45x80.ktx",
TEST_IMAGE_DIR "/fractal-compressed-RGBA_ASTC_4x4_KHR-32x64.astc",
TEST_IMAGE_DIR "/test-image-4x4-32bpp.ico",
- TEST_IMAGE_DIR "/test-image.wbmp"
-};
+ TEST_IMAGE_DIR "/test-image.wbmp"};
const unsigned NUM_VALID_IMAGES = sizeof(VALID_IMAGES) / sizeof(VALID_IMAGES[0]);
-} // anon namespace
+} // namespace
/** Live platform abstraction recreated for each test case. */
extern TizenPlatform::TizenPlatformAbstraction* gAbstraction;
/** A variety of parameters to reach different code paths in the image loading. */
typedef std::pair<ImageDimensions, std::pair<FittingMode::Type, std::pair<SamplingMode::Type, bool> > > ImageParameters;
-extern std::vector<ImageParameters> gCancelAttributes;
+extern std::vector<ImageParameters> gCancelAttributes;
-double GetTimeMilliseconds( Integration::PlatformAbstraction& abstraction ); ///< Returns elapsed milliseconds.
+double GetTimeMilliseconds(Integration::PlatformAbstraction& abstraction); ///< Returns elapsed milliseconds.
void utc_dali_loading_startup(void);
void utc_dali_loading_cleanup(void);
#define DALI_H
/*
- * Copyright (c) 2019 Samsung Electronics Co., Ltd.
+ * Copyright (c) 2020 Samsung Electronics Co., Ltd.
*
* Licensed under the Apache License, Version 2.0 (the "License");
* you may not use this file except in compliance with the License.
#include <dali/public-api/adaptor-framework/application.h>
#include <dali/public-api/adaptor-framework/device-status.h>
#include <dali/public-api/adaptor-framework/input-method.h>
-#include <dali/public-api/adaptor-framework/key.h>
#include <dali/public-api/adaptor-framework/key-grab.h>
+#include <dali/public-api/adaptor-framework/key.h>
+#include <dali/public-api/adaptor-framework/native-image-source.h>
#include <dali/public-api/adaptor-framework/timer.h>
#include <dali/public-api/adaptor-framework/tts-player.h>
-#include <dali/public-api/adaptor-framework/native-image-source.h>
#include <dali/public-api/adaptor-framework/widget-application.h>
#include <dali/public-api/adaptor-framework/widget-impl.h>
#include <dali/public-api/adaptor-framework/widget.h>
namespace Dali
{
-
/**
* AccessibilityActionHandler is an abstract interface, used by Dali to handle accessibility actions
* passed by the accessibility manager.
class AccessibilityActionHandler
{
public:
-
/**
* Change the accessibility status when Accessibility feature(screen-reader) turned on or off.
* @return whether the status is changed or not.
* @param touch The touch point (and time) of the event.
* @return whether the focus is cleared or not.
*/
- virtual bool AccessibilityActionScroll( Dali::TouchEvent& touch ) = 0;
+ virtual bool AccessibilityActionScroll(Dali::TouchEvent& touch) = 0;
/**
* Perform the accessibility action to move focus to the previous focusable actor (by one finger flick up).
/*
- * Copyright (c) 2015 Samsung Electronics Co., Ltd.
+ * Copyright (c) 2020 Samsung Electronics Co., Ltd.
*
* Licensed under the Apache License, Version 2.0 (the "License");
* you may not use this file except in compliance with the License.
namespace Dali
{
-
AccessibilityAdaptor::AccessibilityAdaptor()
{
}
return Internal::Adaptor::AccessibilityAdaptor::GetImplementation(*this).HandleActionActivateEvent();
}
-bool AccessibilityAdaptor::HandleActionReadEvent(unsigned int x, unsigned int y, bool allowReadAgain)
+bool AccessibilityAdaptor::HandleActionReadEvent(unsigned int x, unsigned int y, bool allowReadAgain)
{
return Internal::Adaptor::AccessibilityAdaptor::GetImplementation(*this).HandleActionReadEvent(x, y, allowReadAgain);
}
return Internal::Adaptor::AccessibilityAdaptor::GetImplementation(*this).HandleActionStartStopEvent();
}
-AccessibilityAdaptor::AccessibilityAdaptor( Internal::Adaptor::AccessibilityAdaptor& manager )
-: BaseHandle( &manager )
+AccessibilityAdaptor::AccessibilityAdaptor(Internal::Adaptor::AccessibilityAdaptor& manager)
+: BaseHandle(&manager)
{
}
-AccessibilityAdaptor::AccessibilityAdaptor( Internal::Adaptor::AccessibilityAdaptor* manager )
-: BaseHandle( manager )
+AccessibilityAdaptor::AccessibilityAdaptor(Internal::Adaptor::AccessibilityAdaptor* manager)
+: BaseHandle(manager)
{
}
#define DALI_ACCESSIBILITY_ADAPTOR_H
/*
- * Copyright (c) 2019 Samsung Electronics Co., Ltd.
+ * Copyright (c) 2020 Samsung Electronics Co., Ltd.
*
* Licensed under the Apache License, Version 2.0 (the "License");
* you may not use this file except in compliance with the License.
*
*/
-
// EXTERNAL INCLUDES
#include <dali/devel-api/events/touch-point.h>
-#include <dali/public-api/object/base-handle.h>
#include <dali/public-api/dali-adaptor-common.h>
+#include <dali/public-api/object/base-handle.h>
namespace Dali
{
-
namespace Internal DALI_INTERNAL
{
namespace Adaptor
{
class AccessibilityAdaptor;
}
-}
+} // namespace DALI_INTERNAL
class AccessibilityActionHandler;
class AccessibilityGestureHandler;
-class TouchPoint;
+struct TouchPoint;
/**
* @brief The AccessibilityAdaptor provides communication to the accessibility manager interface (implemented in toolkit).
class DALI_ADAPTOR_API AccessibilityAdaptor : public BaseHandle
{
public:
-
/**
* @brief Create an uninitialized handle.
*
bool HandleActionStartStopEvent();
public: // Not intended for application developers
-
/**
* @brief Creates a handle using the Adaptor::Internal implementation.
*
* @param[in] adaptor The AccessibilityAdaptor implementation.
*/
- DALI_INTERNAL AccessibilityAdaptor( Internal::Adaptor::AccessibilityAdaptor& adaptor );
+ DALI_INTERNAL AccessibilityAdaptor(Internal::Adaptor::AccessibilityAdaptor& adaptor);
/**
* @brief This constructor is used by AccessibilityAdaptor::Get().
*
* @param[in] adaptor A pointer to the accessibility adaptor.
*/
- explicit DALI_INTERNAL AccessibilityAdaptor( Internal::Adaptor::AccessibilityAdaptor* adaptor );
+ explicit DALI_INTERNAL AccessibilityAdaptor(Internal::Adaptor::AccessibilityAdaptor* adaptor);
};
} // namespace Dali
#define DALI_INTEGRAION_ACCESSIBILITY_GESTURE_STRUCTS_H
/*
- * Copyright (c) 2019 Samsung Electronics Co., Ltd.
+ * Copyright (c) 2020 Samsung Electronics Co., Ltd.
*
* Licensed under the Apache License, Version 2.0 (the "License");
* you may not use this file except in compliance with the License.
namespace Dali
{
-
struct AccessibilityGestureEvent
{
// Construction & Destruction
* @param[in] state The state of the gesture
*/
AccessibilityGestureEvent(AccessibilityGestureEvent::State state)
- : timeDelta( 0 ),
- numberOfTouches( 0 ),
- state( state ),
- time( 0 )
- {}
+ : timeDelta(0),
+ numberOfTouches(0),
+ state(state),
+ time(0)
+ {
+ }
};
} // namespace Dali
#define DALI_ACCESSIBILITY_GESTURE_HANDLER_H
/*
- * Copyright (c) 2019 Samsung Electronics Co., Ltd.
+ * Copyright (c) 2020 Samsung Electronics Co., Ltd.
*
* Licensed under the Apache License, Version 2.0 (the "License");
* you may not use this file except in compliance with the License.
namespace Dali
{
-
/**
* AccessibilityGestureHandler is an interface used by Dali to handle accessibility gestures
* passed by the accessibility manager.
class AccessibilityGestureHandler
{
public:
-
/**
* Handle the accessibility pan gesture.
* @param[in] panEvent The pan event to be handled.
* @return whether the gesture is handled successfully or not.
*/
- virtual bool HandlePanGesture( const AccessibilityGestureEvent& panEvent ) = 0;
+ virtual bool HandlePanGesture(const AccessibilityGestureEvent& panEvent) = 0;
}; // class AccessibilityGestureHandler
namespace Dali
{
-
AnimatedImageLoading::AnimatedImageLoading()
{
}
-AnimatedImageLoading AnimatedImageLoading::New( const std::string& url, bool isLocalResource )
+AnimatedImageLoading AnimatedImageLoading::New(const std::string& url, bool isLocalResource)
{
const std::size_t urlSize = url.length();
Internal::Adaptor::AnimatedImageLoadingPtr internal = NULL;
- if(urlSize >= 4){ // Avoid throwing out_of_range or failing silently if exceptions are turned-off on the compare(). (http://www.cplusplus.com/reference/string/string/compare/)
- if( !url.compare( urlSize - 4, 4, ".gif" )
- || !url.compare( urlSize - 4, 4, ".GIF" ) )
+ if(urlSize >= 4)
+ { // Avoid throwing out_of_range or failing silently if exceptions are turned-off on the compare(). (http://www.cplusplus.com/reference/string/string/compare/)
+ if(!url.compare(urlSize - 4, 4, ".gif") || !url.compare(urlSize - 4, 4, ".GIF"))
{
- internal = Internal::Adaptor::GifLoading::New( url, isLocalResource );
+ internal = Internal::Adaptor::GifLoading::New(url, isLocalResource);
}
}
- if(urlSize >= 5){ // Avoid throwing out_of_range or failing silently if exceptions are turned-off on the compare(). (http://www.cplusplus.com/reference/string/string/compare/)
- if( !url.compare( urlSize - 5, 5, ".webp" )
- || !url.compare( urlSize - 5, 5, ".WEBP" ) )
+ if(urlSize >= 5)
+ { // Avoid throwing out_of_range or failing silently if exceptions are turned-off on the compare(). (http://www.cplusplus.com/reference/string/string/compare/)
+ if(!url.compare(urlSize - 5, 5, ".webp") || !url.compare(urlSize - 5, 5, ".WEBP"))
{
- internal = Internal::Adaptor::WebPLoading::New( url, isLocalResource );
+ internal = Internal::Adaptor::WebPLoading::New(url, isLocalResource);
}
}
- return AnimatedImageLoading( internal.Get() );
+ return AnimatedImageLoading(internal.Get());
}
-AnimatedImageLoading AnimatedImageLoading::DownCast( BaseHandle handle )
+AnimatedImageLoading AnimatedImageLoading::DownCast(BaseHandle handle)
{
- return AnimatedImageLoading( dynamic_cast< Internal::Adaptor::AnimatedImageLoading* >( handle.GetObjectPtr() ) );
+ return AnimatedImageLoading(dynamic_cast<Internal::Adaptor::AnimatedImageLoading*>(handle.GetObjectPtr()));
}
AnimatedImageLoading::~AnimatedImageLoading()
{
}
-bool AnimatedImageLoading::LoadNextNFrames( uint32_t frameStartIndex, int count, std::vector<Dali::PixelData>& pixelData )
+bool AnimatedImageLoading::LoadNextNFrames(uint32_t frameStartIndex, int count, std::vector<Dali::PixelData>& pixelData)
{
- return GetImplementation( *this ).LoadNextNFrames( frameStartIndex, count, pixelData );
+ return GetImplementation(*this).LoadNextNFrames(frameStartIndex, count, pixelData);
}
-Dali::Devel::PixelBuffer AnimatedImageLoading::LoadFrame( uint32_t frameIndex )
+Dali::Devel::PixelBuffer AnimatedImageLoading::LoadFrame(uint32_t frameIndex)
{
- return GetImplementation( *this ).LoadFrame( frameIndex );
+ return GetImplementation(*this).LoadFrame(frameIndex);
}
ImageDimensions AnimatedImageLoading::GetImageSize() const
{
- return GetImplementation( *this ).GetImageSize();
+ return GetImplementation(*this).GetImageSize();
}
uint32_t AnimatedImageLoading::GetImageCount() const
{
- return GetImplementation( *this ).GetImageCount();
+ return GetImplementation(*this).GetImageCount();
}
-uint32_t AnimatedImageLoading::GetFrameInterval( uint32_t frameIndex ) const
+uint32_t AnimatedImageLoading::GetFrameInterval(uint32_t frameIndex) const
{
- return GetImplementation( *this ).GetFrameInterval( frameIndex );
+ return GetImplementation(*this).GetFrameInterval(frameIndex);
}
std::string AnimatedImageLoading::GetUrl() const
{
- return GetImplementation( *this ).GetUrl();
+ return GetImplementation(*this).GetUrl();
}
-AnimatedImageLoading::AnimatedImageLoading( Internal::Adaptor::AnimatedImageLoading* internal )
-: BaseHandle( internal )
+AnimatedImageLoading::AnimatedImageLoading(Internal::Adaptor::AnimatedImageLoading* internal)
+: BaseHandle(internal)
{
}
#include <dali/public-api/object/base-handle.h>
// INTERNAL INCLUDES
-#include <dali/public-api/dali-adaptor-common.h>
#include <dali/devel-api/adaptor-framework/pixel-buffer.h>
+#include <dali/public-api/dali-adaptor-common.h>
namespace Dali
{
-
class PixelData;
typedef Dali::Uint16Pair ImageDimensions;
{
class AnimatedImageLoading;
}
-}
+} // namespace DALI_INTERNAL
/**
* Class to manage loading frames of an animated image in small chunks. Lazy initializes only when
class DALI_ADAPTOR_API AnimatedImageLoading : public BaseHandle
{
public:
-
/**
* Create a GifLoading with the given url and resourceType.
* @param[in] url The url of the animated image to load
* @param[in] isLocalResource The true or false whether this is a local resource.
* @return A newly created GifLoading.
*/
- static AnimatedImageLoading New( const std::string& url, bool isLocalResource );
+ static AnimatedImageLoading New(const std::string& url, bool isLocalResource);
/**
* @brief Constructor
* @param[in] handle to An object.
* @return handle to a Capture object or an uninitialized handle.
*/
- static AnimatedImageLoading DownCast( BaseHandle handle );
-
+ static AnimatedImageLoading DownCast(BaseHandle handle);
/**
* @brief Copy constructor.
* @param[out] pixelData The vector in which to return the frame data
* @return True if the frame data was successfully loaded
*/
- bool LoadNextNFrames( uint32_t frameStartIndex, int count, std::vector<Dali::PixelData>& pixelData );
+ bool LoadNextNFrames(uint32_t frameStartIndex, int count, std::vector<Dali::PixelData>& pixelData);
- /**
+ /**
* @brief Load a frame of the animated image.
*
* @note This function will load the entire animated image into memory if not already loaded.
* @return Dali::Devel::PixelBuffer The loaded PixelBuffer. If loading is fail, return empty handle.
*/
- Dali::Devel::PixelBuffer LoadFrame( uint32_t frameIndex );
+ Dali::Devel::PixelBuffer LoadFrame(uint32_t frameIndex);
/**
* @brief Get the size of a animated image.
*
* @return The time interval of the frame(microsecond).
*/
- uint32_t GetFrameInterval( uint32_t frameIndex ) const;
+ uint32_t GetFrameInterval(uint32_t frameIndex) const;
/**
* @brief Get the animated image file URL
*
* @param[in] internal A pointer to a newly allocated Dali resource.
*/
- explicit DALI_INTERNAL AnimatedImageLoading( Internal::Adaptor::AnimatedImageLoading* internal );
+ explicit DALI_INTERNAL AnimatedImageLoading(Internal::Adaptor::AnimatedImageLoading* internal);
/// @endcond
};
/*
- * Copyright (c) 2019 Samsung Electronics Co., Ltd.
+ * Copyright (c) 2020 Samsung Electronics Co., Ltd.
*
* Licensed under the Apache License, Version 2.0 (the "License");
* you may not use this file except in compliance with the License.
namespace Dali
{
-
namespace DevelApplication
{
-
-
-bool AddIdleWithReturnValue( Application application, CallbackBase* callback )
+bool AddIdleWithReturnValue(Application application, CallbackBase* callback)
{
- return Internal::Adaptor::GetImplementation( application ).AddIdle( callback, true );
+ return Internal::Adaptor::GetImplementation(application).AddIdle(callback, true);
}
std::string GetDataPath()
return Internal::Adaptor::Application::GetDataPath();
}
-Application DownCast( Dali::RefObject* refObject )
+Application DownCast(Dali::RefObject* refObject)
{
- return Application( dynamic_cast<Dali::Internal::Adaptor::Application*>( refObject ) );
+ return Application(dynamic_cast<Dali::Internal::Adaptor::Application*>(refObject));
}
} // namespace DevelApplication
} // namespace Dali
-extern "C"
-void ApplicationPreInitialize( int* argc, char** argv[] )
+extern "C" void ApplicationPreInitialize(int* argc, char** argv[])
{
- Dali::Internal::Adaptor::Application::PreInitialize( argc, argv );
+ Dali::Internal::Adaptor::Application::PreInitialize(argc, argv);
}
-
#define DALI_APPLICATION_DEVEL_H
/*
- * Copyright (c) 2019 Samsung Electronics Co., Ltd.
+ * Copyright (c) 2020 Samsung Electronics Co., Ltd.
*
* Licensed under the Apache License, Version 2.0 (the "License");
* you may not use this file except in compliance with the License.
namespace Dali
{
-
namespace DevelApplication
{
-
-
/**
* @brief Ensures that the function passed in is called from the main loop when it is idle.
* @param[in] application A handle to the Application
*
* @note Ownership of the callback is passed onto this class.
*/
-DALI_ADAPTOR_API bool AddIdleWithReturnValue( Application application, CallbackBase* callback );
+DALI_ADAPTOR_API bool AddIdleWithReturnValue(Application application, CallbackBase* callback);
/**
* @brief Gets the absolute path to the application's data directory which is used to store private data of the application.
* @param[in] refObject to an Application
* @return handle to an Application object or an uninitialized base handle
*/
-DALI_ADAPTOR_API Application DownCast( Dali::RefObject* refObject );
+DALI_ADAPTOR_API Application DownCast(Dali::RefObject* refObject);
} // namespace DevelApplication
* @note Declared in C style for calling from app-launcher.
*
*/
-extern "C"
-DALI_ADAPTOR_API void ApplicationPreInitialize( int* argc, char** argv[] );
+extern "C" DALI_ADAPTOR_API void ApplicationPreInitialize(int* argc, char** argv[]);
#endif // DALI_APPLICATION_DEVEL_H
#ifndef DALI_DEVEL_ATSPI_ACCESSIBILITY_H
#define DALI_DEVEL_ATSPI_ACCESSIBILITY_H
/*
- * Copyright (c) 2019 Samsung Electronics Co., Ltd.
+ * Copyright (c) 2020 Samsung Electronics Co., Ltd.
*
* Licensed under the Apache License, Version 2.0 (the "License");
* you may not use this file except in compliance with the License.
* Callback can be one of the following signals:
* ReadingCancelled, ReadingStopped, ReadingSkipped
*/
-DALI_ADAPTOR_API void Say( const std::string &text, bool discardable, std::function<void(std::string)> callback );
+DALI_ADAPTOR_API void Say(const std::string& text, bool discardable, std::function<void(std::string)> callback);
/**
* @brief Force accessibility client to pause.
* @return The status of ATSPI : 0(ATSPI OFF, ScreenReader OFF), 1(ATSPI ON, ScreenReader OFF),
* 2 (ATSPI OFF, ScreenReader ON), 3(ATSPI ON, ScreenReader ON)
*/
-DALI_ADAPTOR_API int SetForcefully( bool turnOn );
+DALI_ADAPTOR_API int SetForcefully(bool turnOn);
/**
* @brief Get ATSPI status.
#include <dali/internal/legacy/common/tizen-platform-abstraction.h>
#include <dali/internal/legacy/tizen/image-encoder.h>
-
namespace Dali
{
-
// Pieces needed to save compressed images (temporary location while plumbing):
namespace
{
-
/**
* Simple function to tell intended image file format from filename
*/
-FileFormat GetFormatFromFileName( const std::string& filename )
+FileFormat GetFormatFromFileName(const std::string& filename)
{
- if (filename.length() < 5)
+ if(filename.length() < 5)
{
DALI_LOG_WARNING("Invalid (short) filename.\n");
}
const std::size_t filenameSize = filename.length();
- if(filenameSize >= 4){ // Avoid throwing out_of_range or failing silently if exceptions are turned-off on the compare(). (http://www.cplusplus.com/reference/string/string/compare/)
- if( !filename.compare( filenameSize - 4, 4, ".jpg" )
- || !filename.compare( filenameSize - 4, 4, ".JPG" ) )
+ if(filenameSize >= 4)
+ { // Avoid throwing out_of_range or failing silently if exceptions are turned-off on the compare(). (http://www.cplusplus.com/reference/string/string/compare/)
+ if(!filename.compare(filenameSize - 4, 4, ".jpg") || !filename.compare(filenameSize - 4, 4, ".JPG"))
{
format = JPG_FORMAT;
}
- else if( !filename.compare( filenameSize - 4, 4, ".png" )
- || !filename.compare( filenameSize - 4, 4, ".PNG" ) )
+ else if(!filename.compare(filenameSize - 4, 4, ".png") || !filename.compare(filenameSize - 4, 4, ".PNG"))
{
format = PNG_FORMAT;
}
- else if( !filename.compare( filenameSize - 4, 4, ".bmp" )
- || !filename.compare( filenameSize - 4, 4, ".BMP" ) )
+ else if(!filename.compare(filenameSize - 4, 4, ".bmp") || !filename.compare(filenameSize - 4, 4, ".BMP"))
{
format = BMP_FORMAT;
}
- else if( !filename.compare( filenameSize - 4, 4, ".gif" )
- || !filename.compare( filenameSize - 4, 4, ".GIF" ) )
+ else if(!filename.compare(filenameSize - 4, 4, ".gif") || !filename.compare(filenameSize - 4, 4, ".GIF"))
{
format = GIF_FORMAT;
}
- else if( !filename.compare( filenameSize - 4, 4, ".ico" )
- || !filename.compare( filenameSize - 4, 4, ".ICO" ) )
+ else if(!filename.compare(filenameSize - 4, 4, ".ico") || !filename.compare(filenameSize - 4, 4, ".ICO"))
{
format = ICO_FORMAT;
}
- else if(filenameSize >= 5){
- if( !filename.compare( filenameSize - 5, 5, ".jpeg" )
- || !filename.compare( filenameSize - 5, 5, ".JPEG" ) )
+ else if(filenameSize >= 5)
+ {
+ if(!filename.compare(filenameSize - 5, 5, ".jpeg") || !filename.compare(filenameSize - 5, 5, ".JPEG"))
{
format = JPG_FORMAT;
}
return format;
}
-bool EncodeToFormat( const unsigned char* pixelBuffer,
- Vector< unsigned char >& encodedPixels,
- FileFormat formatEncoding,
- std::size_t width,
- std::size_t height,
- Pixel::Format pixelFormat,
- const uint32_t quality )
+bool EncodeToFormat(const unsigned char* pixelBuffer,
+ Vector<unsigned char>& encodedPixels,
+ FileFormat formatEncoding,
+ std::size_t width,
+ std::size_t height,
+ Pixel::Format pixelFormat,
+ const uint32_t quality)
{
- switch( formatEncoding )
+ switch(formatEncoding)
{
case JPG_FORMAT:
{
- return TizenPlatform::EncodeToJpeg( pixelBuffer, encodedPixels, width, height, pixelFormat, quality );
+ return TizenPlatform::EncodeToJpeg(pixelBuffer, encodedPixels, width, height, pixelFormat, quality);
break;
}
case PNG_FORMAT:
{
- return TizenPlatform::EncodeToPng( pixelBuffer, encodedPixels, width, height, pixelFormat );
+ return TizenPlatform::EncodeToPng(pixelBuffer, encodedPixels, width, height, pixelFormat);
break;
}
default:
}
} // anonymous namespace
-
bool EncodeToFile(const unsigned char* const pixelBuffer,
- const std::string& filename,
- const Pixel::Format pixelFormat,
- const std::size_t width,
- const std::size_t height )
+ const std::string& filename,
+ const Pixel::Format pixelFormat,
+ const std::size_t width,
+ const std::size_t height)
{
- return EncodeToFile( pixelBuffer, filename, pixelFormat, width, height, DEFAULT_JPG_QUALITY );
+ return EncodeToFile(pixelBuffer, filename, pixelFormat, width, height, DEFAULT_JPG_QUALITY);
}
bool EncodeToFile(const unsigned char* const pixelBuffer,
- const std::string& filename,
- const Pixel::Format pixelFormat,
- const std::size_t width,
- const std::size_t height,
- const uint32_t quality )
+ const std::string& filename,
+ const Pixel::Format pixelFormat,
+ const std::size_t width,
+ const std::size_t height,
+ const uint32_t quality)
{
DALI_ASSERT_DEBUG(pixelBuffer != 0 && filename.size() > 4 && width > 0 && height > 0);
- Vector< unsigned char > pixbufEncoded;
- const FileFormat format = GetFormatFromFileName( filename );
- const bool encodeResult = EncodeToFormat( pixelBuffer, pixbufEncoded, format, width, height, pixelFormat, quality );
+ Vector<unsigned char> pixbufEncoded;
+ const FileFormat format = GetFormatFromFileName(filename);
+ const bool encodeResult = EncodeToFormat(pixelBuffer, pixbufEncoded, format, width, height, pixelFormat, quality);
if(!encodeResult)
{
DALI_LOG_ERROR("Encoding pixels failed\n");
return false;
}
- return TizenPlatform::SaveFile( filename, pixbufEncoded.Begin(), pixbufEncoded.Count() );
+ return TizenPlatform::SaveFile(filename, pixbufEncoded.Begin(), pixbufEncoded.Count());
}
} // namespace Dali
*/
// EXTERNAL INCLUDES
-#include <string>
#include <dali/public-api/images/pixel.h>
+#include <string>
// INTERNAL INCLUDES
#include <dali/public-api/dali-adaptor-common.h>
namespace Dali
{
-
static constexpr uint32_t DEFAULT_JPG_QUALITY = 100;
/**
* @return true if the file was saved
*/
DALI_ADAPTOR_API bool EncodeToFile(const unsigned char* const pixelBuffer,
- const std::string& filename,
- const Pixel::Format pixelFormat,
- const std::size_t width,
- const std::size_t height);
+ const std::string& filename,
+ const Pixel::Format pixelFormat,
+ const std::size_t width,
+ const std::size_t height);
/**
* Store the given pixel data to a file.
* @return true if the file was saved
*/
DALI_ADAPTOR_API bool EncodeToFile(const unsigned char* const pixelBuffer,
- const std::string& filename,
- const Pixel::Format pixelFormat,
- const std::size_t width,
- const std::size_t height,
- const uint32_t quality);
+ const std::string& filename,
+ const Pixel::Format pixelFormat,
+ const std::size_t width,
+ const std::size_t height,
+ const uint32_t quality);
} // namespace Dali
-
#endif // DALI_ADAPTOR_BITMAP_SAVER_H
/*
- * Copyright (c) 2015 Samsung Electronics Co., Ltd.
+ * Copyright (c) 2020 Samsung Electronics Co., Ltd.
*
* Licensed under the Apache License, Version 2.0 (the "License");
* you may not use this file except in compliance with the License.
namespace Dali
{
-
ClipboardEventNotifier::ClipboardEventNotifier()
{
}
return Internal::Adaptor::ClipboardEventNotifier::GetImplementation(*this).GetContent();
}
-void ClipboardEventNotifier::SetContent( const std::string& content )
+void ClipboardEventNotifier::SetContent(const std::string& content)
{
Internal::Adaptor::ClipboardEventNotifier::GetImplementation(*this).SetContent(content);
}
return Internal::Adaptor::ClipboardEventNotifier::GetImplementation(*this).ContentSelectedSignal();
}
-ClipboardEventNotifier::ClipboardEventNotifier( Internal::Adaptor::ClipboardEventNotifier* notifier )
-: BaseHandle( notifier )
+ClipboardEventNotifier::ClipboardEventNotifier(Internal::Adaptor::ClipboardEventNotifier* notifier)
+: BaseHandle(notifier)
{
}
#define DALI_CLIPBOARD_EVENT_NOTIFIER_H
/*
- * Copyright (c) 2019 Samsung Electronics Co., Ltd.
+ * Copyright (c) 2020 Samsung Electronics Co., Ltd.
*
* Licensed under the Apache License, Version 2.0 (the "License");
* you may not use this file except in compliance with the License.
namespace Dali
{
-
namespace Internal DALI_INTERNAL
{
namespace Adaptor
{
class ClipboardEventNotifier;
}
-}
+} // namespace DALI_INTERNAL
/**
* @brief The ClipboardEventNotifier provides signals when clipboard events are received from the device.
class DALI_ADAPTOR_API ClipboardEventNotifier : public BaseHandle
{
public:
-
// Typedefs
/**
* @brief Clipboard event
*/
- typedef Signal< void ( ClipboardEventNotifier& ) > ClipboardEventSignalType;
+ typedef Signal<void(ClipboardEventNotifier&)> ClipboardEventSignalType;
/**
* @brief Create an uninitialized handle.
* @brief Sets the selected content.
* @param[in] content A string that represents the content that has been selected.
*/
- void SetContent( const std::string& content );
+ void SetContent(const std::string& content);
/**
* @brief Clears the stored content.
*/
void EmitContentSelectedSignal();
-public: // Signals
-
+public: // Signals
/**
* @brief This is emitted when content is selected from the clipboard.
*
ClipboardEventSignalType& ContentSelectedSignal();
public: // Not intended for application developers
-
/**
* @brief This constructor is used by ClipboardEventNotifier::Get().
*
* @param[in] notifier A pointer to the drag and drop notifier.
*/
- explicit DALI_INTERNAL ClipboardEventNotifier( Internal::Adaptor::ClipboardEventNotifier* notifier );
+ explicit DALI_INTERNAL ClipboardEventNotifier(Internal::Adaptor::ClipboardEventNotifier* notifier);
};
} // namespace Dali
/*
- * Copyright (c) 2015 Samsung Electronics Co., Ltd.
+ * Copyright (c) 2020 Samsung Electronics Co., Ltd.
*
* Licensed under the Apache License, Version 2.0 (the "License");
* you may not use this file except in compliance with the License.
namespace Dali
{
-
Clipboard::Clipboard()
{
}
Clipboard::~Clipboard()
{
}
-Clipboard::Clipboard(Internal::Adaptor::Clipboard *impl)
- : BaseHandle(impl)
+Clipboard::Clipboard(Internal::Adaptor::Clipboard* impl)
+: BaseHandle(impl)
{
}
return Internal::Adaptor::Clipboard::Get();
}
-bool Clipboard::SetItem( const std::string &itemData)
+bool Clipboard::SetItem(const std::string& itemData)
{
- return GetImplementation(*this).SetItem( itemData );
+ return GetImplementation(*this).SetItem(itemData);
}
void Clipboard::RequestItem()
-#ifndef DALI_CLIPBOARD_H
-#define DALI_CLIPBOARD_H
+#ifndef DALI_CLIPBOARD_H
+#define DALI_CLIPBOARD_H
/*
- * Copyright (c) 2019 Samsung Electronics Co., Ltd.
+ * Copyright (c) 2020 Samsung Electronics Co., Ltd.
*
* Licensed under the Apache License, Version 2.0 (the "License");
* you may not use this file except in compliance with the License.
*
*/
-
// EXTERNAL INCLUDES
#include <dali/public-api/math/rect.h>
#include <dali/public-api/object/base-handle.h>
namespace Dali
{
-
namespace Internal DALI_INTERNAL
{
-
namespace Adaptor
{
class Clipboard;
}
-}
+} // namespace DALI_INTERNAL
/**
* @brief Interface to the device's clipboard.
*
* @param[in] clipboard A pointer to the clipboard.
*/
- explicit DALI_INTERNAL Clipboard( Internal::Adaptor::Clipboard* clipboard );
+ explicit DALI_INTERNAL Clipboard(Internal::Adaptor::Clipboard* clipboard);
/**
* @brief Retrieve a handle to the ClipboardEventNotifier instance.
* @param[in] itemData string to send to clip board
* @return bool true if the internal clip board sending was successful.
*/
- bool SetItem( const std::string& itemData );
+ bool SetItem(const std::string& itemData);
/**
* @brief Request clipboard service to retrieve an item
* @return bool true if the clipboard is visible.
*/
bool IsVisible() const;
-
};
} // namespace Dali
#define DALI_COLOR_CONTROLLER_PLUGIN_H
/*
- * Copyright (c) 2019 Samsung Electronics Co., Ltd.
+ * Copyright (c) 2020 Samsung Electronics Co., Ltd.
*
* Licensed under the Apache License, Version 2.0 (the "License");
* you may not use this file except in compliance with the License.
namespace Dali
{
-
/**
* @brief ColorControllerPlugin is an abstract interface, used by dali-adaptor to access Color Controller plugin.
* A concrete implementation must be created for each platform and provided as dynamic library.
class ColorControllerPlugin
{
public:
-
/**
* @brief Constructor.
*/
- ColorControllerPlugin(){}
+ ColorControllerPlugin()
+ {
+ }
/**
* @brief Destructor.
*/
- virtual ~ColorControllerPlugin(){}
+ virtual ~ColorControllerPlugin()
+ {
+ }
/**
* @brief Retrieve the RGBA value by given the color code.
* @param[out] colorValue The RGBA color
* @return true if the color code exists, otherwise false
*/
- virtual bool RetrieveColor( const std::string& colorCode, Vector4& colorValue ) const = 0;
+ virtual bool RetrieveColor(const std::string& colorCode, Vector4& colorValue) const = 0;
/**
* @brief Retrieve the RGBA value by given the color code.
* @param[out] textShadowColor The text shadow color.
* @return true if the color code exists, otherwise false
*/
- virtual bool RetrieveColor( const std::string& colorCode , Vector4& textColor, Vector4& textOutlineColor, Vector4& textShadowColor ) const = 0;
+ virtual bool RetrieveColor(const std::string& colorCode, Vector4& textColor, Vector4& textOutlineColor, Vector4& textShadowColor) const = 0;
};
-} // namespace Dali;
+} // namespace Dali
#endif // DALI_COLOR_CONTROLLER_PLUGIN_H
/*
- * Copyright (c) 2015 Samsung Electronics Co., Ltd.
+ * Copyright (c) 2020 Samsung Electronics Co., Ltd.
*
* Licensed under the Apache License, Version 2.0 (the "License");
* you may not use this file except in compliance with the License.
namespace Dali
{
-
ColorController::ColorController()
{
}
{
}
-bool ColorController::RetrieveColor( const std::string& colorCode, Vector4& colorValue )
+bool ColorController::RetrieveColor(const std::string& colorCode, Vector4& colorValue)
{
- return GetImplementation(*this).RetrieveColor( colorCode, colorValue );
+ return GetImplementation(*this).RetrieveColor(colorCode, colorValue);
}
-bool ColorController::RetrieveColor( const std::string& colorCode , Vector4& textColor, Vector4& textOutlineColor, Vector4& textShadowColor)
+bool ColorController::RetrieveColor(const std::string& colorCode, Vector4& textColor, Vector4& textOutlineColor, Vector4& textShadowColor)
{
- return GetImplementation(*this).RetrieveColor( colorCode, textColor, textOutlineColor, textShadowColor );
+ return GetImplementation(*this).RetrieveColor(colorCode, textColor, textOutlineColor, textShadowColor);
}
ColorController::ColorController(Internal::Adaptor::ColorController* internal)
{
}
-}
+} // namespace Dali
#define DALI_COLOR_CONTROLLER_H
/*
- * Copyright (c) 2019 Samsung Electronics Co., Ltd.
+ * Copyright (c) 2020 Samsung Electronics Co., Ltd.
*
* Licensed under the Apache License, Version 2.0 (the "License");
* you may not use this file except in compliance with the License.
*/
// EXTERNAL INCLUDES
-#include <string>
-#include <dali/public-api/object/base-handle.h>
#include <dali/public-api/math/vector4.h>
+#include <dali/public-api/object/base-handle.h>
+#include <string>
// INTERNAL INCLUDES
#include <dali/public-api/dali-adaptor-common.h>
namespace Dali
{
-
namespace Internal DALI_INTERNAL
{
namespace Adaptor
class ColorController;
}
-}
+} // namespace DALI_INTERNAL
/**
* Color controller currently caches the changeable color table which updates with the theme change
class DALI_ADAPTOR_API ColorController : public BaseHandle
{
public:
-
/**
* @brief Create an uninitialized ColorController handle.
*/
* The copy will point to the same implementation as the original.
* @param[in] colorController The Color Controller to copy from.
*/
- ColorController( const ColorController& colorController);
+ ColorController(const ColorController& colorController);
/**
* @brief This assignment operator is required for (smart) pointer semantics.
* @param[out] colorValue The RGBA color
* @return true if the color code exists, otherwise false
*/
- bool RetrieveColor( const std::string& colorCode, Vector4& colorValue );
+ bool RetrieveColor(const std::string& colorCode, Vector4& colorValue);
/**
* @brief Retrieve the RGBA values by given the color code.
* @param[out] textShadowColor The text shadow color.
* @return true if the color code exists, otherwise false
*/
- bool RetrieveColor( const std::string& colorCode , Vector4& textColor, Vector4& textOutlineColor, Vector4& textShadowColor);
-
+ bool RetrieveColor(const std::string& colorCode, Vector4& textColor, Vector4& textOutlineColor, Vector4& textShadowColor);
public: // Not intended for application developers
/**
explicit DALI_INTERNAL ColorController(Internal::Adaptor::ColorController* colorController);
};
-
} //namespace Dali
#endif // DALI_COLOR_CONTROLLER_H
{\r
namespace Internal DALI_INTERNAL\r
{\r
-\r
namespace Adaptor\r
{\r
class ComponentApplication;\r
}\r
\r
-}\r
+} // namespace DALI_INTERNAL\r
\r
/**\r
* @brief An ComponentApplication class object should be created by every component-based application\r
class DALI_ADAPTOR_API ComponentApplication : public Application\r
{\r
public:\r
- typedef Signal< Any () > CreateSignalType;\r
+ typedef Signal<Any()> CreateSignalType;\r
\r
public:\r
/**
* @brief This is the constructor for component applications without an argument list.\r
* @return A handle to the ComponentApplication\r
*/\r
- static ComponentApplication New( );\r
-
+ static ComponentApplication New();\r
+\r
/**
* @brief This is the constructor for component applications.\r
*\r
* @param[in,out] argv A pointer to the argument list\r
* @return A handle to the ComponentApplication\r
*/\r
- static ComponentApplication New( int* argc, char **argv[] );\r
-
+ static ComponentApplication New(int* argc, char** argv[]);\r
+\r
/**
* @brief This is the constructor for component applications with a stylesheet\r
*\r
* @param[in] stylesheet The path to user defined theme file
* @return A handle to the ComponentApplication\r
*/\r
- static ComponentApplication New( int* argc, char **argv[], const std::string& stylesheet );\r
+ static ComponentApplication New(int* argc, char** argv[], const std::string& stylesheet);\r
\r
/**\r
* @brief The default constructor.\r
*\r
* @param[in] componentApplication Handle to an object\r
*/\r
- ComponentApplication( const ComponentApplication& componentApplication ) = default;\r
+ ComponentApplication(const ComponentApplication& componentApplication) = default;\r
\r
/**\r
* @brief Assignment operator.\r
* @param[in] componentApplication Handle to an object\r
* @return A reference to this\r
*/\r
- ComponentApplication& operator=( const ComponentApplication& componentApplication ) = default;\r
+ ComponentApplication& operator=(const ComponentApplication& componentApplication) = default;\r
\r
- /**\r
+ /**\r
* @brief Destructor\r
*/\r
~ComponentApplication() = default;\r
\r
- /**\r
+ /**\r
* @brief The user should connect to this signal to determine when they should initialize\r
* their application.\r
* The callback function is called before the main loop of the application starts.\r
} // namespace Dali\r
\r
#endif // DALI_COMPONENT_APPLICATION_H\r
-\r
/*
- * Copyright (c) 2015 Samsung Electronics Co., Ltd.
+ * Copyright (c) 2020 Samsung Electronics Co., Ltd.
*
* Licensed under the Apache License, Version 2.0 (the "License");
* you may not use this file except in compliance with the License.
namespace Dali
{
-
namespace EnvironmentVariable
{
-
-const char * GetEnvironmentVariable( const char * variable )
+const char* GetEnvironmentVariable(const char* variable)
{
- return std::getenv( variable );
+ return std::getenv(variable);
}
-bool SetEnvironmentVariable( const char * variable, const char * value )
+bool SetEnvironmentVariable(const char* variable, const char* value)
{
- return setenv( variable, value, 1 ) == 0;
+ return setenv(variable, value, 1) == 0;
}
} // namespace EnvironmentVariable
#define DALI_ENVIRONMENT_VARIABLE_H
/*
- * Copyright (c) 2019 Samsung Electronics Co., Ltd.
+ * Copyright (c) 2020 Samsung Electronics Co., Ltd.
*
* Licensed under the Apache License, Version 2.0 (the "License");
* you may not use this file except in compliance with the License.
namespace Dali
{
-
namespace EnvironmentVariable
{
-
/**
* @brief Search the environment list for the specified variable name and return a pointer to the C string that is associated with the matched environment list member.
*
* @param[in] variable Null-terminated character string identifying the name of the environmental variable to look for.
* @return A C-string containing the value of the specified environment variable.
*/
-DALI_ADAPTOR_API const char * GetEnvironmentVariable( const char * variable );
+DALI_ADAPTOR_API const char* GetEnvironmentVariable(const char* variable);
/**
* @brief Create or overwrite (when it does not exist) an environment variable.
* @param[in] value Null-terminated character string to set as a value.
* @return True on success, false on error.
*/
-DALI_ADAPTOR_API bool SetEnvironmentVariable( const char * variable, const char * value );
+DALI_ADAPTOR_API bool SetEnvironmentVariable(const char* variable, const char* value);
} // namespace EnvironmentVariable
/*
- * Copyright (c) 2015 Samsung Electronics Co., Ltd.
+ * Copyright (c) 2020 Samsung Electronics Co., Ltd.
*
* Licensed under the Apache License, Version 2.0 (the "License");
* you may not use this file except in compliance with the License.
namespace Dali
{
-
namespace EventFeeder
{
-
-void FeedTouchPoint( TouchPoint& point, int timeStamp )
+void FeedTouchPoint(TouchPoint& point, int timeStamp)
{
- if ( Adaptor::IsAvailable() )
+ if(Adaptor::IsAvailable())
{
- Internal::Adaptor::Adaptor::GetImplementation( Adaptor::Get() ).FeedTouchPoint( point, timeStamp );
+ Internal::Adaptor::Adaptor::GetImplementation(Adaptor::Get()).FeedTouchPoint(point, timeStamp);
}
}
-void FeedWheelEvent( WheelEvent& wheelEvent )
+void FeedWheelEvent(WheelEvent& wheelEvent)
{
- if ( Adaptor::IsAvailable() )
+ if(Adaptor::IsAvailable())
{
- Internal::Adaptor::Adaptor::GetImplementation( Adaptor::Get() ).FeedWheelEvent( wheelEvent );
+ Internal::Adaptor::Adaptor::GetImplementation(Adaptor::Get()).FeedWheelEvent(wheelEvent);
}
}
-void FeedKeyEvent( KeyEvent& keyEvent )
+void FeedKeyEvent(KeyEvent& keyEvent)
{
- if ( Adaptor::IsAvailable() )
+ if(Adaptor::IsAvailable())
{
- Internal::Adaptor::Adaptor::GetImplementation( Adaptor::Get() ).FeedKeyEvent( keyEvent );
+ Internal::Adaptor::Adaptor::GetImplementation(Adaptor::Get()).FeedKeyEvent(keyEvent);
}
}
namespace Dali
{
-
class WheelEvent;
class KeyEvent;
struct TouchPoint;
namespace EventFeeder
{
-
/**
* Feed a touch point to the adaptor.
*
*
* @note For testing/automation purposes only.
*/
-DALI_ADAPTOR_API void FeedTouchPoint( TouchPoint& point, int timeStamp );
+DALI_ADAPTOR_API void FeedTouchPoint(TouchPoint& point, int timeStamp);
/**
* Feed a wheel event to the adaptor.
*
* @note For testing/automation purposes only.
*/
-DALI_ADAPTOR_API void FeedWheelEvent( WheelEvent& wheelEvent );
+DALI_ADAPTOR_API void FeedWheelEvent(WheelEvent& wheelEvent);
/**
* Feed a key event to the adaptor.
*
* @note For testing/automation purposes only.
*/
-DALI_ADAPTOR_API void FeedKeyEvent( KeyEvent& keyEvent );
+DALI_ADAPTOR_API void FeedKeyEvent(KeyEvent& keyEvent);
} // namespace EventFeeder
/*
- * Copyright (c) 2015 Samsung Electronics Co., Ltd.
+ * Copyright (c) 2020 Samsung Electronics Co., Ltd.
*
* Licensed under the Apache License, Version 2.0 (the "License");
* you may not use this file except in compliance with the License.
namespace Dali
{
-
struct EventThreadCallback::Impl
{
TriggerEventInterface* eventTrigger;
};
-EventThreadCallback::EventThreadCallback( CallbackBase* callback )
-: mImpl( new Impl() )
+EventThreadCallback::EventThreadCallback(CallbackBase* callback)
+: mImpl(new Impl())
{
- mImpl->eventTrigger = TriggerEventFactory::CreateTriggerEvent( callback, TriggerEventInterface::KEEP_ALIVE_AFTER_TRIGGER );
+ mImpl->eventTrigger = TriggerEventFactory::CreateTriggerEvent(callback, TriggerEventInterface::KEEP_ALIVE_AFTER_TRIGGER);
}
EventThreadCallback::~EventThreadCallback()
{
- TriggerEventFactory::DestroyTriggerEvent( mImpl->eventTrigger );
+ TriggerEventFactory::DestroyTriggerEvent(mImpl->eventTrigger);
delete mImpl;
}
void EventThreadCallback::Trigger()
{
- if( mImpl->eventTrigger )
+ if(mImpl->eventTrigger)
{
mImpl->eventTrigger->Trigger();
}
}
-}
+} // namespace Dali
#define DALI_EVENT_THREAD_CALLBACK_H
/*
- * Copyright (c) 2019 Samsung Electronics Co., Ltd.
+ * Copyright (c) 2020 Samsung Electronics Co., Ltd.
*
* Licensed under the Apache License, Version 2.0 (the "License");
* you may not use this file except in compliance with the License.
namespace Dali
{
-
/**
* @brief The EventThreadCallback class provides a mechanism for the worker thread to trigger the execution of a given callback in main event thread .
*
class DALI_ADAPTOR_API EventThreadCallback
{
public:
-
/**
* @brief Constructor. Create an object that will call the given callback in main event thread.
*
* @param[in] callback The callback to call.
*/
- EventThreadCallback( CallbackBase* callback );
+ EventThreadCallback(CallbackBase* callback);
/**
* @brief Destructor.
void Trigger();
private:
-
// undefined copy constructor.
- EventThreadCallback( const EventThreadCallback& );
+ EventThreadCallback(const EventThreadCallback&);
// undefined assignment operator
- EventThreadCallback& operator=( const EventThreadCallback& );
+ EventThreadCallback& operator=(const EventThreadCallback&);
private:
-
struct Impl;
Impl* mImpl;
-
};
-}
+} // namespace Dali
#endif /* DALI_EVENT_THREAD_CALLBACK_H */
/*
- * Copyright (c) 2015 Samsung Electronics Co., Ltd.
+ * Copyright (c) 2020 Samsung Electronics Co., Ltd.
*
* Licensed under the Apache License, Version 2.0 (the "License");
* you may not use this file except in compliance with the License.
namespace Dali
{
-
FeedbackPlayer::FeedbackPlayer()
{
}
GetImplementation(*this).Stop();
}
-int FeedbackPlayer::PlaySound( const std::string& fileName )
+int FeedbackPlayer::PlaySound(const std::string& fileName)
{
return GetImplementation(*this).PlaySound(fileName);
}
-void FeedbackPlayer::StopSound( int handle )
+void FeedbackPlayer::StopSound(int handle)
{
GetImplementation(*this).StopSound(handle);
}
-void FeedbackPlayer::PlayFeedbackPattern( int type, int pattern )
+void FeedbackPlayer::PlayFeedbackPattern(int type, int pattern)
{
GetImplementation(*this).PlayFeedbackPattern(type, pattern);
}
return GetImplementation(*this).LoadFile(filename, data);
}
-FeedbackPlayer::FeedbackPlayer( Internal::Adaptor::FeedbackPlayer* player )
-: BaseHandle( player )
+FeedbackPlayer::FeedbackPlayer(Internal::Adaptor::FeedbackPlayer* player)
+: BaseHandle(player)
{
}
#define DALI_FEEDBACK_PLAYER_H
/*
- * Copyright (c) 2019 Samsung Electronics Co., Ltd.
+ * Copyright (c) 2020 Samsung Electronics Co., Ltd.
*
* Licensed under the Apache License, Version 2.0 (the "License");
* you may not use this file except in compliance with the License.
namespace Dali
{
-
namespace Internal DALI_INTERNAL
{
namespace Adaptor
{
class FeedbackPlayer;
}
-}
+} // namespace DALI_INTERNAL
/**
* @brief Plays feedback effects.
class DALI_ADAPTOR_API FeedbackPlayer : public BaseHandle
{
public:
-
/**
* @brief Create an uninitialized handle.
*
* @param[in] fileName Path to the sound file to play.
* @return A handle which can be used to stop the sound playback.
*/
- int PlaySound( const std::string& fileName );
+ int PlaySound(const std::string& fileName);
/**
* Stops a currently playing sound.
* @param[in] handle A handle to the currently playing sound.
*/
- void StopSound( int handle );
+ void StopSound(int handle);
/**
* Plays a feedback pattern.
* @param[in] type The type of feedback.
* @param[in] pattern The ID of the pattern to play.
*/
- void PlayFeedbackPattern( int type, int pattern );
+ void PlayFeedbackPattern(int type, int pattern);
/*
* Loads a file into data
bool LoadFile(const std::string& filename, std::string& data);
public: // Not intended for application developers
-
/**
* @brief This constructor is used by FeedbackPlayer::Get().
* @param[in] feedbackPlayer A pointer to the feedback player.
*/
- explicit DALI_INTERNAL FeedbackPlayer( Internal::Adaptor::FeedbackPlayer* feedbackPlayer );
+ explicit DALI_INTERNAL FeedbackPlayer(Internal::Adaptor::FeedbackPlayer* feedbackPlayer);
};
} // namespace Dali
#define DALI_FEEDBACK_PLUGIN_H
/*
- * Copyright (c) 2019 Samsung Electronics Co., Ltd.
+ * Copyright (c) 2020 Samsung Electronics Co., Ltd.
*
* Licensed under the Apache License, Version 2.0 (the "License");
* you may not use this file except in compliance with the License.
namespace Dali
{
-
/**
* FeedbackPlugin is an abstract interface, used by Dali-adaptor to access haptic and audio feedback.
* A concrete implementation must be created for each platform and provided as a dynamic library which
class FeedbackPlugin
{
public:
-
- typedef void (*SoundStopCallBack)( void* ptr );
+ typedef void (*SoundStopCallBack)(void* ptr);
/**
* Destructor.
* Plays vibration in predefined patterns.
* @param[in] filePath Path to the file containing the effect.
*/
- virtual void PlayHaptic( const std::string& filePath ) = 0;
+ virtual void PlayHaptic(const std::string& filePath) = 0;
/**
* Plays a monotone vibration.
* @param[in] duration The duration of the vibration.
*/
- virtual void PlayHapticMonotone( unsigned int duration ) = 0;
+ virtual void PlayHapticMonotone(unsigned int duration) = 0;
/**
* Stops the currently playing vibration effects.
* @param[in] fileName Path to the sound file to play.
* @return A handle which can be used to stop the sound playback.
*/
- virtual int PlaySound( const std::string& fileName ) = 0;
+ virtual int PlaySound(const std::string& fileName) = 0;
/**
* Stops a currently playing sound.
* @param[in] handle A handle to the currently playing sound.
*/
- virtual void StopSound( int handle ) = 0;
+ virtual void StopSound(int handle) = 0;
/**
* Plays a feedback pattern.
* @param[in] type The type of feedback.
* @param[in] pattern The ID of the pattern to play.
*/
- virtual void PlayFeedbackPattern( int type, int pattern ) = 0;
+ virtual void PlayFeedbackPattern(int type, int pattern) = 0;
// Types for plugin factories
* @param [in] pluginName name of the plugin to load.
* @return Pointer to the newly created plugin object
*/
- typedef FeedbackPlugin* CreateFeedbackPlugin( void );
+ typedef FeedbackPlugin* CreateFeedbackPlugin(void);
}; // class FeedbackPlugin
/*
- * Copyright (c) 2019 Samsung Electronics Co., Ltd.
+ * Copyright (c) 2020 Samsung Electronics Co., Ltd.
*
* Licensed under the Apache License, Version 2.0 (the "License");
* you may not use this file except in compliance with the License.
#include <dali/devel-api/adaptor-framework/file-loader.h>
// EXTERNAL INCLUDES
-#include <iostream>
#include <fstream>
+#include <iostream>
// INTERNAL INCLUDES
#include <dali/internal/adaptor-framework/common/file-loader-impl.h>
namespace Dali
{
-
namespace
{
-
// limit maximum image down load size to 50 MB
-const size_t MAXIMUM_DOWNLOAD_IMAGE_SIZE = 50 * 1024 * 1024 ;
+const size_t MAXIMUM_DOWNLOAD_IMAGE_SIZE = 50 * 1024 * 1024;
-}
+} // namespace
namespace FileLoader
{
-
-int ReadFile(const std::string& filename, Dali::Vector<char> & memblock, FileLoader::FileType fileType)
+int ReadFile(const std::string& filename, Dali::Vector<char>& memblock, FileLoader::FileType fileType)
{
- return Dali::Internal::Adaptor::ReadFile( filename, memblock, fileType );
+ return Dali::Internal::Adaptor::ReadFile(filename, memblock, fileType);
}
int ReadFile(const std::string& filename, std::streampos& fileSize, Dali::Vector<char>& memblock, FileLoader::FileType fileType)
{
- return Dali::Internal::Adaptor::ReadFile( filename, fileSize, memblock, fileType );;
+ return Dali::Internal::Adaptor::ReadFile(filename, fileSize, memblock, fileType);
+ ;
}
std::streampos GetFileSize(const std::string& filename)
return Dali::Internal::Adaptor::GetFileSize(filename);
}
-bool DownloadFileSynchronously(const std::string& filename, Dali::Vector<uint8_t> &dataBuffer)
+bool DownloadFileSynchronously(const std::string& filename, Dali::Vector<uint8_t>& dataBuffer)
{
size_t dataSize;
- return TizenPlatform::Network::DownloadRemoteFileIntoMemory( filename, dataBuffer, dataSize, MAXIMUM_DOWNLOAD_IMAGE_SIZE );
+ return TizenPlatform::Network::DownloadRemoteFileIntoMemory(filename, dataBuffer, dataSize, MAXIMUM_DOWNLOAD_IMAGE_SIZE);
}
-} //FileLoader
+} // namespace FileLoader
-} //Dali
+} // namespace Dali
#define DALI_FILE_LOADER_H
/*
- * Copyright (c) 2019 Samsung Electronics Co., Ltd.
+ * Copyright (c) 2020 Samsung Electronics Co., Ltd.
*
* Licensed under the Apache License, Version 2.0 (the "License");
* you may not use this file except in compliance with the License.
*/
// EXTERNAL INCLUDES
-#include <string>
#include <dali/public-api/object/base-handle.h>
+#include <string>
// INTERNAL INCLUDES
#include <dali/public-api/dali-adaptor-common.h>
namespace Dali
{
-
namespace FileLoader
{
/**
* @brief File type formats
* The default format is binary
*/
-enum FileType ///< FileType format
+enum FileType ///< FileType format
{
- BINARY, ///< File will be loaded as a binary
- TEXT ///< File will be loaded as text
+ BINARY, ///< File will be loaded as a binary
+ TEXT ///< File will be loaded as text
};
/**
*
*
*/
-DALI_ADAPTOR_API int ReadFile(const std::string& filename, Dali::Vector<char> & memblock, FileLoader::FileType fileType = BINARY);
+DALI_ADAPTOR_API int ReadFile(const std::string& filename, Dali::Vector<char>& memblock, FileLoader::FileType fileType = BINARY);
/**
* @brief Load the file. It will load it either as a binary or as a text
* @return error code. 0 - Error, 1 - Ok
*
*/
-DALI_ADAPTOR_API int ReadFile(const std::string& filename, std::streampos& fileSize, Dali::Vector<char> & memblock, FileLoader::FileType fileType = BINARY);
+DALI_ADAPTOR_API int ReadFile(const std::string& filename, std::streampos& fileSize, Dali::Vector<char>& memblock, FileLoader::FileType fileType = BINARY);
/**
* @brief Get the file size of a file
*/
DALI_ADAPTOR_API std::streampos GetFileSize(const std::string& filename);
-
/**
* @brief Download a requested file into a memory buffer.
*
* @param[out] dataBuffer A memory buffer object to be written with downloaded file data.
* @return error code. false - Error, true - Ok
*/
-DALI_ADAPTOR_API bool DownloadFileSynchronously(const std::string& filename, Dali::Vector<uint8_t> &dataBuffer);
+DALI_ADAPTOR_API bool DownloadFileSynchronously(const std::string& filename, Dali::Vector<uint8_t>& dataBuffer);
-};
+}; // namespace FileLoader
-} // Dali
+} // namespace Dali
#endif // DALI_FILE_LOADER_H
/*
- * Copyright (c) 2019 Samsung Electronics Co., Ltd.
+ * Copyright (c) 2020 Samsung Electronics Co., Ltd.
*
* Licensed under the Apache License, Version 2.0 (the "License");
* you may not use this file except in compliance with the License.
namespace Dali
{
-
FileStream::FileStream(const std::string& filename, uint8_t mode)
{
- mImpl.reset( new Impl( filename, mode ) );
+ mImpl.reset(new Impl(filename, mode));
}
FileStream::FileStream(uint8_t* buffer, size_t dataSize, uint8_t mode)
{
- mImpl.reset( new Impl( buffer, dataSize, mode ) );
+ mImpl.reset(new Impl(buffer, dataSize, mode));
}
FileStream::FileStream(Dali::Vector<uint8_t>& buffer, size_t dataSize, uint8_t mode)
{
- mImpl.reset( new Impl( buffer, dataSize, mode ) );
+ mImpl.reset(new Impl(buffer, dataSize, mode));
}
FileStream::FileStream(FileStream&&) = default;
return mImpl->GetFile();
}
-} // Dali
+} // namespace Dali
*/
// EXTERNAL INCLUDES
-#include <stdio.h>
#include <stdint.h>
+#include <stdio.h>
#include <iostream>
-#include <string>
#include <memory>
+#include <string>
// INTERNAL INCLUDES
#include <dali/public-api/common/dali-vector.h>
namespace Dali
{
-
class DALI_ADAPTOR_API FileStream
{
public:
-
/**
* @brief File type formats
* The default format is binary
*/
- enum FileMode ///< FileType format
+ enum FileMode ///< FileType format
{
- BINARY = 1 << 0, ///< File stream will be opened as a binary
- TEXT = 1 << 1, ///< File stream will be opened as text
- READ = 1 << 2, ///< File stream will be opened for reading
- WRITE = 1 << 3, ///< File stream will be opened for writing
- APPEND = 1 << 4, ///< File stream will be opened for appending
+ BINARY = 1 << 0, ///< File stream will be opened as a binary
+ TEXT = 1 << 1, ///< File stream will be opened as text
+ READ = 1 << 2, ///< File stream will be opened for reading
+ WRITE = 1 << 3, ///< File stream will be opened for writing
+ APPEND = 1 << 4, ///< File stream will be opened for appending
};
/**
FILE* GetFile();
private:
-
- struct Impl;
+ class Impl;
std::unique_ptr<Impl> mImpl;
};
-} // Dali
+} // namespace Dali
#endif // DALI_FILE_STREAM_H
#define DALI_TIZEN_PLATFORM_IMAGE_LOADER_INPUT_H
/*
- * Copyright (c) 2019 Samsung Electronics Co., Ltd.
+ * Copyright (c) 2020 Samsung Electronics Co., Ltd.
*
* Licensed under the Apache License, Version 2.0 (the "License");
* you may not use this file except in compliance with the License.
*/
// EXTERNAL INCLUDES
-#include <cstdio>
-#include <dali/public-api/images/image-operations.h>
#include <dali/devel-api/adaptor-framework/pixel-buffer.h>
#include <dali/integration-api/bitmap.h>
+#include <dali/public-api/images/image-operations.h>
+#include <cstdio>
// INTERNAL INCLUDES
{
namespace ImageLoader
{
-
/**
* @brief A simple immutable struct to bundle together parameters for scaling an image.
*/
class ScalingParameters
{
public:
- ScalingParameters( ImageDimensions dimensions = ImageDimensions(), FittingMode::Type fittingMode = FittingMode::DEFAULT, SamplingMode::Type samplingMode = SamplingMode::DEFAULT ) :
- dimensions(dimensions), scalingMode(fittingMode), samplingMode(samplingMode) {}
- const ImageDimensions dimensions;
- const FittingMode::Type scalingMode;
+ ScalingParameters(ImageDimensions dimensions = ImageDimensions(), FittingMode::Type fittingMode = FittingMode::DEFAULT, SamplingMode::Type samplingMode = SamplingMode::DEFAULT)
+ : dimensions(dimensions),
+ scalingMode(fittingMode),
+ samplingMode(samplingMode)
+ {
+ }
+ const ImageDimensions dimensions;
+ const FittingMode::Type scalingMode;
const SamplingMode::Type samplingMode;
};
- /**
+/**
* @brief Bundle-up the data pushed into an image loader.
*/
struct Input
{
- Input( FILE* file, ScalingParameters scalingParameters = ScalingParameters(), bool reorientationRequested = true ) :
- file(file), scalingParameters(scalingParameters), reorientationRequested(reorientationRequested) {}
- FILE* file;
+ Input(FILE* file, ScalingParameters scalingParameters = ScalingParameters(), bool reorientationRequested = true)
+ : file(file),
+ scalingParameters(scalingParameters),
+ reorientationRequested(reorientationRequested)
+ {
+ }
+ FILE* file;
ScalingParameters scalingParameters;
- bool reorientationRequested;
+ bool reorientationRequested;
};
-
-using LoadBitmapFunction = bool( * )( const Dali::ImageLoader::Input& input, Dali::Devel::PixelBuffer& pixelData );
-using LoadBitmapHeaderFunction = bool( * )( const Dali::ImageLoader::Input& input, unsigned int& width, unsigned int& height );
+using LoadBitmapFunction = bool (*)(const Dali::ImageLoader::Input& input, Dali::Devel::PixelBuffer& pixelData);
+using LoadBitmapHeaderFunction = bool (*)(const Dali::ImageLoader::Input& input, unsigned int& width, unsigned int& height);
/**
* Stores the magic bytes, and the loader and header functions used for each image loader.
*/
struct BitmapLoader
{
- unsigned char magicByte1; ///< The first byte in the file should be this
- unsigned char magicByte2; ///< The second byte in the file should be this
- LoadBitmapFunction loader; ///< The function which decodes the file
- LoadBitmapHeaderFunction header; ///< The function which decodes the header of the file
- Dali::Integration::Bitmap::Profile profile; ///< The kind of bitmap to be created
- /// (addressable packed pixels or an opaque compressed blob).
+ unsigned char magicByte1; ///< The first byte in the file should be this
+ unsigned char magicByte2; ///< The second byte in the file should be this
+ LoadBitmapFunction loader; ///< The function which decodes the file
+ LoadBitmapHeaderFunction header; ///< The function which decodes the header of the file
+ Dali::Integration::Bitmap::Profile profile; ///< The kind of bitmap to be created
+ /// (addressable packed pixels or an opaque compressed blob).
};
-} // ImageLoader
-} // Dali
+} // namespace ImageLoader
+} // namespace Dali
#endif // DALI_TIZEN_PLATFORM_IMAGE_LOADER_INPUT_H
#define DALI_IMAGE_LOADING_PLUGIN_H
/*
- * Copyright (c) 2019 Samsung Electronics Co., Ltd.
+ * Copyright (c) 2020 Samsung Electronics Co., Ltd.
*
* Licensed under the Apache License, Version 2.0 (the "License");
* you may not use this file except in compliance with the License.
namespace Dali
{
-
/**
* @brief
*/
class ImageLoaderPlugin
{
public:
-
/**
* @brief Constructor.
*/
- ImageLoaderPlugin(){}
+ ImageLoaderPlugin()
+ {
+ }
/**
* @brief Destructor.
*/
- virtual ~ImageLoaderPlugin(){}
+ virtual ~ImageLoaderPlugin()
+ {
+ }
/**
* @brief Get the image decorder
* @param[in] filename The path to the resource.
* @return BitmapLoader
*/
- virtual const ImageLoader::BitmapLoader* BitmapLoaderLookup( const std::string& filename ) const = 0;
+ virtual const ImageLoader::BitmapLoader* BitmapLoaderLookup(const std::string& filename) const = 0;
/**
* @brief Function pointer called in adaptor to create a image loading plugin instance.
* @return Pointer to the newly created plugin object
*/
- typedef ImageLoaderPlugin* CreateImageLoaderPlugin( void );
+ typedef ImageLoaderPlugin* CreateImageLoaderPlugin(void);
/**
* @brief Function pointer called in adaptor to destory a image loading plugin instance.
*/
- typedef void DestroyImageLoaderPlugin( ImageLoaderPlugin* plugin );
-
+ typedef void DestroyImageLoaderPlugin(ImageLoaderPlugin* plugin);
};
-} // namespace Dali;
+} // namespace Dali
#endif
/*
- * Copyright (c) 2017 Samsung Electronics Co., Ltd.
+ * Copyright (c) 2020 Samsung Electronics Co., Ltd.
*
* Licensed under the Apache License, Version 2.0 (the "License");
* you may not use this file except in compliance with the License.
#include <dali/devel-api/adaptor-framework/image-loading.h>
// INTERNAL INCLUDES
-#include <dali/public-api/object/property-map.h>
-#include <dali/internal/imaging/common/image-loader.h>
+#include <dali/devel-api/adaptor-framework/pixel-buffer.h>
#include <dali/internal/imaging/common/file-download.h>
+#include <dali/internal/imaging/common/image-loader.h>
#include <dali/internal/system/common/file-reader.h>
-#include <dali/devel-api/adaptor-framework/pixel-buffer.h>
+#include <dali/public-api/object/property-map.h>
namespace Dali
{
-
namespace
{
-
// limit maximum image down load size to 50 MB
-const size_t MAXIMUM_DOWNLOAD_IMAGE_SIZE = 50 * 1024 * 1024 ;
+const size_t MAXIMUM_DOWNLOAD_IMAGE_SIZE = 50 * 1024 * 1024;
-}
+} // namespace
-Devel::PixelBuffer LoadImageFromFile( const std::string& url, ImageDimensions size, FittingMode::Type fittingMode, SamplingMode::Type samplingMode, bool orientationCorrection )
+Devel::PixelBuffer LoadImageFromFile(const std::string& url, ImageDimensions size, FittingMode::Type fittingMode, SamplingMode::Type samplingMode, bool orientationCorrection)
{
- Integration::BitmapResourceType resourceType( size, fittingMode, samplingMode, orientationCorrection );
+ Integration::BitmapResourceType resourceType(size, fittingMode, samplingMode, orientationCorrection);
- Internal::Platform::FileReader fileReader( url );
- FILE * const fp = fileReader.GetFile();
- if( fp != NULL )
+ Internal::Platform::FileReader fileReader(url);
+ FILE* const fp = fileReader.GetFile();
+ if(fp != NULL)
{
Dali::Devel::PixelBuffer bitmap;
- bool success = TizenPlatform::ImageLoader::ConvertStreamToBitmap( resourceType, url, fp, bitmap );
- if( success && bitmap )
+ bool success = TizenPlatform::ImageLoader::ConvertStreamToBitmap(resourceType, url, fp, bitmap);
+ if(success && bitmap)
{
return bitmap;
}
return Dali::Devel::PixelBuffer();
}
-ImageDimensions GetClosestImageSize( const std::string& filename,
- ImageDimensions size,
- FittingMode::Type fittingMode,
- SamplingMode::Type samplingMode,
- bool orientationCorrection )
+ImageDimensions GetClosestImageSize(const std::string& filename,
+ ImageDimensions size,
+ FittingMode::Type fittingMode,
+ SamplingMode::Type samplingMode,
+ bool orientationCorrection)
{
- ImageDimensions dimension = TizenPlatform::ImageLoader::GetClosestImageSize( filename, size, fittingMode, samplingMode, orientationCorrection );
+ ImageDimensions dimension = TizenPlatform::ImageLoader::GetClosestImageSize(filename, size, fittingMode, samplingMode, orientationCorrection);
- dimension.SetWidth( std::min( dimension.GetWidth(), static_cast< uint16_t >( GetMaxTextureSize() ) ) );
- dimension.SetHeight( std::min( dimension.GetHeight(), static_cast< uint16_t >( GetMaxTextureSize() ) ) );
+ dimension.SetWidth(std::min(dimension.GetWidth(), static_cast<uint16_t>(GetMaxTextureSize())));
+ dimension.SetHeight(std::min(dimension.GetHeight(), static_cast<uint16_t>(GetMaxTextureSize())));
return dimension;
}
-ImageDimensions GetOriginalImageSize( const std::string& filename )
+ImageDimensions GetOriginalImageSize(const std::string& filename)
{
- return TizenPlatform::ImageLoader::GetClosestImageSize( filename, ImageDimensions(0, 0), FittingMode::DEFAULT, SamplingMode::BOX_THEN_LINEAR, true );
+ return TizenPlatform::ImageLoader::GetClosestImageSize(filename, ImageDimensions(0, 0), FittingMode::DEFAULT, SamplingMode::BOX_THEN_LINEAR, true);
}
-Devel::PixelBuffer DownloadImageSynchronously( const std::string& url, ImageDimensions size, FittingMode::Type fittingMode, SamplingMode::Type samplingMode, bool orientationCorrection )
+Devel::PixelBuffer DownloadImageSynchronously(const std::string& url, ImageDimensions size, FittingMode::Type fittingMode, SamplingMode::Type samplingMode, bool orientationCorrection)
{
- Integration::BitmapResourceType resourceType( size, fittingMode, samplingMode, orientationCorrection );
+ Integration::BitmapResourceType resourceType(size, fittingMode, samplingMode, orientationCorrection);
- bool succeeded;
+ bool succeeded;
Dali::Vector<uint8_t> dataBuffer;
- size_t dataSize;
+ size_t dataSize;
- succeeded = TizenPlatform::Network::DownloadRemoteFileIntoMemory( url, dataBuffer, dataSize,
- MAXIMUM_DOWNLOAD_IMAGE_SIZE );
- if( succeeded )
+ succeeded = TizenPlatform::Network::DownloadRemoteFileIntoMemory(url, dataBuffer, dataSize, MAXIMUM_DOWNLOAD_IMAGE_SIZE);
+ if(succeeded)
{
size_t blobSize = dataBuffer.Size();
- DALI_ASSERT_DEBUG( blobSize > 0U );
+ DALI_ASSERT_DEBUG(blobSize > 0U);
- if( blobSize > 0U )
+ if(blobSize > 0U)
{
// Open a file handle on the memory buffer:
- Dali::Internal::Platform::FileReader fileReader( dataBuffer, blobSize );
- FILE * const fp = fileReader.GetFile();
- if ( NULL != fp )
+ Dali::Internal::Platform::FileReader fileReader(dataBuffer, blobSize);
+ FILE* const fp = fileReader.GetFile();
+ if(NULL != fp)
{
Dali::Devel::PixelBuffer bitmap;
- bool result = TizenPlatform::ImageLoader::ConvertStreamToBitmap(
+ bool result = TizenPlatform::ImageLoader::ConvertStreamToBitmap(
resourceType,
url,
fp,
- bitmap );
+ bitmap);
- if ( result && bitmap )
+ if(result && bitmap)
{
return bitmap;
}
else
{
- DALI_LOG_WARNING( "Unable to decode bitmap supplied as in-memory blob.\n" );
+ DALI_LOG_WARNING("Unable to decode bitmap supplied as in-memory blob.\n");
}
}
}
#define DALI_IMAGE_LOADING_H
/*
- * Copyright (c) 2018 Samsung Electronics Co., Ltd.
+ * Copyright (c) 2020 Samsung Electronics Co., Ltd.
*
* Licensed under the Apache License, Version 2.0 (the "License");
* you may not use this file except in compliance with the License.
*/
// EXTERNAL INCLUDES
-#include <string>
-#include <dali/public-api/images/image-operations.h>
#include <dali/devel-api/adaptor-framework/pixel-buffer.h>
+#include <dali/public-api/images/image-operations.h>
+#include <string>
// INTERNAL INCLUDES
#include <dali/public-api/dali-adaptor-common.h>
-
namespace Dali
{
-
/**
* @brief Load an image synchronously from local file.
*
*/
DALI_ADAPTOR_API Devel::PixelBuffer LoadImageFromFile(
const std::string& url,
- ImageDimensions size = ImageDimensions( 0, 0 ),
- FittingMode::Type fittingMode = FittingMode::DEFAULT,
- SamplingMode::Type samplingMode = SamplingMode::BOX_THEN_LINEAR,
- bool orientationCorrection = true );
+ ImageDimensions size = ImageDimensions(0, 0),
+ FittingMode::Type fittingMode = FittingMode::DEFAULT,
+ SamplingMode::Type samplingMode = SamplingMode::BOX_THEN_LINEAR,
+ bool orientationCorrection = true);
/**
* @brief Determine the size of an image that LoadImageFromFile will provide when
*/
DALI_ADAPTOR_API ImageDimensions GetClosestImageSize(
const std::string& filename,
- ImageDimensions size = ImageDimensions(0, 0),
- FittingMode::Type fittingMode = FittingMode::DEFAULT,
- SamplingMode::Type samplingMode = SamplingMode::BOX_THEN_LINEAR ,
- bool orientationCorrection = true );
+ ImageDimensions size = ImageDimensions(0, 0),
+ FittingMode::Type fittingMode = FittingMode::DEFAULT,
+ SamplingMode::Type samplingMode = SamplingMode::BOX_THEN_LINEAR,
+ bool orientationCorrection = true);
/**
* @brief Get the size of an original image
*/
DALI_ADAPTOR_API Devel::PixelBuffer DownloadImageSynchronously(
const std::string& url,
- ImageDimensions size = ImageDimensions( 0, 0 ),
- FittingMode::Type fittingMode = FittingMode::DEFAULT,
- SamplingMode::Type samplingMode = SamplingMode::BOX_THEN_LINEAR,
- bool orientationCorrection = true );
+ ImageDimensions size = ImageDimensions(0, 0),
+ FittingMode::Type fittingMode = FittingMode::DEFAULT,
+ SamplingMode::Type samplingMode = SamplingMode::BOX_THEN_LINEAR,
+ bool orientationCorrection = true);
/**
* @brief get the maximum texture size.
*/
DALI_ADAPTOR_API unsigned int GetMaxTextureSize();
-} // Dali
+} // namespace Dali
#endif // DALI_IMAGE_LOADING_H
/*
- * Copyright (c) 2018 Samsung Electronics Co., Ltd.
+ * Copyright (c) 2020 Samsung Electronics Co., Ltd.
*
* Licensed under the Apache License, Version 2.0 (the "License");
* you may not use this file except in compliance with the License.
namespace Dali
{
-
InputMethodContext::InputMethodContext() = default;
InputMethodContext::~InputMethodContext() = default;
InputMethodContext InputMethodContext::New()
{
- return InputMethodContext::New( Actor() );
+ return InputMethodContext::New(Actor());
}
-InputMethodContext InputMethodContext::New( Actor actor )
+InputMethodContext InputMethodContext::New(Actor actor)
{
- Internal::Adaptor::InputMethodContextPtr inputMethodContext = Internal::Adaptor::InputMethodContext::New( actor );
+ Internal::Adaptor::InputMethodContextPtr inputMethodContext = Internal::Adaptor::InputMethodContext::New(actor);
- if( inputMethodContext )
+ if(inputMethodContext)
{
inputMethodContext->Initialize();
}
- return InputMethodContext( inputMethodContext.Get() );
+ return InputMethodContext(inputMethodContext.Get());
}
-InputMethodContext::InputMethodContext( const InputMethodContext& inputMethodContext )
-: BaseHandle( inputMethodContext )
+InputMethodContext::InputMethodContext(const InputMethodContext& inputMethodContext)
+: BaseHandle(inputMethodContext)
{
}
-InputMethodContext& InputMethodContext::operator=( const InputMethodContext& inputMethodContext )
+InputMethodContext& InputMethodContext::operator=(const InputMethodContext& inputMethodContext)
{
- if( *this != inputMethodContext )
- {
- BaseHandle::operator=( inputMethodContext );
- }
- return *this;
+ if(*this != inputMethodContext)
+ {
+ BaseHandle::operator=(inputMethodContext);
+ }
+ return *this;
}
-InputMethodContext InputMethodContext::DownCast( BaseHandle handle )
+InputMethodContext InputMethodContext::DownCast(BaseHandle handle)
{
- return InputMethodContext( dynamic_cast< Internal::Adaptor::InputMethodContext* >( handle.GetObjectPtr() ) );
+ return InputMethodContext(dynamic_cast<Internal::Adaptor::InputMethodContext*>(handle.GetObjectPtr()));
}
void InputMethodContext::Finalize()
return Internal::Adaptor::InputMethodContext::GetImplementation(*this).RestoreAfterFocusLost();
}
-void InputMethodContext::SetRestoreAfterFocusLost( bool toggle )
+void InputMethodContext::SetRestoreAfterFocusLost(bool toggle)
{
- Internal::Adaptor::InputMethodContext::GetImplementation(*this).SetRestoreAfterFocusLost( toggle );
+ Internal::Adaptor::InputMethodContext::GetImplementation(*this).SetRestoreAfterFocusLost(toggle);
}
void InputMethodContext::Reset()
Internal::Adaptor::InputMethodContext::GetImplementation(*this).NotifyCursorPosition();
}
-void InputMethodContext::SetCursorPosition( unsigned int SetCursorPosition )
+void InputMethodContext::SetCursorPosition(unsigned int SetCursorPosition)
{
- Internal::Adaptor::InputMethodContext::GetImplementation(*this).SetCursorPosition( SetCursorPosition );
+ Internal::Adaptor::InputMethodContext::GetImplementation(*this).SetCursorPosition(SetCursorPosition);
}
unsigned int InputMethodContext::GetCursorPosition() const
return Internal::Adaptor::InputMethodContext::GetImplementation(*this).GetCursorPosition();
}
-void InputMethodContext::SetSurroundingText( const std::string& text )
+void InputMethodContext::SetSurroundingText(const std::string& text)
{
- Internal::Adaptor::InputMethodContext::GetImplementation(*this).SetSurroundingText( text );
+ Internal::Adaptor::InputMethodContext::GetImplementation(*this).SetSurroundingText(text);
}
const std::string& InputMethodContext::GetSurroundingText() const
return Internal::Adaptor::InputMethodContext::GetImplementation(*this).GetSurroundingText();
}
-void InputMethodContext::NotifyTextInputMultiLine( bool multiLine )
+void InputMethodContext::NotifyTextInputMultiLine(bool multiLine)
{
- Internal::Adaptor::InputMethodContext::GetImplementation(*this).NotifyTextInputMultiLine( multiLine );
+ Internal::Adaptor::InputMethodContext::GetImplementation(*this).NotifyTextInputMultiLine(multiLine);
}
InputMethodContext::TextDirection InputMethodContext::GetTextDirection()
return Internal::Adaptor::InputMethodContext::GetImplementation(*this).GetInputMethodArea();
}
-void InputMethodContext::ApplyOptions( const InputMethodOptions& options )
+void InputMethodContext::ApplyOptions(const InputMethodOptions& options)
{
- Internal::Adaptor::InputMethodContext::GetImplementation(*this).ApplyOptions( options );
+ Internal::Adaptor::InputMethodContext::GetImplementation(*this).ApplyOptions(options);
}
-void InputMethodContext::SetInputPanelData( const std::string& data )
+void InputMethodContext::SetInputPanelData(const std::string& data)
{
- Internal::Adaptor::InputMethodContext::GetImplementation(*this).SetInputPanelData( data );
+ Internal::Adaptor::InputMethodContext::GetImplementation(*this).SetInputPanelData(data);
}
-void InputMethodContext::GetInputPanelData( std::string& data )
+void InputMethodContext::GetInputPanelData(std::string& data)
{
- Internal::Adaptor::InputMethodContext::GetImplementation(*this).GetInputPanelData( data );
+ Internal::Adaptor::InputMethodContext::GetImplementation(*this).GetInputPanelData(data);
}
Dali::InputMethodContext::State InputMethodContext::GetInputPanelState()
return Internal::Adaptor::InputMethodContext::GetImplementation(*this).GetInputPanelState();
}
-void InputMethodContext::SetReturnKeyState( bool visible )
+void InputMethodContext::SetReturnKeyState(bool visible)
{
- Internal::Adaptor::InputMethodContext::GetImplementation(*this).SetReturnKeyState( visible );
+ Internal::Adaptor::InputMethodContext::GetImplementation(*this).SetReturnKeyState(visible);
}
-void InputMethodContext::AutoEnableInputPanel( bool enabled )
+void InputMethodContext::AutoEnableInputPanel(bool enabled)
{
- Internal::Adaptor::InputMethodContext::GetImplementation(*this).AutoEnableInputPanel( enabled );
+ Internal::Adaptor::InputMethodContext::GetImplementation(*this).AutoEnableInputPanel(enabled);
}
void InputMethodContext::ShowInputPanel()
return Internal::Adaptor::InputMethodContext::GetImplementation(*this).GetInputPanelLocale();
}
-void InputMethodContext::SetContentMIMETypes( const std::string& mimeTypes )
+void InputMethodContext::SetContentMIMETypes(const std::string& mimeTypes)
{
- Internal::Adaptor::InputMethodContext::GetImplementation(*this).SetContentMIMETypes( mimeTypes );
+ Internal::Adaptor::InputMethodContext::GetImplementation(*this).SetContentMIMETypes(mimeTypes);
}
-bool InputMethodContext::FilterEventKey( const Dali::KeyEvent& keyEvent )
+bool InputMethodContext::FilterEventKey(const Dali::KeyEvent& keyEvent)
{
- return Internal::Adaptor::InputMethodContext::GetImplementation(*this).FilterEventKey( keyEvent );
+ return Internal::Adaptor::InputMethodContext::GetImplementation(*this).FilterEventKey(keyEvent);
}
-void InputMethodContext::AllowTextPrediction( bool prediction )
+void InputMethodContext::AllowTextPrediction(bool prediction)
{
- Internal::Adaptor::InputMethodContext::GetImplementation(*this).AllowTextPrediction( prediction );
+ Internal::Adaptor::InputMethodContext::GetImplementation(*this).AllowTextPrediction(prediction);
}
bool InputMethodContext::IsTextPredictionAllowed() const
return Internal::Adaptor::InputMethodContext::GetImplementation(*this).IsTextPredictionAllowed();
}
-void InputMethodContext::SetInputPanelLanguage( Dali::InputMethodContext::InputPanelLanguage language )
+void InputMethodContext::SetInputPanelLanguage(Dali::InputMethodContext::InputPanelLanguage language)
{
- Internal::Adaptor::InputMethodContext::GetImplementation(*this).SetInputPanelLanguage( language );
+ Internal::Adaptor::InputMethodContext::GetImplementation(*this).SetInputPanelLanguage(language);
}
Dali::InputMethodContext::InputPanelLanguage InputMethodContext::GetInputPanelLanguage() const
return Internal::Adaptor::InputMethodContext::GetImplementation(*this).GetInputPanelLanguage();
}
-void InputMethodContext::SetInputPanelPosition( unsigned int x, unsigned int y )
+void InputMethodContext::SetInputPanelPosition(unsigned int x, unsigned int y)
{
- Internal::Adaptor::InputMethodContext::GetImplementation(*this).SetInputPanelPosition( x, y );
+ Internal::Adaptor::InputMethodContext::GetImplementation(*this).SetInputPanelPosition(x, y);
}
-void InputMethodContext::GetPreeditStyle( PreEditAttributeDataContainer& attrs ) const
+void InputMethodContext::GetPreeditStyle(PreEditAttributeDataContainer& attrs) const
{
- Internal::Adaptor::InputMethodContext::GetImplementation(*this).GetPreeditStyle( attrs );
+ Internal::Adaptor::InputMethodContext::GetImplementation(*this).GetPreeditStyle(attrs);
}
// Signals
return Internal::Adaptor::InputMethodContext::GetImplementation(*this).ContentReceivedSignal();
}
-InputMethodContext::InputMethodContext(Internal::Adaptor::InputMethodContext *impl)
- : BaseHandle(impl)
+InputMethodContext::InputMethodContext(Internal::Adaptor::InputMethodContext* impl)
+: BaseHandle(impl)
{
}
} // namespace Dali
#define DALI_INPUT_METHOD_CONTEXT_H
/*
- * Copyright (c) 2019 Samsung Electronics Co., Ltd.
+ * Copyright (c) 2020 Samsung Electronics Co., Ltd.
*
* Licensed under the Apache License, Version 2.0 (the "License");
* you may not use this file except in compliance with the License.
*/
// EXTERNAL INCLUDES
-#include <dali/public-api/events/key-event.h>
#include <dali/public-api/common/dali-vector.h>
+#include <dali/public-api/events/key-event.h>
// EXTERNAL INCLUDES
+#include <dali/devel-api/adaptor-framework/input-method-options.h>
#include <dali/public-api/object/base-handle.h>
#include <dali/public-api/signals/dali-signal.h>
-#include <dali/devel-api/adaptor-framework/input-method-options.h>
namespace Dali
{
-
namespace Internal DALI_INTERNAL
{
namespace Adaptor
{
class InputMethodContext;
}
-}
+} // namespace DALI_INTERNAL
class Actor;
class DALI_ADAPTOR_API InputMethodContext : public BaseHandle
{
public:
-
/**
* @brief The direction of text.
*/
*/
enum EventType
{
- VOID, ///< No event
- PRE_EDIT, ///< Pre-Edit changed
- COMMIT, ///< Commit recieved
- DELETE_SURROUNDING, ///< Event to delete a range of characters from the string
- GET_SURROUNDING, ///< Event to query string and cursor position
- PRIVATE_COMMAND ///< Private command sent from the input panel
+ VOID, ///< No event
+ PRE_EDIT, ///< Pre-Edit changed
+ COMMIT, ///< Commit recieved
+ DELETE_SURROUNDING, ///< Event to delete a range of characters from the string
+ GET_SURROUNDING, ///< Event to query string and cursor position
+ PRIVATE_COMMAND ///< Private command sent from the input panel
};
/**
*/
enum State
{
- DEFAULT = 0, ///< Unknown state
- SHOW, ///< Input panel is shown
- HIDE, ///< Input panel is hidden
- WILL_SHOW ///< Input panel in process of being shown
+ DEFAULT = 0, ///< Unknown state
+ SHOW, ///< Input panel is shown
+ HIDE, ///< Input panel is hidden
+ WILL_SHOW ///< Input panel in process of being shown
};
/**
*/
enum KeyboardType
{
- SOFTWARE_KEYBOARD, ///< Software keyboard (Virtual keyboard) is default
- HARDWARE_KEYBOARD ///< Hardware keyboard
+ SOFTWARE_KEYBOARD, ///< Software keyboard (Virtual keyboard) is default
+ HARDWARE_KEYBOARD ///< Hardware keyboard
};
/**
*/
enum class InputPanelLanguage
{
- AUTOMATIC, ///< IME Language automatically set depending on the system display
- ALPHABET ///< Latin alphabet at all times
+ AUTOMATIC, ///< IME Language automatically set depending on the system display
+ ALPHABET ///< Latin alphabet at all times
};
/**
struct PreeditAttributeData
{
PreeditAttributeData()
- : preeditType( PreeditStyle::NONE ),
- startIndex( 0 ),
- endIndex( 0 )
+ : preeditType(PreeditStyle::NONE),
+ startIndex(0),
+ endIndex(0)
{
}
- PreeditStyle preeditType; /// The preedit style type
- unsigned int startIndex; /// The start index of preedit
- unsigned int endIndex; /// The end index of preedit
+ PreeditStyle preeditType; /// The preedit style type
+ unsigned int startIndex; /// The start index of preedit
+ unsigned int endIndex; /// The end index of preedit
};
/**
*/
EventData()
: predictiveString(),
- eventName( VOID ),
- cursorOffset( 0 ),
- numberOfChars ( 0 )
- {
- };
+ eventName(VOID),
+ cursorOffset(0),
+ numberOfChars(0){};
/**
* @brief Constructor
* @param[in] aCursorOffset Start position from the current cursor position to start deleting characters.
* @param[in] aNumberOfChars The number of characters to delete from the cursorOffset.
*/
- EventData( EventType aEventName, const std::string& aPredictiveString, int aCursorOffset, int aNumberOfChars )
- : predictiveString( aPredictiveString ),
- eventName( aEventName ),
- cursorOffset( aCursorOffset ),
- numberOfChars( aNumberOfChars )
+ EventData(EventType aEventName, const std::string& aPredictiveString, int aCursorOffset, int aNumberOfChars)
+ : predictiveString(aPredictiveString),
+ eventName(aEventName),
+ cursorOffset(aCursorOffset),
+ numberOfChars(aNumberOfChars)
{
}
// Data
std::string predictiveString; ///< The pre-edit or commit string.
- EventType eventName; ///< The name of the event from the InputMethodContext.
- int cursorOffset; ///< Start position from the current cursor position to start deleting characters.
- int numberOfChars; ///< number of characters to delete from the cursorOffset.
+ EventType eventName; ///< The name of the event from the InputMethodContext.
+ int cursorOffset; ///< Start position from the current cursor position to start deleting characters.
+ int numberOfChars; ///< number of characters to delete from the cursorOffset.
};
/**
*/
CallbackData()
: currentText(),
- cursorPosition( 0 ),
- update( false ),
- preeditResetRequired( false )
+ cursorPosition(0),
+ update(false),
+ preeditResetRequired(false)
{
}
* @param[in] aCurrentText current text string
* @param[in] aPreeditResetRequired flag if preedit reset is required.
*/
- CallbackData( bool aUpdate, int aCursorPosition, const std::string& aCurrentText, bool aPreeditResetRequired )
- : currentText( aCurrentText ),
- cursorPosition( aCursorPosition ),
- update( aUpdate ),
- preeditResetRequired( aPreeditResetRequired )
+ CallbackData(bool aUpdate, int aCursorPosition, const std::string& aCurrentText, bool aPreeditResetRequired)
+ : currentText(aCurrentText),
+ cursorPosition(aCursorPosition),
+ update(aUpdate),
+ preeditResetRequired(aPreeditResetRequired)
{
}
- std::string currentText; ///< current text string
- int cursorPosition; ///< new position of cursor
- bool update :1; ///< if cursor position needs to be updated
- bool preeditResetRequired :1; ///< flag if preedit reset is required.
+ std::string currentText; ///< current text string
+ int cursorPosition; ///< new position of cursor
+ bool update : 1; ///< if cursor position needs to be updated
+ bool preeditResetRequired : 1; ///< flag if preedit reset is required.
};
- typedef Signal< void (InputMethodContext&) > ActivatedSignalType; ///< Keyboard actived signal
- typedef Signal< CallbackData ( InputMethodContext&, const EventData& ) > KeyboardEventSignalType; ///< keyboard events
- typedef Signal< void () > VoidSignalType;
- typedef Signal< void ( bool ) > StatusSignalType;
- typedef Signal< void ( KeyboardType ) > KeyboardTypeSignalType; ///< keyboard type
- typedef Signal< void ( int ) > KeyboardResizedSignalType; ///< Keyboard resized signal
- typedef Signal< void ( int ) > LanguageChangedSignalType; ///< Language changed signal
- typedef Signal< void ( const std::string&, const std::string&, const std::string& ) > ContentReceivedSignalType; ///< Content received signal
+ typedef Signal<void(InputMethodContext&)> ActivatedSignalType; ///< Keyboard actived signal
+ typedef Signal<CallbackData(InputMethodContext&, const EventData&)> KeyboardEventSignalType; ///< keyboard events
+ typedef Signal<void()> VoidSignalType;
+ typedef Signal<void(bool)> StatusSignalType;
+ typedef Signal<void(KeyboardType)> KeyboardTypeSignalType; ///< keyboard type
+ typedef Signal<void(int)> KeyboardResizedSignalType; ///< Keyboard resized signal
+ typedef Signal<void(int)> LanguageChangedSignalType; ///< Language changed signal
+ typedef Signal<void(const std::string&, const std::string&, const std::string&)> ContentReceivedSignalType; ///< Content received signal
- using PreEditAttributeDataContainer = Vector< Dali::InputMethodContext::PreeditAttributeData >;
+ using PreEditAttributeDataContainer = Vector<Dali::InputMethodContext::PreeditAttributeData>;
public:
-
/**
* @brief Retrieve a handle to the instance of InputMethodContext.
* @return A handle to the InputMethodContext.
*
* @param[in] actor The actor that uses the new InputMethodContext instance.
*/
- static InputMethodContext New( Actor actor );
+ static InputMethodContext New(Actor actor);
/**
* @brief Copy constructor.
*
* @param[in] inputMethodContext InputMethodContext to copy. The copied inputMethodContext will point at the same implementation.
*/
- InputMethodContext( const InputMethodContext& inputMethodContext );
+ InputMethodContext(const InputMethodContext& inputMethodContext);
/**
* @brief Assignment operator.
* @param[in] inputMethodContext The InputMethodContext to assign from.
* @return The updated InputMethodContext.
*/
- InputMethodContext& operator=( const InputMethodContext& inputMethodContext );
+ InputMethodContext& operator=(const InputMethodContext& inputMethodContext);
/**
* @brief Downcast a handle to InputMethodContext handle.
* @param[in] handle Handle to an object.
* @return Handle to an InputMethodContext or an uninitialized handle.
*/
- static InputMethodContext DownCast( BaseHandle handle );
+ static InputMethodContext DownCast(BaseHandle handle);
public:
-
/**
* @brief Finalize the InputMethodContext.
*
*
* @param[in] toggle True means that keyboard should be restored after focus lost and regained.
*/
- void SetRestoreAfterFocusLost( bool toggle );
+ void SetRestoreAfterFocusLost(bool toggle);
/**
* @brief Send message reset the pred-edit state / InputMethodContext module.
*
* @param[in] cursorPosition position of cursor
*/
- void SetCursorPosition( unsigned int cursorPosition );
+ void SetCursorPosition(unsigned int cursorPosition);
/**
* @brief Gets cursor position stored in VirtualKeyboard, this is required by the InputMethodContext.
*
* @param[in] text The text string surrounding the current cursor point.
*/
- void SetSurroundingText( const std::string& text );
+ void SetSurroundingText(const std::string& text);
/**
* @brief Gets current text string set within the InputMethodContext manager, this is used to offer predictive suggestions.
*
* @param[in] multiLine True if multiline text input is used
*/
- void NotifyTextInputMultiLine( bool multiLine );
+ void NotifyTextInputMultiLine(bool multiLine);
/**
* @brief Returns text direction of the keyboard's current input language.
* @brief Set one or more of the Input Method options
* @param[in] options The options to be applied
*/
- void ApplyOptions( const InputMethodOptions& options );
+ void ApplyOptions(const InputMethodOptions& options);
/**
* @brief Sets up the input-panel specific data.
* @param[in] data The specific data to be set to the input panel
*/
- void SetInputPanelData( const std::string& data );
+ void SetInputPanelData(const std::string& data);
/**
* @brief Gets the specific data of the current active input panel.
* It is just used to get a specific data from the input panel to an application.
* @param[in] data The specific data to be got from the input panel
*/
- void GetInputPanelData( std::string& data );
+ void GetInputPanelData(std::string& data);
/**
* @brief Gets the state of the current active input panel.
* The default is true.
* @param[in] visible True if the return key is visible(enabled), false otherwise.
*/
- void SetReturnKeyState( bool visible );
+ void SetReturnKeyState(bool visible);
/**
* @brief Enable to show the input panel automatically when focused.
* @param[in] enabled If true, the input panel will be shown when focused
*/
- void AutoEnableInputPanel( bool enabled );
+ void AutoEnableInputPanel(bool enabled);
/**
* @brief Shows the input panel.
* You can receive a media content URI and its MIME type from ContentReceivedSignal(). @see ContentReceivedSignal
* @param[in] mimeTypes The allowed MIME types
*/
- void SetContentMIMETypes( const std::string& mimeTypes );
+ void SetContentMIMETypes(const std::string& mimeTypes);
/**
* @brief Process event key down or up, whether filter a key to isf.
* @param[in] keyEvent The event key to be handled.
* @return Whether the event key is handled.
*/
- bool FilterEventKey( const Dali::KeyEvent& keyEvent );
+ bool FilterEventKey(const Dali::KeyEvent& keyEvent);
/**
* @brief Sets whether the IM context should allow to use the text prediction.
*
* @param[in] prediction Whether to allow text prediction or not.
*/
- void AllowTextPrediction( bool prediction );
+ void AllowTextPrediction(bool prediction);
/**
* @brief Gets whether the IM context allow to use the text prediction.
* This method can be used when you want to show the English keyboard.
* @param[in] language The language to be set to the input panel
*/
- void SetInputPanelLanguage( InputPanelLanguage language );
+ void SetInputPanelLanguage(InputPanelLanguage language);
/**
* @brief Gets the language of the input panel.
* @param[in] x The top-left x coordinate of the input panel
* @param[in] y The top-left y coordinate of the input panel
*/
- void SetInputPanelPosition( unsigned int x, unsigned int y );
+ void SetInputPanelPosition(unsigned int x, unsigned int y);
/**
* @brief Gets the preedit attributes data.
*
* @param[out] attrs The preedit attributes data.
*/
- void GetPreeditStyle( PreEditAttributeDataContainer& attrs ) const;
+ void GetPreeditStyle(PreEditAttributeDataContainer& attrs) const;
public:
-
// Signals
/**
ContentReceivedSignalType& ContentReceivedSignal();
public:
-
/**
* @brief This constructor is used by InputMethodContext::New().
*
* @param[in] inputMethodContext A pointer to the InputMethodContext.
*/
- explicit DALI_INTERNAL InputMethodContext( Internal::Adaptor::InputMethodContext* inputMethodContext );
-
+ explicit DALI_INTERNAL InputMethodContext(Internal::Adaptor::InputMethodContext* inputMethodContext);
};
-
-
} // namespace Dali
#endif // DALI_INPUT_METHOD_CONTEXT_H
/*
- * Copyright (c) 2018 Samsung Electronics Co., Ltd.
+ * Copyright (c) 2020 Samsung Electronics Co., Ltd.
*
* Licensed under the Apache License, Version 2.0 (the "License");
* you may not use this file except in compliance with the License.
namespace Dali
{
-
#define TOKEN_STRING(x) #x
struct InputMethodOptions::Impl
{
Impl()
{
- mPanelLayout = PanelLayout::NORMAL;
- mAutoCapital = AutoCapital::SENTENCE;
+ mPanelLayout = PanelLayout::NORMAL;
+ mAutoCapital = AutoCapital::SENTENCE;
mButtonAction = ButtonAction::DEFAULT;
- mVariation = NormalLayout::NORMAL;
+ mVariation = NormalLayout::NORMAL;
}
- PanelLayout::Type mPanelLayout;
- AutoCapital::Type mAutoCapital;
+ PanelLayout::Type mPanelLayout;
+ AutoCapital::Type mAutoCapital;
ButtonAction::Type mButtonAction;
- int mVariation:4;
+ int mVariation : 4;
};
InputMethodOptions::InputMethodOptions()
return (mImpl->mPanelLayout == Dali::InputMethod::PanelLayout::PASSWORD);
}
-void InputMethodOptions::ApplyProperty( const Property::Map& settings )
+void InputMethodOptions::ApplyProperty(const Property::Map& settings)
{
- for ( unsigned int i = 0, count = settings.Count(); i < count; ++i )
+ for(unsigned int i = 0, count = settings.Count(); i < count; ++i)
{
- Property::Key key = settings.GetKeyAt( i );
- if( key.type == Property::Key::INDEX )
+ Property::Key key = settings.GetKeyAt(i);
+ if(key.type == Property::Key::INDEX)
{
continue;
}
Property::Value item = settings.GetValue(i);
- if( key == TOKEN_STRING( PANEL_LAYOUT ) )
+ if(key == TOKEN_STRING(PANEL_LAYOUT))
{
- if( item.GetType() == Property::INTEGER )
+ if(item.GetType() == Property::INTEGER)
{
- int value = item.Get< int >();
+ int value = item.Get<int>();
mImpl->mPanelLayout = static_cast<InputMethod::PanelLayout::Type>(value);
}
}
- else if ( key == TOKEN_STRING( BUTTON_ACTION ) )
+ else if(key == TOKEN_STRING(BUTTON_ACTION))
{
- if ( item.GetType() == Property::INTEGER )
+ if(item.GetType() == Property::INTEGER)
{
- int value = item.Get< int >();
+ int value = item.Get<int>();
mImpl->mButtonAction = static_cast<InputMethod::ButtonAction::Type>(value);
}
}
- else if ( key == TOKEN_STRING( AUTO_CAPITALIZE ) )
+ else if(key == TOKEN_STRING(AUTO_CAPITALIZE))
{
- if ( item.GetType() == Property::INTEGER )
+ if(item.GetType() == Property::INTEGER)
{
- int value = item.Get< int >();
+ int value = item.Get<int>();
mImpl->mAutoCapital = static_cast<InputMethod::AutoCapital::Type>(value);
}
}
- else if( key == TOKEN_STRING( VARIATION ) )
+ else if(key == TOKEN_STRING(VARIATION))
{
- if( item.GetType() == Property::INTEGER )
+ if(item.GetType() == Property::INTEGER)
{
- int value = item.Get< int >();
+ int value = item.Get<int>();
mImpl->mVariation = value;
}
}
}
}
-void InputMethodOptions::RetrieveProperty( Property::Map& settings )
+void InputMethodOptions::RetrieveProperty(Property::Map& settings)
{
- settings[TOKEN_STRING( PANEL_LAYOUT )] = mImpl->mPanelLayout;
- settings[TOKEN_STRING( BUTTON_ACTION )] = mImpl->mButtonAction;
- settings[TOKEN_STRING( AUTO_CAPITALIZE )] = mImpl->mAutoCapital;
- settings[TOKEN_STRING( VARIATION )] = mImpl->mVariation;
+ settings[TOKEN_STRING(PANEL_LAYOUT)] = mImpl->mPanelLayout;
+ settings[TOKEN_STRING(BUTTON_ACTION)] = mImpl->mButtonAction;
+ settings[TOKEN_STRING(AUTO_CAPITALIZE)] = mImpl->mAutoCapital;
+ settings[TOKEN_STRING(VARIATION)] = mImpl->mVariation;
}
-bool InputMethodOptions::CompareAndSet( InputMethod::Category::Type type, const InputMethodOptions& options, int& index)
+bool InputMethodOptions::CompareAndSet(InputMethod::Category::Type type, const InputMethodOptions& options, int& index)
{
bool updated = false;
- switch (type)
+ switch(type)
{
case PANEL_LAYOUT:
{
- if ( options.mImpl->mPanelLayout != mImpl->mPanelLayout )
+ if(options.mImpl->mPanelLayout != mImpl->mPanelLayout)
{
mImpl->mPanelLayout = options.mImpl->mPanelLayout;
- index = static_cast<int>(mImpl->mPanelLayout);
- updated = true;
+ index = static_cast<int>(mImpl->mPanelLayout);
+ updated = true;
}
break;
}
case BUTTON_ACTION:
{
- if ( options.mImpl->mButtonAction != mImpl->mButtonAction )
+ if(options.mImpl->mButtonAction != mImpl->mButtonAction)
{
mImpl->mButtonAction = options.mImpl->mButtonAction;
- index = static_cast<int>(mImpl->mButtonAction);
- updated = true;
+ index = static_cast<int>(mImpl->mButtonAction);
+ updated = true;
}
break;
}
case AUTO_CAPITALIZE:
{
- if ( options.mImpl->mAutoCapital != mImpl->mAutoCapital )
+ if(options.mImpl->mAutoCapital != mImpl->mAutoCapital)
{
mImpl->mAutoCapital = options.mImpl->mAutoCapital;
- index = static_cast<int>(mImpl->mAutoCapital);
- updated = true;
+ index = static_cast<int>(mImpl->mAutoCapital);
+ updated = true;
}
break;
}
case VARIATION:
{
- if ( options.mImpl->mVariation != mImpl->mVariation )
+ if(options.mImpl->mVariation != mImpl->mVariation)
{
mImpl->mVariation = options.mImpl->mVariation;
- index = static_cast<int>(mImpl->mVariation);
- updated = true;
+ index = static_cast<int>(mImpl->mVariation);
+ updated = true;
}
break;
}
#define DALI_VIRTUAL_KEYBOARD_OPTIONS_H
/*
- * Copyright (c) 2019 Samsung Electronics Co., Ltd.
+ * Copyright (c) 2020 Samsung Electronics Co., Ltd.
*
* Licensed under the Apache License, Version 2.0 (the "License");
* you may not use this file except in compliance with the License.
namespace Dali
{
-
/**
* Class to handle the Input Method options
*/
class DALI_ADAPTOR_API InputMethodOptions
{
public:
-
/**
* Constructor
*/
- InputMethodOptions(); /// Default InputMethodOptions options
+ InputMethodOptions(); /// Default InputMethodOptions options
/**
* Destructor
* @brief Apply property map to attribute class, this class will keep the virtualKeyboard settings.
* @param[in] settings The property map to be applied
*/
- void ApplyProperty( const Property::Map& settings );
+ void ApplyProperty(const Property::Map& settings);
/**
* @brief Retrieve property map from current option
* @param[out] settings The converted property map
*/
- void RetrieveProperty( Property::Map& settings );
+ void RetrieveProperty(Property::Map& settings);
public: // Intended for internal use
/**
* @param[out] index The updated index after applying source option
* @return true if the value of this option is updated by source option
*/
- DALI_INTERNAL bool CompareAndSet( InputMethod::Category::Type type, const InputMethodOptions& options, int& index );
+ DALI_INTERNAL bool CompareAndSet(InputMethod::Category::Type type, const InputMethodOptions& options, int& index);
private:
-
struct Impl;
std::unique_ptr<Impl> mImpl;
};
/*
- * Copyright (c) 2019 Samsung Electronics Co., Ltd.
+ * Copyright (c) 2020 Samsung Electronics Co., Ltd.
*
* Licensed under the Apache License, Version 2.0 (the "License");
* you may not use this file except in compliance with the License.
namespace Dali
{
-
namespace DevelKey
{
-
-int GetDaliKeyCode( const char* keyName )
+int GetDaliKeyCode(const char* keyName)
{
- return Internal::Adaptor::KeyLookup::GetDaliKeyCode( keyName );
+ return Internal::Adaptor::KeyLookup::GetDaliKeyCode(keyName);
}
} // namespace DevelKey
#define DALI_KEY_DEVEL_H
/*
- * Copyright (c) 2017 Samsung Electronics Co., Ltd.
+ * Copyright (c) 2020 Samsung Electronics Co., Ltd.
*
* Licensed under the Apache License, Version 2.0 (the "License");
* you may not use this file except in compliance with the License.
namespace Dali
{
-
namespace DevelKey
{
-
enum Key
{
- DALI_KEY_INVALID = Dali::DALI_KEY_INVALID,
- DALI_KEY_ESCAPE = Dali::DALI_KEY_ESCAPE,
- DALI_KEY_BACKSPACE = Dali::DALI_KEY_BACKSPACE,
- DALI_KEY_SHIFT_LEFT = Dali::DALI_KEY_SHIFT_LEFT,
- DALI_KEY_SHIFT_RIGHT = Dali::DALI_KEY_SHIFT_RIGHT,
- DALI_KEY_CURSOR_UP = Dali::DALI_KEY_CURSOR_UP,
- DALI_KEY_CURSOR_LEFT = Dali::DALI_KEY_CURSOR_LEFT,
- DALI_KEY_CURSOR_RIGHT = Dali::DALI_KEY_CURSOR_RIGHT,
- DALI_KEY_CURSOR_DOWN = Dali::DALI_KEY_CURSOR_DOWN,
- DALI_KEY_BACK = Dali::DALI_KEY_BACK,
- DALI_KEY_CAMERA = Dali::DALI_KEY_CAMERA,
- DALI_KEY_CONFIG = Dali::DALI_KEY_CONFIG,
- DALI_KEY_POWER = Dali::DALI_KEY_POWER,
- DALI_KEY_PAUSE = Dali::DALI_KEY_PAUSE,
- DALI_KEY_CANCEL = Dali::DALI_KEY_CANCEL,
- DALI_KEY_PLAY_CD = Dali::DALI_KEY_PLAY_CD,
- DALI_KEY_STOP_CD = Dali::DALI_KEY_STOP_CD,
- DALI_KEY_PAUSE_CD = Dali::DALI_KEY_PAUSE_CD,
- DALI_KEY_NEXT_SONG = Dali::DALI_KEY_NEXT_SONG,
- DALI_KEY_PREVIOUS_SONG = Dali::DALI_KEY_PREVIOUS_SONG,
- DALI_KEY_REWIND = Dali::DALI_KEY_REWIND,
- DALI_KEY_FASTFORWARD = Dali::DALI_KEY_FASTFORWARD,
- DALI_KEY_MEDIA = Dali::DALI_KEY_MEDIA,
- DALI_KEY_PLAY_PAUSE = Dali::DALI_KEY_PLAY_PAUSE,
- DALI_KEY_MUTE = Dali::DALI_KEY_MUTE,
- DALI_KEY_MENU = Dali::DALI_KEY_MENU,
- DALI_KEY_HOME = Dali::DALI_KEY_HOME,
- DALI_KEY_HOMEPAGE = Dali::DALI_KEY_HOMEPAGE,
- DALI_KEY_WEBPAGE = Dali::DALI_KEY_WEBPAGE,
- DALI_KEY_MAIL = Dali::DALI_KEY_MAIL,
- DALI_KEY_SCREENSAVER = Dali::DALI_KEY_SCREENSAVER,
- DALI_KEY_BRIGHTNESS_UP = Dali::DALI_KEY_BRIGHTNESS_UP,
+ DALI_KEY_INVALID = Dali::DALI_KEY_INVALID,
+ DALI_KEY_ESCAPE = Dali::DALI_KEY_ESCAPE,
+ DALI_KEY_BACKSPACE = Dali::DALI_KEY_BACKSPACE,
+ DALI_KEY_SHIFT_LEFT = Dali::DALI_KEY_SHIFT_LEFT,
+ DALI_KEY_SHIFT_RIGHT = Dali::DALI_KEY_SHIFT_RIGHT,
+ DALI_KEY_CURSOR_UP = Dali::DALI_KEY_CURSOR_UP,
+ DALI_KEY_CURSOR_LEFT = Dali::DALI_KEY_CURSOR_LEFT,
+ DALI_KEY_CURSOR_RIGHT = Dali::DALI_KEY_CURSOR_RIGHT,
+ DALI_KEY_CURSOR_DOWN = Dali::DALI_KEY_CURSOR_DOWN,
+ DALI_KEY_BACK = Dali::DALI_KEY_BACK,
+ DALI_KEY_CAMERA = Dali::DALI_KEY_CAMERA,
+ DALI_KEY_CONFIG = Dali::DALI_KEY_CONFIG,
+ DALI_KEY_POWER = Dali::DALI_KEY_POWER,
+ DALI_KEY_PAUSE = Dali::DALI_KEY_PAUSE,
+ DALI_KEY_CANCEL = Dali::DALI_KEY_CANCEL,
+ DALI_KEY_PLAY_CD = Dali::DALI_KEY_PLAY_CD,
+ DALI_KEY_STOP_CD = Dali::DALI_KEY_STOP_CD,
+ DALI_KEY_PAUSE_CD = Dali::DALI_KEY_PAUSE_CD,
+ DALI_KEY_NEXT_SONG = Dali::DALI_KEY_NEXT_SONG,
+ DALI_KEY_PREVIOUS_SONG = Dali::DALI_KEY_PREVIOUS_SONG,
+ DALI_KEY_REWIND = Dali::DALI_KEY_REWIND,
+ DALI_KEY_FASTFORWARD = Dali::DALI_KEY_FASTFORWARD,
+ DALI_KEY_MEDIA = Dali::DALI_KEY_MEDIA,
+ DALI_KEY_PLAY_PAUSE = Dali::DALI_KEY_PLAY_PAUSE,
+ DALI_KEY_MUTE = Dali::DALI_KEY_MUTE,
+ DALI_KEY_MENU = Dali::DALI_KEY_MENU,
+ DALI_KEY_HOME = Dali::DALI_KEY_HOME,
+ DALI_KEY_HOMEPAGE = Dali::DALI_KEY_HOMEPAGE,
+ DALI_KEY_WEBPAGE = Dali::DALI_KEY_WEBPAGE,
+ DALI_KEY_MAIL = Dali::DALI_KEY_MAIL,
+ DALI_KEY_SCREENSAVER = Dali::DALI_KEY_SCREENSAVER,
+ DALI_KEY_BRIGHTNESS_UP = Dali::DALI_KEY_BRIGHTNESS_UP,
DALI_KEY_BRIGHTNESS_DOWN = Dali::DALI_KEY_BRIGHTNESS_DOWN,
- DALI_KEY_SOFT_KBD = Dali::DALI_KEY_SOFT_KBD,
- DALI_KEY_QUICK_PANEL = Dali::DALI_KEY_QUICK_PANEL,
- DALI_KEY_TASK_SWITCH = Dali::DALI_KEY_TASK_SWITCH,
- DALI_KEY_APPS = Dali::DALI_KEY_APPS,
- DALI_KEY_SEARCH = Dali::DALI_KEY_SEARCH,
- DALI_KEY_VOICE = Dali::DALI_KEY_VOICE,
- DALI_KEY_LANGUAGE = Dali::DALI_KEY_LANGUAGE,
- DALI_KEY_VOLUME_UP = Dali::DALI_KEY_VOLUME_UP,
- DALI_KEY_VOLUME_DOWN = Dali::DALI_KEY_VOLUME_DOWN,
+ DALI_KEY_SOFT_KBD = Dali::DALI_KEY_SOFT_KBD,
+ DALI_KEY_QUICK_PANEL = Dali::DALI_KEY_QUICK_PANEL,
+ DALI_KEY_TASK_SWITCH = Dali::DALI_KEY_TASK_SWITCH,
+ DALI_KEY_APPS = Dali::DALI_KEY_APPS,
+ DALI_KEY_SEARCH = Dali::DALI_KEY_SEARCH,
+ DALI_KEY_VOICE = Dali::DALI_KEY_VOICE,
+ DALI_KEY_LANGUAGE = Dali::DALI_KEY_LANGUAGE,
+ DALI_KEY_VOLUME_UP = Dali::DALI_KEY_VOLUME_UP,
+ DALI_KEY_VOLUME_DOWN = Dali::DALI_KEY_VOLUME_DOWN,
/**
* @brief Delete key.
* @param[in] keyName The key name
* @return The key code. -1 if the daliKey does not exist in the supported key lookup table.
*/
-DALI_ADAPTOR_API int GetDaliKeyCode( const char* keyName );
+DALI_ADAPTOR_API int GetDaliKeyCode(const char* keyName);
} // namespace DevelKey
#define DALI_KEY_EXTENSION_PLUGIN_H
/*
- * Copyright (c) 2019 Samsung Electronics Co., Ltd.
+ * Copyright (c) 2020 Samsung Electronics Co., Ltd.
*
* Licensed under the Apache License, Version 2.0 (the "License");
* you may not use this file except in compliance with the License.
namespace Dali
{
-
/**
* @brief KeyExtensionPlugin is an abstract interface, used by dali-adaptor to access key extension plugin.
* A concrete implementation must be created for each platform and provided as dynamic library.
class KeyExtensionPlugin
{
public:
-
struct KeyLookup
{
- const char* keyName; ///< XF86 key name
- const int daliKeyCode; ///< Dali key code
- const bool deviceButton; ///< Whether the key is from a button on the device
+ const char* keyName; ///< XF86 key name
+ const int daliKeyCode; ///< Dali key code
+ const bool deviceButton; ///< Whether the key is from a button on the device
};
/**
* @brief Constructor.
* @SINCE_1_2.41
*/
- KeyExtensionPlugin(){}
+ KeyExtensionPlugin()
+ {
+ }
/**
* @brief Destructor.
* @SINCE_1_2.41
*/
- virtual ~KeyExtensionPlugin(){}
+ virtual ~KeyExtensionPlugin()
+ {
+ }
/**
* @brief Get extension key lookup table.
virtual std::size_t GetKeyLookupTableCount() = 0;
};
-} // namespace Dali;
+} // namespace Dali
#endif
#define DALI_KEYBOARD_H
/*
- * Copyright (c) 2018 Samsung Electronics Co., Ltd.
+ * Copyright (c) 2020 Samsung Electronics Co., Ltd.
*
* Licensed under the Apache License, Version 2.0 (the "License");
* you may not use this file except in compliance with the License.
*/
namespace Keyboard
{
-
/**
* @brief Sets keyboard repeat information.
*
* @param[in] delay The key repeat delay value in seconds
* @return true if setting the keyboard repeat succeeds
*/
-DALI_ADAPTOR_API bool SetRepeatInfo( float rate, float delay );
-
+DALI_ADAPTOR_API bool SetRepeatInfo(float rate, float delay);
/**
* @brief Gets keyboard repeat information.
* @param[in] delay The key repeat delay value in seconds
* @return true if getting the keyboard repeat succeeds, false otherwise
*/
-DALI_ADAPTOR_API bool GetRepeatInfo( float& rate, float& delay );
+DALI_ADAPTOR_API bool GetRepeatInfo(float& rate, float& delay);
} // namespace Keyboard
namespace Dali
{
-
LifecycleController::LifecycleController()
{
}
LifecycleController& LifecycleController::operator=(const LifecycleController& monitor)
{
- if( *this != monitor )
+ if(*this != monitor)
{
BaseHandle::operator=(monitor);
}
namespace Dali
{
-
namespace Internal DALI_INTERNAL
{
namespace Adaptor
{
class LifecycleController;
}
-}
+} // namespace DALI_INTERNAL
/**
* @brief Provides application lifecycle events.
*/
class DALI_ADAPTOR_API LifecycleController : public BaseHandle
{
-public: // Typedefs
-
- typedef Signal< void (void) > LifecycleSignalType; ///< Lifecycle Signal type
+public: // Typedefs
+ typedef Signal<void(void)> LifecycleSignalType; ///< Lifecycle Signal type
public: // Creation & Destruction
-
/**
* @brief Create an uninitialized LifecycleController handle.
*
~LifecycleController();
public: // Signals
-
/**
* The user should connect to this signal to determine when they should initialise
* their application.
LifecycleSignalType& LanguageChangedSignal();
public: // Operators
-
/**
* @brief Assignment operator.
*
//INTERNAL INCLUDES\r
#include <dali/internal/imaging/common/native-image-source-impl.h>\r
\r
-\r
namespace Dali\r
{\r
-\r
namespace DevelNativeImageSource\r
{\r
-\r
-bool EncodeToFile( NativeImageSource& image, const std::string& filename, const uint32_t quality )\r
+bool EncodeToFile(NativeImageSource& image, const std::string& filename, const uint32_t quality)\r
{\r
- return Dali::Internal::Adaptor::NativeImageSource::GetImplementation( image ).EncodeToFile( filename, quality );\r
+ return Dali::Internal::Adaptor::NativeImageSource::GetImplementation(image).EncodeToFile(filename, quality);\r
}\r
\r
-uint8_t* AcquireBuffer( NativeImageSource& image, uint16_t& width, uint16_t& height, uint16_t& stride )\r
+uint8_t* AcquireBuffer(NativeImageSource& image, uint16_t& width, uint16_t& height, uint16_t& stride)\r
{\r
- return Dali::Internal::Adaptor::NativeImageSource::GetImplementation( image ).AcquireBuffer( width, height, stride );\r
+ return Dali::Internal::Adaptor::NativeImageSource::GetImplementation(image).AcquireBuffer(width, height, stride);\r
}\r
\r
-bool ReleaseBuffer( NativeImageSource& image )\r
+bool ReleaseBuffer(NativeImageSource& image)\r
{\r
- return Dali::Internal::Adaptor::NativeImageSource::GetImplementation( image ).ReleaseBuffer();\r
+ return Dali::Internal::Adaptor::NativeImageSource::GetImplementation(image).ReleaseBuffer();\r
}\r
\r
} // namespace DevelNativeImageSource\r
\r
namespace Dali\r
{\r
-\r
namespace DevelNativeImageSource\r
{\r
-\r
/**\r
* @brief Converts the current pixel contents to either a JPEG or PNG format\r
* and write that to the filesystem.\r
* @param[in] quality The value to control image quality for jpeg file format in the range [1, 100]\r
* @return @c true if the pixels were written, and @c false otherwise\r
*/\r
-DALI_ADAPTOR_API bool EncodeToFile( NativeImageSource& image, const std::string& filename, const uint32_t quality );\r
+DALI_ADAPTOR_API bool EncodeToFile(NativeImageSource& image, const std::string& filename, const uint32_t quality);\r
\r
/**\r
* @brief Acquire buffer and information of an internal native image.\r
* @param[out] stride The stride of image\r
* @return The buffer of an internal native image\r
*/\r
-DALI_ADAPTOR_API uint8_t* AcquireBuffer( NativeImageSource& image, uint16_t& width, uint16_t& height, uint16_t& stride );\r
+DALI_ADAPTOR_API uint8_t* AcquireBuffer(NativeImageSource& image, uint16_t& width, uint16_t& height, uint16_t& stride);\r
\r
/**\r
* @brief Release information of an internal native image.\r
* @param[in] image The instance of NativeImageSource.\r
* @return @c true If the buffer is released successfully, and @c false otherwise\r
*/\r
-DALI_ADAPTOR_API bool ReleaseBuffer( NativeImageSource& image );\r
+DALI_ADAPTOR_API bool ReleaseBuffer(NativeImageSource& image);\r
\r
} // namespace DevelNativeImageSource\r
\r
/*
- * Copyright (c) 2018 Samsung Electronics Co., Ltd.
+ * Copyright (c) 2020 Samsung Electronics Co., Ltd.
*
* Licensed under the Apache License, Version 2.0 (the "License");
* you may not use this file except in compliance with the License.
#include <dali/devel-api/adaptor-framework/native-image-source-queue.h>
// INTERNAL INCLUDES
-#include <dali/internal/imaging/common/native-image-source-queue-impl.h>
#include <dali/internal/imaging/common/native-image-source-factory.h>
+#include <dali/internal/imaging/common/native-image-source-queue-impl.h>
namespace Dali
{
-
-NativeImageSourceQueuePtr NativeImageSourceQueue::New( uint32_t width, uint32_t height, ColorDepth depth )
+NativeImageSourceQueuePtr NativeImageSourceQueue::New(uint32_t width, uint32_t height, ColorDepth depth)
{
- Any empty;
- NativeImageSourceQueuePtr image = new NativeImageSourceQueue( width, height, depth, empty );
- if( image->mImpl )
+ Any empty;
+ NativeImageSourceQueuePtr image = new NativeImageSourceQueue(width, height, depth, empty);
+ if(image->mImpl)
{
return image;
}
return nullptr;
}
-NativeImageSourceQueuePtr NativeImageSourceQueue::New( Any nativeImageSourceQueue )
+NativeImageSourceQueuePtr NativeImageSourceQueue::New(Any nativeImageSourceQueue)
{
- NativeImageSourceQueuePtr image = new NativeImageSourceQueue( 0, 0, COLOR_DEPTH_DEFAULT, nativeImageSourceQueue );
- if( image->mImpl )
+ NativeImageSourceQueuePtr image = new NativeImageSourceQueue(0, 0, COLOR_DEPTH_DEFAULT, nativeImageSourceQueue);
+ if(image->mImpl)
{
return image;
}
return mImpl->GetNativeImageSourceQueue();
}
-void NativeImageSourceQueue::SetSize( uint32_t width, uint32_t height )
+void NativeImageSourceQueue::SetSize(uint32_t width, uint32_t height)
{
- return mImpl->SetSize( width, height );
+ return mImpl->SetSize(width, height);
}
void NativeImageSourceQueue::IgnoreSourceImage()
return mImpl->GetNativeImageInterfaceExtension();
}
-NativeImageSourceQueue::NativeImageSourceQueue( uint32_t width, uint32_t height, ColorDepth depth, Any nativeImageSourceQueue )
+NativeImageSourceQueue::NativeImageSourceQueue(uint32_t width, uint32_t height, ColorDepth depth, Any nativeImageSourceQueue)
{
auto factory = Dali::Internal::Adaptor::GetNativeImageSourceFactory();
- mImpl = factory->CreateNativeImageSourceQueue( width, height, depth, nativeImageSourceQueue );
+ mImpl = factory->CreateNativeImageSourceQueue(width, height, depth, nativeImageSourceQueue);
}
NativeImageSourceQueue::~NativeImageSourceQueue()
#define DALI_NATIVE_IMAGE_SOURCE_QUEUE_H
/*
- * Copyright (c) 2018 Samsung Electronics Co., Ltd.
+ * Copyright (c) 2020 Samsung Electronics Co., Ltd.
*
* Licensed under the Apache License, Version 2.0 (the "License");
* you may not use this file except in compliance with the License.
{
class NativeImageSourceQueue;
}
-}
+} // namespace DALI_INTERNAL
class NativeImageSourceQueue;
/**
* @brief Pointer to Dali::NativeImageSourceQueue.
*/
-typedef Dali::IntrusivePtr< Dali::NativeImageSourceQueue > NativeImageSourceQueuePtr;
+typedef Dali::IntrusivePtr<Dali::NativeImageSourceQueue> NativeImageSourceQueuePtr;
/**
* @brief Used for displaying native images.
class DALI_ADAPTOR_API NativeImageSourceQueue : public NativeImageInterface
{
public:
-
- /**
+ /**
* @brief Enumeration for the instance when creating a native image, the color depth has to be specified.
*/
- enum ColorDepth
- {
- COLOR_DEPTH_DEFAULT, ///< Uses the current screen default depth (recommended)
- COLOR_DEPTH_24, ///< 24 bits per pixel
- COLOR_DEPTH_32 ///< 32 bits per pixel
- };
+ enum ColorDepth
+ {
+ COLOR_DEPTH_DEFAULT, ///< Uses the current screen default depth (recommended)
+ COLOR_DEPTH_24, ///< 24 bits per pixel
+ COLOR_DEPTH_32 ///< 32 bits per pixel
+ };
/**
* @brief Creates a new NativeImageSourceQueue.
* @param[in] depth color depth of the image
* @return A smart-pointer to a newly allocated image
*/
- static NativeImageSourceQueuePtr New( uint32_t width, uint32_t height, ColorDepth depth );
+ static NativeImageSourceQueuePtr New(uint32_t width, uint32_t height, ColorDepth depth);
/**
* @brief Creates a new NativeImageSourceQueue from an existing native image source.
* @return A smart-pointer to a newly allocated image
* @see NativeImageInterface
*/
- static NativeImageSourceQueuePtr New( Any nativeImageSourceQueue );
+ static NativeImageSourceQueuePtr New(Any nativeImageSourceQueue);
/**
* @brief Retrieves the internal native image.
* @param[in] width The width of the image
* @param[in] height The height of the image
*/
- void SetSize( uint32_t width, uint32_t height );
+ void SetSize(uint32_t width, uint32_t height);
/**
* @brief Ignores a source image which is inserted to the queue.
*/
const char* GetCustomSamplerTypename() const override;
-
-private: // native image
-
+private: // native image
/**
* @copydoc Dali::NativeImageInterface::CreateResource()
*/
/**
* @copydoc Dali::NativeImageInterface::GetExtension()
*/
- NativeImageInterface::Extension* GetExtension();
+ NativeImageInterface::Extension* GetExtension() override;
private:
-
/// @cond internal
/**
* @brief Private constructor.
* @param[in] depth color depth of the image
* @param[in] nativeImageSourceQueue contains either: native image source or is empty
*/
- DALI_INTERNAL NativeImageSourceQueue( uint32_t width, uint32_t height, ColorDepth depth, Any nativeImageSourceQueue );
+ DALI_INTERNAL NativeImageSourceQueue(uint32_t width, uint32_t height, ColorDepth depth, Any nativeImageSourceQueue);
/**
* @brief A reference counted object may only be deleted by calling Unreference().
*
* The implementation should destroy the NativeImage resources.
*/
- DALI_INTERNAL virtual ~NativeImageSourceQueue();
+ DALI_INTERNAL ~NativeImageSourceQueue() override;
/**
* @brief Undefined copy constructor.
* This avoids accidental calls to a default copy constructor.
* @param[in] nativeImageSourceQueue A reference to the object to copy
*/
- DALI_INTERNAL NativeImageSourceQueue( const NativeImageSourceQueue& nativeImageSourceQueue );
+ DALI_INTERNAL NativeImageSourceQueue(const NativeImageSourceQueue& nativeImageSourceQueue);
/**
* @brief Undefined assignment operator.
/// @endcond
private:
-
/// @cond internal
- std::unique_ptr< Internal::Adaptor::NativeImageSourceQueue > mImpl; ///< Implementation pointer
+ std::unique_ptr<Internal::Adaptor::NativeImageSourceQueue> mImpl; ///< Implementation pointer
/// @endcond
};
/*
- * Copyright (c) 2015 Samsung Electronics Co., Ltd.
+ * Copyright (c) 2020 Samsung Electronics Co., Ltd.
*
* Licensed under the Apache License, Version 2.0 (the "License");
* you may not use this file except in compliance with the License.
namespace Dali
{
-
Orientation::Orientation()
{
}
return Internal::Adaptor::GetImplementation(*this).ChangedSignal();
}
-Orientation::Orientation( Internal::Adaptor::Orientation* orientation )
+Orientation::Orientation(Internal::Adaptor::Orientation* orientation)
: BaseHandle(orientation)
{
}
#define DALI_ORIENTATION_H
/*
- * Copyright (c) 2019 Samsung Electronics Co., Ltd.
+ * Copyright (c) 2020 Samsung Electronics Co., Ltd.
*
* Licensed under the Apache License, Version 2.0 (the "License");
* you may not use this file except in compliance with the License.
*/
// EXTERNAL INCLUDES
-#include <dali/public-api/signals/dali-signal.h>
#include <dali/public-api/object/base-handle.h>
+#include <dali/public-api/signals/dali-signal.h>
// INTERNAL INCLUDES
#include <dali/public-api/dali-adaptor-common.h>
namespace Dali
{
-
namespace Internal DALI_INTERNAL
{
namespace Adaptor
{
class Orientation;
}
-}
+} // namespace DALI_INTERNAL
/**
* @brief Orientation allows the user to determine the orientation of the device.
class DALI_ADAPTOR_API Orientation : public BaseHandle
{
public:
-
- typedef Signal< void (Orientation) > OrientationSignalType; ///< Orientation changed signal type
+ typedef Signal<void(Orientation)> OrientationSignalType; ///< Orientation changed signal type
/**
* @brief Create an unintialized handle.
*
* @param[in] orientation A pointer to the orientation object
*/
- explicit DALI_INTERNAL Orientation( Internal::Adaptor::Orientation* orientation );
+ explicit DALI_INTERNAL Orientation(Internal::Adaptor::Orientation* orientation);
};
} // namespace Dali
/*
- * Copyright (c) 2015 Samsung Electronics Co., Ltd.
+ * Copyright (c) 2020 Samsung Electronics Co., Ltd.
*
* Licensed under the Apache License, Version 2.0 (the "License");
* you may not use this file except in compliance with the License.
namespace Dali
{
-
PerformanceLogger::PerformanceLogger()
{
}
-PerformanceLogger PerformanceLogger::New( const char* name )
+PerformanceLogger PerformanceLogger::New(const char* name)
{
- Internal::Adaptor::PerformanceLoggerPtr internal = Internal::Adaptor::PerformanceLogger::New( name );
+ Internal::Adaptor::PerformanceLoggerPtr internal = Internal::Adaptor::PerformanceLogger::New(name);
return PerformanceLogger(internal.Get());
}
-PerformanceLogger::PerformanceLogger( const PerformanceLogger& performanceLogger )
+PerformanceLogger::PerformanceLogger(const PerformanceLogger& performanceLogger)
: BaseHandle(performanceLogger)
{
}
-PerformanceLogger& PerformanceLogger::operator=( const PerformanceLogger& performanceLogger )
+PerformanceLogger& PerformanceLogger::operator=(const PerformanceLogger& performanceLogger)
{
// check self assignment
- if( *this != performanceLogger )
+ if(*this != performanceLogger)
{
BaseHandle::operator=(performanceLogger);
}
{
}
-PerformanceLogger PerformanceLogger::DownCast( BaseHandle handle )
+PerformanceLogger PerformanceLogger::DownCast(BaseHandle handle)
{
- return PerformanceLogger( dynamic_cast<Internal::Adaptor::PerformanceLogger*>( handle.GetObjectPtr() ) );
+ return PerformanceLogger(dynamic_cast<Internal::Adaptor::PerformanceLogger*>(handle.GetObjectPtr()));
}
-void PerformanceLogger::AddMarker( Marker markerType )
+void PerformanceLogger::AddMarker(Marker markerType)
{
- Internal::Adaptor::GetImplementation(*this).AddMarker( markerType );
+ Internal::Adaptor::GetImplementation(*this).AddMarker(markerType);
}
-void PerformanceLogger::SetLoggingFrequency( unsigned int logFrequency)
+void PerformanceLogger::SetLoggingFrequency(unsigned int logFrequency)
{
- Internal::Adaptor::GetImplementation(*this).SetLoggingFrequency( logFrequency );
+ Internal::Adaptor::GetImplementation(*this).SetLoggingFrequency(logFrequency);
}
-void PerformanceLogger::EnableLogging( bool enable )
+void PerformanceLogger::EnableLogging(bool enable)
{
- Internal::Adaptor::GetImplementation(*this).EnableLogging( enable );
+ Internal::Adaptor::GetImplementation(*this).EnableLogging(enable);
}
PerformanceLogger::PerformanceLogger(Internal::Adaptor::PerformanceLogger* PerformanceLogger)
#define DALI_PERFORMANCE_LOGGER_H
/*
- * Copyright (c) 2019 Samsung Electronics Co., Ltd.
+ * Copyright (c) 2020 Samsung Electronics Co., Ltd.
*
* Licensed under the Apache License, Version 2.0 (the "License");
* you may not use this file except in compliance with the License.
namespace Dali
{
-
namespace Internal DALI_INTERNAL
{
namespace Adaptor
{
class PerformanceLogger;
}
-}
+} // namespace DALI_INTERNAL
/**
* @brief Performance logger class
class DALI_ADAPTOR_API PerformanceLogger : public BaseHandle
{
public:
-
/**
* Enum for events that can be logged
*/
enum Marker
{
- START_EVENT, ///< The start of timing
- END_EVENT ///< The end of timing
+ START_EVENT, ///< The start of timing
+ END_EVENT ///< The end of timing
};
/**
* @param[in] name The name of the logger. This needs to be a compile-time literal and alive for the whole lifetime of the performance logger.
* @return a new logger
*/
- static PerformanceLogger New( const char* name );
+ static PerformanceLogger New(const char* name);
/**
* @brief Copy constructor.
*
* @param[in] logger The handle to copy. The copied handle will point at the same implementation
*/
- PerformanceLogger( const PerformanceLogger& logger );
+ PerformanceLogger(const PerformanceLogger& logger);
/**
* @brief Assignment operator.
* as the copied handle.
* @return Reference to this logger handle
*/
- PerformanceLogger& operator=( const PerformanceLogger& logger );
+ PerformanceLogger& operator=(const PerformanceLogger& logger);
/**
* @brief Destructor
* @param[in] handle to An object
* @return handle to a PerformanceLogger object or an uninitialized handle
*/
- static PerformanceLogger DownCast( BaseHandle handle );
+ static PerformanceLogger DownCast(BaseHandle handle);
/**
* Add a performance marker
*
* @param markerType Performance marker type
*/
- void AddMarker( Marker markerType );
+ void AddMarker(Marker markerType);
/**
* Set the logging frequency
*
* @param logFrequency how often to log out in seconds
*/
- void SetLoggingFrequency( unsigned int logFrequency);
+ void SetLoggingFrequency(unsigned int logFrequency);
/**
* Set logging on or off for this logger
*
* @param[in] enable Enable logging or not
*/
- void EnableLogging( bool enable );
+ void EnableLogging(bool enable);
// Not intended for application developers
* Creates a new handle from the implementation.
* @param[in] impl A pointer to the object.
*/
- explicit DALI_INTERNAL PerformanceLogger( Internal::Adaptor::PerformanceLogger* impl );
-
+ explicit DALI_INTERNAL PerformanceLogger(Internal::Adaptor::PerformanceLogger* impl);
};
} // namespace Dali
/*
- * Copyright (c) 2015 Samsung Electronics Co., Ltd.
+ * Copyright (c) 2020 Samsung Electronics Co., Ltd.
*
* Licensed under the Apache License, Version 2.0 (the "License");
* you may not use this file except in compliance with the License.
namespace Dali
{
-
PhysicalKeyboard::PhysicalKeyboard()
{
}
PhysicalKeyboard handle = Internal::Adaptor::PhysicalKeyboard::Get();
// If it's not been created then create one
- if ( !handle )
+ if(!handle)
{
handle = Internal::Adaptor::PhysicalKeyboard::New();
}
bool PhysicalKeyboard::IsAttached() const
{
- return GetImplementation( *this ).IsAttached();
+ return GetImplementation(*this).IsAttached();
}
PhysicalKeyboard::PhysicalKeyboardSignalType& PhysicalKeyboard::StatusChangedSignal()
{
- return GetImplementation( *this ).StatusChangedSignal();
+ return GetImplementation(*this).StatusChangedSignal();
}
-PhysicalKeyboard::PhysicalKeyboard( Internal::Adaptor::PhysicalKeyboard *impl )
+PhysicalKeyboard::PhysicalKeyboard(Internal::Adaptor::PhysicalKeyboard* impl)
: BaseHandle(impl)
{
}
#define DALI_PHYSICAL_KEYBOARD_H
/*
- * Copyright (c) 2019 Samsung Electronics Co., Ltd.
+ * Copyright (c) 2020 Samsung Electronics Co., Ltd.
*
* Licensed under the Apache License, Version 2.0 (the "License");
* you may not use this file except in compliance with the License.
namespace Dali
{
-
namespace Internal DALI_INTERNAL
{
namespace Adaptor
{
class PhysicalKeyboard;
}
-}
+} // namespace DALI_INTERNAL
/**
* This is a handle to a physical keyboard connected to the device.
class DALI_ADAPTOR_API PhysicalKeyboard : public BaseHandle
{
public:
-
- typedef Signal< void (PhysicalKeyboard) > PhysicalKeyboardSignalType;
+ typedef Signal<void(PhysicalKeyboard)> PhysicalKeyboardSignalType;
public:
-
/**
* Create an uninitialized PhysicalKeyboard handle; this can be initialized with GetKeyboard()
* Calling member functions with an uninitialized Dali::Object is not allowed.
* Creates a new handle from the implementation.
* @param[in] impl A pointer to the object.
*/
- explicit DALI_INTERNAL PhysicalKeyboard( Internal::Adaptor::PhysicalKeyboard* impl );
+ explicit DALI_INTERNAL PhysicalKeyboard(Internal::Adaptor::PhysicalKeyboard* impl);
};
} // namespace Dali
/*
- * Copyright (c) 2018 Samsung Electronics Co., Ltd.
+ * Copyright (c) 2020 Samsung Electronics Co., Ltd.
*
* Licensed under the Apache License, Version 2.0 (the "License");
* you may not use this file except in compliance with the License.
{
namespace Devel
{
-
-PixelBuffer PixelBuffer::New( unsigned int width,
- unsigned int height,
- Dali::Pixel::Format pixelFormat )
+PixelBuffer PixelBuffer::New(unsigned int width,
+ unsigned int height,
+ Dali::Pixel::Format pixelFormat)
{
Internal::Adaptor::PixelBufferPtr internal =
- Internal::Adaptor::PixelBuffer::New( width, height, pixelFormat );
- return Devel::PixelBuffer( internal.Get() );
+ Internal::Adaptor::PixelBuffer::New(width, height, pixelFormat);
+ return Devel::PixelBuffer(internal.Get());
}
-Dali::PixelData PixelBuffer::Convert( PixelBuffer& pixelBuffer )
+Dali::PixelData PixelBuffer::Convert(PixelBuffer& pixelBuffer)
{
Dali::PixelData pixelData =
- Internal::Adaptor::PixelBuffer::Convert( GetImplementation(pixelBuffer) );
+ Internal::Adaptor::PixelBuffer::Convert(GetImplementation(pixelBuffer));
pixelBuffer.Reset();
return pixelData;
}
return GetImplementation(*this).CreatePixelData();
}
-
PixelBuffer::PixelBuffer()
{
}
{
}
-PixelBuffer::PixelBuffer( Internal::Adaptor::PixelBuffer* internal )
-: BaseHandle( internal )
+PixelBuffer::PixelBuffer(Internal::Adaptor::PixelBuffer* internal)
+: BaseHandle(internal)
{
}
PixelBuffer::PixelBuffer(const PixelBuffer& handle)
-: BaseHandle( handle )
+: BaseHandle(handle)
{
}
return GetImplementation(*this).GetConstBuffer();
}
-void PixelBuffer::ApplyMask( PixelBuffer mask, float contentScale, bool cropToMask )
+void PixelBuffer::ApplyMask(PixelBuffer mask, float contentScale, bool cropToMask)
{
- GetImplementation(*this).ApplyMask( GetImplementation( mask ), contentScale, cropToMask );
+ GetImplementation(*this).ApplyMask(GetImplementation(mask), contentScale, cropToMask);
}
-void PixelBuffer::ApplyGaussianBlur( const float blurRadius )
+void PixelBuffer::ApplyGaussianBlur(const float blurRadius)
{
- GetImplementation(*this).ApplyGaussianBlur( blurRadius );
+ GetImplementation(*this).ApplyGaussianBlur(blurRadius);
}
-void PixelBuffer::Crop( uint16_t x, uint16_t y, uint16_t width, uint16_t height )
+void PixelBuffer::Crop(uint16_t x, uint16_t y, uint16_t width, uint16_t height)
{
- GetImplementation(*this).Crop( x, y, ImageDimensions( width, height ) );
+ GetImplementation(*this).Crop(x, y, ImageDimensions(width, height));
}
-void PixelBuffer::Resize( uint16_t width, uint16_t height )
+void PixelBuffer::Resize(uint16_t width, uint16_t height)
{
- GetImplementation(*this).Resize( ImageDimensions( width, height ) );
+ GetImplementation(*this).Resize(ImageDimensions(width, height));
}
void PixelBuffer::MultiplyColorByAlpha()
GetImplementation(*this).MultiplyColorByAlpha();
}
-bool PixelBuffer::GetMetadata( Property::Map& metadata ) const
+bool PixelBuffer::GetMetadata(Property::Map& metadata) const
{
return GetImplementation(*this).GetMetadata(metadata);
}
-bool PixelBuffer::Rotate( Degree angle )
+bool PixelBuffer::Rotate(Degree angle)
{
- return GetImplementation(*this).Rotate( angle );
+ return GetImplementation(*this).Rotate(angle);
}
bool PixelBuffer::IsAlphaPreMultiplied() const
#define DALI_PIXEL_BUFFER_H
/*
- * Copyright (c) 2018 Samsung Electronics Co., Ltd.
+ * Copyright (c) 2020 Samsung Electronics Co., Ltd.
*
* Licensed under the Apache License, Version 2.0 (the "License");
* you may not use this file except in compliance with the License.
*/
// INTERNAL INCLUDES
-#include <dali/public-api/images/pixel.h>
#include <dali/public-api/images/pixel-data.h>
+#include <dali/public-api/images/pixel.h>
#include <dali/public-api/object/base-handle.h>
// INTERNAL INCLUDES
namespace Dali
{
-
namespace Internal
{
namespace Adaptor
{
class PixelBuffer;
}
-}
-
+} // namespace Internal
// Use namespace to separate from PixelBuffer typedef in buffer-image.h
namespace Devel
{
-
/**
* @brief The PixelBuffer object holds a pixel buffer.
*
class DALI_ADAPTOR_API PixelBuffer : public BaseHandle
{
public:
-
/**
* Create a PixelBuffer with it's own data buffer.
*/
- static PixelBuffer New( unsigned int width,
- unsigned int height,
- Dali::Pixel::Format pixelFormat );
+ static PixelBuffer New(unsigned int width,
+ unsigned int height,
+ Dali::Pixel::Format pixelFormat);
/**
* @brief Creates an empty handle.
* @param[in,out] pixelBuffer
* @return a new PixelData which takes ownership of the PixelBuffer's buffer.
*/
- static PixelData Convert( PixelBuffer& pixelBuffer );
+ static PixelData Convert(PixelBuffer& pixelBuffer);
/**
* Copy the data from this object into a new PixelData object, which could be
* @param[in] cropToMask Whether to crop the output to the mask size (true)
* or scale the mask to the content size (false)
*/
- void ApplyMask( PixelBuffer mask, float contentScale=1.0f, bool cropToMask=false );
+ void ApplyMask(PixelBuffer mask, float contentScale = 1.0f, bool cropToMask = false);
/**
* Apply a Gaussian blur to this pixel data with the given radius.
*
* @param[in] blurRadius The radius for Gaussian blur. A value of 0 or negative value indicates no blur.
*/
- void ApplyGaussianBlur( const float blurRadius );
+ void ApplyGaussianBlur(const float blurRadius);
/**
* @brief Crops this buffer to the given crop rectangle.
* @param[in] width The crop width
* @param[in] height The crop height
*/
- void Crop( uint16_t x, uint16_t y, uint16_t width, uint16_t height );
+ void Crop(uint16_t x, uint16_t y, uint16_t width, uint16_t height);
/**
* @brief Resizes the buffer to the given dimensions.
* @param[in] width The new width
* @param[in] height The new height
*/
- void Resize( uint16_t width, uint16_t height );
+ void Resize(uint16_t width, uint16_t height);
/**
* @brief Returns Exif metadata as a property map
* @param[out] metadata Property map object to write into
* @return True on success
*/
- bool GetMetadata( Property::Map& metadata ) const;
+ bool GetMetadata(Property::Map& metadata) const;
/**
* @brief Multiplies the image's color values by the alpha value. This provides better
*
* @return @e false if the rotation fails (invalid pixel format or memory issues).
*/
- bool Rotate( Degree angle );
+ bool Rotate(Degree angle);
/**
* @brief Returns pixel-buffer is premultiplied or not.
bool IsAlphaPreMultiplied() const;
public:
-
/**
* @brief The constructor.
* @note Not intended for application developers.
* @SINCE_1_2.46
* @param[in] pointer A pointer to a newly allocated PixelBuffer
*/
- explicit DALI_INTERNAL PixelBuffer( Internal::Adaptor::PixelBuffer* pointer );
+ explicit DALI_INTERNAL PixelBuffer(Internal::Adaptor::PixelBuffer* pointer);
};
} // namespace Devel
/*
- * Copyright (c) 2015 Samsung Electronics Co., Ltd.
+ * Copyright (c) 2020 Samsung Electronics Co., Ltd.
*
* Licensed under the Apache License, Version 2.0 (the "License");
* you may not use this file except in compliance with the License.
namespace Dali
{
-
SoundPlayer::SoundPlayer()
{
}
return GetImplementation(*this).SoundPlayFinishedSignal();
}
-SoundPlayer::SoundPlayer( Internal::Adaptor::SoundPlayer* player )
-: BaseHandle( player )
+SoundPlayer::SoundPlayer(Internal::Adaptor::SoundPlayer* player)
+: BaseHandle(player)
{
}
#define DALI_SOUND_PLAYER_H
/*
- * Copyright (c) 2019 Samsung Electronics Co., Ltd.
+ * Copyright (c) 2020 Samsung Electronics Co., Ltd.
*
* Licensed under the Apache License, Version 2.0 (the "License");
* you may not use this file except in compliance with the License.
namespace Dali
{
-
namespace Internal DALI_INTERNAL
{
namespace Adaptor
{
class SoundPlayer;
}
-}
+} // namespace DALI_INTERNAL
/**
* @brief Plays sound effects.
class DALI_ADAPTOR_API SoundPlayer : public BaseHandle
{
public:
-
- typedef Signal< void (SoundPlayer&) > SoundPlayFinishedSignalType; ///< Sound play finished signal
+ typedef Signal<void(SoundPlayer&)> SoundPlayFinishedSignalType; ///< Sound play finished signal
/**
* @brief Create an uninitialized handle.
SoundPlayFinishedSignalType& SoundPlayFinishedSignal();
public: // Not intended for application developers
-
/**
* @brief This constructor is used by SoundPlayer::Get().
*
* @param[in] soundPlayer A pointer to the sound player.
*/
- explicit DALI_INTERNAL SoundPlayer( Internal::Adaptor::SoundPlayer* soundPlayer );
+ explicit DALI_INTERNAL SoundPlayer(Internal::Adaptor::SoundPlayer* soundPlayer);
};
} // namespace Dali
/*
- * Copyright (c) 2015 Samsung Electronics Co., Ltd.
+ * Copyright (c) 2020 Samsung Electronics Co., Ltd.
*
* Licensed under the Apache License, Version 2.0 (the "License");
* you may not use this file except in compliance with the License.
namespace Dali
{
-
StyleMonitor::StyleMonitor()
{
}
{
}
-StyleMonitor StyleMonitor::DownCast( BaseHandle handle )
+StyleMonitor StyleMonitor::DownCast(BaseHandle handle)
{
- return StyleMonitor( dynamic_cast<Internal::Adaptor::StyleMonitor*>( handle.GetObjectPtr() ) );
+ return StyleMonitor(dynamic_cast<Internal::Adaptor::StyleMonitor*>(handle.GetObjectPtr()));
}
std::string StyleMonitor::GetDefaultFontFamily() const
return GetImplementation(*this).SetTheme(themFilePath);
}
-bool StyleMonitor::LoadThemeFile( const std::string& filename, std::string& output )
+bool StyleMonitor::LoadThemeFile(const std::string& filename, std::string& output)
{
- return GetImplementation(*this).LoadThemeFile( filename, output );
+ return GetImplementation(*this).LoadThemeFile(filename, output);
}
StyleMonitor::StyleChangeSignalType& StyleMonitor::StyleChangeSignal()
StyleMonitor& StyleMonitor::operator=(const StyleMonitor& monitor)
{
- if( *this != monitor )
+ if(*this != monitor)
{
BaseHandle::operator=(monitor);
}
#define DALI_STYLE_MONITOR_H
/*
- * Copyright (c) 2019 Samsung Electronics Co., Ltd.
+ * Copyright (c) 2020 Samsung Electronics Co., Ltd.
*
* Licensed under the Apache License, Version 2.0 (the "License");
* you may not use this file except in compliance with the License.
namespace Dali
{
-
namespace Internal DALI_INTERNAL
{
namespace Adaptor
{
class StyleMonitor;
}
-}
+} // namespace DALI_INTERNAL
/**
* @brief Monitors the platform for style changes.
*/
class DALI_ADAPTOR_API StyleMonitor : public BaseHandle
{
-public: // Typedefs
-
- typedef Signal< void ( StyleMonitor, StyleChange::Type ) > StyleChangeSignalType; ///< StyleChange Signal type
+public: // Typedefs
+ typedef Signal<void(StyleMonitor, StyleChange::Type)> StyleChangeSignalType; ///< StyleChange Signal type
public: // Creation & Destruction
-
/**
* @brief Create an uninitialized StyleMonitor handle.
*
* @param[in] handle to An object @return handle to a Timer object
* or an uninitialized handle
*/
- static StyleMonitor DownCast( BaseHandle handle );
+ static StyleMonitor DownCast(BaseHandle handle);
public: // Style Information
-
/**
* @brief Retrieves the default font family.
* @return The default font family.
* @param output to write the contents to
* @return true if the load is successful
*/
- bool LoadThemeFile( const std::string& filename, std::string& output );
+ bool LoadThemeFile(const std::string& filename, std::string& output);
public: // Signals
-
/**
* @brief This signal is emitted whenever the style changes on the device.
*
StyleChangeSignalType& StyleChangeSignal();
public: // Operators
-
/**
* @brief Assignment operator.
*
/*
- * Copyright (c) 2017 Samsung Electronics Co., Ltd.
+ * Copyright (c) 2020 Samsung Electronics Co., Ltd.
*
* Licensed under the Apache License, Version 2.0 (the "License");
* you may not use this file except in compliance with the License.
{
void SetThreadName(const std::string& threadName)
{
- Internal::Adaptor::ThreadSettings::SetThreadName( threadName );
+ Internal::Adaptor::ThreadSettings::SetThreadName(threadName);
}
} // namespace Dali
#define DALI_THREAD_SETTINGS_H
/*
- * Copyright (c) 2018 Samsung Electronics Co., Ltd.
+ * Copyright (c) 2020 Samsung Electronics Co., Ltd.
*
* Licensed under the Apache License, Version 2.0 (the "License");
* you may not use this file except in compliance with the License.
*/
DALI_ADAPTOR_API void SetThreadName(const std::string& threadName);
-} // Dali
+} // namespace Dali
#endif // DALI_THREAD_SETTINGS_H
\ No newline at end of file
/*
- * Copyright (c) 2015 Samsung Electronics Co., Ltd.
+ * Copyright (c) 2020 Samsung Electronics Co., Ltd.
*
* Licensed under the Apache License, Version 2.0 (the "License");
* you may not use this file except in compliance with the License.
#include <dali/devel-api/adaptor-framework/tilt-sensor.h>
// INTERNAL INCLUDES
+#include <dali/internal/adaptor/common/adaptor-impl.h>
#include <dali/internal/sensor/common/tilt-sensor-factory.h>
#include <dali/internal/sensor/common/tilt-sensor-impl.h>
-#include <dali/internal/adaptor/common/adaptor-impl.h>
namespace Dali
{
-
const float TiltSensor::DEFAULT_UPDATE_FREQUENCY = 60.0f;
TiltSensor::TiltSensor()
return GetImplementation(*this).TiltedSignal();
}
-void TiltSensor::SetUpdateFrequency( float frequencyHertz )
+void TiltSensor::SetUpdateFrequency(float frequencyHertz)
{
- GetImplementation(*this).SetUpdateFrequency( frequencyHertz );
+ GetImplementation(*this).SetUpdateFrequency(frequencyHertz);
}
float TiltSensor::GetUpdateFrequency() const
void TiltSensor::SetRotationThreshold(Radian rotationThreshold)
{
- GetImplementation(*this).SetRotationThreshold( rotationThreshold );
+ GetImplementation(*this).SetRotationThreshold(rotationThreshold);
}
Radian TiltSensor::GetRotationThreshold() const
return GetImplementation(*this).GetRotationThreshold();
}
-TiltSensor::TiltSensor( Internal::Adaptor::TiltSensor* sensor )
-: BaseHandle( sensor )
+TiltSensor::TiltSensor(Internal::Adaptor::TiltSensor* sensor)
+: BaseHandle(sensor)
{
}
#define DALI_TILT_SENSOR_H
/*
- * Copyright (c) 2019 Samsung Electronics Co., Ltd.
+ * Copyright (c) 2020 Samsung Electronics Co., Ltd.
*
* Licensed under the Apache License, Version 2.0 (the "License");
* you may not use this file except in compliance with the License.
namespace Dali
{
-
namespace Internal DALI_INTERNAL
{
namespace Adaptor
{
class TiltSensor;
}
-}
+} // namespace DALI_INTERNAL
/**
* TiltSensor provides pitch & roll values when the device is tilted.
class DALI_ADAPTOR_API TiltSensor : public BaseHandle
{
public:
-
- typedef Signal< void (const TiltSensor&) > TiltedSignalType;
+ typedef Signal<void(const TiltSensor&)> TiltedSignalType;
static const float DEFAULT_UPDATE_FREQUENCY; // 60 hertz
* The default is TiltSensor::DEFAULT_UPDATE_FREQUENCY.
* @param[in] frequencyHertz The frequency in hertz.
*/
- void SetUpdateFrequency( float frequencyHertz );
+ void SetUpdateFrequency(float frequencyHertz);
/**
* Query the sensor update frequency.
* Example tiltSensor.SetRotationThreshold( Radian(Degree(10) ) // A rotation threshold of 10 degrees
* @param[in] rotationThreshold The threshold value for rotation.
*/
- void SetRotationThreshold( Radian rotationThreshold );
+ void SetRotationThreshold(Radian rotationThreshold);
/**
* Query the rotation threshold above which TiltedSignal will be emitted.
Radian GetRotationThreshold() const;
public: // Not intended for application developers
-
/**
* This constructor is used by TiltSensor::Get().
* @param[in] sensor A pointer to the tilt sensor.
*/
- explicit DALI_INTERNAL TiltSensor( Internal::Adaptor::TiltSensor* sensor );
+ explicit DALI_INTERNAL TiltSensor(Internal::Adaptor::TiltSensor* sensor);
};
} // namespace Dali
#define DALI_VECTOR_ANIMATION_RENDERER_PLUGIN_H
/*
- * Copyright (c) 2019 Samsung Electronics Co., Ltd.
+ * Copyright (c) 2020 Samsung Electronics Co., Ltd.
*
* Licensed under the Apache License, Version 2.0 (the "License");
* you may not use this file except in compliance with the License.
namespace Dali
{
-
/**
* VectorAnimationRendererPlugin is an abstract interface, used by dali-adaptor to render a vector animation.
* A concrete implementation must be created for each platform and provided as a dynamic library which
class VectorAnimationRendererPlugin
{
public:
-
using UploadCompletedSignalType = Dali::VectorAnimationRenderer::UploadCompletedSignalType;
/**
* @brief Constructor
*/
- VectorAnimationRendererPlugin() {}
+ VectorAnimationRendererPlugin()
+ {
+ }
/**
* @brief Destructor
*/
- virtual ~VectorAnimationRendererPlugin() {}
+ virtual ~VectorAnimationRendererPlugin()
+ {
+ }
/**
* @brief Second-phase constructor.
*
* @param[in] url The url of the animation file
*/
- virtual bool Initialize( const std::string& url ) = 0;
+ virtual bool Initialize(const std::string& url) = 0;
/**
* @brief Finalizes the renderer. It will be called in the main thread.
*
* @param[in] renderer The renderer used to display the result image
*/
- virtual void SetRenderer( Renderer renderer ) = 0;
+ virtual void SetRenderer(Renderer renderer) = 0;
/**
* @brief Sets the target image size.
* @param[in] width The target image width
* @param[in] height The target image height
*/
- virtual void SetSize( uint32_t width, uint32_t height ) = 0;
+ virtual void SetSize(uint32_t width, uint32_t height) = 0;
/**
* @brief Renders the content to the target buffer synchronously.
* @param[in] frameNumber The frame number to be rendered
* @return True if the rendering success, false otherwise.
*/
- virtual bool Render( uint32_t frameNumber ) = 0;
+ virtual bool Render(uint32_t frameNumber) = 0;
/**
* @brief Gets the total number of frames of the file.
* @param[out] width The default width of the file
* @param[out] height The default height of the file
*/
- virtual void GetDefaultSize( uint32_t& width, uint32_t& height ) const = 0;
+ virtual void GetDefaultSize(uint32_t& width, uint32_t& height) const = 0;
/**
* @brief Gets the layer information of all the child layers.
*
* @param[out] map The layer information
*/
- virtual void GetLayerInfo( Property::Map& map ) const = 0;
+ virtual void GetLayerInfo(Property::Map& map) const = 0;
/**
* @brief Gets the start frame and the end frame number of the composition marker.
* Marker can be use to devide a resource in to separate animations by tagging the segment with comment string,
* start frame and duration of that segment.
*/
- virtual bool GetMarkerInfo( const std::string& marker, uint32_t& startFrame, uint32_t& endFrame ) const = 0;
+ virtual bool GetMarkerInfo(const std::string& marker, uint32_t& startFrame, uint32_t& endFrame) const = 0;
/**
* @brief Ignores a rendered frame which is not shown yet.
/*
- * Copyright (c) 2019 Samsung Electronics Co., Ltd.
+ * Copyright (c) 2020 Samsung Electronics Co., Ltd.
*
* Licensed under the Apache License, Version 2.0 (the "License");
* you may not use this file except in compliance with the License.
namespace Dali
{
-
-VectorAnimationRenderer VectorAnimationRenderer::New( const std::string& url )
+VectorAnimationRenderer VectorAnimationRenderer::New(const std::string& url)
{
Internal::Adaptor::VectorAnimationRendererPtr animationRenderer = Internal::Adaptor::VectorAnimationRenderer::New();
- if( animationRenderer )
+ if(animationRenderer)
{
- animationRenderer->Initialize( url );
+ animationRenderer->Initialize(url);
}
- return VectorAnimationRenderer( animationRenderer.Get() );
+ return VectorAnimationRenderer(animationRenderer.Get());
}
VectorAnimationRenderer::VectorAnimationRenderer()
{
}
-VectorAnimationRenderer::VectorAnimationRenderer( Internal::Adaptor::VectorAnimationRenderer* internal )
-: BaseHandle( internal )
+VectorAnimationRenderer::VectorAnimationRenderer(Internal::Adaptor::VectorAnimationRenderer* internal)
+: BaseHandle(internal)
{
}
-VectorAnimationRenderer::VectorAnimationRenderer( const VectorAnimationRenderer& handle )
-: BaseHandle( handle )
+VectorAnimationRenderer::VectorAnimationRenderer(const VectorAnimationRenderer& handle)
+: BaseHandle(handle)
{
}
-VectorAnimationRenderer& VectorAnimationRenderer::operator=( const VectorAnimationRenderer& rhs )
+VectorAnimationRenderer& VectorAnimationRenderer::operator=(const VectorAnimationRenderer& rhs)
{
- BaseHandle::operator=( rhs );
+ BaseHandle::operator=(rhs);
return *this;
}
void VectorAnimationRenderer::Finalize()
{
- GetImplementation( *this ).Finalize();
+ GetImplementation(*this).Finalize();
}
-void VectorAnimationRenderer::SetRenderer( Renderer renderer )
+void VectorAnimationRenderer::SetRenderer(Renderer renderer)
{
- GetImplementation( *this ).SetRenderer( renderer );
+ GetImplementation(*this).SetRenderer(renderer);
}
-void VectorAnimationRenderer::SetSize( uint32_t width, uint32_t height )
+void VectorAnimationRenderer::SetSize(uint32_t width, uint32_t height)
{
- GetImplementation( *this ).SetSize( width, height );
+ GetImplementation(*this).SetSize(width, height);
}
-bool VectorAnimationRenderer::Render( uint32_t frameNumber )
+bool VectorAnimationRenderer::Render(uint32_t frameNumber)
{
- return GetImplementation( *this ).Render( frameNumber );
+ return GetImplementation(*this).Render(frameNumber);
}
uint32_t VectorAnimationRenderer::GetTotalFrameNumber() const
{
- return GetImplementation( *this ).GetTotalFrameNumber();
+ return GetImplementation(*this).GetTotalFrameNumber();
}
float VectorAnimationRenderer::GetFrameRate() const
{
- return GetImplementation( *this ).GetFrameRate();
+ return GetImplementation(*this).GetFrameRate();
}
-void VectorAnimationRenderer::GetDefaultSize( uint32_t& width, uint32_t& height ) const
+void VectorAnimationRenderer::GetDefaultSize(uint32_t& width, uint32_t& height) const
{
- GetImplementation( *this ).GetDefaultSize( width, height );
+ GetImplementation(*this).GetDefaultSize(width, height);
}
-void VectorAnimationRenderer::GetLayerInfo( Property::Map& map ) const
+void VectorAnimationRenderer::GetLayerInfo(Property::Map& map) const
{
- GetImplementation( *this ).GetLayerInfo( map );
+ GetImplementation(*this).GetLayerInfo(map);
}
-bool VectorAnimationRenderer::GetMarkerInfo( const std::string& marker, uint32_t& startFrame, uint32_t& endFrame ) const
+bool VectorAnimationRenderer::GetMarkerInfo(const std::string& marker, uint32_t& startFrame, uint32_t& endFrame) const
{
- return GetImplementation( *this ).GetMarkerInfo( marker, startFrame, endFrame );
+ return GetImplementation(*this).GetMarkerInfo(marker, startFrame, endFrame);
}
void VectorAnimationRenderer::IgnoreRenderedFrame()
{
- GetImplementation( *this ).IgnoreRenderedFrame();
+ GetImplementation(*this).IgnoreRenderedFrame();
}
VectorAnimationRenderer::UploadCompletedSignalType& VectorAnimationRenderer::UploadCompletedSignal()
{
- return GetImplementation( *this ).UploadCompletedSignal();
+ return GetImplementation(*this).UploadCompletedSignal();
}
} // namespace Dali
#define DALI_VECTOR_ANIMATION_RENDERER_H
/*
- * Copyright (c) 2019 Samsung Electronics Co., Ltd.
+ * Copyright (c) 2020 Samsung Electronics Co., Ltd.
*
* Licensed under the Apache License, Version 2.0 (the "License");
* you may not use this file except in compliance with the License.
{
class VectorAnimationRenderer;
}
-}
+} // namespace DALI_INTERNAL
/**
* @brief Used for rendering a vector animation file
class DALI_ADAPTOR_API VectorAnimationRenderer : public BaseHandle
{
public:
-
/// @brief UploadCompleted signal type.
- using UploadCompletedSignalType = Signal< void () >;
+ using UploadCompletedSignalType = Signal<void()>;
/**
* @brief Creates an initialized handle to a new VectorAnimationRenderer.
* @param[in] url The url of the vector animation file
* @return A handle to a newly allocated VectorAnimationRenderer
*/
- static VectorAnimationRenderer New( const std::string& url );
+ static VectorAnimationRenderer New(const std::string& url);
/**
* @brief Creates an empty handle.
*
* @param[in] handle A reference to the copied handle
*/
- VectorAnimationRenderer( const VectorAnimationRenderer& handle );
+ VectorAnimationRenderer(const VectorAnimationRenderer& handle);
/**
* @brief This assignment operator is required for (smart) pointer semantics.
* @param[in] rhs A reference to the copied handle
* @return A reference to this
*/
- VectorAnimationRenderer& operator=( const VectorAnimationRenderer& rhs );
+ VectorAnimationRenderer& operator=(const VectorAnimationRenderer& rhs);
/**
* @brief Finalizes the renderer.
*
* @param[in] renderer The renderer used to display the result image
*/
- void SetRenderer( Renderer renderer );
+ void SetRenderer(Renderer renderer);
/**
* @brief Sets the target image size.
* @param[in] width The target image width
* @param[in] height The target image height
*/
- void SetSize( uint32_t width, uint32_t height );
+ void SetSize(uint32_t width, uint32_t height);
/**
* @brief Renders the content to the target buffer synchronously.
* @param[in] frameNumber The frame number to be rendered
* @return True if the rendering success, false otherwise.
*/
- bool Render( uint32_t frameNumber );
+ bool Render(uint32_t frameNumber);
/**
* @brief Gets the total number of frames of the file
* @param[out] width The default width of the file
* @param[out] height The default height of the file
*/
- void GetDefaultSize( uint32_t& width, uint32_t& height ) const;
+ void GetDefaultSize(uint32_t& width, uint32_t& height) const;
/**
* @brief Gets the layer information of all the child layers.
*
* @param[out] map The layer information
*/
- void GetLayerInfo( Property::Map& map ) const;
+ void GetLayerInfo(Property::Map& map) const;
/**
* @brief Gets the start frame and the end frame number of the composition marker.
* Marker can be use to devide a resource in to separate animations by tagging the segment with comment string,
* start frame and duration of that segment.
*/
- bool GetMarkerInfo( const std::string& marker, uint32_t& startFrame, uint32_t& endFrame ) const;
+ bool GetMarkerInfo(const std::string& marker, uint32_t& startFrame, uint32_t& endFrame) const;
/**
* @brief Ignores a rendered frame which is not shown yet.
void IgnoreRenderedFrame();
public: // Signals
-
/**
* @brief Connect to this signal to be notified when the texture upload is completed.
*
UploadCompletedSignalType& UploadCompletedSignal();
public: // Not intended for application developers
-
/// @cond internal
/**
* @brief The constructor.
*
* @param[in] pointer A pointer to a newly allocated VectorAnimationRenderer
*/
- explicit DALI_INTERNAL VectorAnimationRenderer( Internal::Adaptor::VectorAnimationRenderer* internal );
+ explicit DALI_INTERNAL VectorAnimationRenderer(Internal::Adaptor::VectorAnimationRenderer* internal);
/// @endcond
-
};
/**
#define DALI_VIDEO_PLAYER_PLUGIN_H
/*
- * Copyright (c) 2019 Samsung Electronics Co., Ltd.
+ * Copyright (c) 2020 Samsung Electronics Co., Ltd.
*
* Licensed under the Apache License, Version 2.0 (the "License");
* you may not use this file except in compliance with the License.
*/
// EXTERNAL INCLUDES
-#include <dali/public-api/signals/dali-signal.h>
-#include <dali/public-api/math/rect.h>
#include <dali/public-api/actors/actor.h>
+#include <dali/public-api/math/rect.h>
+#include <dali/public-api/signals/dali-signal.h>
namespace Dali
{
-
class Any;
-typedef Dali::Rect< int > DisplayArea;
+typedef Dali::Rect<int> DisplayArea;
/**
* @brief VideoPlayerPlugin is an abstract interface, used by dali-adaptor to access video player plugin.
class VideoPlayerPlugin
{
public:
-
- typedef Signal< void () > VideoPlayerSignalType;
+ typedef Signal<void()> VideoPlayerSignalType;
/**
* @brief Video display rotation option
*/
enum DisplayRotation
{
- ROTATION_NONE, ///< Display isn't rotated. @SINCE_1_1.38
- ROTATION_90, ///< Display is rotated 90 degree. @SINCE_1_1.38
- ROTATION_180, ///< Display is rotated 180 degree. @SINCE_1_1.38
- ROTATION_270 ///< Display is rotated 270 degree. @SINCE_1_1.38
+ ROTATION_NONE, ///< Display isn't rotated. @SINCE_1_1.38
+ ROTATION_90, ///< Display is rotated 90 degree. @SINCE_1_1.38
+ ROTATION_180, ///< Display is rotated 180 degree. @SINCE_1_1.38
+ ROTATION_270 ///< Display is rotated 270 degree. @SINCE_1_1.38
};
/**
*/
enum class CodecType
{
- DEFAULT, ///< Codec which has higher priority as default. Platform selects it. Usually the H/W codec has higher priority than S/W codec if it exist.
- HW, ///< H/W codec
- SW ///< S/W codec
+ DEFAULT, ///< Codec which has higher priority as default. Platform selects it. Usually the H/W codec has higher priority than S/W codec if it exist.
+ HW, ///< H/W codec
+ SW ///< S/W codec
};
/**
{
enum Type
{
- LETTER_BOX = 0, /**< Letter box */
- ORIGIN_SIZE, /**< Origin size */
- FULL_SCREEN, /**< Full-screen */
- CROPPED_FULL, /**< Cropped full-screen */
- ORIGIN_OR_LETTER, /**< Origin size (if surface size is larger than video size(width/height)) or Letter box (if video size(width/height) is larger than surface size) */
- DST_ROI /**< Region of Interest */
+ LETTER_BOX = 0, /**< Letter box */
+ ORIGIN_SIZE, /**< Origin size */
+ FULL_SCREEN, /**< Full-screen */
+ CROPPED_FULL, /**< Cropped full-screen */
+ ORIGIN_OR_LETTER, /**< Origin size (if surface size is larger than video size(width/height)) or Letter box (if video size(width/height) is larger than surface size) */
+ DST_ROI /**< Region of Interest */
};
};
* @brief Constructor.
* @SINCE_1_1.38
*/
- VideoPlayerPlugin(){}
+ VideoPlayerPlugin()
+ {
+ }
/**
* @brief Destructor.
* @SINCE_1_1.38
*/
- virtual ~VideoPlayerPlugin(){}
+ virtual ~VideoPlayerPlugin()
+ {
+ }
/**
* @brief Sets a URL of the video file to play.
* @SINCE_1_1.38
* @param [in] url The url of video file
*/
- virtual void SetUrl( const std::string& url ) = 0;
+ virtual void SetUrl(const std::string& url) = 0;
/**
* @brief Returns the URL of the video file.
* @SINCE_1_1.38
* @param[in] mute The new mute status, true is mute.
*/
- virtual void SetMute( bool mute ) = 0;
+ virtual void SetMute(bool mute) = 0;
/**
* @brief Returns the player mute status.
* @param[in] left The left volume scalar
* @param[in] right The right volume scalar
*/
- virtual void SetVolume( float left, float right ) = 0;
+ virtual void SetVolume(float left, float right) = 0;
/**
* @brief Gets current volume factor.
* @param[out] left The current left volume scalar
* @param[out] right The current right volume scalar
*/
- virtual void GetVolume( float& left, float& right ) = 0;
+ virtual void GetVolume(float& left, float& right) = 0;
/**
* @brief Sets video rendering target.
* @SINCE_1_1.38
* @param[in] target The target for video rendering, window surface or native image source
*/
- virtual void SetRenderingTarget( Any target ) = 0;
+ virtual void SetRenderingTarget(Any target) = 0;
/**
* @brief Sets the position for playback.
*
* @param[in] millisecond The position for playback
*/
- virtual void SetPlayPosition( int millisecond ) = 0;
+ virtual void SetPlayPosition(int millisecond) = 0;
/**
* @brief Returns the current position in milliseconds.
* @SINCE_1_2.46
* param[in] area The left-top position and size of the video display area
*/
- virtual void SetDisplayArea( DisplayArea area ) = 0;
+ virtual void SetDisplayArea(DisplayArea area) = 0;
/**
* @brief Sets video display rotation
* @SINCE_1_1.38
* @param[in] rotation The rotation of display
*/
- virtual void SetDisplayRotation( Dali::VideoPlayerPlugin::DisplayRotation rotation ) = 0;
+ virtual void SetDisplayRotation(Dali::VideoPlayerPlugin::DisplayRotation rotation) = 0;
/**
* @brief Returns rotation of current video display
* @SINCE_1_2.46
* @param[in] millisecond The position for forward playback
*/
- virtual void Forward( int millisecond ) = 0;
+ virtual void Forward(int millisecond) = 0;
/**
* @brief Seeks backward by the specified number of milliseconds.
* @SINCE_1_2.46
* @param[in] millisecond The position for backward playback
*/
- virtual void Backward( int millisecond ) = 0;
+ virtual void Backward(int millisecond) = 0;
/**
* @brief Checks whether the video texture is supported
* @brief Sets codec type
* @param[in] type The CodecType
*/
- virtual void SetCodecType( VideoPlayerPlugin::CodecType type ) = 0;
+ virtual void SetCodecType(VideoPlayerPlugin::CodecType type) = 0;
/**
* @brief Gets codec type
* @brief Sets the display mode for playback.
* @param[in] mode of playback
*/
- virtual void SetDisplayMode( VideoPlayerPlugin::DisplayMode::Type mode ) = 0;
+ virtual void SetDisplayMode(VideoPlayerPlugin::DisplayMode::Type mode) = 0;
/**
* @brief Returns the current display mode.
* This function is called, the synchronization is finished between UI(transparent hole) and video player.
*/
virtual void FinishSynchronization() = 0;
-
};
-} // namespace Dali;
+} // namespace Dali
#endif // DALI_VIDEO_PLAYER_PLUGIN_H
/*
- * Copyright (c) 2016 Samsung Electronics Co., Ltd.
+ * Copyright (c) 2020 Samsung Electronics Co., Ltd.
*
* Licensed under the Apache License, Version 2.0 (the "License");
* you may not use this file except in compliance with the License.
namespace Dali
{
-
VideoPlayer::VideoPlayer()
{
}
-VideoPlayer::VideoPlayer( Internal::Adaptor::VideoPlayer* internal )
-: BaseHandle( internal )
+VideoPlayer::VideoPlayer(Internal::Adaptor::VideoPlayer* internal)
+: BaseHandle(internal)
{
}
{
Internal::Adaptor::VideoPlayerPtr player = Internal::Adaptor::VideoPlayer::New();
- if( player )
+ if(player)
{
Dali::Actor actor;
- player->Initialize( actor, VideoSyncMode::DISABLED );
+ player->Initialize(actor, VideoSyncMode::DISABLED);
}
- return VideoPlayer( player.Get() );
+ return VideoPlayer(player.Get());
}
-VideoPlayer VideoPlayer::New( Dali::Actor actor, VideoSyncMode syncMode )
+VideoPlayer VideoPlayer::New(Dali::Actor actor, VideoSyncMode syncMode)
{
Internal::Adaptor::VideoPlayerPtr player = Internal::Adaptor::VideoPlayer::New();
- if( player )
+ if(player)
{
- player->Initialize( actor, syncMode );
+ player->Initialize(actor, syncMode);
}
- return VideoPlayer( player.Get() );
+ return VideoPlayer(player.Get());
}
-VideoPlayer::VideoPlayer( const VideoPlayer& player )
-: BaseHandle( player )
+VideoPlayer::VideoPlayer(const VideoPlayer& player)
+: BaseHandle(player)
{
}
-VideoPlayer& VideoPlayer::operator=( const VideoPlayer& player )
+VideoPlayer& VideoPlayer::operator=(const VideoPlayer& player)
{
- if( *this != player )
+ if(*this != player)
{
- BaseHandle::operator=( player );
+ BaseHandle::operator=(player);
}
return *this;
}
-VideoPlayer VideoPlayer::DownCast( BaseHandle handle )
+VideoPlayer VideoPlayer::DownCast(BaseHandle handle)
{
- return VideoPlayer( dynamic_cast< Internal::Adaptor::VideoPlayer* >( handle.GetObjectPtr() ) );
+ return VideoPlayer(dynamic_cast<Internal::Adaptor::VideoPlayer*>(handle.GetObjectPtr()));
}
-void VideoPlayer::SetUrl( const std::string& url )
+void VideoPlayer::SetUrl(const std::string& url)
{
- GetImplementation( *this ).SetUrl( url );
+ GetImplementation(*this).SetUrl(url);
}
std::string VideoPlayer::GetUrl()
{
- return GetImplementation( *this ).GetUrl();
+ return GetImplementation(*this).GetUrl();
}
void VideoPlayer::SetLooping(bool looping)
{
- GetImplementation( *this ).SetLooping( looping );
+ GetImplementation(*this).SetLooping(looping);
}
bool VideoPlayer::IsLooping()
{
- return GetImplementation( *this ).IsLooping();
+ return GetImplementation(*this).IsLooping();
}
void VideoPlayer::Play()
{
- GetImplementation( *this ).Play();
+ GetImplementation(*this).Play();
}
void VideoPlayer::Pause()
{
- GetImplementation( *this ).Pause();
+ GetImplementation(*this).Pause();
}
void VideoPlayer::Stop()
{
- GetImplementation( *this ).Stop();
+ GetImplementation(*this).Stop();
}
-void VideoPlayer::SetMute( bool mute )
+void VideoPlayer::SetMute(bool mute)
{
- GetImplementation( *this ).SetMute( mute );
+ GetImplementation(*this).SetMute(mute);
}
bool VideoPlayer::IsMuted()
{
- return GetImplementation( *this ).IsMuted();
+ return GetImplementation(*this).IsMuted();
}
-void VideoPlayer::SetVolume( float left, float right )
+void VideoPlayer::SetVolume(float left, float right)
{
- GetImplementation( *this ).SetVolume( left, right );
+ GetImplementation(*this).SetVolume(left, right);
}
-void VideoPlayer::GetVolume( float& left, float& right )
+void VideoPlayer::GetVolume(float& left, float& right)
{
- GetImplementation( *this ).GetVolume( left, right );
+ GetImplementation(*this).GetVolume(left, right);
}
-void VideoPlayer::SetRenderingTarget( Any target )
+void VideoPlayer::SetRenderingTarget(Any target)
{
- GetImplementation( *this ).SetRenderingTarget( target );
+ GetImplementation(*this).SetRenderingTarget(target);
}
-void VideoPlayer::SetPlayPosition( int millisecond )
+void VideoPlayer::SetPlayPosition(int millisecond)
{
- GetImplementation( *this ).SetPlayPosition( millisecond );
+ GetImplementation(*this).SetPlayPosition(millisecond);
}
int VideoPlayer::GetPlayPosition()
{
- return GetImplementation( *this ).GetPlayPosition();
+ return GetImplementation(*this).GetPlayPosition();
}
-void VideoPlayer::SetDisplayArea( DisplayArea area )
+void VideoPlayer::SetDisplayArea(DisplayArea area)
{
- GetImplementation( *this ).SetDisplayArea( area );
+ GetImplementation(*this).SetDisplayArea(area);
}
-void VideoPlayer::SetDisplayRotation( Dali::VideoPlayerPlugin::DisplayRotation rotation )
+void VideoPlayer::SetDisplayRotation(Dali::VideoPlayerPlugin::DisplayRotation rotation)
{
- GetImplementation( *this ).SetDisplayRotation( rotation );
+ GetImplementation(*this).SetDisplayRotation(rotation);
}
Dali::VideoPlayerPlugin::DisplayRotation VideoPlayer::GetDisplayRotation()
{
- return GetImplementation( *this ).GetDisplayRotation();
+ return GetImplementation(*this).GetDisplayRotation();
}
Dali::VideoPlayerPlugin::VideoPlayerSignalType& VideoPlayer::FinishedSignal()
{
- return GetImplementation( *this ).FinishedSignal();
+ return GetImplementation(*this).FinishedSignal();
}
-void VideoPlayer::Forward( int millisecond )
+void VideoPlayer::Forward(int millisecond)
{
- GetImplementation( *this ).Forward( millisecond );
+ GetImplementation(*this).Forward(millisecond);
}
-void VideoPlayer::Backward( int millisecond )
+void VideoPlayer::Backward(int millisecond)
{
- GetImplementation( *this ).Backward( millisecond );
+ GetImplementation(*this).Backward(millisecond);
}
bool VideoPlayer::IsVideoTextureSupported()
{
- return GetImplementation( *this ).IsVideoTextureSupported();
+ return GetImplementation(*this).IsVideoTextureSupported();
}
-void VideoPlayer::SetCodecType( Dali::VideoPlayerPlugin::CodecType type )
+void VideoPlayer::SetCodecType(Dali::VideoPlayerPlugin::CodecType type)
{
- GetImplementation( *this ).SetCodecType( type );
+ GetImplementation(*this).SetCodecType(type);
}
Dali::VideoPlayerPlugin::CodecType VideoPlayer::GetCodecType() const
{
- return GetImplementation( *this ).GetCodecType();
+ return GetImplementation(*this).GetCodecType();
}
-void VideoPlayer::SetDisplayMode( Dali::VideoPlayerPlugin::DisplayMode::Type mode )
+void VideoPlayer::SetDisplayMode(Dali::VideoPlayerPlugin::DisplayMode::Type mode)
{
- GetImplementation( *this ).SetDisplayMode( mode );
+ GetImplementation(*this).SetDisplayMode(mode);
}
Dali::VideoPlayerPlugin::DisplayMode::Type VideoPlayer::GetDisplayMode() const
{
- return GetImplementation( *this ).GetDisplayMode();
+ return GetImplementation(*this).GetDisplayMode();
}
Any VideoPlayer::GetMediaPlayer()
{
- return GetImplementation( *this ).GetMediaPlayer();
+ return GetImplementation(*this).GetMediaPlayer();
}
void VideoPlayer::StartSynchronization()
{
- GetImplementation( *this ).StartSynchronization();
+ GetImplementation(*this).StartSynchronization();
}
void VideoPlayer::FinishSynchronization()
{
- GetImplementation( *this ).FinishSynchronization();
+ GetImplementation(*this).FinishSynchronization();
}
-} // namespace Dali;
-
+} // namespace Dali
#define DALI_VIDEO_PLAYER_H
/*
- * Copyright (c) 2019 Samsung Electronics Co., Ltd.
+ * Copyright (c) 2020 Samsung Electronics Co., Ltd.
*
* Licensed under the Apache License, Version 2.0 (the "License");
* you may not use this file except in compliance with the License.
*/
// EXTERNAL INCLUDES
-#include <dali/public-api/object/base-handle.h>
#include <dali/devel-api/adaptor-framework/video-sync-mode.h>
+#include <dali/public-api/object/base-handle.h>
//INTERNAL INCLUDES
#include <dali/devel-api/adaptor-framework/video-player-plugin.h>
namespace Dali
{
-
class Any;
namespace Internal
{
-
namespace Adaptor
{
- class VideoPlayer;
+class VideoPlayer;
} // namespace Adaptor
} // namespace Internal
* @brief VideoPlayer class is used for video playback.
* @SINCE_1_1.38
*/
-class DALI_ADAPTOR_API VideoPlayer: public BaseHandle
+class DALI_ADAPTOR_API VideoPlayer : public BaseHandle
{
public:
-
/**
* @brief Constructor.
* @SINCE_1_1.38
* @param[in] actor video view's actor instance
* @param[in] syncMode The synchronization mode between the UI (transparent hole) and VideoPlayer.
*/
- static VideoPlayer New( Dali::Actor actor, VideoSyncMode syncMode );
+ static VideoPlayer New(Dali::Actor actor, VideoSyncMode syncMode);
- /**
+ /**
* @brief Copy constructor.
*
* @SINCE_1_1.38
* @param[in] player VideoPlayer to copy. The copied player will point at the same implementation
*/
- VideoPlayer( const VideoPlayer& player );
+ VideoPlayer(const VideoPlayer& player);
- /**
+ /**
* @brief Assignment operator.
*
* @SINCE_1_1.38
* @param[in] player The VideoPlayer to assign from.
* @return The updated VideoPlayer.
*/
- VideoPlayer& operator=( const VideoPlayer& player );
+ VideoPlayer& operator=(const VideoPlayer& player);
/**
* @brief Downcast a handle to VideoPlayer handle.
* @param[in] handle Handle to an object
* @return Handle to a VideoPlayer or an uninitialized handle
*/
- static VideoPlayer DownCast( BaseHandle handle );
+ static VideoPlayer DownCast(BaseHandle handle);
/**
* @brief Sets a URL of the video file to play.
* @SINCE_1_1.38
* @param [in] url The url of video file
*/
- void SetUrl( const std::string& url );
+ void SetUrl(const std::string& url);
/**
* @brief Returns the URL of the video file.
* @SINCE_1_1.38
* @param[in] mute The new mute status, true is mute.
*/
- void SetMute( bool mute );
+ void SetMute(bool mute);
/**
* @brief Returns the player mute status.
* @param[in] left The left volume scalar
* @param[in] right The right volume scalar
*/
- void SetVolume( float left, float right );
+ void SetVolume(float left, float right);
/**
* @brief Returns current volume factor.
* @param[out] left The current left volume scalar
* @param[out] right The current right volume scalar
*/
- void GetVolume( float& left, float& right );
+ void GetVolume(float& left, float& right);
/**
* @brief Sets video rendering target.
* @SINCE_1_1.38
* @param[in] target The target for video rendering, window surface or native image source
*/
- void SetRenderingTarget( Any target );
+ void SetRenderingTarget(Any target);
/**
* @brief Sets the position for playback.
*
* @param[in] millisecond The position for playback
*/
- void SetPlayPosition( int millisecond );
+ void SetPlayPosition(int millisecond);
/**
* @brief Gets the current position in milliseconds.
* @SINCE_1_2.46
* param[in] area The left-top position and size of the video display area
*/
- void SetDisplayArea( DisplayArea area );
+ void SetDisplayArea(DisplayArea area);
/**
* @brief Sets video display rotation
* @SINCE_1_1.38
* @param[in] rotation The rotation of display
*/
- void SetDisplayRotation( Dali::VideoPlayerPlugin::DisplayRotation rotation );
+ void SetDisplayRotation(Dali::VideoPlayerPlugin::DisplayRotation rotation);
/**
* @brief Returns rotation of current video display
* @SINCE_1_2.46
* @param[in] millisecond The position for forward playback
*/
- void Forward( int millisecond );
+ void Forward(int millisecond);
/**
* @brief Seeks backward by the specified number of milliseconds.
* @SINCE_1_2.46
* @param[in] millisecond The position for backward playback
*/
- void Backward( int millisecond );
+ void Backward(int millisecond);
/**
* @brief Checks whether the video texture is supported
* @brief Sets codec type
* @param[in] type The VideoCodec::Type
*/
- void SetCodecType( Dali::VideoPlayerPlugin::CodecType type );
+ void SetCodecType(Dali::VideoPlayerPlugin::CodecType type);
/**
* @brief Gets codec type
* @brief Sets the display mode for playback.
* @param[in] mode of playback
*/
- void SetDisplayMode( Dali::VideoPlayerPlugin::DisplayMode::Type mode );
+ void SetDisplayMode(Dali::VideoPlayerPlugin::DisplayMode::Type mode);
/**
* @brief Gets display mode
void FinishSynchronization();
private: // Not intended for application developers
-
/**
* @brief Internal constructor
* @SINCE_1_1.38
*/
- explicit DALI_INTERNAL VideoPlayer( Internal::Adaptor::VideoPlayer* internal );
+ explicit DALI_INTERNAL VideoPlayer(Internal::Adaptor::VideoPlayer* internal);
};
-} // namespace Dali;
+} // namespace Dali
#endif // DALI_VIDEO_PLAYER_H
#define DALI_VIDEO_SYNC_MODE
/*
- * Copyright (c) 2019 Samsung Electronics Co., Ltd.
+ * Copyright (c) 2020 Samsung Electronics Co., Ltd.
*
* Licensed under the Apache License, Version 2.0 (the "License");
* you may not use this file except in compliance with the License.
namespace Dali
{
- /**
+/**
* @brief Enumeration for the synchronization is ended between UI(transparent hole) and video player.
*/
- enum class VideoSyncMode
- {
- DISABLED = 0,
- ENABLED
- };
+enum class VideoSyncMode
+{
+ DISABLED = 0,
+ ENABLED
+};
-} // Dali
+} // namespace Dali
#endif // DALI_VIDEO_SYNC_MODE
-
/*
- * Copyright (c) 2018 Samsung Electronics Co., Ltd.
+ * Copyright (c) 2020 Samsung Electronics Co., Ltd.
*
* Licensed under the Apache License, Version 2.0 (the "License");
* you may not use this file except in compliance with the License.
namespace Dali
{
-
namespace VirtualKeyboard
{
-
void Show()
{
Internal::Adaptor::VirtualKeyboard::Show();
return Internal::Adaptor::VirtualKeyboard::IsVisible();
}
-void ApplySettings( const Property::Map& settingsMap )
+void ApplySettings(const Property::Map& settingsMap)
{
- Internal::Adaptor::VirtualKeyboard::ApplySettings( settingsMap );
+ Internal::Adaptor::VirtualKeyboard::ApplySettings(settingsMap);
}
-void SetReturnKeyType( const InputMethod::ButtonAction::Type type )
+void SetReturnKeyType(const InputMethod::ButtonAction::Type type)
{
- Internal::Adaptor::VirtualKeyboard::SetReturnKeyType( type );
+ Internal::Adaptor::VirtualKeyboard::SetReturnKeyType(type);
}
InputMethod::ButtonAction::Type GetReturnKeyType()
#define DALI_VIRTUAL_KEYBOARD_H
/*
- * Copyright (c) 2019 Samsung Electronics Co., Ltd.
+ * Copyright (c) 2020 Samsung Electronics Co., Ltd.
*
* Licensed under the Apache License, Version 2.0 (the "License");
* you may not use this file except in compliance with the License.
*/
// EXTERNAL INCLUDES
-#include <dali/public-api/signals/dali-signal.h>
-#include <dali/public-api/object/property-map.h>
#include <dali/public-api/math/rect.h>
+#include <dali/public-api/object/property-map.h>
+#include <dali/public-api/signals/dali-signal.h>
// INTERNAL INCLUDES
#include <dali/public-api/adaptor-framework/input-method.h>
namespace Dali
{
-
/**
* @brief This namespace is provided for application developers to be able to show and hide the on-screen keyboard.
*
*/
namespace VirtualKeyboard
{
-
// Types
-typedef Signal< void () > VoidSignalType;
-typedef Signal< void ( bool ) > StatusSignalType;
-typedef Signal< void ( int ) > KeyboardResizedSignalType;
-typedef Signal< void ( int ) > LanguageChangedSignalType;
+typedef Signal<void()> VoidSignalType;
+typedef Signal<void(bool)> StatusSignalType;
+typedef Signal<void(int)> KeyboardResizedSignalType;
+typedef Signal<void(int)> LanguageChangedSignalType;
// Enumerations
* @brief Set one or more of the Input Method Settings
* @param[in] settingsMap Map of Settings to be applied.
*/
-DALI_ADAPTOR_API void ApplySettings( const Property::Map& settingsMap );
+DALI_ADAPTOR_API void ApplySettings(const Property::Map& settingsMap);
/**
* @brief Set the specific return key into the virtual keyboard.
* @param[in] type the kind of return key types.
*/
-DALI_ADAPTOR_API void SetReturnKeyType( const InputMethod::ButtonAction::Type type );
+DALI_ADAPTOR_API void SetReturnKeyType(const InputMethod::ButtonAction::Type type);
/**
* @brief Retrieve the current return key type.
namespace Dali
{
-
class KeyEvent;
class TouchEvent;
class WebEnginePlugin
{
public:
-
/**
* @brief WebEngine signal type related with page loading.
*/
- typedef Signal< void( const std::string& ) > WebEnginePageLoadSignalType;
+ typedef Signal<void(const std::string&)> WebEnginePageLoadSignalType;
/**
* @brief WebView signal type related with page loading error.
*/
- typedef Signal< void( const std::string&, int ) > WebEnginePageLoadErrorSignalType;
+ typedef Signal<void(const std::string&, int)> WebEnginePageLoadErrorSignalType;
/**
* @brief Enumeration for cache model options.
* @param [in] locale The locale of Web
* @param [in] timezoneId The timezoneID of Web
*/
- virtual void Create( int width, int height, const std::string& locale, const std::string& timezoneId ) = 0;
+ virtual void Create(int width, int height, const std::string& locale, const std::string& timezoneId) = 0;
/**
* @brief Destroys WebEngine instance.
*
* @param [in] url The URL of the resource to load
*/
- virtual void LoadUrl( const std::string& url ) = 0;
+ virtual void LoadUrl(const std::string& url) = 0;
/**
* @brief Gets image to render.
*
* @param [in] htmlString The string to use as the contents of the web page
*/
- virtual void LoadHTMLString( const std::string& htmlString ) = 0;
+ virtual void LoadHTMLString(const std::string& htmlString) = 0;
/**
* @brief Reloads the Web.
* @param[in] script The JavaScript code
* @param[in] resultHandler The callback function to be called by the JavaScript runtime. This carries evaluation result.
*/
- virtual void EvaluateJavaScript( const std::string& script, std::function< void( const std::string& ) > resultHandler ) = 0;
+ virtual void EvaluateJavaScript(const std::string& script, std::function<void(const std::string&)> resultHandler) = 0;
/**
* @brief Add a message handler into JavaScript.
* @param[in] exposedObjectName The name of exposed object
* @param[in] handler The callback function
*/
- virtual void AddJavaScriptMessageHandler( const std::string& exposedObjectName, std::function< void( const std::string& ) > handler ) = 0;
+ virtual void AddJavaScriptMessageHandler(const std::string& exposedObjectName, std::function<void(const std::string&)> handler) = 0;
/**
* @brief Clears the history of Web.
*
* @param[in] cacheModel The cache model option
*/
- virtual void SetCacheModel( CacheModel cacheModel ) = 0;
+ virtual void SetCacheModel(CacheModel cacheModel) = 0;
/**
* @brief Gets the cookie acceptance policy. The default is NO_THIRD_PARTY.
*
* @param[in] policy The cookie acceptance policy
*/
- virtual void SetCookieAcceptPolicy( CookieAcceptPolicy policy ) = 0;
+ virtual void SetCookieAcceptPolicy(CookieAcceptPolicy policy) = 0;
/**
* @brief Get user agent string.
*
* @param[in] userAgent The string value of user agent
*/
- virtual void SetUserAgent( const std::string& userAgent ) = 0;
+ virtual void SetUserAgent(const std::string& userAgent) = 0;
/**
* @brief Returns whether JavaScript can be executable. The default is true.
*
* @param[in] enabled True if JavaScript executing is enabled, false otherwise
*/
- virtual void EnableJavaScript( bool enabled ) = 0;
+ virtual void EnableJavaScript(bool enabled) = 0;
/**
* @brief Returns whether images can be loaded automatically. The default is true.
*
* @param[in] automatic True if images are loaded automatically, false otherwise
*/
- virtual void LoadImagesAutomatically( bool automatic ) = 0;
+ virtual void LoadImagesAutomatically(bool automatic) = 0;
/**
* @brief Gets the default text encoding name (e.g. UTF-8).
*
* @param[in] defaultTextEncodingName The default text encoding name
*/
- virtual void SetDefaultTextEncodingName( const std::string& defaultTextEncodingName ) = 0;
+ virtual void SetDefaultTextEncodingName(const std::string& defaultTextEncodingName) = 0;
/**
* @brief Returns the default font size in pixel. The default value is 16.
*
* @param[in] defaultFontSize A new default font size to set
*/
- virtual void SetDefaultFontSize( int defaultFontSize ) = 0;
+ virtual void SetDefaultFontSize(int defaultFontSize) = 0;
/**
* @brief Sets size of Web Page.
*/
- virtual void SetSize( int width, int height ) = 0;
+ virtual void SetSize(int width, int height) = 0;
/**
* @brief Sends Touch Events.
*/
- virtual bool SendTouchEvent( const TouchEvent& touch ) = 0;
+ virtual bool SendTouchEvent(const TouchEvent& touch) = 0;
/**
* @brief Sends Key Events.
*/
- virtual bool SendKeyEvent( const KeyEvent& event ) = 0;
+ virtual bool SendKeyEvent(const KeyEvent& event) = 0;
/**
* @brief Connects to this signal to be notified when page loading is started.
* @return A signal object to connect with.
*/
virtual WebEnginePageLoadErrorSignalType& PageLoadErrorSignal() = 0;
-
};
-} // namespace Dali;
+} // namespace Dali
#endif
namespace Dali
{
-
WebEngine::WebEngine()
{
}
-WebEngine::WebEngine( Internal::Adaptor::WebEngine* internal )
-: BaseHandle( internal )
+WebEngine::WebEngine(Internal::Adaptor::WebEngine* internal)
+: BaseHandle(internal)
{
}
{
Internal::Adaptor::WebEnginePtr engine = Internal::Adaptor::WebEngine::New();
- return WebEngine( engine.Get() );
+ return WebEngine(engine.Get());
}
-WebEngine::WebEngine( const WebEngine& webEngine )
-: BaseHandle( webEngine )
+WebEngine::WebEngine(const WebEngine& webEngine)
+: BaseHandle(webEngine)
{
}
-WebEngine& WebEngine::operator=( const WebEngine& webEngine )
+WebEngine& WebEngine::operator=(const WebEngine& webEngine)
{
- if( *this != webEngine )
+ if(*this != webEngine)
{
- BaseHandle::operator=( webEngine );
+ BaseHandle::operator=(webEngine);
}
return *this;
}
-WebEngine WebEngine::DownCast( BaseHandle handle )
+WebEngine WebEngine::DownCast(BaseHandle handle)
{
- return WebEngine( dynamic_cast< Internal::Adaptor::WebEngine* >( handle.GetObjectPtr() ) );
+ return WebEngine(dynamic_cast<Internal::Adaptor::WebEngine*>(handle.GetObjectPtr()));
}
-void WebEngine::Create( int width, int height, const std::string& locale, const std::string& timezoneId )
+void WebEngine::Create(int width, int height, const std::string& locale, const std::string& timezoneId)
{
- GetImplementation( *this ).Create( width, height, locale, timezoneId );
+ GetImplementation(*this).Create(width, height, locale, timezoneId);
}
void WebEngine::Destroy()
{
- GetImplementation( *this ).Destroy();
+ GetImplementation(*this).Destroy();
}
NativeImageInterfacePtr WebEngine::GetNativeImageSource()
{
- return GetImplementation( *this ).GetNativeImageSource();
+ return GetImplementation(*this).GetNativeImageSource();
}
-void WebEngine::LoadUrl( const std::string& url )
+void WebEngine::LoadUrl(const std::string& url)
{
- return GetImplementation( *this ).LoadUrl( url );
+ return GetImplementation(*this).LoadUrl(url);
}
const std::string& WebEngine::GetUrl()
{
- return GetImplementation( *this ).GetUrl();
+ return GetImplementation(*this).GetUrl();
}
-void WebEngine::LoadHTMLString( const std::string& htmlString )
+void WebEngine::LoadHTMLString(const std::string& htmlString)
{
- GetImplementation( *this ).LoadHTMLString( htmlString );
+ GetImplementation(*this).LoadHTMLString(htmlString);
}
void WebEngine::Reload()
{
- GetImplementation( *this ).Reload();
+ GetImplementation(*this).Reload();
}
void WebEngine::StopLoading()
{
- GetImplementation( *this ).StopLoading();
+ GetImplementation(*this).StopLoading();
}
void WebEngine::Suspend()
{
- GetImplementation( *this ).Suspend();
+ GetImplementation(*this).Suspend();
}
void WebEngine::Resume()
{
- GetImplementation( *this ).Resume();
+ GetImplementation(*this).Resume();
}
bool WebEngine::CanGoForward()
{
- return GetImplementation( *this ).CanGoForward();
+ return GetImplementation(*this).CanGoForward();
}
void WebEngine::GoForward()
{
- GetImplementation( *this ).GoForward();
+ GetImplementation(*this).GoForward();
}
bool WebEngine::CanGoBack()
{
- return GetImplementation( *this ).CanGoBack();
+ return GetImplementation(*this).CanGoBack();
}
void WebEngine::GoBack()
{
- GetImplementation( *this ).GoBack();
+ GetImplementation(*this).GoBack();
}
-void WebEngine::EvaluateJavaScript( const std::string& script, std::function< void( const std::string& ) > resultHandler )
+void WebEngine::EvaluateJavaScript(const std::string& script, std::function<void(const std::string&)> resultHandler)
{
- GetImplementation( *this ).EvaluateJavaScript( script, resultHandler );
+ GetImplementation(*this).EvaluateJavaScript(script, resultHandler);
}
-void WebEngine::AddJavaScriptMessageHandler( const std::string& exposedObjectName, std::function< void( const std::string& ) > handler )
+void WebEngine::AddJavaScriptMessageHandler(const std::string& exposedObjectName, std::function<void(const std::string&)> handler)
{
- GetImplementation( *this ).AddJavaScriptMessageHandler( exposedObjectName, handler );
+ GetImplementation(*this).AddJavaScriptMessageHandler(exposedObjectName, handler);
}
void WebEngine::ClearHistory()
{
- return GetImplementation( *this ).ClearHistory();
+ return GetImplementation(*this).ClearHistory();
}
void WebEngine::ClearCache()
{
- return GetImplementation( *this ).ClearCache();
+ return GetImplementation(*this).ClearCache();
}
void WebEngine::ClearCookies()
{
- return GetImplementation( *this ).ClearCookies();
+ return GetImplementation(*this).ClearCookies();
}
Dali::WebEnginePlugin::CacheModel WebEngine::GetCacheModel() const
{
- return GetImplementation( *this ).GetCacheModel();
+ return GetImplementation(*this).GetCacheModel();
}
-void WebEngine::SetCacheModel( Dali::WebEnginePlugin::CacheModel cacheModel )
+void WebEngine::SetCacheModel(Dali::WebEnginePlugin::CacheModel cacheModel)
{
- GetImplementation( *this ).SetCacheModel( cacheModel );
+ GetImplementation(*this).SetCacheModel(cacheModel);
}
Dali::WebEnginePlugin::CookieAcceptPolicy WebEngine::GetCookieAcceptPolicy() const
{
- return GetImplementation( *this ).GetCookieAcceptPolicy();
+ return GetImplementation(*this).GetCookieAcceptPolicy();
}
-void WebEngine::SetCookieAcceptPolicy( Dali::WebEnginePlugin::CookieAcceptPolicy policy )
+void WebEngine::SetCookieAcceptPolicy(Dali::WebEnginePlugin::CookieAcceptPolicy policy)
{
- GetImplementation( *this ).SetCookieAcceptPolicy( policy );
+ GetImplementation(*this).SetCookieAcceptPolicy(policy);
}
const std::string& WebEngine::GetUserAgent() const
{
- return GetImplementation( *this ).GetUserAgent();
+ return GetImplementation(*this).GetUserAgent();
}
-void WebEngine::SetUserAgent( const std::string& userAgent )
+void WebEngine::SetUserAgent(const std::string& userAgent)
{
- GetImplementation( *this ).SetUserAgent( userAgent );
+ GetImplementation(*this).SetUserAgent(userAgent);
}
bool WebEngine::IsJavaScriptEnabled() const
{
- return GetImplementation( *this ).IsJavaScriptEnabled();
+ return GetImplementation(*this).IsJavaScriptEnabled();
}
-void WebEngine::EnableJavaScript( bool enabled )
+void WebEngine::EnableJavaScript(bool enabled)
{
- GetImplementation( *this ).EnableJavaScript( enabled );
+ GetImplementation(*this).EnableJavaScript(enabled);
}
bool WebEngine::AreImagesAutomaticallyLoaded() const
{
- return GetImplementation( *this ).AreImagesAutomaticallyLoaded();
+ return GetImplementation(*this).AreImagesAutomaticallyLoaded();
}
-void WebEngine::LoadImagesAutomatically( bool automatic )
+void WebEngine::LoadImagesAutomatically(bool automatic)
{
- GetImplementation( *this ).LoadImagesAutomatically( automatic );
+ GetImplementation(*this).LoadImagesAutomatically(automatic);
}
const std::string& WebEngine::GetDefaultTextEncodingName() const
{
- return GetImplementation( *this ).GetDefaultTextEncodingName();
+ return GetImplementation(*this).GetDefaultTextEncodingName();
}
-void WebEngine::SetDefaultTextEncodingName( const std::string& defaultTextEncodingName )
+void WebEngine::SetDefaultTextEncodingName(const std::string& defaultTextEncodingName)
{
- GetImplementation( *this ).SetDefaultTextEncodingName( defaultTextEncodingName );
+ GetImplementation(*this).SetDefaultTextEncodingName(defaultTextEncodingName);
}
int WebEngine::GetDefaultFontSize() const
{
- return GetImplementation( *this ).GetDefaultFontSize();
+ return GetImplementation(*this).GetDefaultFontSize();
}
-void WebEngine::SetDefaultFontSize( int defaultFontSize )
+void WebEngine::SetDefaultFontSize(int defaultFontSize)
{
- GetImplementation( *this ).SetDefaultFontSize( defaultFontSize );
+ GetImplementation(*this).SetDefaultFontSize(defaultFontSize);
}
-void WebEngine::SetSize( int width, int height )
+void WebEngine::SetSize(int width, int height)
{
- return GetImplementation( *this ).SetSize( width, height );
+ return GetImplementation(*this).SetSize(width, height);
}
-bool WebEngine::SendTouchEvent( const TouchEvent& touch )
+bool WebEngine::SendTouchEvent(const TouchEvent& touch)
{
- return GetImplementation( *this ).SendTouchEvent( touch );
+ return GetImplementation(*this).SendTouchEvent(touch);
}
-bool WebEngine::SendKeyEvent( const KeyEvent& event )
+bool WebEngine::SendKeyEvent(const KeyEvent& event)
{
- return GetImplementation( *this ).SendKeyEvent( event );
+ return GetImplementation(*this).SendKeyEvent(event);
}
Dali::WebEnginePlugin::WebEnginePageLoadSignalType& WebEngine::PageLoadStartedSignal()
{
- return GetImplementation( *this ).PageLoadStartedSignal();
+ return GetImplementation(*this).PageLoadStartedSignal();
}
Dali::WebEnginePlugin::WebEnginePageLoadSignalType& WebEngine::PageLoadFinishedSignal()
{
- return GetImplementation( *this ).PageLoadFinishedSignal();
+ return GetImplementation(*this).PageLoadFinishedSignal();
}
Dali::WebEnginePlugin::WebEnginePageLoadErrorSignalType& WebEngine::PageLoadErrorSignal()
{
- return GetImplementation( *this ).PageLoadErrorSignal();
+ return GetImplementation(*this).PageLoadErrorSignal();
}
-} // namespace Dali;
-
+} // namespace Dali
namespace Dali
{
-
namespace Internal
{
-
namespace Adaptor
{
- class WebEngine;
+class WebEngine;
} // namespace Adaptor
} // namespace Internal
class DALI_ADAPTOR_API WebEngine : public BaseHandle
{
public:
-
/**
* @brief Constructor.
*/
*
* @param[in] WebEngine WebEngine to copy. The copied WebEngine will point at the same implementation
*/
- WebEngine( const WebEngine& WebEngine );
+ WebEngine(const WebEngine& WebEngine);
/**
* @brief Assignment operator.
* @param[in] WebEngine The WebEngine to assign from.
* @return The updated WebEngine.
*/
- WebEngine& operator=( const WebEngine& WebEngine );
+ WebEngine& operator=(const WebEngine& WebEngine);
/**
* @brief Downcast a handle to WebEngine handle.
* @param[in] handle Handle to an object
* @return Handle to a WebEngine or an uninitialized handle
*/
- static WebEngine DownCast( BaseHandle handle );
+ static WebEngine DownCast(BaseHandle handle);
/**
* @brief Creates WebEngine instance.
* @param [in] locale The locale of Web
* @param [in] timezoneId The timezoneID of Web
*/
- void Create( int width, int height, const std::string& locale, const std::string& timezoneId );
+ void Create(int width, int height, const std::string& locale, const std::string& timezoneId);
/**
* @brief Destroys WebEngine instance.
*
* @param [in] url The URL of the resource to load
*/
- void LoadUrl( const std::string& url );
+ void LoadUrl(const std::string& url);
/**
* @brief Gets the url.
*
* @param [in] htmlString The string to use as the contents of the web page
*/
- void LoadHTMLString( const std::string& htmlString );
+ void LoadHTMLString(const std::string& htmlString);
/**
* @brief Reloads the Web.
* @param[in] script The JavaScript code
* @param[in] resultHandler The callback function to be called by the JavaScript runtime. This carries evaluation result.
*/
- void EvaluateJavaScript( const std::string& script, std::function< void( const std::string& ) > resultHandler );
+ void EvaluateJavaScript(const std::string& script, std::function<void(const std::string&)> resultHandler);
/**
* @brief Add a message handler into JavaScript.
* @param[in] exposedObjectName The name of exposed object
* @param[in] handler The callback function
*/
- void AddJavaScriptMessageHandler( const std::string& exposedObjectName, std::function< void( const std::string& ) > handler );
+ void AddJavaScriptMessageHandler(const std::string& exposedObjectName, std::function<void(const std::string&)> handler);
/**
* @brief Clears the history of Web.
*
* @param[in] cacheModel The cache model option
*/
- void SetCacheModel( Dali::WebEnginePlugin::CacheModel cacheModel );
+ void SetCacheModel(Dali::WebEnginePlugin::CacheModel cacheModel);
/**
* @brief Gets the cookie acceptance policy. The default is NO_THIRD_PARTY.
*
* @param[in] policy The cookie acceptance policy
*/
- void SetCookieAcceptPolicy( Dali::WebEnginePlugin::CookieAcceptPolicy policy );
+ void SetCookieAcceptPolicy(Dali::WebEnginePlugin::CookieAcceptPolicy policy);
/**
* @brief Get user agent string.
*
* @param[in] userAgent The string value of user agent
*/
- void SetUserAgent( const std::string& userAgent );
+ void SetUserAgent(const std::string& userAgent);
/**
* @brief Returns whether JavaScript can be executable. The default is true.
*
* @param[in] enabled True if JavaScript executing is enabled, false otherwise
*/
- void EnableJavaScript( bool enabled );
+ void EnableJavaScript(bool enabled);
/**
* @brief Returns whether JavaScript can be executable. The default is true.
*
* @param[in] automatic True if images are loaded automatically, false otherwise
*/
- void LoadImagesAutomatically( bool automatic );
+ void LoadImagesAutomatically(bool automatic);
/**
* @brief Gets the default text encoding name.
*
* @param[in] defaultTextEncodingName The default text encoding name
*/
- void SetDefaultTextEncodingName( const std::string& defaultTextEncodingName );
+ void SetDefaultTextEncodingName(const std::string& defaultTextEncodingName);
/**
* @brief Returns the default font size in pixel. The default value is 16.
*
* @param[in] defaultFontSize A new default font size to set
*/
- void SetDefaultFontSize( int defaultFontSize );
+ void SetDefaultFontSize(int defaultFontSize);
/**
* @brief Sets the size of Web Pages.
*/
- void SetSize( int width, int height );
+ void SetSize(int width, int height);
/**
* @brief Sends Touch Events.
*/
- bool SendTouchEvent( const TouchEvent& touch );
+ bool SendTouchEvent(const TouchEvent& touch);
/**
* @brief Sends key Events.
*/
- bool SendKeyEvent( const KeyEvent& event );
+ bool SendKeyEvent(const KeyEvent& event);
/**
* @brief Connects to this signal to be notified when page loading is started.
Dali::WebEnginePlugin::WebEnginePageLoadErrorSignalType& PageLoadErrorSignal();
private: // Not intended for application developers
-
/**
* @brief Internal constructor
*/
- explicit DALI_INTERNAL WebEngine( Internal::Adaptor::WebEngine* internal );
+ explicit DALI_INTERNAL WebEngine(Internal::Adaptor::WebEngine* internal);
};
-} // namespace Dali;
+} // namespace Dali
#endif // DALI_WEB_ENGINE_H
namespace Dali
{
-
namespace DevelWindow
{
-
Window New(Any surface, PositionSize windowPosition, const std::string& name, bool isTransparent)
{
return DevelWindow::New(surface, windowPosition, name, "", isTransparent);
Window newWindow;
const bool isAdaptorAvailable = Dali::Adaptor::IsAvailable();
- bool isNewWindowAllowed = true;
+ bool isNewWindowAllowed = true;
- if (isAdaptorAvailable)
+ if(isAdaptorAvailable)
{
Dali::Adaptor& adaptor = Internal::Adaptor::Adaptor::Get();
- isNewWindowAllowed = Internal::Adaptor::Adaptor::GetImplementation(adaptor).IsMultipleWindowSupported();
+ isNewWindowAllowed = Internal::Adaptor::Adaptor::GetImplementation(adaptor).IsMultipleWindowSupported();
}
- if (isNewWindowAllowed)
+ if(isNewWindowAllowed)
{
Internal::Adaptor::Window* window = Internal::Adaptor::Window::New(surface, windowPosition, name, className, isTransparent);
Integration::SceneHolder sceneHolder = Integration::SceneHolder(window);
- if (isAdaptorAvailable)
+ if(isAdaptorAvailable)
{
Dali::Adaptor& adaptor = Internal::Adaptor::Adaptor::Get();
Internal::Adaptor::Adaptor::GetImplementation(adaptor).AddWindow(sceneHolder);
return newWindow;
}
-void SetPositionSize( Window window, PositionSize positionSize )
-{
- GetImplementation( window ).SetPositionSize( positionSize );
-}
-
-Window Get( Actor actor )
+void SetPositionSize(Window window, PositionSize positionSize)
{
- return Internal::Adaptor::Window::Get( actor );
+ GetImplementation(window).SetPositionSize(positionSize);
}
-EventProcessingFinishedSignalType& EventProcessingFinishedSignal( Window window )
+Window Get(Actor actor)
{
- return GetImplementation( window ).EventProcessingFinishedSignal();
+ return Internal::Adaptor::Window::Get(actor);
}
-WheelEventSignalType& WheelEventSignal( Window window )
+EventProcessingFinishedSignalType& EventProcessingFinishedSignal(Window window)
{
- return GetImplementation( window ).WheelEventSignal();
+ return GetImplementation(window).EventProcessingFinishedSignal();
}
-VisibilityChangedSignalType& VisibilityChangedSignal( Window window )
+WheelEventSignalType& WheelEventSignal(Window window)
{
- return GetImplementation( window ).VisibilityChangedSignal();
+ return GetImplementation(window).WheelEventSignal();
}
-TransitionEffectEventSignalType& TransitionEffectEventSignal( Window window )
+VisibilityChangedSignalType& VisibilityChangedSignal(Window window)
{
- return GetImplementation( window ).TransitionEffectEventSignal();
+ return GetImplementation(window).VisibilityChangedSignal();
}
-KeyboardRepeatSettingsChangedSignalType& KeyboardRepeatSettingsChangedSignal( Window window )
+TransitionEffectEventSignalType& TransitionEffectEventSignal(Window window)
{
- return GetImplementation( window ).KeyboardRepeatSettingsChangedSignal();
+ return GetImplementation(window).TransitionEffectEventSignal();
}
-void SetParent( Window window, Window parent )
+KeyboardRepeatSettingsChangedSignalType& KeyboardRepeatSettingsChangedSignal(Window window)
{
- GetImplementation( window ).SetParent( parent );
+ return GetImplementation(window).KeyboardRepeatSettingsChangedSignal();
}
-void Unparent( Window window )
+void SetParent(Window window, Window parent)
{
- GetImplementation( window ).Unparent();
+ GetImplementation(window).SetParent(parent);
}
-Window GetParent( Window window )
+void Unparent(Window window)
{
- return GetImplementation( window ).GetParent();
+ GetImplementation(window).Unparent();
}
-Window DownCast( BaseHandle handle )
+Window GetParent(Window window)
{
- return Window( dynamic_cast<Dali::Internal::Adaptor::Window*>( handle.GetObjectPtr()) );
+ return GetImplementation(window).GetParent();
}
-Dali::Window::WindowOrientation GetCurrentOrientation( Window window )
+Window DownCast(BaseHandle handle)
{
- return GetImplementation( window ).GetCurrentOrientation();
+ return Window(dynamic_cast<Dali::Internal::Adaptor::Window*>(handle.GetObjectPtr()));
}
-void SetAvailableOrientations( Window window, const Dali::Vector<Dali::Window::WindowOrientation>& orientations )
+Dali::Window::WindowOrientation GetCurrentOrientation(Window window)
{
- GetImplementation( window ).SetAvailableOrientations( orientations );
+ return GetImplementation(window).GetCurrentOrientation();
}
-int32_t GetNativeId( Window window )
+void SetAvailableOrientations(Window window, const Dali::Vector<Dali::Window::WindowOrientation>& orientations)
{
- return GetImplementation( window ).GetNativeId();
+ GetImplementation(window).SetAvailableOrientations(orientations);
}
-void SetDamagedAreas(Window window, std::vector<Dali::Rect<int>>& areas)
+int32_t GetNativeId(Window window)
{
- GetImplementation(window).SetDamagedAreas(areas);
+ return GetImplementation(window).GetNativeId();
}
-void AddFrameRenderedCallback( Window window, std::unique_ptr< CallbackBase > callback, int32_t frameId )
+void AddFrameRenderedCallback(Window window, std::unique_ptr<CallbackBase> callback, int32_t frameId)
{
- GetImplementation( window ).AddFrameRenderedCallback( std::move( callback ), frameId );
+ GetImplementation(window).AddFrameRenderedCallback(std::move(callback), frameId);
}
-void AddFramePresentedCallback( Window window, std::unique_ptr< CallbackBase > callback, int32_t frameId )
+void AddFramePresentedCallback(Window window, std::unique_ptr<CallbackBase> callback, int32_t frameId)
{
- GetImplementation( window ).AddFramePresentedCallback( std::move( callback ), frameId );
+ GetImplementation(window).AddFramePresentedCallback(std::move(callback), frameId);
}
} // namespace DevelWindow
#include <memory>
// INTERNAL INCLUDES
-#include <dali/public-api/common/vector-wrapper.h>
#include <dali/public-api/adaptor-framework/window.h>
+#include <dali/public-api/common/vector-wrapper.h>
namespace Dali
{
*/
enum class EffectState
{
- NONE = 0, ///< None state
- START, ///< Transition effect is started.
- END ///< Transition effect is ended.
+ NONE = 0, ///< None state
+ START, ///< Transition effect is started.
+ END ///< Transition effect is ended.
};
/**
* @brief Enumeration for transition effect's type.
*/
-enum class EffectType
+enum class EffectType
{
- NONE = 0, ///< None type
- SHOW, ///< Window show effect.
- HIDE, ///< Window hide effect.
+ NONE = 0, ///< None type
+ SHOW, ///< Window show effect.
+ HIDE, ///< Window hide effect.
};
-typedef Signal< void () > EventProcessingFinishedSignalType; ///< Event Processing finished signal type
+typedef Signal<void()> EventProcessingFinishedSignalType; ///< Event Processing finished signal type
-typedef Signal< void (const KeyEvent&) > KeyEventSignalType; ///< Key event signal type
+typedef Signal<void(const KeyEvent&)> KeyEventSignalType; ///< Key event signal type
-typedef Signal< void (const TouchEvent&) > TouchEventSignalType; ///< Touch signal type
+typedef Signal<void(const TouchEvent&)> TouchEventSignalType; ///< Touch signal type
-typedef Signal< void (const WheelEvent&) > WheelEventSignalType; ///< Touched signal type
+typedef Signal<void(const WheelEvent&)> WheelEventSignalType; ///< Touched signal type
-typedef Signal< void ( Window, bool ) > VisibilityChangedSignalType; ///< Visibility changed signal type
+typedef Signal<void(Window, bool)> VisibilityChangedSignalType; ///< Visibility changed signal type
-typedef Signal< void (Window, EffectState, EffectType) > TransitionEffectEventSignalType; ///< Effect signal type and state
+typedef Signal<void(Window, EffectState, EffectType)> TransitionEffectEventSignalType; ///< Effect signal type and state
-typedef Signal< void () > KeyboardRepeatSettingsChangedSignalType; ///< Keyboard repeat settings changed signal type
+typedef Signal<void()> KeyboardRepeatSettingsChangedSignalType; ///< Keyboard repeat settings changed signal type
/**
* @brief Creates an initialized handle to a new Window.
* @param[in] window The window instance
* @param[in] positionSize The new window position and size
*/
-DALI_ADAPTOR_API void SetPositionSize( Window window, PositionSize positionSize );
+DALI_ADAPTOR_API void SetPositionSize(Window window, PositionSize positionSize);
/**
* @brief Retrieve the window that the given actor is added to.
* @param[in] actor The actor
* @return The window the actor is added to or an empty handle if the actor is not added to any window.
*/
-DALI_ADAPTOR_API Window Get( Actor actor );
+DALI_ADAPTOR_API Window Get(Actor actor);
/**
* @brief This signal is emitted just after the event processing is finished.
* @param[in] window The window instance
* @return The signal to connect to
*/
-DALI_ADAPTOR_API EventProcessingFinishedSignalType& EventProcessingFinishedSignal( Window window );
+DALI_ADAPTOR_API EventProcessingFinishedSignalType& EventProcessingFinishedSignal(Window window);
/**
* @brief This signal is emitted when wheel event is received.
* @param[in] window The window instance
* @return The signal to connect to
*/
-DALI_ADAPTOR_API WheelEventSignalType& WheelEventSignal( Window window );
+DALI_ADAPTOR_API WheelEventSignalType& WheelEventSignal(Window window);
/**
* @brief This signal is emitted when the window is shown or hidden.
* @param[in] window The window instance
* @return The signal to connect to
*/
-DALI_ADAPTOR_API VisibilityChangedSignalType& VisibilityChangedSignal( Window window );
+DALI_ADAPTOR_API VisibilityChangedSignalType& VisibilityChangedSignal(Window window);
/**
* @brief This signal is emitted for transition effect.
* @param[in] window The window instance
* @return The signal to connect to
*/
-DALI_ADAPTOR_API TransitionEffectEventSignalType& TransitionEffectEventSignal( Window window );
+DALI_ADAPTOR_API TransitionEffectEventSignalType& TransitionEffectEventSignal(Window window);
/**
* @brief This signal is emitted just after the keyboard repeat setting is changed globally.
* @param[in] window The window instance
* @return The signal to connect to
*/
-DALI_ADAPTOR_API KeyboardRepeatSettingsChangedSignalType& KeyboardRepeatSettingsChangedSignal( Window window );
+DALI_ADAPTOR_API KeyboardRepeatSettingsChangedSignalType& KeyboardRepeatSettingsChangedSignal(Window window);
/**
* @brief Sets parent window of the window.
* @param[in] window The window instance
* @param[in] parent The parent window instance
*/
-DALI_ADAPTOR_API void SetParent( Window window, Window parent );
+DALI_ADAPTOR_API void SetParent(Window window, Window parent);
/**
* @brief Unsets parent window of the window.
*
* @param[in] window The window instance
*/
-DALI_ADAPTOR_API void Unparent( Window window );
+DALI_ADAPTOR_API void Unparent(Window window);
/**
* @brief Gets parent window of the window.
* @param[in] window The window instance
* @return The parent window of the window
*/
-DALI_ADAPTOR_API Window GetParent( Window window );
+DALI_ADAPTOR_API Window GetParent(Window window);
/**
* @brief Downcast sceneHolder to window
* @param[in] handle The handle need to downcast
* @return The window cast from SceneHolder
*/
-DALI_ADAPTOR_API Window DownCast( BaseHandle handle );
+DALI_ADAPTOR_API Window DownCast(BaseHandle handle);
/**
* @brief Gets current orientation of the window.
* @param[in] window The window instance
* @return The current window orientation if previously set, or none
*/
-DALI_ADAPTOR_API Dali::Window::WindowOrientation GetCurrentOrientation( Window window );
+DALI_ADAPTOR_API Dali::Window::WindowOrientation GetCurrentOrientation(Window window);
/**
* @brief Sets available orientations of the window.
* @param[in] window The window instance
* @param[in] orientations The available orientation list to add
*/
-DALI_ADAPTOR_API void SetAvailableOrientations( Window window, const Dali::Vector<Dali::Window::WindowOrientation>& orientations );
+DALI_ADAPTOR_API void SetAvailableOrientations(Window window, const Dali::Vector<Dali::Window::WindowOrientation>& orientations);
/**
* @brief Gets current window ID.
*
* @param[in] window The window instance
*/
-DALI_ADAPTOR_API int32_t GetNativeId( Window window );
-
-/**
- * @brief Sets damaged areas of the window.
- *
- * This API is for setting static damaged areas of the window for partial update.
- *
- * @param[in] window The window instance
- * @param[in] areas The damaged areas list to set
- */
-DALI_ADAPTOR_API void SetDamagedAreas(Window window, std::vector<Dali::Rect<int>>& areas);
+DALI_ADAPTOR_API int32_t GetNativeId(Window window);
/**
* @brief Adds a callback that is called when the frame rendering is done by the graphics driver.
*
* @note Ownership of the callback is passed onto this class.
*/
-DALI_ADAPTOR_API void AddFrameRenderedCallback( Window window, std::unique_ptr< CallbackBase > callback, int32_t frameId );
+DALI_ADAPTOR_API void AddFrameRenderedCallback(Window window, std::unique_ptr<CallbackBase> callback, int32_t frameId);
/**
* @brief Adds a callback that is called when the frame is displayed on the display.
*
* @note Ownership of the callback is passed onto this class.
*/
-DALI_ADAPTOR_API void AddFramePresentedCallback( Window window, std::unique_ptr< CallbackBase > callback, int32_t frameId );
+DALI_ADAPTOR_API void AddFramePresentedCallback(Window window, std::unique_ptr<CallbackBase> callback, int32_t frameId);
} // namespace DevelWindow
/*
- * Copyright (c) 2015 Samsung Electronics Co., Ltd.
+ * Copyright (c) 2020 Samsung Electronics Co., Ltd.
*
* Licensed under the Apache License, Version 2.0 (the "License");
* you may not use this file except in compliance with the License.
namespace Dali
{
-
namespace TextAbstraction
{
-
BidirectionalSupport::BidirectionalSupport()
{
}
{
}
-BidirectionalSupport::BidirectionalSupport( Internal::BidirectionalSupport* implementation )
-: BaseHandle( implementation )
+BidirectionalSupport::BidirectionalSupport(Internal::BidirectionalSupport* implementation)
+: BaseHandle(implementation)
{
}
return Internal::BidirectionalSupport::Get();
}
-BidiInfoIndex BidirectionalSupport::CreateInfo( const Character* const paragraph,
- Length numberOfCharacters,
- bool matchSystemLanguageDirection,
- LayoutDirection::Type layoutDirection )
+BidiInfoIndex BidirectionalSupport::CreateInfo(const Character* const paragraph,
+ Length numberOfCharacters,
+ bool matchSystemLanguageDirection,
+ LayoutDirection::Type layoutDirection)
{
- return GetImplementation( *this ).CreateInfo( paragraph,
- numberOfCharacters,
- matchSystemLanguageDirection,
- layoutDirection );
+ return GetImplementation(*this).CreateInfo(paragraph,
+ numberOfCharacters,
+ matchSystemLanguageDirection,
+ layoutDirection);
}
-void BidirectionalSupport::DestroyInfo( BidiInfoIndex bidiInfoIndex )
+void BidirectionalSupport::DestroyInfo(BidiInfoIndex bidiInfoIndex)
{
- GetImplementation( *this ).DestroyInfo( bidiInfoIndex );
+ GetImplementation(*this).DestroyInfo(bidiInfoIndex);
}
-void BidirectionalSupport::Reorder( BidiInfoIndex bidiInfoIndex,
- CharacterIndex firstCharacterIndex,
- Length numberOfCharacters,
- CharacterIndex* visualToLogicalMap )
+void BidirectionalSupport::Reorder(BidiInfoIndex bidiInfoIndex,
+ CharacterIndex firstCharacterIndex,
+ Length numberOfCharacters,
+ CharacterIndex* visualToLogicalMap)
{
- GetImplementation( *this ).Reorder( bidiInfoIndex,
- firstCharacterIndex,
- numberOfCharacters,
- visualToLogicalMap );
+ GetImplementation(*this).Reorder(bidiInfoIndex,
+ firstCharacterIndex,
+ numberOfCharacters,
+ visualToLogicalMap);
}
-bool BidirectionalSupport::GetMirroredText( Character* text,
- CharacterDirection* directions,
- Length numberOfCharacters )
+bool BidirectionalSupport::GetMirroredText(Character* text,
+ CharacterDirection* directions,
+ Length numberOfCharacters)
{
- return GetImplementation( *this ).GetMirroredText( text,
- directions,
- numberOfCharacters );
+ return GetImplementation(*this).GetMirroredText(text,
+ directions,
+ numberOfCharacters);
}
-bool BidirectionalSupport::GetParagraphDirection( BidiInfoIndex bidiInfoIndex ) const
+bool BidirectionalSupport::GetParagraphDirection(BidiInfoIndex bidiInfoIndex) const
{
- return GetImplementation( *this ).GetParagraphDirection( bidiInfoIndex );
+ return GetImplementation(*this).GetParagraphDirection(bidiInfoIndex);
}
-void BidirectionalSupport::GetCharactersDirection( BidiInfoIndex bidiInfoIndex,
- CharacterDirection* directions,
- Length numberOfCharacters )
+void BidirectionalSupport::GetCharactersDirection(BidiInfoIndex bidiInfoIndex,
+ CharacterDirection* directions,
+ Length numberOfCharacters)
{
- GetImplementation( *this ).GetCharactersDirection( bidiInfoIndex,
- directions,
- numberOfCharacters );
+ GetImplementation(*this).GetCharactersDirection(bidiInfoIndex,
+ directions,
+ numberOfCharacters);
}
} // namespace TextAbstraction
#define DALI_PLATFORM_TEXT_ABSTRACTION_BIDIRECTIONAL_SUPPORT_H
/*
- * Copyright (c) 2019 Samsung Electronics Co., Ltd.
+ * Copyright (c) 2020 Samsung Electronics Co., Ltd.
*
* Licensed under the Apache License, Version 2.0 (the "License");
* you may not use this file except in compliance with the License.
#include <dali/devel-api/text-abstraction/text-abstraction-definitions.h>
// EXTERNAL INCLUDES
-#include <dali/public-api/object/base-handle.h>
#include <dali/public-api/actors/actor-enumerations.h>
+#include <dali/public-api/object/base-handle.h>
// INTERNAL INCLUDES
#include <dali/public-api/dali-adaptor-common.h>
namespace Dali
{
-
namespace TextAbstraction
{
-
namespace Internal DALI_INTERNAL
{
-
class BidirectionalSupport;
-} // Internal
+} // namespace DALI_INTERNAL
/**
* BidirectionalSupport API
*/
class DALI_ADAPTOR_API BidirectionalSupport : public BaseHandle
{
-
public:
-
/**
* @brief Create an uninitialized TextAbstraction handle.
*
*
* @param[in] implementation a pointer to the internal bidirectional support object.
*/
- explicit DALI_INTERNAL BidirectionalSupport( Internal::BidirectionalSupport* implementation );
+ explicit DALI_INTERNAL BidirectionalSupport(Internal::BidirectionalSupport* implementation);
/**
* @brief Retrieve a handle to the BidirectionalSupport instance.
* @param[in] layoutDirection The direction of the system language.
* @return An index of an object inside a table storing the bidirectional data.
*/
- BidiInfoIndex CreateInfo( const Character* const paragraph,
- Length numberOfCharacters,
- bool matchSystemLanguageDirection,
- LayoutDirection::Type layoutDirection );
+ BidiInfoIndex CreateInfo(const Character* const paragraph,
+ Length numberOfCharacters,
+ bool matchSystemLanguageDirection,
+ LayoutDirection::Type layoutDirection);
/**
* @brief Destroys the bidirectional data.
*
* @param[in] bidiInfoIndex The index to the of the object inside the table storing the bidirectional data for the current paragraph.
*/
- void DestroyInfo( BidiInfoIndex bidiInfoIndex );
+ void DestroyInfo(BidiInfoIndex bidiInfoIndex);
/**
* @brief Reorders a line of a paragraph.
* @param[in] numberOfCharacters The number of characters of the line.
* @param[out] visualToLogicalMap The visual to logical conversion map.
*/
- void Reorder( BidiInfoIndex bidiInfoIndex,
- CharacterIndex firstCharacterIndex,
- Length numberOfCharacters,
- CharacterIndex* visualToLogicalMap );
+ void Reorder(BidiInfoIndex bidiInfoIndex,
+ CharacterIndex firstCharacterIndex,
+ Length numberOfCharacters,
+ CharacterIndex* visualToLogicalMap);
/**
* @brief Replaces any character which could be mirrored.
*
* @return @e true if a character has been replaced.
*/
- bool GetMirroredText( Character* text,
- CharacterDirection* directions,
- Length numberOfCharacters );
+ bool GetMirroredText(Character* text,
+ CharacterDirection* directions,
+ Length numberOfCharacters);
/**
* @brief Retrieves the paragrpah's direction.
*
* @return @e true if the paragraph is right to left, otherwise @e false.
*/
- bool GetParagraphDirection( BidiInfoIndex bidiInfoIndex ) const;
+ bool GetParagraphDirection(BidiInfoIndex bidiInfoIndex) const;
/**
* @brief Retrieves the character's directions.
* @param[out] directions The direction, @e false is left to right and @e true is right to left, of each character of the paragraph.
* @param[in] numberOfCharacters The number of characters.
*/
- void GetCharactersDirection( BidiInfoIndex bidiInfoIndex,
- CharacterDirection* directions,
- Length numberOfCharacters );
+ void GetCharactersDirection(BidiInfoIndex bidiInfoIndex,
+ CharacterDirection* directions,
+ Length numberOfCharacters);
};
} // namespace TextAbstraction
/*
- * Copyright (c) 2019 Samsung Electronics Co., Ltd.
+ * Copyright (c) 2020 Samsung Electronics Co., Ltd.
*
* Licensed under the Apache License, Version 2.0 (the "License");
* you may not use this file except in compliance with the License.
namespace Dali
{
-
namespace TextAbstraction
{
-
BitmapGlyph::BitmapGlyph()
: url{},
- utf32{ 0u },
- ascender{ 0.f },
- descender{ 0.f }
-{}
-
-BitmapGlyph::BitmapGlyph( const std::string& url, GlyphIndex utf32, float ascender, float descender )
-: url{ url },
- utf32{ utf32 },
- ascender{ ascender },
- descender{ descender }
-{}
+ utf32{0u},
+ ascender{0.f},
+ descender{0.f}
+{
+}
+
+BitmapGlyph::BitmapGlyph(const std::string& url, GlyphIndex utf32, float ascender, float descender)
+: url{url},
+ utf32{utf32},
+ ascender{ascender},
+ descender{descender}
+{
+}
BitmapGlyph::~BitmapGlyph()
-{}
+{
+}
BitmapFont::BitmapFont()
: glyphs{},
name{},
- ascender{ 0.f },
- descender{ 0.f },
- underlinePosition{ 0.f },
- underlineThickness{ 1.f },
- isColorFont{ false }
-{}
+ ascender{0.f},
+ descender{0.f},
+ underlinePosition{0.f},
+ underlineThickness{1.f},
+ isColorFont{false}
+{
+}
BitmapFont::~BitmapFont()
-{}
+{
+}
} // namespace TextAbstraction
} // namespace Dali
-
#define DALI_TEXT_ABSTRACTION_BITMAP_FONT_H
/*
- * Copyright (c) 2019 Samsung Electronics Co., Ltd.
+ * Copyright (c) 2020 Samsung Electronics Co., Ltd.
*
* Licensed under the Apache License, Version 2.0 (the "License");
* you may not use this file except in compliance with the License.
// INTERNAL INCLUDES
#include <dali/devel-api/text-abstraction/text-abstraction-definitions.h>
-
-
namespace Dali
{
-
namespace TextAbstraction
{
-
/**
* @brief Struct that stores the needed info to create a bitmap glyph.
*
* @param[in] ascender The ascender of the glyph.
* @param[in] descender The descender of the glyph.
*/
- BitmapGlyph( const std::string& url, GlyphIndex utf32, float ascender, float descender );
+ BitmapGlyph(const std::string& url, GlyphIndex utf32, float ascender, float descender);
/**
* @brief Default destructor.
*/
~BitmapGlyph();
- std::string url; ///< The url of the glyph's bitmap.
- GlyphIndex utf32; ///< The id of the glyph encoded in utf32.
- float ascender; ///< The ascender in pixels. The distance from the base line to the top of the glyph.
- float descender; ///< The descender in pixels. The distance from the base line to the bottom of the glyph.
+ std::string url; ///< The url of the glyph's bitmap.
+ GlyphIndex utf32; ///< The id of the glyph encoded in utf32.
+ float ascender; ///< The ascender in pixels. The distance from the base line to the top of the glyph.
+ float descender; ///< The descender in pixels. The distance from the base line to the bottom of the glyph.
};
/**
*/
~BitmapFont();
- std::vector<BitmapGlyph> glyphs; ///< The glyphs of the font.
- std::string name; ///< The name of the font.
- float ascender; ///< The ascender in pixels. Maximum ascender of all the glyphs.
- float descender; ///< The descender in pixels. Minimum descender of all the glyphs.
- float underlinePosition; ///< The position in pixels of the underline from the base line.
- float underlineThickness; ///< The thickness in pixels of the underline.
- bool isColorFont:1; ///< Whether the glyphs of this font have their own colors.
+ std::vector<BitmapGlyph> glyphs; ///< The glyphs of the font.
+ std::string name; ///< The name of the font.
+ float ascender; ///< The ascender in pixels. Maximum ascender of all the glyphs.
+ float descender; ///< The descender in pixels. Minimum descender of all the glyphs.
+ float underlinePosition; ///< The position in pixels of the underline from the base line.
+ float underlineThickness; ///< The thickness in pixels of the underline.
+ bool isColorFont : 1; ///< Whether the glyphs of this font have their own colors.
};
} // namespace TextAbstraction
/*
- * Copyright (c) 2019 Samsung Electronics Co., Ltd.
+ * Copyright (c) 2020 Samsung Electronics Co., Ltd.
*
* Licensed under the Apache License, Version 2.0 (the "License");
* you may not use this file except in compliance with the License.
namespace Dali
{
-
namespace TextAbstraction
{
-
-const PointSize26Dot6 FontClient::DEFAULT_POINT_SIZE = 768u; // 12*64
-const float FontClient::DEFAULT_ITALIC_ANGLE = 12.f * Dali::Math::PI_OVER_180; // FreeType documentation states the software italic is done by doing a horizontal shear of 12 degrees (file ftsynth.h).
+const PointSize26Dot6 FontClient::DEFAULT_POINT_SIZE = 768u; // 12*64
+const float FontClient::DEFAULT_ITALIC_ANGLE = 12.f * Dali::Math::PI_OVER_180; // FreeType documentation states the software italic is done by doing a horizontal shear of 12 degrees (file ftsynth.h).
FontClient::GlyphBufferData::GlyphBufferData()
-: buffer{ nullptr },
- width{ 0u },
- height{ 0u },
- outlineOffsetX{ 0 },
- outlineOffsetY{ 0 },
- format{ Pixel::A8 },
- isColorEmoji{ false },
- isColorBitmap{ false }
+: buffer{nullptr},
+ width{0u},
+ height{0u},
+ outlineOffsetX{0},
+ outlineOffsetY{0},
+ format{Pixel::A8},
+ isColorEmoji{false},
+ isColorBitmap{false}
{
}
{
}
-FontClient::FontClient( const FontClient& handle )
-: BaseHandle( handle )
+FontClient::FontClient(const FontClient& handle)
+: BaseHandle(handle)
{
}
-FontClient& FontClient::operator=( const FontClient& handle )
+FontClient& FontClient::operator=(const FontClient& handle)
{
- BaseHandle::operator=( handle );
+ BaseHandle::operator=(handle);
return *this;
}
GetImplementation(*this).ClearCache();
}
-void FontClient::SetDpi( unsigned int horizontalDpi, unsigned int verticalDpi )
+void FontClient::SetDpi(unsigned int horizontalDpi, unsigned int verticalDpi)
{
- GetImplementation(*this).SetDpi( horizontalDpi, verticalDpi );
+ GetImplementation(*this).SetDpi(horizontalDpi, verticalDpi);
}
-void FontClient::GetDpi( unsigned int& horizontalDpi, unsigned int& verticalDpi )
+void FontClient::GetDpi(unsigned int& horizontalDpi, unsigned int& verticalDpi)
{
- GetImplementation(*this).GetDpi( horizontalDpi, verticalDpi );
+ GetImplementation(*this).GetDpi(horizontalDpi, verticalDpi);
}
int FontClient::GetDefaultFontSize()
GetImplementation(*this).ResetSystemDefaults();
}
-void FontClient::GetDefaultFonts( FontList& defaultFonts )
+void FontClient::GetDefaultFonts(FontList& defaultFonts)
{
- GetImplementation(*this).GetDefaultFonts( defaultFonts );
+ GetImplementation(*this).GetDefaultFonts(defaultFonts);
}
-void FontClient::GetDefaultPlatformFontDescription( FontDescription& fontDescription )
+void FontClient::GetDefaultPlatformFontDescription(FontDescription& fontDescription)
{
- GetImplementation(*this).GetDefaultPlatformFontDescription( fontDescription );
+ GetImplementation(*this).GetDefaultPlatformFontDescription(fontDescription);
}
-void FontClient::GetSystemFonts( FontList& systemFonts )
+void FontClient::GetSystemFonts(FontList& systemFonts)
{
- GetImplementation(*this).GetSystemFonts( systemFonts );
+ GetImplementation(*this).GetSystemFonts(systemFonts);
}
-void FontClient::GetDescription( FontId id, FontDescription& fontDescription )
+void FontClient::GetDescription(FontId id, FontDescription& fontDescription)
{
- GetImplementation(*this).GetDescription( id, fontDescription );
+ GetImplementation(*this).GetDescription(id, fontDescription);
}
-PointSize26Dot6 FontClient::GetPointSize( FontId id )
+PointSize26Dot6 FontClient::GetPointSize(FontId id)
{
- return GetImplementation(*this).GetPointSize( id );
+ return GetImplementation(*this).GetPointSize(id);
}
-bool FontClient::IsCharacterSupportedByFont( FontId fontId, Character character )
+bool FontClient::IsCharacterSupportedByFont(FontId fontId, Character character)
{
- return GetImplementation(*this).IsCharacterSupportedByFont( fontId, character );
+ return GetImplementation(*this).IsCharacterSupportedByFont(fontId, character);
}
-FontId FontClient::FindDefaultFont( Character charcode,
- PointSize26Dot6 requestedPointSize,
- bool preferColor )
+FontId FontClient::FindDefaultFont(Character charcode,
+ PointSize26Dot6 requestedPointSize,
+ bool preferColor)
{
- return GetImplementation(*this).FindDefaultFont( charcode,
- requestedPointSize,
- preferColor );
+ return GetImplementation(*this).FindDefaultFont(charcode,
+ requestedPointSize,
+ preferColor);
}
-FontId FontClient::FindFallbackFont( Character charcode,
- const FontDescription& preferredFontDescription,
- PointSize26Dot6 requestedPointSize,
- bool preferColor )
+FontId FontClient::FindFallbackFont(Character charcode,
+ const FontDescription& preferredFontDescription,
+ PointSize26Dot6 requestedPointSize,
+ bool preferColor)
{
- return GetImplementation(*this).FindFallbackFont( charcode, preferredFontDescription, requestedPointSize, preferColor );
+ return GetImplementation(*this).FindFallbackFont(charcode, preferredFontDescription, requestedPointSize, preferColor);
}
-FontId FontClient::GetFontId( const FontPath& path, PointSize26Dot6 requestedPointSize, FaceIndex faceIndex )
+FontId FontClient::GetFontId(const FontPath& path, PointSize26Dot6 requestedPointSize, FaceIndex faceIndex)
{
- return GetImplementation(*this).GetFontId( path, requestedPointSize, faceIndex );
+ return GetImplementation(*this).GetFontId(path, requestedPointSize, faceIndex);
}
-FontId FontClient::GetFontId( const FontDescription& fontDescription,
- PointSize26Dot6 requestedPointSize,
- FaceIndex faceIndex )
+FontId FontClient::GetFontId(const FontDescription& fontDescription,
+ PointSize26Dot6 requestedPointSize,
+ FaceIndex faceIndex)
{
- return GetImplementation(*this).GetFontId( fontDescription,
- requestedPointSize,
- faceIndex );
+ return GetImplementation(*this).GetFontId(fontDescription,
+ requestedPointSize,
+ faceIndex);
}
-FontId FontClient::GetFontId( const BitmapFont& bitmapFont )
+FontId FontClient::GetFontId(const BitmapFont& bitmapFont)
{
- return GetImplementation(*this).GetFontId( bitmapFont );
+ return GetImplementation(*this).GetFontId(bitmapFont);
}
-bool FontClient::IsScalable( const FontPath& path )
+bool FontClient::IsScalable(const FontPath& path)
{
- return GetImplementation(*this).IsScalable( path );
+ return GetImplementation(*this).IsScalable(path);
}
-bool FontClient::IsScalable( const FontDescription& fontDescription )
+bool FontClient::IsScalable(const FontDescription& fontDescription)
{
- return GetImplementation(*this).IsScalable( fontDescription );
+ return GetImplementation(*this).IsScalable(fontDescription);
}
-void FontClient::GetFixedSizes( const FontPath& path, Dali::Vector< PointSize26Dot6>& sizes )
+void FontClient::GetFixedSizes(const FontPath& path, Dali::Vector<PointSize26Dot6>& sizes)
{
- GetImplementation(*this).GetFixedSizes( path, sizes );
+ GetImplementation(*this).GetFixedSizes(path, sizes);
}
-void FontClient::GetFixedSizes( const FontDescription& fontDescription,
- Dali::Vector< PointSize26Dot6 >& sizes )
+void FontClient::GetFixedSizes(const FontDescription& fontDescription,
+ Dali::Vector<PointSize26Dot6>& sizes)
{
- GetImplementation(*this).GetFixedSizes( fontDescription, sizes );
+ GetImplementation(*this).GetFixedSizes(fontDescription, sizes);
}
-bool FontClient::HasItalicStyle( FontId fontId ) const
+bool FontClient::HasItalicStyle(FontId fontId) const
{
- return GetImplementation(*this).HasItalicStyle( fontId );
+ return GetImplementation(*this).HasItalicStyle(fontId);
}
-void FontClient::GetFontMetrics( FontId fontId, FontMetrics& metrics )
+void FontClient::GetFontMetrics(FontId fontId, FontMetrics& metrics)
{
- GetImplementation(*this).GetFontMetrics( fontId, metrics );
+ GetImplementation(*this).GetFontMetrics(fontId, metrics);
}
-GlyphIndex FontClient::GetGlyphIndex( FontId fontId, Character charcode )
+GlyphIndex FontClient::GetGlyphIndex(FontId fontId, Character charcode)
{
- return GetImplementation(*this).GetGlyphIndex( fontId, charcode );
+ return GetImplementation(*this).GetGlyphIndex(fontId, charcode);
}
-bool FontClient::GetGlyphMetrics( GlyphInfo* array, uint32_t size, GlyphType type, bool horizontal )
+bool FontClient::GetGlyphMetrics(GlyphInfo* array, uint32_t size, GlyphType type, bool horizontal)
{
- return GetImplementation(*this).GetGlyphMetrics( array, size, type, horizontal );
+ return GetImplementation(*this).GetGlyphMetrics(array, size, type, horizontal);
}
-void FontClient::CreateBitmap( FontId fontId, GlyphIndex glyphIndex, bool isItalicRequired, bool isBoldRequired, GlyphBufferData& data, int outlineWidth )
+void FontClient::CreateBitmap(FontId fontId, GlyphIndex glyphIndex, bool isItalicRequired, bool isBoldRequired, GlyphBufferData& data, int outlineWidth)
{
- GetImplementation(*this).CreateBitmap( fontId, glyphIndex, isItalicRequired, isBoldRequired, data, outlineWidth );
+ GetImplementation(*this).CreateBitmap(fontId, glyphIndex, isItalicRequired, isBoldRequired, data, outlineWidth);
}
-PixelData FontClient::CreateBitmap( FontId fontId, GlyphIndex glyphIndex, int outlineWidth )
+PixelData FontClient::CreateBitmap(FontId fontId, GlyphIndex glyphIndex, int outlineWidth)
{
- return GetImplementation(*this).CreateBitmap( fontId, glyphIndex, outlineWidth );
+ return GetImplementation(*this).CreateBitmap(fontId, glyphIndex, outlineWidth);
}
-void FontClient::CreateVectorBlob( FontId fontId, GlyphIndex glyphIndex, VectorBlob*& blob, unsigned int& blobLength, unsigned int& nominalWidth, unsigned int& nominalHeight )
+void FontClient::CreateVectorBlob(FontId fontId, GlyphIndex glyphIndex, VectorBlob*& blob, unsigned int& blobLength, unsigned int& nominalWidth, unsigned int& nominalHeight)
{
- GetImplementation(*this).CreateVectorBlob( fontId, glyphIndex, blob, blobLength, nominalWidth, nominalHeight );
+ GetImplementation(*this).CreateVectorBlob(fontId, glyphIndex, blob, blobLength, nominalWidth, nominalHeight);
}
-const GlyphInfo& FontClient::GetEllipsisGlyph( PointSize26Dot6 requestedPointSize )
+const GlyphInfo& FontClient::GetEllipsisGlyph(PointSize26Dot6 requestedPointSize)
{
- return GetImplementation(*this).GetEllipsisGlyph( requestedPointSize );
+ return GetImplementation(*this).GetEllipsisGlyph(requestedPointSize);
}
-bool FontClient::IsColorGlyph( FontId fontId, GlyphIndex glyphIndex )
+bool FontClient::IsColorGlyph(FontId fontId, GlyphIndex glyphIndex)
{
- return GetImplementation(*this).IsColorGlyph( fontId, glyphIndex );
+ return GetImplementation(*this).IsColorGlyph(fontId, glyphIndex);
}
-bool FontClient::AddCustomFontDirectory( const FontPath& path )
+bool FontClient::AddCustomFontDirectory(const FontPath& path)
{
- return GetImplementation(*this).AddCustomFontDirectory( path );
+ return GetImplementation(*this).AddCustomFontDirectory(path);
}
GlyphIndex FontClient::CreateEmbeddedItem(const EmbeddedItemDescription& description, Pixel::Format& pixelFormat)
{
- return GetImplementation(*this).CreateEmbeddedItem( description, pixelFormat);
+ return GetImplementation(*this).CreateEmbeddedItem(description, pixelFormat);
}
-FontClient::FontClient( Internal::FontClient* internal )
-: BaseHandle( internal )
+FontClient::FontClient(Internal::FontClient* internal)
+: BaseHandle(internal)
{
}
*/
// INTERNAL INCLUDES
-#include <dali/public-api/common/dali-vector.h>
-#include <dali/public-api/images/pixel-data.h>
-#include <dali/public-api/object/base-handle.h>
#include <dali/devel-api/text-abstraction/font-list.h>
#include <dali/devel-api/text-abstraction/text-abstraction-definitions.h>
+#include <dali/public-api/common/dali-vector.h>
#include <dali/public-api/dali-adaptor-common.h>
+#include <dali/public-api/images/pixel-data.h>
+#include <dali/public-api/object/base-handle.h>
namespace Dali
{
-
namespace TextAbstraction
{
-
struct FontMetrics;
struct GlyphInfo;
struct BitmapFont;
class DALI_ADAPTOR_API FontClient : public BaseHandle
{
public:
- static const PointSize26Dot6 DEFAULT_POINT_SIZE; ///< The default point size.
- static const float DEFAULT_ITALIC_ANGLE; ///< The default software italic angle in radians.
+ static const PointSize26Dot6 DEFAULT_POINT_SIZE; ///< The default point size.
+ static const float DEFAULT_ITALIC_ANGLE; ///< The default software italic angle in radians.
/**
* @brief Struct used to retrieve the glyph's bitmap.
*/
~GlyphBufferData();
- unsigned char* buffer; ///< The glyph's bitmap buffer data.
- unsigned int width; ///< The width of the bitmap.
- unsigned int height; ///< The height of the bitmap.
- int outlineOffsetX; ///< The additional horizontal offset to be added for the glyph's position for outline.
- int outlineOffsetY; ///< The additional vertical offset to be added for the glyph's position for outline.
- Pixel::Format format; ///< The pixel's format of the bitmap.
- bool isColorEmoji:1; ///< Whether the glyph is an emoji.
- bool isColorBitmap:1; ///< Whether the glyph is a color bitmap.
+ unsigned char* buffer; ///< The glyph's bitmap buffer data.
+ unsigned int width; ///< The width of the bitmap.
+ unsigned int height; ///< The height of the bitmap.
+ int outlineOffsetX; ///< The additional horizontal offset to be added for the glyph's position for outline.
+ int outlineOffsetY; ///< The additional vertical offset to be added for the glyph's position for outline.
+ Pixel::Format format; ///< The pixel's format of the bitmap.
+ bool isColorEmoji : 1; ///< Whether the glyph is an emoji.
+ bool isColorBitmap : 1; ///< Whether the glyph is a color bitmap.
};
/**
};
public:
-
/**
* @brief Retrieve a handle to the FontClient instance.
*
*
* @param[in] handle A reference to the copied handle.
*/
- FontClient( const FontClient& handle );
+ FontClient(const FontClient& handle);
/**
* @brief This assignment operator is required for (smart) pointer semantics.
* @param [in] handle A reference to the copied handle.
* @return A reference to this.
*/
- FontClient& operator=( const FontClient& handle );
+ FontClient& operator=(const FontClient& handle);
////////////////////////////////////////
// Font management and validation.
* @param[in] horizontalDpi The horizontal resolution in DPI.
* @param[in] verticalDpi The vertical resolution in DPI.
*/
- void SetDpi( unsigned int horizontalDpi, unsigned int verticalDpi );
+ void SetDpi(unsigned int horizontalDpi, unsigned int verticalDpi);
/**
* @brief Retrieves the DPI previously set to the target window.
* @param[out] horizontalDpi The horizontal resolution in DPI.
* @param[out] verticalDpi The vertical resolution in DPI.
*/
- void GetDpi( unsigned int& horizontalDpi, unsigned int& verticalDpi );
+ void GetDpi(unsigned int& horizontalDpi, unsigned int& verticalDpi);
/**
* @brief Called by Dali to retrieve the default font size for the platform.
*
* @param[out] defaultFonts A list of default font paths, family, width, weight and slant.
*/
- void GetDefaultFonts( FontList& defaultFonts );
+ void GetDefaultFonts(FontList& defaultFonts);
/**
* @brief Retrieve the active default font from the system.
*
* @param[out] fontDescription font structure describing the default font.
*/
- void GetDefaultPlatformFontDescription( FontDescription& fontDescription );
+ void GetDefaultPlatformFontDescription(FontDescription& fontDescription);
/**
* @brief Retrieve the list of fonts supported by the system.
*
* @param[out] systemFonts A list of font paths, family, width, weight and slant.
*/
- void GetSystemFonts( FontList& systemFonts );
+ void GetSystemFonts(FontList& systemFonts);
/**
* @brief Retrieves the font description of a given font @p id.
* @param[in] id The font identifier.
* @param[out] fontDescription The path, family & style (width, weight and slant) describing the font.
*/
- void GetDescription( FontId id, FontDescription& fontDescription );
+ void GetDescription(FontId id, FontDescription& fontDescription);
/**
* @brief Retrieves the font point size of a given font @p id.
*
* @return The point size in 26.6 fractional points.
*/
- PointSize26Dot6 GetPointSize( FontId id );
+ PointSize26Dot6 GetPointSize(FontId id);
/**
* @brief Whether the given @p character is supported by the font.
*
* @return @e true if the character is supported by the font.
*/
- bool IsCharacterSupportedByFont( FontId fontId, Character character );
+ bool IsCharacterSupportedByFont(FontId fontId, Character character);
/**
* @brief Find the default font for displaying a UTF-32 character.
*
* @return A valid font identifier, or zero if the font does not exist.
*/
- FontId FindDefaultFont( Character charcode,
- PointSize26Dot6 requestedPointSize = DEFAULT_POINT_SIZE,
- bool preferColor = false );
+ FontId FindDefaultFont(Character charcode,
+ PointSize26Dot6 requestedPointSize = DEFAULT_POINT_SIZE,
+ bool preferColor = false);
/**
* @brief Find a fallback-font for displaying a UTF-32 character.
*
* @return A valid font identifier, or zero if the font does not exist.
*/
- FontId FindFallbackFont( Character charcode,
- const FontDescription& preferredFontDescription,
- PointSize26Dot6 requestedPointSize = DEFAULT_POINT_SIZE,
- bool preferColor = false );
+ FontId FindFallbackFont(Character charcode,
+ const FontDescription& preferredFontDescription,
+ PointSize26Dot6 requestedPointSize = DEFAULT_POINT_SIZE,
+ bool preferColor = false);
/**
* @brief Retrieve the unique identifier for a font.
*
* @return A valid font identifier, or zero if the font does not exist.
*/
- FontId GetFontId( const FontPath& path,
- PointSize26Dot6 requestedPointSize = DEFAULT_POINT_SIZE,
- FaceIndex faceIndex = 0 );
+ FontId GetFontId(const FontPath& path,
+ PointSize26Dot6 requestedPointSize = DEFAULT_POINT_SIZE,
+ FaceIndex faceIndex = 0);
/**
* @brief Retrieves a unique font identifier for a given description.
*
* @return A valid font identifier, or zero if no font is found.
*/
- FontId GetFontId( const FontDescription& preferredFontDescription,
- PointSize26Dot6 requestedPointSize = DEFAULT_POINT_SIZE,
- FaceIndex faceIndex = 0 );
+ FontId GetFontId(const FontDescription& preferredFontDescription,
+ PointSize26Dot6 requestedPointSize = DEFAULT_POINT_SIZE,
+ FaceIndex faceIndex = 0);
/**
* @brief Retrieves a unique font identifier for a given bitmap font.
*
* @return A valid font identifier, or zero if no bitmap font is created.
*/
- FontId GetFontId( const BitmapFont& bitmapFont );
+ FontId GetFontId(const BitmapFont& bitmapFont);
/**
* @brief Check to see if a font is scalable.
* @param[in] path The path to a font file.
* @return true if scalable.
*/
- bool IsScalable( const FontPath& path );
+ bool IsScalable(const FontPath& path);
/**
* @brief Check to see if a font is scalable.
*
* @return true if scalable
*/
- bool IsScalable( const FontDescription& fontDescription );
+ bool IsScalable(const FontDescription& fontDescription);
/**
* @brief Get a list of sizes available for a fixed size font.
* @param[in] path The path to a font file.
* @param[out] sizes A list of the available sizes, if no sizes available will return empty.
*/
- void GetFixedSizes( const FontPath& path, Dali::Vector< PointSize26Dot6>& sizes );
+ void GetFixedSizes(const FontPath& path, Dali::Vector<PointSize26Dot6>& sizes);
/**
* @brief Get a list of sizes available for a fixed size font.
* @param[in] fontDescription A font description.
* @param[out] sizes A list of the available sizes, if no sizes available will return empty.
*/
- void GetFixedSizes( const FontDescription& fontDescription,
- Dali::Vector< PointSize26Dot6 >& sizes );
+ void GetFixedSizes(const FontDescription& fontDescription,
+ Dali::Vector<PointSize26Dot6>& sizes);
/**
* @brief Whether the font has Italic style.
*
* @return true if the font has italic style.
*/
- bool HasItalicStyle( FontId fontId ) const;
+ bool HasItalicStyle(FontId fontId) const;
////////////////////////////////////////
// Font metrics, glyphs and bitmaps.
* @param[in] fontId The identifier of the font for the required glyph.
* @param[out] metrics The font metrics.
*/
- void GetFontMetrics( FontId fontId, FontMetrics& metrics );
+ void GetFontMetrics(FontId fontId, FontMetrics& metrics);
/**
* @brief Retrieve the glyph index for a UTF-32 character code.
*
* @return The glyph index, or zero if the character code is undefined.
*/
- GlyphIndex GetGlyphIndex( FontId fontId, Character charcode );
+ GlyphIndex GetGlyphIndex(FontId fontId, Character charcode);
/**
* @brief Retrieve the metrics for a series of glyphs.
*
* @return @e true if all of the requested metrics were found.
*/
- bool GetGlyphMetrics( GlyphInfo* array, uint32_t size, GlyphType type, bool horizontal = true );
+ bool GetGlyphMetrics(GlyphInfo* array, uint32_t size, GlyphType type, bool horizontal = true);
/**
* @brief Create a bitmap representation of a glyph.
* @param[out] data The bitmap data.
* @param[in] outlineWidth The width of the glyph outline in pixels.
*/
- void CreateBitmap( FontId fontId, GlyphIndex glyphIndex, bool isItalicRequired, bool isBoldRequired, GlyphBufferData& data, int outlineWidth );
+ void CreateBitmap(FontId fontId, GlyphIndex glyphIndex, bool isItalicRequired, bool isBoldRequired, GlyphBufferData& data, int outlineWidth);
/**
* @brief Create a bitmap representation of a glyph.
*
* @return A valid PixelData, or an empty handle if the glyph could not be rendered.
*/
- PixelData CreateBitmap( FontId fontId, GlyphIndex glyphIndex, int outlineWidth );
+ PixelData CreateBitmap(FontId fontId, GlyphIndex glyphIndex, int outlineWidth);
/**
* @brief Create a vector representation of a glyph.
* @param[out] nominalWidth The width of the blob.
* @param[out] nominalHeight The height of the blob.
*/
- void CreateVectorBlob( FontId fontId,
- GlyphIndex glyphIndex,
- VectorBlob*& blob,
- unsigned int& blobLength,
- unsigned int& nominalWidth,
- unsigned int& nominalHeight );
+ void CreateVectorBlob(FontId fontId,
+ GlyphIndex glyphIndex,
+ VectorBlob*& blob,
+ unsigned int& blobLength,
+ unsigned int& nominalWidth,
+ unsigned int& nominalHeight);
/**
* @brief Retrieves the ellipsis glyph for a requested point size.
*
* @return The ellipsis glyph.
*/
- const GlyphInfo& GetEllipsisGlyph( PointSize26Dot6 requestedPointSize );
+ const GlyphInfo& GetEllipsisGlyph(PointSize26Dot6 requestedPointSize);
/**
* @brief Whether the given glyph @p glyphIndex is a color glyph.
*
* @return @e true if the glyph is a color one.
*/
- bool IsColorGlyph( FontId fontId, GlyphIndex glyphIndex );
+ bool IsColorGlyph(FontId fontId, GlyphIndex glyphIndex);
/**
* @brief Add custom fonts directory
*
* @return true if the fonts can be added.
*/
- bool AddCustomFontDirectory( const FontPath& path );
+ bool AddCustomFontDirectory(const FontPath& path);
/**
* @brief Creates and stores an embedded item and it's metrics.
*
* return The index within the vector of embedded items.
*/
- GlyphIndex CreateEmbeddedItem( const EmbeddedItemDescription& description, Pixel::Format& pixelFormat);
-
+ GlyphIndex CreateEmbeddedItem(const EmbeddedItemDescription& description, Pixel::Format& pixelFormat);
public: // Not intended for application developers
/**
*
* @param[in] fontClient A pointer to the internal fontClient object.
*/
- explicit DALI_INTERNAL FontClient( Internal::FontClient* fontClient );
+ explicit DALI_INTERNAL FontClient(Internal::FontClient* fontClient);
};
/**
/*
- * Copyright (c) 2018 Samsung Electronics Co., Ltd.
+ * Copyright (c) 2020 Samsung Electronics Co., Ltd.
*
* Licensed under the Apache License, Version 2.0 (the "License");
* you may not use this file except in compliance with the License.
namespace Dali
{
-
namespace TextAbstraction
{
-
-DALI_ADAPTOR_API std::ostream& operator<<( std::ostream& o, const FontList& fontList )
+DALI_ADAPTOR_API std::ostream& operator<<(std::ostream& o, const FontList& fontList)
{
- for( unsigned int i=0; i<fontList.size(); ++i )
+ for(unsigned int i = 0; i < fontList.size(); ++i)
{
const FontDescription& description = fontList[i];
- o << "Font " << i << ") path: " << description.path << " family: " << " width : " << description.width << " weight : " << description.weight << " slant : " << description.slant << std::endl;
+ o << "Font " << i << ") path: " << description.path << " family: "
+ << " width : " << description.width << " weight : " << description.weight << " slant : " << description.slant << std::endl;
}
return o;
#define DALI_TEXT_ABSTRACTION_FONT_LIST_H
/*
- * Copyright (c) 2019 Samsung Electronics Co., Ltd.
+ * Copyright (c) 2020 Samsung Electronics Co., Ltd.
*
* Licensed under the Apache License, Version 2.0 (the "License");
* you may not use this file except in compliance with the License.
*/
// EXTERNAL INCLUDES
-#include <string>
-#include <iostream>
#include <dali/public-api/common/vector-wrapper.h>
+#include <iostream>
+#include <string>
// INTERNAL INCLUDES
#include <dali/public-api/dali-adaptor-common.h>
namespace Dali
{
-
namespace TextAbstraction
{
typedef std::string FontPath;
namespace FontWidth
{
- /**
+/**
* @brief Enumeration type for the font's width
*/
- enum Type
- {
- NONE, ///< Means not defined. Will use what is set as default, currently NORMAL.
- ULTRA_CONDENSED,
- EXTRA_CONDENSED,
- CONDENSED,
- SEMI_CONDENSED,
- NORMAL,
- SEMI_EXPANDED,
- EXPANDED,
- EXTRA_EXPANDED,
- ULTRA_EXPANDED
- };
+enum Type
+{
+ NONE, ///< Means not defined. Will use what is set as default, currently NORMAL.
+ ULTRA_CONDENSED,
+ EXTRA_CONDENSED,
+ CONDENSED,
+ SEMI_CONDENSED,
+ NORMAL,
+ SEMI_EXPANDED,
+ EXPANDED,
+ EXTRA_EXPANDED,
+ ULTRA_EXPANDED
+};
- const char* const Name[] =
+const char* const Name[] =
{
"NONE",
"ULTRA_CONDENSED",
"SEMI_EXPANDED",
"EXPANDED",
"EXTRA_EXPANDED",
- "ULTRA_EXPANDED"
- };
+ "ULTRA_EXPANDED"};
} // namespace FontWidth
namespace FontWeight
{
- /**
+/**
* @brief Enumeration type for the font's weight
*/
- enum Type
- {
- NONE, ///< Means not defined. Will use what is set as default, currently NORMAL.
- THIN,
- ULTRA_LIGHT,
- EXTRA_LIGHT = ULTRA_LIGHT,
- LIGHT,
- DEMI_LIGHT,
- SEMI_LIGHT = DEMI_LIGHT,
- BOOK,
- NORMAL,
- REGULAR = NORMAL,
- MEDIUM,
- DEMI_BOLD,
- SEMI_BOLD = DEMI_BOLD,
- BOLD,
- ULTRA_BOLD,
- EXTRA_BOLD = ULTRA_BOLD,
- BLACK,
- HEAVY = BLACK,
- EXTRA_BLACK = BLACK
- };
+enum Type
+{
+ NONE, ///< Means not defined. Will use what is set as default, currently NORMAL.
+ THIN,
+ ULTRA_LIGHT,
+ EXTRA_LIGHT = ULTRA_LIGHT,
+ LIGHT,
+ DEMI_LIGHT,
+ SEMI_LIGHT = DEMI_LIGHT,
+ BOOK,
+ NORMAL,
+ REGULAR = NORMAL,
+ MEDIUM,
+ DEMI_BOLD,
+ SEMI_BOLD = DEMI_BOLD,
+ BOLD,
+ ULTRA_BOLD,
+ EXTRA_BOLD = ULTRA_BOLD,
+ BLACK,
+ HEAVY = BLACK,
+ EXTRA_BLACK = BLACK
+};
- const char* const Name[] =
+const char* const Name[] =
{
"NONE",
"THIN",
"DEMI_BOLD",
"BOLD",
"ULTRA_BOLD",
- "BLACK"
- };
-}
+ "BLACK"};
+} // namespace FontWeight
namespace FontSlant
{
- /**
+/**
* @brief Enumeration type for the font's slant
*/
- enum Type
- {
- NONE, ///< Means not defined. Will use what is set as default, currently NORMAL.
- NORMAL,
- ROMAN = NORMAL,
- ITALIC,
- OBLIQUE
- };
+enum Type
+{
+ NONE, ///< Means not defined. Will use what is set as default, currently NORMAL.
+ NORMAL,
+ ROMAN = NORMAL,
+ ITALIC,
+ OBLIQUE
+};
- const char* const Name[] =
+const char* const Name[] =
{
"NONE",
"NORMAL",
"ITALIC",
- "OBLIQUE"
- };
+ "OBLIQUE"};
} // namespace FontSlant
struct FontDescription
FontDescription()
: path(),
family(),
- width( FontWidth::NONE ),
- weight( FontWeight::NONE ),
- slant( FontSlant::NONE ),
- type( INVALID )
- {}
+ width(FontWidth::NONE),
+ weight(FontWeight::NONE),
+ slant(FontSlant::NONE),
+ type(INVALID)
+ {
+ }
~FontDescription()
- {}
+ {
+ }
FontPath path; ///< The font's file name path.
FontFamily family; ///< The font's family name.
typedef std::vector<FontDescription> FontList;
-DALI_ADAPTOR_API std::ostream& operator<<( std::ostream& o, const FontList& fontList );
+DALI_ADAPTOR_API std::ostream& operator<<(std::ostream& o, const FontList& fontList);
} // namespace TextAbstraction
/*
- * Copyright (c) 2015 Samsung Electronics Co., Ltd.
+ * Copyright (c) 2020 Samsung Electronics Co., Ltd.
*
* Licensed under the Apache License, Version 2.0 (the "License");
* you may not use this file except in compliance with the License.
namespace Dali
{
-
namespace TextAbstraction
{
-
FontMetrics::FontMetrics()
-: ascender{ 0.f },
- descender{ 0.f },
- height{ 0.f },
- underlinePosition{ 0.f },
- underlineThickness{ 0.f }
+: ascender{0.f},
+ descender{0.f},
+ height{0.f},
+ underlinePosition{0.f},
+ underlineThickness{0.f}
{
}
-FontMetrics::FontMetrics( float ascenderPixels,
- float descenderPixels,
- float heightPixels,
- float underlinePositionPixels,
- float underlineThicknessPixels )
-: ascender{ ascenderPixels },
- descender{ descenderPixels },
- height{ heightPixels },
- underlinePosition{ underlinePositionPixels },
- underlineThickness{ underlineThicknessPixels }
+FontMetrics::FontMetrics(float ascenderPixels,
+ float descenderPixels,
+ float heightPixels,
+ float underlinePositionPixels,
+ float underlineThicknessPixels)
+: ascender{ascenderPixels},
+ descender{descenderPixels},
+ height{heightPixels},
+ underlinePosition{underlinePositionPixels},
+ underlineThickness{underlineThicknessPixels}
{
}
#define DALI_TEXT_ABSTRACTION_FONT_METRICS_H
/*
- * Copyright (c) 2019 Samsung Electronics Co., Ltd.
+ * Copyright (c) 2020 Samsung Electronics Co., Ltd.
*
* Licensed under the Apache License, Version 2.0 (the "License");
* you may not use this file except in compliance with the License.
namespace Dali
{
-
namespace TextAbstraction
{
-
/**
* The metrics for a Font expressed in pixels.
*/
/**
* @brief Create the font metrics in pixels.
*/
- FontMetrics( float ascenderPixels,
- float descenderPixels,
- float heightPixels,
- float underlinePositionPixels,
- float underlineThicknessPixels );
-
- float ascender; ///< The ascender in pixels.
- float descender; ///< The descender in pixels.
- float height; ///< The height in pixels.
- float underlinePosition; ///< The underline position in pixels.
- float underlineThickness; ///< The vertical height of the underline in pixels.
+ FontMetrics(float ascenderPixels,
+ float descenderPixels,
+ float heightPixels,
+ float underlinePositionPixels,
+ float underlineThicknessPixels);
+
+ float ascender; ///< The ascender in pixels.
+ float descender; ///< The descender in pixels.
+ float height; ///< The height in pixels.
+ float underlinePosition; ///< The underline position in pixels.
+ float underlineThickness; ///< The vertical height of the underline in pixels.
};
-} // Dali
+} // namespace TextAbstraction
-} // TextAbstraction
+} // namespace Dali
#endif //DALI_TEXT_ABSTRACTION_FONT_METRICS_H
/*
- * Copyright (c) 2019 Samsung Electronics Co., Ltd.
+ * Copyright (c) 2020 Samsung Electronics Co., Ltd.
*
* Licensed under the Apache License, Version 2.0 (the "License");
* you may not use this file except in compliance with the License.
namespace Dali
{
-
namespace TextAbstraction
{
-
GlyphInfo::GlyphInfo()
-: fontId{ 0u },
- index{ 0u },
- width( 0.f ),
- height{ 0.f },
- xBearing{ 0.f },
- yBearing{ 0.f },
- advance{ 0.f },
- scaleFactor{ 0.f },
- isItalicRequired{ false },
- isBoldRequired{ false }
+: fontId{0u},
+ index{0u},
+ width(0.f),
+ height{0.f},
+ xBearing{0.f},
+ yBearing{0.f},
+ advance{0.f},
+ scaleFactor{0.f},
+ isItalicRequired{false},
+ isBoldRequired{false}
{
}
-GlyphInfo::GlyphInfo( FontId font, GlyphIndex i )
-: fontId{ font },
- index{ i },
- width( 0.f ),
- height{ 0.f },
- xBearing{ 0.f },
- yBearing{ 0.f },
- advance{ 0.f },
- scaleFactor{ 0.f },
- isItalicRequired{ false },
- isBoldRequired{ false }
+GlyphInfo::GlyphInfo(FontId font, GlyphIndex i)
+: fontId{font},
+ index{i},
+ width(0.f),
+ height{0.f},
+ xBearing{0.f},
+ yBearing{0.f},
+ advance{0.f},
+ scaleFactor{0.f},
+ isItalicRequired{false},
+ isBoldRequired{false}
{
}
#define DALI_TEXT_ABSTRACTION_GLYPH_INFO_H
/*
- * Copyright (c) 2019 Samsung Electronics Co., Ltd.
+ * Copyright (c) 2020 Samsung Electronics Co., Ltd.
*
* Licensed under the Apache License, Version 2.0 (the "License");
* you may not use this file except in compliance with the License.
*/
// INTERNAL INCLUDES
-#include <dali/public-api/dali-adaptor-common.h>
#include <dali/devel-api/text-abstraction/text-abstraction-definitions.h>
+#include <dali/public-api/dali-adaptor-common.h>
namespace Dali
{
-
namespace TextAbstraction
{
-
/**
* The information describing a glyph (font ID, index, metrics)
* The metrics are in pixels.
/**
* @brief Creates the GlyphInfo without metrics.
*/
- GlyphInfo( FontId font, GlyphIndex i );
-
- FontId fontId; ///< Identifies the font containing the glyph
- GlyphIndex index; ///< Uniquely identifies a glyph for a given FontId
- float width; ///< The width of the glyph
- float height; ///< The height of the glyph
- float xBearing; ///< The distance from the cursor position to the leftmost border of the glyph
- float yBearing; ///< The distance from the baseline to the topmost border of the glyph
- float advance; ///< The distance to move the cursor for this glyph
- float scaleFactor; ///< The scaling applied (fixed-size fonts only)
- bool isItalicRequired:1; ///< Whether the italic style is required.
- bool isBoldRequired:1; ///< Whether the bold style is required.
+ GlyphInfo(FontId font, GlyphIndex i);
+
+ FontId fontId; ///< Identifies the font containing the glyph
+ GlyphIndex index; ///< Uniquely identifies a glyph for a given FontId
+ float width; ///< The width of the glyph
+ float height; ///< The height of the glyph
+ float xBearing; ///< The distance from the cursor position to the leftmost border of the glyph
+ float yBearing; ///< The distance from the baseline to the topmost border of the glyph
+ float advance; ///< The distance to move the cursor for this glyph
+ float scaleFactor; ///< The scaling applied (fixed-size fonts only)
+ bool isItalicRequired : 1; ///< Whether the italic style is required.
+ bool isBoldRequired : 1; ///< Whether the bold style is required.
};
-} // Dali
+} // namespace TextAbstraction
-} // TextAbstraction
+} // namespace Dali
#endif //DALI_TEXT_ABSTRACTION_GLYPH_INFO_H
/*
- * Copyright (c) 2015 Samsung Electronics Co., Ltd.
+ * Copyright (c) 2020 Samsung Electronics Co., Ltd.
*
* Licensed under the Apache License, Version 2.0 (the "License");
* you may not use this file except in compliance with the License.
namespace Dali
{
-
namespace TextAbstraction
{
-
namespace
{
-const unsigned int WHITE_SPACE_THRESHOLD = 0x21; ///< All characters below 0x21 are considered white spaces.
-const unsigned int CHAR_LF = 0x000A; ///< NL Line feed, new line.
-const unsigned int CHAR_VT = 0x000B; ///< Vertical tab.
-const unsigned int CHAR_FF = 0x000C; ///< NP Form feed, new page.
-const unsigned int CHAR_CR = 0x000D; ///< Carriage return, new line.
-const unsigned int CHAR_NEL = 0x0085; ///< Next line.
-const unsigned int CHAR_LS = 0x2028; ///< Line separator.
-const unsigned int CHAR_PS = 0x2029; ///< Paragraph separator
+const unsigned int WHITE_SPACE_THRESHOLD = 0x21; ///< All characters below 0x21 are considered white spaces.
+const unsigned int CHAR_LF = 0x000A; ///< NL Line feed, new line.
+const unsigned int CHAR_VT = 0x000B; ///< Vertical tab.
+const unsigned int CHAR_FF = 0x000C; ///< NP Form feed, new page.
+const unsigned int CHAR_CR = 0x000D; ///< Carriage return, new line.
+const unsigned int CHAR_NEL = 0x0085; ///< Next line.
+const unsigned int CHAR_LS = 0x2028; ///< Line separator.
+const unsigned int CHAR_PS = 0x2029; ///< Paragraph separator
const unsigned int CHAR_ZWS = 0x200B; ///< Zero width space.
const unsigned int CHAR_ZWNJ = 0x200C; ///< Zero width non joiner.
const unsigned int CHAR_TS = 0x2009; ///< Thin Space.
} // namespace
-bool IsRightToLeftScript( Script script )
+bool IsRightToLeftScript(Script script)
{
- return ( ( ARABIC == script ) ||
- ( HEBREW == script ) );
+ return ((ARABIC == script) ||
+ (HEBREW == script));
}
-Script GetCharacterScript( Character character )
+Script GetCharacterScript(Character character)
{
// Latin script: It contains punctuation characters and symbols which are not part of the latin script. https://en.wikipedia.org/wiki/Latin_script_in_Unicode
// 0x0000 - 0x007f C0 Controls and Basic Latin
// 0x25aa
// 0x262a
- if( IsCommonScript( character ) )
+ if(IsCommonScript(character))
{
return COMMON;
}
- if( character <= 0x0cff )
+ if(character <= 0x0cff)
{
- if( character <= 0x09ff )
+ if(character <= 0x09ff)
{
- if( character <= 0x077f )
+ if(character <= 0x077f)
{
- if( ( 0x0030 <= character ) && ( character <= 0x0039 ) )
+ if((0x0030 <= character) && (character <= 0x0039))
{
return ASCII_DIGITS;
}
- if( character <= 0x007E )
+ if(character <= 0x007E)
{
- if( ( 0x0020 <= character ) && ( character <= 0x002F ) )
+ if((0x0020 <= character) && (character <= 0x002F))
{
return ASCII_PS;
}
- if( ( 0x003A <= character ) && ( character <= 0x0040 ) )
+ if((0x003A <= character) && (character <= 0x0040))
{
return ASCII_PS;
}
- if( ( 0x005B <= character ) && ( character <= 0x0060 ) )
+ if((0x005B <= character) && (character <= 0x0060))
{
return ASCII_PS;
}
- if( ( 0x007B <= character ) && ( character <= 0x007E ) )
+ if((0x007B <= character) && (character <= 0x007E))
{
return ASCII_PS;
}
}
- if( ( 0x007F <= character ) && ( character <= 0x009F ) )
+ if((0x007F <= character) && (character <= 0x009F))
{
// 0x007F is actually part of C0 Controls and Basic Latin. However, is the last and only control character of its block
// and the following characters of the next block are consecutive.
return C1_CONTROLS;
}
- if( ( 0x00A0 <= character ) && ( character <= 0x00BF ) )
+ if((0x00A0 <= character) && (character <= 0x00BF))
{
- if( character == 0x00A9 )
+ if(character == 0x00A9)
{
return EMOJI; // 5. Uncategorized: copyright sign
}
- if( character == 0x00AE )
+ if(character == 0x00AE)
{
return EMOJI; // 5. Uncategorized: registered sign
}
return C1_PS;
}
- if( character == 0x00D7 )
+ if(character == 0x00D7)
{
return C1_MATH;
}
- if( character == 0x00F7 )
+ if(character == 0x00F7)
{
- return C1_MATH;
+ return C1_MATH;
}
- if( character <= 0x02ff )
+ if(character <= 0x02ff)
{
- if( ( 0x02B9 <= character ) && ( character <= 0x02BF ) )
+ if((0x02B9 <= character) && (character <= 0x02BF))
{
return SML_P;
}
return LATIN;
}
- if( ( 0x0370 <= character ) && ( character <= 0x03ff ) )
+ if((0x0370 <= character) && (character <= 0x03ff))
{
return GREEK;
}
- if( ( 0x0400 <= character ) && ( character <= 0x04ff ) )
+ if((0x0400 <= character) && (character <= 0x04ff))
{
return CYRILLIC;
}
- if( ( 0x0500 <= character ) && ( character <= 0x052f ) )
+ if((0x0500 <= character) && (character <= 0x052f))
{
return CYRILLIC;
}
- if( ( 0x0530 <= character ) && ( character <= 0x058f ) )
+ if((0x0530 <= character) && (character <= 0x058f))
{
return ARMENIAN;
}
- if( ( 0x0591 <= character ) && ( character <= 0x05f4 ) )
+ if((0x0591 <= character) && (character <= 0x05f4))
{
return HEBREW;
}
- if( ( 0x0600 <= character ) && ( character <= 0x06ff ) )
+ if((0x0600 <= character) && (character <= 0x06ff))
{
return ARABIC;
}
- if( ( 0x0750 <= character ) && ( character <= 0x077f ) )
+ if((0x0750 <= character) && (character <= 0x077f))
{
return ARABIC;
}
}
else // > 0x077f
{
- if( ( 0x08A0 <= character ) && ( character <= 0x08ff ) )
+ if((0x08A0 <= character) && (character <= 0x08ff))
{
return ARABIC;
}
- if( ( 0x0900 <= character ) && ( character <= 0x097f ) )
+ if((0x0900 <= character) && (character <= 0x097f))
{
return DEVANAGARI;
}
- if( ( 0x0980 <= character ) && ( character <= 0x09ff ) )
+ if((0x0980 <= character) && (character <= 0x09ff))
{
return BENGALI;
}
}
else // > 0x09ff
{
- if( character <= 0x0b7f )
+ if(character <= 0x0b7f)
{
- if( ( 0x0a00 <= character ) && ( character <= 0x0a7f ) )
+ if((0x0a00 <= character) && (character <= 0x0a7f))
{
return GURMUKHI;
}
- if( ( 0x0a80 <= character ) && ( character <= 0x0aff ) )
+ if((0x0a80 <= character) && (character <= 0x0aff))
{
return GUJARATI;
}
- if( ( 0x0b00 <= character ) && ( character <= 0x0b7f ) )
+ if((0x0b00 <= character) && (character <= 0x0b7f))
{
return ORIYA;
}
}
else // > 0x0b7f
{
- if( ( 0x0b80 <= character ) && ( character <= 0x0bff ) )
+ if((0x0b80 <= character) && (character <= 0x0bff))
{
return TAMIL;
}
- if( ( 0x0c00 <= character ) && ( character <= 0x0c7f ) )
+ if((0x0c00 <= character) && (character <= 0x0c7f))
{
return TELUGU;
}
- if( ( 0x0c80 <= character ) && ( character <= 0x0cff ) )
+ if((0x0c80 <= character) && (character <= 0x0cff))
{
return KANNADA;
}
}
else // > 0x0cff
{
- if( character <= 0x2c7f )
+ if(character <= 0x2c7f)
{
- if( character <= 0x1eff )
+ if(character <= 0x1eff)
{
- if( ( 0x0d00 <= character ) && ( character <= 0x0d7f ) )
+ if((0x0d00 <= character) && (character <= 0x0d7f))
{
return MALAYALAM;
}
- if( ( 0x0d80 <= character ) && ( character <= 0x0dff ) )
+ if((0x0d80 <= character) && (character <= 0x0dff))
{
return SINHALA;
}
- if( ( 0x0e00 <= character ) && ( character <= 0x0e7f ) )
+ if((0x0e00 <= character) && (character <= 0x0e7f))
{
return THAI;
}
- if( ( 0x0e80 <= character ) && ( character <= 0x0eff ) )
+ if((0x0e80 <= character) && (character <= 0x0eff))
{
return LAO;
}
- if( ( 0x1000 <= character ) && ( character <= 0x109f ) )
+ if((0x1000 <= character) && (character <= 0x109f))
{
return BURMESE;
}
- if( ( 0x10a0 <= character ) && ( character <= 0x10ff ) )
+ if((0x10a0 <= character) && (character <= 0x10ff))
{
return GEORGIAN;
}
- if( ( 0x1100 <= character ) && ( character <= 0x11ff ) )
+ if((0x1100 <= character) && (character <= 0x11ff))
{
return HANGUL;
}
- if( ( 0x1200 <= character ) && ( character <= 0x137f ) )
+ if((0x1200 <= character) && (character <= 0x137f))
{
return GEEZ;
}
- if( ( 0x1380 <= character ) && ( character <= 0x139f ) )
+ if((0x1380 <= character) && (character <= 0x139f))
{
return GEEZ;
}
- if( ( 0x1700 <= character ) && ( character <= 0x171f ) )
+ if((0x1700 <= character) && (character <= 0x171f))
{
return BAYBAYIN;
}
- if( ( 0x1780 <= character ) && ( character <= 0x17ff ) )
+ if((0x1780 <= character) && (character <= 0x17ff))
{
return KHMER;
}
- if( ( 0x19e0 <= character ) && ( character <= 0x19ff ) )
+ if((0x19e0 <= character) && (character <= 0x19ff))
{
return KHMER;
}
- if( ( 0x1b80 <= character ) && ( character <= 0x1bbf ) )
+ if((0x1b80 <= character) && (character <= 0x1bbf))
{
return SUNDANESE;
}
- if( ( 0x1c50 <= character ) && ( character <= 0x1c7f ) )
+ if((0x1c50 <= character) && (character <= 0x1c7f))
{
return OL_CHIKI;
}
- if( ( 0x1cc0 <= character ) && ( character <= 0x1ccf ) )
+ if((0x1cc0 <= character) && (character <= 0x1ccf))
{
return SUNDANESE;
}
- if( ( 0x1d00 <= character ) && ( character <= 0x1eff ) )
+ if((0x1d00 <= character) && (character <= 0x1eff))
{
- if( ( 0x1D26 <= character ) && ( character <= 0x1D2B ) )
+ if((0x1D26 <= character) && (character <= 0x1D2B))
{
return PHONETIC_U;
}
- if( ( 0x1D5D <= character ) && ( character <= 0x1D61 ) )
+ if((0x1D5D <= character) && (character <= 0x1D61))
{
return PHONETIC_SS;
}
- if( ( 0x1D66 <= character ) && ( character <= 0x1D6A ) )
+ if((0x1D66 <= character) && (character <= 0x1D6A))
{
return PHONETIC_SS;
}
- if( character == 0x1D78 )
+ if(character == 0x1D78)
{
return PHONETIC_SS;
}
- if( character == 0x1DBF)
+ if(character == 0x1DBF)
{
return PHONETIC_SS;
}
}
else // > 0x1eff
{
- if( ( 0x1f00 <= character ) && ( character <= 0x1fff ) )
+ if((0x1f00 <= character) && (character <= 0x1fff))
{
return GREEK;
}
- if( character == 0x203c )
+ if(character == 0x203c)
{
return EMOJI; // 5. Uncategorized: double exclamation mark
}
- if( character == 0x2049 )
+ if(character == 0x2049)
{
return EMOJI; // 5. Uncategorized: exclamation question mark
}
- if( ( 0x2070 <= character ) && ( character <= 0x209f ) )
+ if((0x2070 <= character) && (character <= 0x209f))
{
- if( character == 0x2070 )
+ if(character == 0x2070)
{
return NUMERIC_SS;
}
- if( ( 0x2074 <= character ) && ( character <= 0x207E ) )
+ if((0x2074 <= character) && (character <= 0x207E))
{
return NUMERIC_SS;
}
return LATIN;
}
- if( character == 0x20e3 )
+ if(character == 0x20e3)
{
return EMOJI; // 5. Uncategorized: combining enclosing keycap
}
- if( character == 0x2122 )
+ if(character == 0x2122)
{
return EMOJI; // 5. Uncategorized: trade mark sign
}
- if( character == 0x2139 )
+ if(character == 0x2139)
{
return EMOJI; // 5. Uncategorized: information source
}
- if( ( 0x2100 <= character ) && ( character <= 0x2189 ) )
+ if((0x2100 <= character) && (character <= 0x2189))
{
- if( ( 0x2100 <= character ) && ( character <= 0x214f ) )
+ if((0x2100 <= character) && (character <= 0x214f))
{
- if( ( 0x212A <= character ) && ( character <= 0x212B ) )
+ if((0x212A <= character) && (character <= 0x212B))
{
return LATIN;
}
- if( character == 0x2132 )
+ if(character == 0x2132)
{
return LATIN;
}
- if( character == 0x214E )
+ if(character == 0x214E)
{
return LATIN;
}
return LETTER_LIKE;
}
- if( ( 0x2150 <= character ) && ( character <= 0x215F ) )
+ if((0x2150 <= character) && (character <= 0x215F))
{
return FRACTIONS_NF;
}
- if( character == 0x2189 )
+ if(character == 0x2189)
{
return FRACTIONS_NF;
}
}
// Symbols
- if( ( 0x25cb == character ) ||
- ( 0x25cf == character ) ||
- ( 0x25a1 == character ) )
+ if((0x25cb == character) ||
+ (0x25cf == character) ||
+ (0x25a1 == character))
{
return SYMBOLS1;
}
- if( 0x25a0 == character )
+ if(0x25a0 == character)
{
return SYMBOLS2;
}
- if( ( 0x2664 == character ) ||
- ( 0x2661 == character ) ||
- ( 0x2662 == character ) ||
- ( 0x2667 == character ) )
+ if((0x2664 == character) ||
+ (0x2661 == character) ||
+ (0x2662 == character) ||
+ (0x2667 == character))
{
return SYMBOLS3;
}
- if( ( 0x2606 == character ) ||
- ( 0x25aa == character ) )
+ if((0x2606 == character) ||
+ (0x25aa == character))
{
return SYMBOLS4;
}
- if( 0x262a == character )
+ if(0x262a == character)
{
return SYMBOLS5;
}
// U+2194 5. Uncategorized: left right arrow
// U+2B55 5. Uncategorized: heavy large circle
- if( ( 0x2194 <= character ) && ( character <= 0x2B55 ) )
+ if((0x2194 <= character) && (character <= 0x2B55))
{
return EMOJI;
}
- if( ( 0x2c60 <= character ) && ( character <= 0x2c7f ) )
+ if((0x2c60 <= character) && (character <= 0x2c7f))
{
return LATIN;
}
}
else // > 0x2c7f
{
- if( character <= 0xfdff )
+ if(character <= 0xfdff)
{
- if( ( 0x2d00 <= character ) && ( character <= 0x2d2f ) )
+ if((0x2d00 <= character) && (character <= 0x2d2f))
{
return GEORGIAN;
}
- if( ( 0x2d80 <= character ) && ( character <= 0x2ddf ) )
+ if((0x2d80 <= character) && (character <= 0x2ddf))
{
return GEEZ;
}
- if( ( 0x2de0 <= character ) && ( character <= 0x2dff ) )
+ if((0x2de0 <= character) && (character <= 0x2dff))
{
return CYRILLIC;
}
- if( ( 0x2e80 <= character ) && ( character <= 0x2eff ) )
+ if((0x2e80 <= character) && (character <= 0x2eff))
{
return CJK;
}
- if( ( 0x2f00 <= character ) && ( character <= 0x2fdf ) )
+ if((0x2f00 <= character) && (character <= 0x2fdf))
{
return CJK;
}
- if( ( 0x3000 <= character ) && ( character <= 0x303f ) )
+ if((0x3000 <= character) && (character <= 0x303f))
{
return CJK;
}
- if( ( 0x3040 <= character ) && ( character <= 0x309f ) )
+ if((0x3040 <= character) && (character <= 0x309f))
{
return HIRAGANA;
}
- if( ( 0x30a0 <= character ) && ( character <= 0x30ff ) )
+ if((0x30a0 <= character) && (character <= 0x30ff))
{
return KATAKANA;
}
- if( ( 0x3100 <= character ) && ( character <= 0x312f ) )
+ if((0x3100 <= character) && (character <= 0x312f))
{
return BOPOMOFO;
}
- if( ( 0x3130 <= character ) && ( character <= 0x318f ) )
+ if((0x3130 <= character) && (character <= 0x318f))
{
return HANGUL;
}
- if( ( 0x31a0 <= character ) && ( character <= 0x31bf ) )
+ if((0x31a0 <= character) && (character <= 0x31bf))
{
return BOPOMOFO;
}
- if( ( 0x3200 <= character ) && ( character <= 0x32ff ) )
+ if((0x3200 <= character) && (character <= 0x32ff))
{
return CJK;
}
- if( ( 0x3400 <= character ) && ( character <= 0x4dbf ) )
+ if((0x3400 <= character) && (character <= 0x4dbf))
{
return CJK;
}
- if( ( 0x4e00 <= character ) && ( character <= 0x62ff ) )
+ if((0x4e00 <= character) && (character <= 0x62ff))
{
return CJK;
}
- if( ( 0x6300 <= character ) && ( character <= 0x77ff ) )
+ if((0x6300 <= character) && (character <= 0x77ff))
{
return CJK;
}
- if( ( 0x7800 <= character ) && ( character <= 0x8cff ) )
+ if((0x7800 <= character) && (character <= 0x8cff))
{
return CJK;
}
- if( ( 0x8d00 <= character ) && ( character <= 0x9fff ) )
+ if((0x8d00 <= character) && (character <= 0x9fff))
{
return CJK;
}
- if( ( 0xa640 <= character ) && ( character <= 0xa69f ) )
+ if((0xa640 <= character) && (character <= 0xa69f))
{
return CYRILLIC;
}
- if( ( 0xa720 <= character ) && ( character <= 0xa7ff ) )
+ if((0xa720 <= character) && (character <= 0xa7ff))
{
- if( character == 0xA720 )
+ if(character == 0xA720)
{
return PHONETIC_U;
}
- if( character == 0xA721 )
+ if(character == 0xA721)
{
return PHONETIC_U;
}
- if( character == 0xA788 )
+ if(character == 0xA788)
{
return NON_LATIN_LED;
}
- if( character == 0xA789 )
+ if(character == 0xA789)
{
return NON_LATIN_LED;
}
- if( character == 0xA78A )
+ if(character == 0xA78A)
{
return NON_LATIN_LED;
}
return LATIN;
}
- if( ( 0xa960 <= character ) && ( character <= 0xa97f ) )
+ if((0xa960 <= character) && (character <= 0xa97f))
{
return HANGUL;
}
- if( ( 0xa980 <= character ) && ( character <= 0xa9fd ) )
+ if((0xa980 <= character) && (character <= 0xa9fd))
{
return JAVANESE;
}
- if( ( 0xab00 <= character ) && ( character <= 0xab2f ) )
+ if((0xab00 <= character) && (character <= 0xab2f))
{
return GEEZ;
}
- if( ( 0xab30 <= character ) && ( character <= 0xab6f ) )
+ if((0xab30 <= character) && (character <= 0xab6f))
{
return LATIN;
}
- if( ( 0xaae0 <= character ) && ( character <= 0xaaff ) )
+ if((0xaae0 <= character) && (character <= 0xaaff))
{
return MEITEI;
}
- if( ( 0xabc0 <= character ) && ( character <= 0xabff ) )
+ if((0xabc0 <= character) && (character <= 0xabff))
{
return MEITEI;
}
- if( ( 0xac00 <= character ) && ( character <= 0xd7af ) )
+ if((0xac00 <= character) && (character <= 0xd7af))
{
return HANGUL;
}
- if( ( 0xd7b0 <= character ) && ( character <= 0xd7ff ) )
+ if((0xd7b0 <= character) && (character <= 0xd7ff))
{
return HANGUL;
}
- if( ( 0xfb00 <= character ) && ( character <= 0xfb06 ) )
+ if((0xfb00 <= character) && (character <= 0xfb06))
{
return LATIN;
}
- if( ( 0xfb13 <= character ) && ( character <= 0xfb17 ) )
+ if((0xfb13 <= character) && (character <= 0xfb17))
{
return ARMENIAN;
}
- if( ( 0xfb1d <= character ) && ( character <= 0xfb4f ) )
+ if((0xfb1d <= character) && (character <= 0xfb4f))
{
return HEBREW;
}
- if( ( 0xfb50 <= character ) && ( character <= 0xfdff ) )
+ if((0xfb50 <= character) && (character <= 0xfdff))
{
return ARABIC;
}
}
else // > 0xfdff
{
- if( ( 0xfe70 <= character ) && ( character <= 0xfeff ) )
+ if((0xfe70 <= character) && (character <= 0xfeff))
{
return ARABIC;
}
- if( ( 0xff00 <= character ) && ( character <= 0xffef ) )
+ if((0xff00 <= character) && (character <= 0xffef))
{
- if( ( 0xFF00 <= character ) && ( character <= 0xFF20 ) )
+ if((0xFF00 <= character) && (character <= 0xFF20))
{
return HWFW_S;
}
- if( ( 0xFF3B <= character ) && ( character <= 0xFF40 ) )
+ if((0xFF3B <= character) && (character <= 0xFF40))
{
return HWFW_S;
}
- if( ( 0xFF5B <= character ) && ( character <= 0xFFEF ) )
+ if((0xFF5B <= character) && (character <= 0xFFEF))
{
return HWFW_S;
}
return LATIN;
}
- if( ( 0x1ee00 <= character ) && ( character <= 0x1eeff ) )
+ if((0x1ee00 <= character) && (character <= 0x1eeff))
{
return ARABIC;
}
// U+1f170 4. Enclosed characters: negative squared latin capital letter A
// U+1f6ff 6b. Additional transport and map symbols
- if( ( 0x1f170 <= character ) && ( character <= 0x1f6ff ) )
+ if((0x1f170 <= character) && (character <= 0x1f6ff))
{
return EMOJI;
}
// 7. Supplemental Symbols and Pictographs
- if( ( 0x1f900 <= character ) && ( character <= 0x1f9ff ) )
+ if((0x1f900 <= character) && (character <= 0x1f9ff))
{
return EMOJI;
}
- if( ( 0x20000 <= character ) && ( character <= 0x215ff ) )
+ if((0x20000 <= character) && (character <= 0x215ff))
{
return CJK;
}
- if( ( 0x21600 <= character ) && ( character <= 0x230ff ) )
+ if((0x21600 <= character) && (character <= 0x230ff))
{
return CJK;
}
- if( ( 0x23100 <= character ) && ( character <= 0x245ff ) )
+ if((0x23100 <= character) && (character <= 0x245ff))
{
return CJK;
}
- if( ( 0x24600 <= character ) && ( character <= 0x260ff ) )
+ if((0x24600 <= character) && (character <= 0x260ff))
{
return CJK;
}
- if( ( 0x26100 <= character ) && ( character <= 0x275ff ) )
+ if((0x26100 <= character) && (character <= 0x275ff))
{
return CJK;
}
- if( ( 0x27600 <= character ) && ( character <= 0x290ff ) )
+ if((0x27600 <= character) && (character <= 0x290ff))
{
return CJK;
}
- if( ( 0x29100 <= character ) && ( character <= 0x2a6df ) )
+ if((0x29100 <= character) && (character <= 0x2a6df))
{
return CJK;
}
- if( ( 0x2a700 <= character ) && ( character <= 0x2b73f ) )
+ if((0x2a700 <= character) && (character <= 0x2b73f))
{
return CJK;
}
- if( ( 0x2b740 <= character ) && ( character <= 0x2b81f ) )
+ if((0x2b740 <= character) && (character <= 0x2b81f))
{
return CJK;
}
return UNKNOWN;
}
-bool IsWhiteSpace( Character character )
+bool IsWhiteSpace(Character character)
{
return character < WHITE_SPACE_THRESHOLD;
}
-bool IsNewParagraph( Character character )
+bool IsNewParagraph(Character character)
{
- return ( ( CHAR_LF == character ) ||
- ( CHAR_VT == character ) ||
- ( CHAR_FF == character ) ||
- ( CHAR_CR == character ) ||
- ( CHAR_NEL == character ) ||
- ( CHAR_LS == character ) ||
- ( CHAR_PS == character ) );
+ return ((CHAR_LF == character) ||
+ (CHAR_VT == character) ||
+ (CHAR_FF == character) ||
+ (CHAR_CR == character) ||
+ (CHAR_NEL == character) ||
+ (CHAR_LS == character) ||
+ (CHAR_PS == character));
}
-bool IsZeroWidthNonJoiner( Character character )
+bool IsZeroWidthNonJoiner(Character character)
{
return CHAR_ZWNJ == character;
}
-bool IsZeroWidthJoiner( Character character )
+bool IsZeroWidthJoiner(Character character)
{
return CHAR_ZWJ == character;
}
-bool IsZeroWidthSpace( Character character )
+bool IsZeroWidthSpace(Character character)
{
return CHAR_ZWS == character;
}
-bool IsLeftToRightMark( Character character )
+bool IsLeftToRightMark(Character character)
{
return CHAR_LTRM == character;
}
-bool IsRightToLeftMark( Character character )
+bool IsRightToLeftMark(Character character)
{
return CHAR_RTLM == character;
}
-bool IsThinSpace( Character character )
+bool IsThinSpace(Character character)
{
return CHAR_TS == character;
}
-bool IsCommonScript( Character character )
+bool IsCommonScript(Character character)
{
- return ( IsWhiteSpace( character ) ||
- IsZeroWidthNonJoiner( character ) ||
- IsZeroWidthJoiner( character ) ||
- IsZeroWidthSpace( character ) ||
- IsLeftToRightMark( character ) ||
- IsRightToLeftMark( character ) ||
- IsThinSpace( character ) ||
- IsNewParagraph( character ) );
+ return (IsWhiteSpace(character) ||
+ IsZeroWidthNonJoiner(character) ||
+ IsZeroWidthJoiner(character) ||
+ IsZeroWidthSpace(character) ||
+ IsLeftToRightMark(character) ||
+ IsRightToLeftMark(character) ||
+ IsThinSpace(character) ||
+ IsNewParagraph(character));
}
-bool HasLigatureMustBreak( Script script )
+bool HasLigatureMustBreak(Script script)
{
- return ( ( LATIN == script ) ||
- ( ARABIC == script ) );
+ return ((LATIN == script) ||
+ (ARABIC == script));
}
} // namespace TextAbstraction
#define DALI_TOOLKIT_TEXT_ABSTRACTION_SCRIPT_H
/*
- * Copyright (c) 2019 Samsung Electronics Co., Ltd.
+ * Copyright (c) 2020 Samsung Electronics Co., Ltd.
*
* Licensed under the Apache License, Version 2.0 (the "License");
* you may not use this file except in compliance with the License.
*/
// INTERNAL INCLUDES
-#include <dali/public-api/dali-adaptor-common.h>
#include <dali/devel-api/text-abstraction/text-abstraction-definitions.h>
+#include <dali/public-api/dali-adaptor-common.h>
namespace Dali
{
-
namespace TextAbstraction
{
-
/**
* @brief Script is the writing system used by a language.
* Typically one script can be used to write different languages although one language could be written in different scrips.
*/
enum Script
{
- COMMON, ///< Valid for all scripts. i.e white space or '\n'.
+ COMMON, ///< Valid for all scripts. i.e white space or '\n'.
- ASCII_DIGITS, ///< ASCII digits.
- ASCII_PS, ///< ASCII punctuation and symbols.
+ ASCII_DIGITS, ///< ASCII digits.
+ ASCII_PS, ///< ASCII punctuation and symbols.
- C1_CONTROLS, ///< Controls of the C1 Controls and Latin-1 Supplement unicode block.
- C1_PS, ///< Punctuation and symbols of the C1 Controls and Latin-1 Supplement unicode block.
- C1_MATH, ///< Math symbols of the C1 Controls and Latin-1 Supplement unicode block.
+ C1_CONTROLS, ///< Controls of the C1 Controls and Latin-1 Supplement unicode block.
+ C1_PS, ///< Punctuation and symbols of the C1 Controls and Latin-1 Supplement unicode block.
+ C1_MATH, ///< Math symbols of the C1 Controls and Latin-1 Supplement unicode block.
- SML_P, ///< Punctuation symbols of the Spacing Modifier Letters unicode block.
- PHONETIC_U, ///< Uralic phonetic symbols of the Phonetic Extensions unicode block.
- PHONETIC_SS, ///< Subscripts and superscripts of the Phonetic Extensions unicode block.
+ SML_P, ///< Punctuation symbols of the Spacing Modifier Letters unicode block.
+ PHONETIC_U, ///< Uralic phonetic symbols of the Phonetic Extensions unicode block.
+ PHONETIC_SS, ///< Subscripts and superscripts of the Phonetic Extensions unicode block.
- NUMERIC_SS, ///< Numeric subscripts and superscripts.
+ NUMERIC_SS, ///< Numeric subscripts and superscripts.
LETTER_LIKE, ///< Symbols of the Letterlike unicode block.
NUMBER_FORMS, ///< Number Forms unicode block.
NON_LATIN_LED, ///< Non latin symbols within the Latin Extended D unicode block.
HWFW_S, ///< Non latin symbols within the Halfwidth and fullwidth unicode block.
- CYRILLIC, ///< The Cyrillic script. Used by Russian, Bulgarian, Ukrainian, Macedonian, ...
- GREEK, ///< The Greek script. Used by Greek.
- LATIN, ///< The latin script. Used by many western languages and others around the world.
-
- ARABIC, ///< The arabic script. Used by Arab and Urdu among others.
- HEBREW, ///< The Hebrew script. Used by the Hebrew, Yiddish, Ladino, and Judeo-Arabic.
-
- ARMENIAN, ///< The Armenian script. Used by Armenian.
- GEORGIAN, ///< The Georgian script. Used by Georgian.
-
- CJK, ///< The CJK script. Used by Chinese, Japanese, Korean and Vietnamese(old writing system).
- HANGUL, ///< The Hangul jamo script. Used by Korean.
- HIRAGANA, ///< The Hiragana script. Used by the Japanese.
- KATAKANA, ///< The Katakana script. Used by the Japanese.
- BOPOMOFO, ///< The Bopomofo script. Also called Zhuyin fuhao or Zhuyin. A phonetic notation used for the transcription of spoken Chinese.
-
- BENGALI, ///< The Bengali script. Used by Bangla, Assamese, Bishnupriya Manipuri, Daphla, Garo, Hallam, Khasi, Mizo, Munda, Naga, Rian, and Santali.
- BURMESE, ///< The Burmese script. Used by the Burmese (Myanmar) language.
- DEVANAGARI, ///< The devanagari script. Used by Hindi, Marathi, Sindhi, Nepali and Sanskrit.
- GUJARATI, ///< The Gujarati script. Used by Gujarati.
- GURMUKHI, ///< The Gurmukhi script. Used by Punjabi.
- KANNADA, ///< The Kannada script. Used by Kannada and Tulu.
- MALAYALAM, ///< The Malayalam script. Used by Malayalam.
- ORIYA, ///< The Oriya script. Used by Oriya (Odia), Khondi, and Santali.
- SINHALA, ///< The Sinhala script. Used by Sinhala and Pali.
- TAMIL, ///< The Tamil script. Used by Tamil, Badaga, and Saurashtra.
- TELUGU, ///< The Telugu script. Used by Telugu, Gondi, and Lambadi.
-
- LAO, ///< The Lao script. Used by the Lao language.
- THAI, ///< The Thai script. Used by the Thai language
- KHMER, ///< The Khmer script. Used by the Khmer language.
- JAVANESE, ///< The Javanese script. Used by the Javanese language.
- SUNDANESE, ///< The Sundanese script. Used by the Sundanese language.
-
- GEEZ, ///< The Ge'ez script. Used by the Amharic, Tigrinya and other languages in Ethiopia and Eritrea.
- OL_CHIKI, ///< The Ol Chiki script. Used by the Santali.
- BAYBAYIN, ///< The Baybayin script. Used by the Tagalog, Bikol languages, Ilocano, Pangasinan, Visayan and other languages in Philippines.
- MEITEI, ///< The Meitei script used for the Meitei language in Manipur, India.
-
- EMOJI, ///< The Emoji which map to standardized Unicode characters.
-
- SYMBOLS1, ///< Some symbols.
- SYMBOLS2, ///< Some symbols.
- SYMBOLS3, ///< Some symbols.
- SYMBOLS4, ///< Some symbols.
- SYMBOLS5, ///< Some symbols.
-
- UNKNOWN ///< The script is unknown.
+ CYRILLIC, ///< The Cyrillic script. Used by Russian, Bulgarian, Ukrainian, Macedonian, ...
+ GREEK, ///< The Greek script. Used by Greek.
+ LATIN, ///< The latin script. Used by many western languages and others around the world.
+
+ ARABIC, ///< The arabic script. Used by Arab and Urdu among others.
+ HEBREW, ///< The Hebrew script. Used by the Hebrew, Yiddish, Ladino, and Judeo-Arabic.
+
+ ARMENIAN, ///< The Armenian script. Used by Armenian.
+ GEORGIAN, ///< The Georgian script. Used by Georgian.
+
+ CJK, ///< The CJK script. Used by Chinese, Japanese, Korean and Vietnamese(old writing system).
+ HANGUL, ///< The Hangul jamo script. Used by Korean.
+ HIRAGANA, ///< The Hiragana script. Used by the Japanese.
+ KATAKANA, ///< The Katakana script. Used by the Japanese.
+ BOPOMOFO, ///< The Bopomofo script. Also called Zhuyin fuhao or Zhuyin. A phonetic notation used for the transcription of spoken Chinese.
+
+ BENGALI, ///< The Bengali script. Used by Bangla, Assamese, Bishnupriya Manipuri, Daphla, Garo, Hallam, Khasi, Mizo, Munda, Naga, Rian, and Santali.
+ BURMESE, ///< The Burmese script. Used by the Burmese (Myanmar) language.
+ DEVANAGARI, ///< The devanagari script. Used by Hindi, Marathi, Sindhi, Nepali and Sanskrit.
+ GUJARATI, ///< The Gujarati script. Used by Gujarati.
+ GURMUKHI, ///< The Gurmukhi script. Used by Punjabi.
+ KANNADA, ///< The Kannada script. Used by Kannada and Tulu.
+ MALAYALAM, ///< The Malayalam script. Used by Malayalam.
+ ORIYA, ///< The Oriya script. Used by Oriya (Odia), Khondi, and Santali.
+ SINHALA, ///< The Sinhala script. Used by Sinhala and Pali.
+ TAMIL, ///< The Tamil script. Used by Tamil, Badaga, and Saurashtra.
+ TELUGU, ///< The Telugu script. Used by Telugu, Gondi, and Lambadi.
+
+ LAO, ///< The Lao script. Used by the Lao language.
+ THAI, ///< The Thai script. Used by the Thai language
+ KHMER, ///< The Khmer script. Used by the Khmer language.
+ JAVANESE, ///< The Javanese script. Used by the Javanese language.
+ SUNDANESE, ///< The Sundanese script. Used by the Sundanese language.
+
+ GEEZ, ///< The Ge'ez script. Used by the Amharic, Tigrinya and other languages in Ethiopia and Eritrea.
+ OL_CHIKI, ///< The Ol Chiki script. Used by the Santali.
+ BAYBAYIN, ///< The Baybayin script. Used by the Tagalog, Bikol languages, Ilocano, Pangasinan, Visayan and other languages in Philippines.
+ MEITEI, ///< The Meitei script used for the Meitei language in Manipur, India.
+
+ EMOJI, ///< The Emoji which map to standardized Unicode characters.
+
+ SYMBOLS1, ///< Some symbols.
+ SYMBOLS2, ///< Some symbols.
+ SYMBOLS3, ///< Some symbols.
+ SYMBOLS4, ///< Some symbols.
+ SYMBOLS5, ///< Some symbols.
+
+ UNKNOWN ///< The script is unknown.
};
const char* const ScriptName[] =
-{
- "COMMON", ///< Valid for all scripts. i.e white space or '\n'.
-
- "ASCII_DIGITS", ///< ASCII digits.
- "ASCII_PS", ///< ASCII punctuation and symbols.
-
- "C1_CONTROLS", ///< Controls of the C1 Controls and Latin-1 Supplement unicode block.
- "C1_PS", ///< Punctuation and symbols of the C1 Controls and Latin-1 Supplement unicode block.
- "C1_MATH", ///< Math symbols of the C1 Controls and Latin-1 Supplement unicode block.
-
- "SML_P", ///< Punctuation symbols of the Spacing Modifier Letters unicode block.
- "PHONETIC_U", ///< Uralic phonetic symbols of the Phonetic Extensions unicode block.
- "PHONETIC_SS", ///< Subscripts and superscripts of the Phonetic Extensions unicode block.
-
- "NUMERIC_SS", ///< Numeric subscripts and superscripts.
-
- "LETTER_LIKE", ///< Symbols of the Letterlike unicode block.
- "NUMBER_FORMS", ///< Number Forms unicode block.
- "FRACTIONS_NF", ///< Numeric fraction symbols of the Number Forms unicode block.
- "NON_LATIN_LED", ///< Non latin symbols within the Latin Extended D unicode block.
- "HWFW_S", ///< Non latin symbols within the Halfwidth and fullwidth unicode block.
-
- "CYRILLIC", ///< The Cyrillic script. Used by Russian, Bulgarian, Ukrainian, Macedonian, ...
- "GREEK", ///< The Greek script. Used by Greek.
- "LATIN", ///< The latin script. Used by many western languages and others around the world.
-
- "ARABIC", ///< The arabic script. Used by Arab and Urdu among others.
- "HEBREW", ///< The Hebrew script. Used by the Hebrew, Yiddish, Ladino, and Judeo-Arabic.
-
- "ARMENIAN", ///< The Armenian script. Used by Armenian.
- "GEORGIAN", ///< The Georgian script. Used by Georgian.
-
- "CJK", ///< The CJK script. Used by Chinese, Japanese, Korean and Vietnamese(old writing system).
- "HANGUL", ///< The Hangul jamo script. Used by Korean.
- "HIRAGANA", ///< The Hiragana script. Used by the Japanese.
- "KATAKANA", ///< The Katakana script. Used by the Japanese.
- "BOPOMOFO", ///< The Bopomofo script. Also called Zhuyin fuhao or Zhuyin. A phonetic notation used for the transcription of spoken Chinese.
-
- "BENGALI", ///< The Bengali script. Used by Bangla, Assamese, Bishnupriya Manipuri, Daphla, Garo, Hallam, Khasi, Mizo, Munda, Naga, Rian, and Santali.
- "BURMESE", ///< The Burmese script. Used by the Burmese (Myanmar) language.
- "DEVANAGARI", ///< The devanagari script. Used by Hindi, Marathi, Sindhi, Nepali and Sanskrit.
- "GUJARATI", ///< The Gujarati script. Used by Gujarati.
- "GURMUKHI", ///< The Gurmukhi script. Used by Punjabi.
- "KANNADA", ///< The Kannada script. Used by Kannada and Tulu.
- "MALAYALAM", ///< The Malayalam script. Used by Malayalam.
- "ORIYA", ///< The Oriya script. Used by Oriya (Odia), Khondi, and Santali.
- "SINHALA", ///< The Sinhala script. Used by Sinhala and Pali.
- "TAMIL", ///< The Tamil script. Used by Tamil, Badaga, and Saurashtra.
- "TELUGU", ///< The Telugu script. Used by Telugu, Gondi, and Lambadi.
-
- "LAO", ///< The Lao script. Used by the Lao language.
- "THAI", ///< The Thai script. Used by the Thai language
- "KHMER", ///< The Khmer script. Used by the Khmer language.
- "JAVANESE", ///< The Javanese script. Used by the Javanese language.
- "SUNDANESE", ///< The Sundanese script. Used by the Sundanese language.
-
- "GEEZ", ///< The Ge'ez script also known as Ethiopic. Used by the Amharic, Tigrinya and other languages in Ethiopia and Eritrea.
- "OL_CHIKI", ///< The Ol Chiki script. Used by the Santali.
- "BAYBAYIN", ///< The Baybayin script. Used by the Tagalog, Bikol languages, Ilocano, Pangasinan, Visayan and other languages in Philippines.
- "MEITEI", ///< The Meitei script used for the Meitei language in Manipur, India.
-
- "EMOJI", ///< The Emoji which map to standardized Unicode characters.
-
- "SYMBOLS1", ///< Some symbols.
- "SYMBOLS2", ///< Some symbols.
- "SYMBOLS3", ///< Some symbols.
- "SYMBOLS4", ///< Some symbols.
- "SYMBOLS5", ///< Some symbols.
-
- "UNKNOWN" ///< The script is unknown.
+ {
+ "COMMON", ///< Valid for all scripts. i.e white space or '\n'.
+
+ "ASCII_DIGITS", ///< ASCII digits.
+ "ASCII_PS", ///< ASCII punctuation and symbols.
+
+ "C1_CONTROLS", ///< Controls of the C1 Controls and Latin-1 Supplement unicode block.
+ "C1_PS", ///< Punctuation and symbols of the C1 Controls and Latin-1 Supplement unicode block.
+ "C1_MATH", ///< Math symbols of the C1 Controls and Latin-1 Supplement unicode block.
+
+ "SML_P", ///< Punctuation symbols of the Spacing Modifier Letters unicode block.
+ "PHONETIC_U", ///< Uralic phonetic symbols of the Phonetic Extensions unicode block.
+ "PHONETIC_SS", ///< Subscripts and superscripts of the Phonetic Extensions unicode block.
+
+ "NUMERIC_SS", ///< Numeric subscripts and superscripts.
+
+ "LETTER_LIKE", ///< Symbols of the Letterlike unicode block.
+ "NUMBER_FORMS", ///< Number Forms unicode block.
+ "FRACTIONS_NF", ///< Numeric fraction symbols of the Number Forms unicode block.
+ "NON_LATIN_LED", ///< Non latin symbols within the Latin Extended D unicode block.
+ "HWFW_S", ///< Non latin symbols within the Halfwidth and fullwidth unicode block.
+
+ "CYRILLIC", ///< The Cyrillic script. Used by Russian, Bulgarian, Ukrainian, Macedonian, ...
+ "GREEK", ///< The Greek script. Used by Greek.
+ "LATIN", ///< The latin script. Used by many western languages and others around the world.
+
+ "ARABIC", ///< The arabic script. Used by Arab and Urdu among others.
+ "HEBREW", ///< The Hebrew script. Used by the Hebrew, Yiddish, Ladino, and Judeo-Arabic.
+
+ "ARMENIAN", ///< The Armenian script. Used by Armenian.
+ "GEORGIAN", ///< The Georgian script. Used by Georgian.
+
+ "CJK", ///< The CJK script. Used by Chinese, Japanese, Korean and Vietnamese(old writing system).
+ "HANGUL", ///< The Hangul jamo script. Used by Korean.
+ "HIRAGANA", ///< The Hiragana script. Used by the Japanese.
+ "KATAKANA", ///< The Katakana script. Used by the Japanese.
+ "BOPOMOFO", ///< The Bopomofo script. Also called Zhuyin fuhao or Zhuyin. A phonetic notation used for the transcription of spoken Chinese.
+
+ "BENGALI", ///< The Bengali script. Used by Bangla, Assamese, Bishnupriya Manipuri, Daphla, Garo, Hallam, Khasi, Mizo, Munda, Naga, Rian, and Santali.
+ "BURMESE", ///< The Burmese script. Used by the Burmese (Myanmar) language.
+ "DEVANAGARI", ///< The devanagari script. Used by Hindi, Marathi, Sindhi, Nepali and Sanskrit.
+ "GUJARATI", ///< The Gujarati script. Used by Gujarati.
+ "GURMUKHI", ///< The Gurmukhi script. Used by Punjabi.
+ "KANNADA", ///< The Kannada script. Used by Kannada and Tulu.
+ "MALAYALAM", ///< The Malayalam script. Used by Malayalam.
+ "ORIYA", ///< The Oriya script. Used by Oriya (Odia), Khondi, and Santali.
+ "SINHALA", ///< The Sinhala script. Used by Sinhala and Pali.
+ "TAMIL", ///< The Tamil script. Used by Tamil, Badaga, and Saurashtra.
+ "TELUGU", ///< The Telugu script. Used by Telugu, Gondi, and Lambadi.
+
+ "LAO", ///< The Lao script. Used by the Lao language.
+ "THAI", ///< The Thai script. Used by the Thai language
+ "KHMER", ///< The Khmer script. Used by the Khmer language.
+ "JAVANESE", ///< The Javanese script. Used by the Javanese language.
+ "SUNDANESE", ///< The Sundanese script. Used by the Sundanese language.
+
+ "GEEZ", ///< The Ge'ez script also known as Ethiopic. Used by the Amharic, Tigrinya and other languages in Ethiopia and Eritrea.
+ "OL_CHIKI", ///< The Ol Chiki script. Used by the Santali.
+ "BAYBAYIN", ///< The Baybayin script. Used by the Tagalog, Bikol languages, Ilocano, Pangasinan, Visayan and other languages in Philippines.
+ "MEITEI", ///< The Meitei script used for the Meitei language in Manipur, India.
+
+ "EMOJI", ///< The Emoji which map to standardized Unicode characters.
+
+ "SYMBOLS1", ///< Some symbols.
+ "SYMBOLS2", ///< Some symbols.
+ "SYMBOLS3", ///< Some symbols.
+ "SYMBOLS4", ///< Some symbols.
+ "SYMBOLS5", ///< Some symbols.
+
+ "UNKNOWN" ///< The script is unknown.
};
/**
*
* @return @e true if the script is right to left.
*/
-DALI_ADAPTOR_API bool IsRightToLeftScript( Script script );
+DALI_ADAPTOR_API bool IsRightToLeftScript(Script script);
/**
* @brief Retrieves a character's script.
*
* @return The chraracter's script.
*/
-DALI_ADAPTOR_API Script GetCharacterScript( Character character );
+DALI_ADAPTOR_API Script GetCharacterScript(Character character);
/**
* @brief Whether the character is a white space.
*
* @return @e true if the character is a white space.
*/
-DALI_ADAPTOR_API bool IsWhiteSpace( Character character );
+DALI_ADAPTOR_API bool IsWhiteSpace(Character character);
/**
* @brief Whether the character is a new paragraph character.
*
* @return @e true if the character is a new paragraph character.
*/
-DALI_ADAPTOR_API bool IsNewParagraph( Character character );
+DALI_ADAPTOR_API bool IsNewParagraph(Character character);
/**
* @brief Whether the character is a zero width non joiner.
*
* @return @e true if the character is a zero width non joiner.
*/
-DALI_ADAPTOR_API bool IsZeroWidthNonJoiner( Character character );
+DALI_ADAPTOR_API bool IsZeroWidthNonJoiner(Character character);
/**
* @brief Whether the character is a zero width joiner.
*
* @return @e true if the character is a zero width joiner.
*/
-DALI_ADAPTOR_API bool IsZeroWidthJoiner( Character character );
+DALI_ADAPTOR_API bool IsZeroWidthJoiner(Character character);
/**
* @brief Whether the character is a zero width space.
*
* @return @e true if the character is a zero width space.
*/
-DALI_ADAPTOR_API bool IsZeroWidthSpace( Character character );
+DALI_ADAPTOR_API bool IsZeroWidthSpace(Character character);
/**
* @brief Whether the character is a left to right mark.
*
* @return @e true if the character is a left to right mark.
*/
-DALI_ADAPTOR_API bool IsLeftToRightMark( Character character );
+DALI_ADAPTOR_API bool IsLeftToRightMark(Character character);
/**
* @brief Whether the character is a right to left mark.
*
* @return @e true if the character is a right to left mark.
*/
-DALI_ADAPTOR_API bool IsRightToLeftMark( Character character );
+DALI_ADAPTOR_API bool IsRightToLeftMark(Character character);
/**
* @brief Whether the character is a thin space.
*
* @return @e true if the character is a thin space.
*/
-DALI_ADAPTOR_API bool IsThinSpace( Character character );
+DALI_ADAPTOR_API bool IsThinSpace(Character character);
/**
* @brief Whether the character is common within all scripts.
*
* @return @e true if the character is common within all scripts.
*/
-DALI_ADAPTOR_API bool IsCommonScript( Character character );
+DALI_ADAPTOR_API bool IsCommonScript(Character character);
/**
* @brief Whether the script contains ligatures that must be 'broken' for selection or cursor position.
*
* @return @e true if the script has ligatures that must be 'broken'.
*/
-DALI_ADAPTOR_API bool HasLigatureMustBreak( Script script );
+DALI_ADAPTOR_API bool HasLigatureMustBreak(Script script);
} // namespace TextAbstraction
} // namespace Dali
/*
- * Copyright (c) 2015 Samsung Electronics Co., Ltd.
+ * Copyright (c) 2020 Samsung Electronics Co., Ltd.
*
* Licensed under the Apache License, Version 2.0 (the "License");
* you may not use this file except in compliance with the License.
namespace Dali
{
-
namespace TextAbstraction
{
-
Segmentation::Segmentation()
{
}
{
}
-Segmentation::Segmentation( Internal::Segmentation* implementation )
-: BaseHandle( implementation )
+Segmentation::Segmentation(Internal::Segmentation* implementation)
+: BaseHandle(implementation)
{
}
return Internal::Segmentation::Get();
}
-void Segmentation::GetLineBreakPositions( const Character* const text,
- Length numberOfCharacters,
- LineBreakInfo* breakInfo )
+void Segmentation::GetLineBreakPositions(const Character* const text,
+ Length numberOfCharacters,
+ LineBreakInfo* breakInfo)
{
- GetImplementation( *this ).GetLineBreakPositions( text,
- numberOfCharacters,
- breakInfo );
+ GetImplementation(*this).GetLineBreakPositions(text,
+ numberOfCharacters,
+ breakInfo);
}
-void Segmentation::GetWordBreakPositions( const Character* const text,
- Length numberOfCharacters,
- WordBreakInfo* breakInfo )
+void Segmentation::GetWordBreakPositions(const Character* const text,
+ Length numberOfCharacters,
+ WordBreakInfo* breakInfo)
{
- GetImplementation( *this ).GetWordBreakPositions( text,
- numberOfCharacters,
- breakInfo );
+ GetImplementation(*this).GetWordBreakPositions(text,
+ numberOfCharacters,
+ breakInfo);
}
} // namespace TextAbstraction
#define DALI_PLATFORM_TEXT_ABSTRACTION_SEGMENTATION_H
/*
- * Copyright (c) 2019 Samsung Electronics Co., Ltd.
+ * Copyright (c) 2020 Samsung Electronics Co., Ltd.
*
* Licensed under the Apache License, Version 2.0 (the "License");
* you may not use this file except in compliance with the License.
namespace Dali
{
-
namespace TextAbstraction
{
-
namespace Internal DALI_INTERNAL
{
-
class Segmentation;
-} // Internal
+} // namespace DALI_INTERNAL
-} // TextAbstraction
+} // namespace TextAbstraction
namespace TextAbstraction
{
-
/**
* Segmentation API
*
*/
class DALI_ADAPTOR_API Segmentation : public BaseHandle
{
-
public:
-
/**
* @brief Create an uninitialized TextAbstraction handle.
*
*
* @param[in] implementation A pointer to the internal segmentation object.
*/
- explicit DALI_INTERNAL Segmentation( Internal::Segmentation* implementation );
+ explicit DALI_INTERNAL Segmentation(Internal::Segmentation* implementation);
/**
* @brief Retrieve a handle to the Segmentation instance.
* @param[in] numberOfCharacters The number of characters.
* @param[out] breakInfo The line break info.
*/
- void GetLineBreakPositions( const Character* const text,
- Length numberOfCharacters,
- LineBreakInfo* breakInfo );
+ void GetLineBreakPositions(const Character* const text,
+ Length numberOfCharacters,
+ LineBreakInfo* breakInfo);
/**
* @brief Retrieves the word break info.
* @param[in] numberOfCharacters The number of characters.
* @param[out] breakInfo The word break info.
*/
- void GetWordBreakPositions( const Character* const text,
- Length numberOfCharacters,
- WordBreakInfo* breakInfo );
+ void GetWordBreakPositions(const Character* const text,
+ Length numberOfCharacters,
+ WordBreakInfo* breakInfo);
};
} // namespace TextAbstraction
/*
- * Copyright (c) 2015 Samsung Electronics Co., Ltd.
+ * Copyright (c) 2020 Samsung Electronics Co., Ltd.
*
* Licensed under the Apache License, Version 2.0 (the "License");
* you may not use this file except in compliance with the License.
namespace Dali
{
-
namespace TextAbstraction
{
-
Shaping::Shaping()
{
}
{
}
-Shaping::Shaping( Internal::Shaping *impl )
-: BaseHandle( impl )
+Shaping::Shaping(Internal::Shaping* impl)
+: BaseHandle(impl)
{
}
return Internal::Shaping::Get();
}
-Length Shaping::Shape( const Character* const text,
- Length numberOfCharacters,
- FontId fontId,
- Script script )
+Length Shaping::Shape(const Character* const text,
+ Length numberOfCharacters,
+ FontId fontId,
+ Script script)
{
- return GetImplementation( *this ).Shape( text,
- numberOfCharacters,
- fontId,
- script );
+ return GetImplementation(*this).Shape(text,
+ numberOfCharacters,
+ fontId,
+ script);
}
-void Shaping::GetGlyphs( GlyphInfo* glyphInfo,
- CharacterIndex* glyphToCharacterMap )
+void Shaping::GetGlyphs(GlyphInfo* glyphInfo,
+ CharacterIndex* glyphToCharacterMap)
{
- GetImplementation( *this ).GetGlyphs( glyphInfo,
- glyphToCharacterMap );
+ GetImplementation(*this).GetGlyphs(glyphInfo,
+ glyphToCharacterMap);
}
} // namespace TextAbstraction
#define DALI_PLATFORM_TEXT_ABSTRACTION_SHAPING_H
/*
- * Copyright (c) 2019 Samsung Electronics Co., Ltd.
+ * Copyright (c) 2020 Samsung Electronics Co., Ltd.
*
* Licensed under the Apache License, Version 2.0 (the "License");
* you may not use this file except in compliance with the License.
namespace Dali
{
-
namespace TextAbstraction
{
-
struct GlyphInfo;
namespace Internal DALI_INTERNAL
{
-
class Shaping;
-} // Internal
+} // namespace DALI_INTERNAL
/**
* @brief Shaping provides an interface to retrieve glyphs from complex text.
*/
class DALI_ADAPTOR_API Shaping : public BaseHandle
{
-
public:
-
/**
* @brief Create an uninitialized Shaping handle.
*
*
* @param[in] implementation A pointer to the internal shaping object.
*/
- explicit DALI_INTERNAL Shaping( Internal::Shaping* implementation );
+ explicit DALI_INTERNAL Shaping(Internal::Shaping* implementation);
/**
* @brief Retrieve a handle to the Shaping instance.
*
* @return The size of the buffer required to get the shaped text.
*/
- Length Shape( const Character* const text,
- Length numberOfCharacters,
- FontId fontId,
- Script script );
+ Length Shape(const Character* const text,
+ Length numberOfCharacters,
+ FontId fontId,
+ Script script);
/**
* Gets the shaped text data.
* @param[out] glyphInfo Vector with indices to the glyph within the font, glyph's metrics and advance.
* @param[out] glyphToCharacterMap The glyph to character conversion map.
*/
- void GetGlyphs( GlyphInfo* glyphInfo,
- CharacterIndex* glyphToCharacterMap );
+ void GetGlyphs(GlyphInfo* glyphInfo,
+ CharacterIndex* glyphToCharacterMap);
};
} // namespace TextAbstraction
#define DALI_TEXT_ABSTRACTION_DEFINITIONS_H
/*
- * Copyright (c) 2019 Samsung Electronics Co., Ltd.
+ * Copyright (c) 2020 Samsung Electronics Co., Ltd.
*
* Licensed under the Apache License, Version 2.0 (the "License");
* you may not use this file except in compliance with the License.
namespace Dali
{
-
namespace TextAbstraction
{
-
typedef uint32_t FontId; ///< The unique identifier for a font face (generated by FontClient)
typedef uint32_t PointSize26Dot6; ///< The point size in 26.6 fractional points
typedef uint32_t FaceIndex; ///< Used with fonts which allow several font faces
*/
enum class ColorBlendingMode
{
- NONE, ///< No blend.
- MULTIPLY ///< The color is multiplied by another one.
+ NONE, ///< No blend.
+ MULTIPLY ///< The color is multiplied by another one.
};
} // namespace TextAbstraction
/*
- * Copyright (c) 2019 Samsung Electronics Co., Ltd.
+ * Copyright (c) 2020 Samsung Electronics Co., Ltd.
*
* Licensed under the Apache License, Version 2.0 (the "License");
* you may not use this file except in compliance with the License.
namespace Dali
{
-
namespace TextAbstraction
{
-
-void TransformToArc( const CircularTextParameters& parameters, double& x, double& y )
+void TransformToArc(const CircularTextParameters& parameters, double& x, double& y)
{
double yP = y;
// Does the italic synthesization for circular layout.
- if( parameters.synthesizeItalic )
+ if(parameters.synthesizeItalic)
{
- const double xP = -yP * sin( TextAbstraction::FontClient::DEFAULT_ITALIC_ANGLE );
- yP *= cos( TextAbstraction::FontClient::DEFAULT_ITALIC_ANGLE );
+ const double xP = -yP * sin(TextAbstraction::FontClient::DEFAULT_ITALIC_ANGLE);
+ yP *= cos(TextAbstraction::FontClient::DEFAULT_ITALIC_ANGLE);
x += xP;
}
- double angle = 0.0;
+ double angle = 0.0;
double radius = parameters.radius;
// Transform to a circular layout.
- if( parameters.isClockwise )
+ if(parameters.isClockwise)
{
angle = parameters.beginAngle - parameters.invRadius * x;
radius -= yP;
- x = radius * cos( angle );
- y = -radius * sin( angle );
+ x = radius * cos(angle);
+ y = -radius * sin(angle);
}
else
{
angle = parameters.beginAngle + parameters.invRadius * x;
radius += yP;
- x = radius * cos( angle );
- y = radius * sin( -angle );
+ x = radius * cos(angle);
+ y = radius * sin(-angle);
}
// Transforms to the text area coordinate system.
#define DALI_PLATFORM_TEXT_ABSTRACTION_TEXT_RENDERER_LAYOUT_HELPER_H
/*
- * Copyright (c) 2019 Samsung Electronics Co., Ltd.
+ * Copyright (c) 2020 Samsung Electronics Co., Ltd.
*
* Licensed under the Apache License, Version 2.0 (the "License");
* you may not use this file except in compliance with the License.
namespace Dali
{
-
namespace TextAbstraction
{
-
/**
* @brief Parameters used to transform the vertices of the glyphs to wrap a circular path.
*/
struct DALI_ADAPTOR_API CircularTextParameters
{
CircularTextParameters()
- : centerX{ 0.0 },
- centerY{ 0.0 },
- radius{ 0.0 },
- invRadius{ 0.0 },
- beginAngle{ 0.0 },
- isClockwise{ true },
- synthesizeItalic{ false }
- {}
+ : centerX{0.0},
+ centerY{0.0},
+ radius{0.0},
+ invRadius{0.0},
+ beginAngle{0.0},
+ isClockwise{true},
+ synthesizeItalic{false}
+ {
+ }
- double centerX; ///< The 'x' center of the circular path.
- double centerY; ///< The 'y' center of the circular path.
- double radius; ///< The radius in pixels.
- double invRadius; ///< 1.0 / radius.
- double beginAngle; ///< The angle in radians where the circular text begins.
- bool isClockwise:1; ///< Whether the circular text layout is clockwise.
- bool synthesizeItalic:1; ///< Whether to synthesize italic.
+ double centerX; ///< The 'x' center of the circular path.
+ double centerY; ///< The 'y' center of the circular path.
+ double radius; ///< The radius in pixels.
+ double invRadius; ///< 1.0 / radius.
+ double beginAngle; ///< The angle in radians where the circular text begins.
+ bool isClockwise : 1; ///< Whether the circular text layout is clockwise.
+ bool synthesizeItalic : 1; ///< Whether to synthesize italic.
};
/**
* @param[in,out] x The 'x' coordinate of the vertex.
* @param[in,out] y The 'y' coordinate of the vertex.
*/
-DALI_ADAPTOR_API void TransformToArc( const CircularTextParameters& parameters, double& x, double& y );
+DALI_ADAPTOR_API void TransformToArc(const CircularTextParameters& parameters, double& x, double& y);
} // namespace TextAbstraction
/*
-* Copyright (c) 2019 Samsung Electronics Co., Ltd.
+* Copyright (c) 2020 Samsung Electronics Co., Ltd.
*
* Licensed under the Apache License, Version 2.0 (the "License");
* you may not use this file except in compliance with the License.
namespace Dali
{
-
namespace TextAbstraction
{
-
TextRenderer::TextRenderer()
{
}
return GetImplementation(*this).Render(parameters);
}
-TextRenderer::TextRenderer(Internal::TextRenderer *impl)
+TextRenderer::TextRenderer(Internal::TextRenderer* impl)
: BaseHandle(impl)
{
}
#define DALI_TOOLKIT_TEXT_ABSTRACTION_TEXT_RENDERER_H
/*
- * Copyright (c) 2019 Samsung Electronics Co., Ltd.
+ * Copyright (c) 2020 Samsung Electronics Co., Ltd.
*
* Licensed under the Apache License, Version 2.0 (the "License");
* you may not use this file except in compliance with the License.
#include <dali/public-api/object/base-handle.h>
// INTERNAL INCLUDES
-#include <dali/devel-api/text-abstraction/glyph-info.h>
#include <dali/devel-api/adaptor-framework/pixel-buffer.h>
+#include <dali/devel-api/text-abstraction/glyph-info.h>
namespace Dali
{
-
namespace TextAbstraction
{
-
namespace Internal
{
-
- // Forward declaration
- class TextRenderer;
+// Forward declaration
+class TextRenderer;
} // namespace Internal
/**
* @brief Parameters for the text renderer function.
*/
- Parameters( Vector<GlyphInfo>& glyphs,
- Vector<Vector2>& positions,
- Vector<Vector4>& colors,
- Vector<ColorIndex>& colorIndices,
- Vector<ColorBlendingMode>& blendingMode,
- Vector<bool>& isEmoji )
- : glyphs( glyphs ),
- positions( positions ),
- colors( colors ),
- colorIndices( colorIndices ),
- blendingMode( blendingMode ),
- isEmoji( isEmoji ),
- width{ 0u },
- height{ 0u },
- radius{ 0u },
- circularWidth{ 0u },
- circularHeight{ 0u },
- centerX{ 0 },
- centerY{ 0 },
- beginAngle{ 0.f },
- pixelFormat{ A8 },
- circularLayout{ CLOCKWISE }
- {}
-
- Vector<GlyphInfo>& glyphs; ///< The glyphs to be rendered.
- Vector<Vector2>& positions; ///< The position for each glyph.
- Vector<Vector4>& colors; ///< Colors of the glyphs.
- Vector<ColorIndex>& colorIndices; ///< Indices to the vector of colors for each glyphs.
- Vector<ColorBlendingMode>& blendingMode; ///< How each glyph is going to be blended with the color of the text.
- Vector<bool>& isEmoji; ///< Whether each glyph is an emoji.
- unsigned int width; ///< The width of the pixel buffer. @note Some implementations may change the width for performance reasons.
- unsigned int height; ///< The height of the pixel buffer.
- unsigned int radius; ///< The radius in pixels of the circular text.
- unsigned int circularWidth; ///< The width of the text laid out on an horizontal straight line.
- unsigned int circularHeight; ///< The height of the text laid out on an horizontal straight line.
- int centerX; ///< The 'x' coordinate of the center. For circular layout.
- int centerY; ///< The 'y' coordinate of the center. For circular layout.
- float beginAngle; ///< The angle in radians where the circular text begins.
- PixelFormat pixelFormat; ///< The pixel format of the pixel buffer.
- CircularLayout circularLayout; ///< The direction of the text's layout.
+ Parameters(Vector<GlyphInfo>& glyphs,
+ Vector<Vector2>& positions,
+ Vector<Vector4>& colors,
+ Vector<ColorIndex>& colorIndices,
+ Vector<ColorBlendingMode>& blendingMode,
+ Vector<bool>& isEmoji)
+ : glyphs(glyphs),
+ positions(positions),
+ colors(colors),
+ colorIndices(colorIndices),
+ blendingMode(blendingMode),
+ isEmoji(isEmoji),
+ width{0u},
+ height{0u},
+ radius{0u},
+ circularWidth{0u},
+ circularHeight{0u},
+ centerX{0},
+ centerY{0},
+ beginAngle{0.f},
+ pixelFormat{A8},
+ circularLayout{CLOCKWISE}
+ {
+ }
+
+ Vector<GlyphInfo>& glyphs; ///< The glyphs to be rendered.
+ Vector<Vector2>& positions; ///< The position for each glyph.
+ Vector<Vector4>& colors; ///< Colors of the glyphs.
+ Vector<ColorIndex>& colorIndices; ///< Indices to the vector of colors for each glyphs.
+ Vector<ColorBlendingMode>& blendingMode; ///< How each glyph is going to be blended with the color of the text.
+ Vector<bool>& isEmoji; ///< Whether each glyph is an emoji.
+ unsigned int width; ///< The width of the pixel buffer. @note Some implementations may change the width for performance reasons.
+ unsigned int height; ///< The height of the pixel buffer.
+ unsigned int radius; ///< The radius in pixels of the circular text.
+ unsigned int circularWidth; ///< The width of the text laid out on an horizontal straight line.
+ unsigned int circularHeight; ///< The height of the text laid out on an horizontal straight line.
+ int centerX; ///< The 'x' coordinate of the center. For circular layout.
+ int centerY; ///< The 'y' coordinate of the center. For circular layout.
+ float beginAngle; ///< The angle in radians where the circular text begins.
+ PixelFormat pixelFormat; ///< The pixel format of the pixel buffer.
+ CircularLayout circularLayout; ///< The direction of the text's layout.
};
public:
-
/**
* @brief Create an uninitialized TextRenderer handle.
*
Devel::PixelBuffer Render(const Parameters& parameters);
public: // Not intended for application developers.
-
/// @cond internal
/**
* @brief This constructor is used by TextRenderer::Get().
*/
// EXTERNAL INCLUDES
-#include <dali/public-api/signals/callback.h>
-#include <dali/public-api/signals/dali-signal.h>
-#include <dali/public-api/math/uint-16-pair.h>
-#include <dali/public-api/math/rect.h>
-#include <dali/public-api/object/any.h>
#include <dali/devel-api/events/touch-point.h>
#include <dali/integration-api/processor-interface.h>
+#include <dali/public-api/math/rect.h>
+#include <dali/public-api/math/uint-16-pair.h>
+#include <dali/public-api/object/any.h>
+#include <dali/public-api/signals/callback.h>
+#include <dali/public-api/signals/dali-signal.h>
// INTERNAL INCLUDES
+#include <dali/integration-api/adaptor-framework/log-factory-interface.h>
#include <dali/public-api/adaptor-framework/window.h>
#include <dali/public-api/dali-adaptor-common.h>
-#include <dali/integration-api/adaptor-framework/log-factory-interface.h>
namespace Dali
{
-
class ObjectRegistry;
class RenderSurfaceInterface;
using SceneHolderList = std::vector<Dali::Integration::SceneHolder>;
-
namespace Internal
{
namespace Adaptor
{
class GraphicsFactory;
class Adaptor;
-}
-}
+} // namespace Adaptor
+} // namespace Internal
/**
* @brief An Adaptor object is used to initialize and control how Dali runs.
class DALI_ADAPTOR_API Adaptor
{
public:
-
- typedef Signal< void (Adaptor&) > AdaptorSignalType; ///< Generic Type for adaptor signals
- typedef Signal< void (Dali::Integration::SceneHolder&) > WindowCreatedSignalType; ///< SceneHolder created signal type
+ typedef Signal<void(Adaptor&)> AdaptorSignalType; ///< Generic Type for adaptor signals
+ typedef Signal<void(Dali::Integration::SceneHolder&)> WindowCreatedSignalType; ///< SceneHolder created signal type
using SurfaceSize = Uint16Pair; ///< Surface size type
* @param[in] window The window to draw onto
* @return a reference to the adaptor handle
*/
- static Adaptor& New( Window window );
+ static Adaptor& New(Window window);
/**
* @brief Create a new adaptor using render surface.
* @param[in] surface The surface to draw onto
* @return a reference to the adaptor handle
*/
- static Adaptor& New( Window window, const Dali::RenderSurfaceInterface& surface );
+ static Adaptor& New(Window window, const Dali::RenderSurfaceInterface& surface);
/**
* @brief Create a new adaptor using the SceneHolder.
* @param[in] sceneHolder The SceneHolder to draw onto
* @return a reference to the adaptor handle
*/
- static Adaptor& New( Dali::Integration::SceneHolder sceneHolder );
+ static Adaptor& New(Dali::Integration::SceneHolder sceneHolder);
/**
* @brief Create a new adaptor using render surface.
* @param[in] surface The surface to draw onto
* @return a reference to the adaptor handle
*/
- static Adaptor& New( Dali::Integration::SceneHolder sceneHolder, const Dali::RenderSurfaceInterface& surface );
+ static Adaptor& New(Dali::Integration::SceneHolder sceneHolder, const Dali::RenderSurfaceInterface& surface);
/**
* @brief Virtual Destructor.
virtual ~Adaptor();
public:
-
/**
* @brief Starts the Adaptor.
*/
*
* @note Ownership of the callback is passed onto this class.
*/
- bool AddIdle( CallbackBase* callback, bool hasReturnValue );
+ bool AddIdle(CallbackBase* callback, bool hasReturnValue);
/**
* @brief Adds a new Window instance to the Adaptor
*
* @param[in] childWindow The child window instance
*/
- bool AddWindow( Dali::Integration::SceneHolder childWindow );
+ bool AddWindow(Dali::Integration::SceneHolder childWindow);
/**
* @brief Removes a previously added @p callback.
*
* @param[in] callback The callback to be removed.
*/
- void RemoveIdle( CallbackBase* callback );
+ void RemoveIdle(CallbackBase* callback);
/**
* @brief Processes the idle callbacks.
* @param[in] window The window to replace the surface for
* @param[in] surface to use
*/
- void ReplaceSurface( Window window, Dali::RenderSurfaceInterface& surface );
+ void ReplaceSurface(Window window, Dali::RenderSurfaceInterface& surface);
/**
* @brief Replaces the rendering surface
* @param[in] sceneHolder The SceneHolder to replace the surface for
* @param[in] surface to use
*/
- void ReplaceSurface( Dali::Integration::SceneHolder sceneHolder, Dali::RenderSurfaceInterface& surface );
+ void ReplaceSurface(Dali::Integration::SceneHolder sceneHolder, Dali::RenderSurfaceInterface& surface);
/**
* @brief Get the render surface the adaptor is using to render to.
* @param[in] actor The actor
* @return native window handle
*/
- Any GetNativeWindowHandle( Actor actor );
+ Any GetNativeWindowHandle(Actor actor);
/**
* @brief Get the native display associated with the graphics backend
* 4 - render every fourth vsync frame
* 8 - render every eighth vsync frame
*/
- void SetRenderRefreshRate( unsigned int numberOfVSyncsPerRender );
+ void SetRenderRefreshRate(unsigned int numberOfVSyncsPerRender);
/**
* @brief The callback is called from the Update/Render thread prior to rendering.
* @endcode
* This callback will be called repeatedly as long as it returns true. A return of 0 deletes this callback.
*/
- void SetPreRenderCallback( CallbackBase* callback );
+ void SetPreRenderCallback(CallbackBase* callback);
/**
* @brief Returns a reference to the instance of the adaptor used by the current thread.
* @param[in] point touch point
* @param[in] timeStamp time value of event
*/
- void FeedTouchPoint( TouchPoint& point, int timeStamp );
+ void FeedTouchPoint(TouchPoint& point, int timeStamp);
/**
* @brief Feed a wheel event to the adaptor.
*
* @param[in] wheelEvent wheel event
*/
- void FeedWheelEvent( WheelEvent& wheelEvent );
+ void FeedWheelEvent(WheelEvent& wheelEvent);
/**
* @brief Feed a key event to the adaptor.
*
* @param[in] keyEvent The key event holding the key information.
*/
- void FeedKeyEvent( KeyEvent& keyEvent );
+ void FeedKeyEvent(KeyEvent& keyEvent);
/**
* @copydoc Dali::Core::SceneCreated();
* @param[in] surface The current render surface
* @param[in] surfaceSize The new surface size
*/
- void SurfaceResizePrepare( Dali::RenderSurfaceInterface* surface, SurfaceSize surfaceSize );
+ void SurfaceResizePrepare(Dali::RenderSurfaceInterface* surface, SurfaceSize surfaceSize);
/**
* @brief Informs ThreadController the surface size has changed.
* @param[in] surface The current render surface
* @param[in] surfaceSize The new surface size
*/
- void SurfaceResizeComplete( Dali::RenderSurfaceInterface* surface, SurfaceSize surfaceSize );
+ void SurfaceResizeComplete(Dali::RenderSurfaceInterface* surface, SurfaceSize surfaceSize);
/**
* @brief Renders once more even if we're paused
* @param[in] processor the Processor to register
* @note using this api does not maintain the processor's lifecycle, must be done elsewhere.
*/
- void RegisterProcessor( Integration::Processor& processor );
+ void RegisterProcessor(Integration::Processor& processor);
/**
* @brief Unregister a previously registered processor from dali-core.
* @param[in] processor the Processor to unregister
*/
- void UnregisterProcessor( Integration::Processor& processor );
+ void UnregisterProcessor(Integration::Processor& processor);
/**
* @brief Get the list of windows created.
*/
void OnWindowHidden();
-public: // Signals
-
+public: // Signals
/**
* @brief The user should connect to this signal if they need to perform any
* special activities when the surface Dali is being rendered on is resized.
WindowCreatedSignalType& WindowCreatedSignal();
private:
-
// Undefined
Adaptor(const Adaptor&);
Adaptor& operator=(Adaptor&);
private:
-
/**
* @brief Create an uninitialized Adaptor.
*/
/*
- * Copyright (c) 2019 Samsung Electronics Co., Ltd.
+ * Copyright (c) 2020 Samsung Electronics Co., Ltd.
*
* Licensed under the Apache License, Version 2.0 (the "License");
* you may not use this file except in compliance with the License.
namespace Dali
{
-
namespace Integration
{
-
AndroidFramework& AndroidFramework::New()
{
return Internal::Adaptor::AndroidFramework::New();
Internal::Adaptor::AndroidFramework::Delete();
}
-void AndroidFramework::SetNativeApplication( android_app* application )
+void AndroidFramework::SetNativeApplication(android_app* application)
{
- mImpl->SetNativeApplication( application );
+ mImpl->SetNativeApplication(application);
}
android_app* AndroidFramework::GetNativeApplication() const
return mImpl->GetNativeApplication();
}
-void AndroidFramework::SetJVM( JavaVM* jvm )
+void AndroidFramework::SetJVM(JavaVM* jvm)
{
- mImpl->SetJVM( jvm );
+ mImpl->SetJVM(jvm);
}
JavaVM* AndroidFramework::GetJVM() const
return mImpl->GetJVM();
}
-void AndroidFramework::SetApplicationAssets( AAssetManager* assets )
+void AndroidFramework::SetApplicationAssets(AAssetManager* assets)
{
- mImpl->SetApplicationAssets( assets );
+ mImpl->SetApplicationAssets(assets);
}
AAssetManager* AndroidFramework::GetApplicationAssets() const
return mImpl->GetApplicationAssets();
}
-void AndroidFramework::SetInternalDataPath( const std::string& path )
+void AndroidFramework::SetInternalDataPath(const std::string& path)
{
- mImpl->SetInternalDataPath( path );
+ mImpl->SetInternalDataPath(path);
}
std::string AndroidFramework::GetInternalDataPath() const
return mImpl->GetInternalDataPath();
}
-void AndroidFramework::SetApplicationConfiguration( AConfiguration* configuration )
+void AndroidFramework::SetApplicationConfiguration(AConfiguration* configuration)
{
- mImpl->SetApplicationConfiguration( configuration );
+ mImpl->SetApplicationConfiguration(configuration);
}
AConfiguration* AndroidFramework::GetApplicationConfiguration() const
return mImpl->GetApplicationConfiguration();
}
-void AndroidFramework::SetApplicationWindow( ANativeWindow* window )
+void AndroidFramework::SetApplicationWindow(ANativeWindow* window)
{
- mImpl->SetApplicationWindow( window );
+ mImpl->SetApplicationWindow(window);
}
ANativeWindow* AndroidFramework::GetApplicationWindow() const
mImpl->OnResume();
}
-void AndroidFramework::OnWindowCreated( ANativeWindow* window )
+void AndroidFramework::OnWindowCreated(ANativeWindow* window)
{
- mImpl->OnWindowCreated( window );
+ mImpl->OnWindowCreated(window);
}
-void AndroidFramework::OnWindowDestroyed( ANativeWindow* window )
+void AndroidFramework::OnWindowDestroyed(ANativeWindow* window)
{
- mImpl->OnWindowDestroyed( window );
+ mImpl->OnWindowDestroyed(window);
}
AndroidFramework::~AndroidFramework()
}
AndroidFramework::AndroidFramework()
-: mImpl( nullptr )
+: mImpl(nullptr)
{
}
// EXTERNAL INCLUDES
#include <string>
-#include <jni.h>
#include <android/asset_manager.h>
#include <android/asset_manager_jni.h>
#include <android/configuration.h>
#include <android/native_window.h>
#include <android/native_window_jni.h>
+#include <jni.h>
#ifndef _ANDROID_NATIVE_APP_GLUE_H
extern "C"
{
-struct android_app;
+ struct android_app;
}
#endif
namespace Dali
{
-
namespace Internal DALI_INTERNAL
{
-
namespace Adaptor
{
class AndroidFramework;
}
-}
+} // namespace DALI_INTERNAL
namespace Integration
{
-
/**
* AndroidFramework provides setter/getter for Android native interfaces for Android DALi Adaptor.
* It is also used to pass Android application events to Android DALi Adaptor.
* @brief Sets the Android native application glue struct
* @param[in] application A pointer to the application glue struct
*/
- void SetNativeApplication( android_app* application );
+ void SetNativeApplication(android_app* application);
/**
* @brief Gets the Android native application glue struct
* @brief Sets the Android JVM
* @param[in] jvm A pointer to Android JVM
*/
- void SetJVM( JavaVM* jvm );
+ void SetJVM(JavaVM* jvm);
/**
* @brief Sets the JVM
* Sets the Android application assets manager.
* @param[in] assets A pointer to assets manager
*/
- void SetApplicationAssets( AAssetManager* assets );
+ void SetApplicationAssets(AAssetManager* assets);
/**
* @brief Gets the Android application assets manager.
* Sets the Android application internal data path.
* @param[in] path A path to the application data path
*/
- void SetInternalDataPath( const std::string& path );
+ void SetInternalDataPath(const std::string& path);
/**
* Gets the Android application internal data path.
* @brief Sets the Android application configuration
* @param[in] configuration A pointer to Android application configuration
*/
- void SetApplicationConfiguration( AConfiguration* configuration );
+ void SetApplicationConfiguration(AConfiguration* configuration);
/**
* @brief Gets the Android application configuration
* @brief Sets the Android application native window
* @return A native window
*/
- void SetApplicationWindow( ANativeWindow* window );
+ void SetApplicationWindow(ANativeWindow* window);
/**
* @brief Gets the Android application native window
/**
* Invoked when the Android application native window is created.
*/
- void OnWindowCreated( ANativeWindow* window );
+ void OnWindowCreated(ANativeWindow* window);
/**
* Invoked when the Android application native window is deleted.
*/
- void OnWindowDestroyed( ANativeWindow* window );
+ void OnWindowDestroyed(ANativeWindow* window);
/**
* @brief Returns a reference to the instance of the Android framework used by the current thread.
virtual ~AndroidFramework();
// Not copyable or movable
- AndroidFramework( const AndroidFramework& ) = delete; ///< Deleted copy constructor
- AndroidFramework( AndroidFramework&& ) = delete; ///< Deleted move constructor
- AndroidFramework& operator=( const AndroidFramework& ) = delete; ///< Deleted copy assignment operator
- AndroidFramework& operator=( AndroidFramework&& ) = delete; ///< Deleted move assignment operator
+ AndroidFramework(const AndroidFramework&) = delete; ///< Deleted copy constructor
+ AndroidFramework(AndroidFramework&&) = delete; ///< Deleted move constructor
+ AndroidFramework& operator=(const AndroidFramework&) = delete; ///< Deleted copy assignment operator
+ AndroidFramework& operator=(AndroidFramework&&) = delete; ///< Deleted move assignment operator
private:
-
/**
* @brief Create an uninitialized AndroidFramework.
*/
} // namespace Dali
#endif // DALI_INTEGRATION_ANDROID_FRAMEWORK_H
-
#define DALI_INTEGRATION_APPLICATION_LAUNCHER_H
/*
- * Copyright (c) 2019 Samsung Electronics Co., Ltd.
+ * Copyright (c) 2020 Samsung Electronics Co., Ltd.
*
* Licensed under the Apache License, Version 2.0 (the "License");
* you may not use this file except in compliance with the License.
*
*/
-#include <jni.h>
#include <dali/devel-api/adaptor-framework/application-devel.h>
+#include <jni.h>
using namespace Dali;
struct ApplicationLauncher
{
static RefObject* applicationObject;
- ApplicationLauncher( Application& application )
+ ApplicationLauncher(Application& application)
{
applicationObject = application.GetObjectPtr();
}
namespace
{
-
// JNI native "nativeOnCreate" callback when DaliView is created
-jlong OnCreate(JNIEnv *jenv, jobject obj)
+jlong OnCreate(JNIEnv* jenv, jobject obj)
{
// Extra reference to prevent finalize clearing the app
ApplicationLauncher::applicationObject->Reference();
// not blocking, does nothing except for the setting of the running flag
- DevelApplication::DownCast( ApplicationLauncher::applicationObject ).MainLoop();
+ DevelApplication::DownCast(ApplicationLauncher::applicationObject).MainLoop();
- return reinterpret_cast<jlong>( ApplicationLauncher::applicationObject );
+ return reinterpret_cast<jlong>(ApplicationLauncher::applicationObject);
};
-}
+} // namespace
// JNI daliview library on load entry function. Registers nativeOnCreate callback for DaliView Java class.
-JNIEXPORT jint JNI_OnLoad(JavaVM *vm, void *reserved)
+JNIEXPORT jint JNI_OnLoad(JavaVM* vm, void* reserved)
{
JNIEnv* env = nullptr;
- if( vm->GetEnv( reinterpret_cast<void **>( &env ), JNI_VERSION_1_6) != JNI_OK )
+ if(vm->GetEnv(reinterpret_cast<void**>(&env), JNI_VERSION_1_6) != JNI_OK)
{
return JNI_ERR;
}
// Find DaliView Java class. JNI_OnLoad is called from the correct class loader context for this to work.
- jclass clazz = env->FindClass( "com/sec/daliview/DaliView" );
- if( clazz == nullptr )
+ jclass clazz = env->FindClass("com/sec/daliview/DaliView");
+ if(clazz == nullptr)
{
return JNI_ERR;
}
// Register your class' native methods.
static const JNINativeMethod methods[] =
- {
- { "nativeOnCreate", "()J", (void *)&OnCreate },
- };
+ {
+ {"nativeOnCreate", "()J", (void*)&OnCreate},
+ };
int rc = env->RegisterNatives(clazz, methods, sizeof(methods) / sizeof(JNINativeMethod));
- if (rc != JNI_OK)
+ if(rc != JNI_OK)
return rc;
return JNI_VERSION_1_6;
// This macro facilitates creation of DALi application and launch when DaliView is created.
// The DALi application controller is passed to the application created by DaliView JNI library.
-#define RUN(Controller) Application application = Application::New(); \
- Controller controller( application ); \
- ApplicationLauncher launcher( application ); \
+#define RUN(Controller) \
+ Application application = Application::New(); \
+ Controller controller(application); \
+ ApplicationLauncher launcher(application);
#endif // DALI_INTEGRATION_APPLICATION_LAUNCHER_H
-
#define DALI_INTEGRATION_EGL_INTERFACE_H
/*
- * Copyright (c) 2019 Samsung Electronics Co., Ltd.
+ * Copyright (c) 2020 Samsung Electronics Co., Ltd.
*
* Licensed under the Apache License, Version 2.0 (the "License");
* you may not use this file except in compliance with the License.
namespace Dali
{
-
enum ColorDepth
{
COLOR_DEPTH_24 = 24,
/**
* Make the OpenGL context current
*/
- virtual void MakeContextCurrent( EGLSurface eglSurface, EGLContext eglContext ) = 0;
+ virtual void MakeContextCurrent(EGLSurface eglSurface, EGLContext eglContext) = 0;
/**
* Terminate GL
/**
* Performs an OpenGL swap buffers command
*/
- virtual void SwapBuffers( EGLSurface& eglSurface ) = 0;
+ virtual void SwapBuffers(EGLSurface& eglSurface) = 0;
/**
* Performs an OpenGL copy buffers command
*/
- virtual void CopyBuffers( EGLSurface& eglSurface ) = 0;
+ virtual void CopyBuffers(EGLSurface& eglSurface) = 0;
/**
* Performs an EGL wait GL command
/**
* Virtual protected destructor, no deletion through this interface
*/
- virtual ~EglInterface() {}
+ virtual ~EglInterface()
+ {
+ }
};
} // namespace Dali
#define DALI_ADAPTOR_LOG_FACTORY_INTERFACE_H
/*
- * Copyright (c) 2019 Samsung Electronics Co., Ltd.
+ * Copyright (c) 2020 Samsung Electronics Co., Ltd.
*
* Licensed under the Apache License, Version 2.0 (the "License");
* you may not use this file except in compliance with the License.
namespace Dali
{
-
class LogFactoryInterface
{
public:
} // namespace Dali
-
#endif //DALI_ADAPTOR_LOG_FACTORY_INTERFACE_H
namespace Dali
{
-
class NativeRenderSurface;
/**
* If you don't pass this, a native surface will be created.
* @param [in] isTransparent Whether the surface has an alpha channel
*/
-NativeRenderSurface* CreateNativeSurface( SurfaceSize surfaceSize, Any surface,
- bool isTransparent );
+NativeRenderSurface* CreateNativeSurface(SurfaceSize surfaceSize, Any surface, bool isTransparent);
} // namespace Dali
#define DALI_NATIVE_RENDER_SURFACE_H
/*
- * Copyright (c) 2019 Samsung Electronics Co., Ltd.
+ * Copyright (c) 2020 Samsung Electronics Co., Ltd.
*
* Licensed under the Apache License, Version 2.0 (the "License");
* you may not use this file except in compliance with the License.
*/
// INTERNAL INCLUDES
-#include <dali/public-api/dali-adaptor-common.h>
#include <dali/integration-api/adaptor-framework/render-surface-interface.h>
+#include <dali/public-api/dali-adaptor-common.h>
namespace Dali
{
-
class TriggerEventInterface;
/**
class DALI_ADAPTOR_API NativeRenderSurface : public Dali::RenderSurfaceInterface
{
public:
-
/**
* @brief Default constructor
*/
virtual ~NativeRenderSurface() = default;
public: // API
-
/**
* @brief Get the render surface the adaptor is using to render to.
* @return reference to current render surface
* @brief Sets the render notification trigger to call when render thread is completed a frame
* @param renderNotification to use
*/
- virtual void SetRenderNotification( TriggerEventInterface* renderNotification ) = 0;
+ virtual void SetRenderNotification(TriggerEventInterface* renderNotification) = 0;
/**
* @brief Waits until surface is replaced
virtual void WaitUntilSurfaceReplaced() = 0;
private: // from NativeRenderSurface
-
/**
* @brief Create a renderable
*/
virtual void ReleaseDrawable() = 0;
protected:
-
// Undefined
NativeRenderSurface(const NativeRenderSurface&) = delete;
// Undefined
NativeRenderSurface& operator=(const NativeRenderSurface& rhs) = delete;
-
};
} // namespace Dali
// EXTERNAL INCLUDES
#include <dali/integration-api/core-enumerations.h>
+#include <dali/integration-api/scene.h>
#include <dali/public-api/common/vector-wrapper.h>
-#include <dali/public-api/math/vector4.h>
#include <dali/public-api/math/rect.h>
+#include <dali/public-api/math/uint-16-pair.h>
+#include <dali/public-api/math/vector4.h>
#include <dali/public-api/object/any.h>
#include <dali/public-api/object/weak-handle.h>
-#include <dali/integration-api/scene.h>
-#include <dali/public-api/math/uint-16-pair.h>
namespace Dali
{
-
class DisplayConnection;
class ThreadSynchronizationInterface;
{
class AdaptorInternalServices;
class GraphicsInterface;
-}
-}
+} // namespace Adaptor
+} // namespace Internal
/**
* @brief The position and size of the render surface.
*/
-using PositionSize = Dali::Rect<int>;
-using SurfaceSize = Uint16Pair;
+using PositionSize = Dali::Rect<int>;
+using SurfaceSize = Uint16Pair;
/**
* @brief Interface for a render surface onto which Dali draws.
class RenderSurfaceInterface
{
public:
-
enum Type
{
WINDOW_RENDER_SURFACE,
* Inlined as this is a pure abstract interface
*/
RenderSurfaceInterface()
- : mAdaptor( nullptr ),
- mGraphics( nullptr ),
- mDisplayConnection( nullptr ),
+ : mAdaptor(nullptr),
+ mGraphics(nullptr),
+ mDisplayConnection(nullptr),
mScene(),
- mDepthBufferRequired( Integration::DepthBufferAvailable::FALSE ),
- mStencilBufferRequired( Integration::StencilBufferAvailable::FALSE )
- {}
+ mFullSwapNextFrame(true),
+ mDepthBufferRequired(Integration::DepthBufferAvailable::FALSE),
+ mStencilBufferRequired(Integration::StencilBufferAvailable::FALSE)
+ {
+ }
/**
* @brief Virtual Destructor.
* Inlined as this is a pure abstract interface
*/
- virtual ~RenderSurfaceInterface() {}
+ virtual ~RenderSurfaceInterface()
+ {
+ }
/**
* @brief Return the size and position of the surface.
* @param[out] dpiHorizontal set to the horizontal dpi
* @param[out] dpiVertical set to the vertical dpi
*/
- virtual void GetDpi( unsigned int& dpiHorizontal, unsigned int& dpiVertical ) = 0;
+ virtual void GetDpi(unsigned int& dpiHorizontal, unsigned int& dpiVertical) = 0;
/**
* @brief InitializeGraphics the platform specific graphics surface interfaces
* @brief Resizes the underlying surface.
* @param[in] The dimensions of the new position
*/
- virtual void MoveResize( Dali::PositionSize positionSize ) = 0;
+ virtual void MoveResize(Dali::PositionSize positionSize) = 0;
/**
* @brief Called when Render thread has started
* @param[in] damagedRects List of damaged rects this render pass
* @return True if the operation is successful, False if the operation failed
*/
- virtual bool PreRender( bool resizingSurface, const std::vector<Rect<int>>& damagedRects, Rect<int>& clippingRect ) = 0;
+ virtual bool PreRender(bool resizingSurface, const std::vector<Rect<int>>& damagedRects, Rect<int>& clippingRect) = 0;
/**
* @brief Invoked by render thread after Core::Render
* @param[in] replacingSurface True if the surface is being replaced.
* @param[in] resizingSurface True if the surface is being resized.
*/
- virtual void PostRender( bool renderToFbo, bool replacingSurface, bool resizingSurface, const std::vector<Rect<int>>& damagedRects ) = 0;
+ virtual void PostRender(bool renderToFbo, bool replacingSurface, bool resizingSurface, const std::vector<Rect<int>>& damagedRects) = 0;
/**
* @brief Invoked by render thread when the thread should be stop
*
* @param threadSynchronization The thread-synchronization implementation.
*/
- virtual void SetThreadSynchronization( ThreadSynchronizationInterface& threadSynchronization ) = 0;
+ virtual void SetThreadSynchronization(ThreadSynchronizationInterface& threadSynchronization) = 0;
/**
* @brief Gets the surface type
virtual Integration::StencilBufferAvailable GetStencilBufferRequired() = 0;
public:
-
- void SetAdaptor( Dali::Internal::Adaptor::AdaptorInternalServices& adaptor )
+ void SetAdaptor(Dali::Internal::Adaptor::AdaptorInternalServices& adaptor)
{
mAdaptor = &adaptor;
}
- void SetGraphicsInterface( Dali::Internal::Adaptor::GraphicsInterface& graphics )
+ void SetGraphicsInterface(Dali::Internal::Adaptor::GraphicsInterface& graphics)
{
mGraphics = &graphics;
}
- void SetDisplayConnection( Dali::DisplayConnection& displayConnection )
+ void SetDisplayConnection(Dali::DisplayConnection& displayConnection)
{
mDisplayConnection = &displayConnection;
}
* @brief Sets a Scene that is rendered on this surface.
* @param scene The Scene object
*/
- void SetScene( Dali::Integration::Scene& scene )
+ void SetScene(Dali::Integration::Scene& scene)
{
mScene = scene;
}
-private:
+ /**
+ * @brief Forces full surface swap next frame, resets current partial update state.
+ */
+ void SetFullSwapNextFrame()
+ {
+ mFullSwapNextFrame = true;
+ }
+private:
/**
* @brief Undefined copy constructor. RenderSurface cannot be copied
*/
- RenderSurfaceInterface( const RenderSurfaceInterface& rhs );
+ RenderSurfaceInterface(const RenderSurfaceInterface& rhs);
/**
* @brief Undefined assignment operator. RenderSurface cannot be copied
*/
- RenderSurfaceInterface& operator=( const RenderSurfaceInterface& rhs );
+ RenderSurfaceInterface& operator=(const RenderSurfaceInterface& rhs);
protected:
-
Dali::Internal::Adaptor::AdaptorInternalServices* mAdaptor;
- Dali::Internal::Adaptor::GraphicsInterface* mGraphics;
- Dali::DisplayConnection* mDisplayConnection;
- WeakHandle< Dali::Integration::Scene > mScene;
+ Dali::Internal::Adaptor::GraphicsInterface* mGraphics;
+ Dali::DisplayConnection* mDisplayConnection;
+ WeakHandle<Dali::Integration::Scene> mScene;
+ bool mFullSwapNextFrame; ///< Whether the full surface swap is required
private:
+ Integration::DepthBufferAvailable mDepthBufferRequired; ///< Whether the depth buffer is required
+ Integration::StencilBufferAvailable mStencilBufferRequired; ///< Whether the stencil buffer is required
- Integration::DepthBufferAvailable mDepthBufferRequired; ///< Whether the depth buffer is required
- Integration::StencilBufferAvailable mStencilBufferRequired; ///< Whether the stencil buffer is required
-
- Vector4 mBackgroundColor; ///< The background color of the surface
+ Vector4 mBackgroundColor; ///< The background color of the surface
};
} // namespace Dali
#include <dali/integration-api/adaptor-framework/scene-holder-impl.h>
// EXTERNAL INCLUDES
-#include <sys/time.h>
-#include <dali/public-api/common/dali-common.h>
-#include <dali/public-api/actors/actor.h>
-#include <dali/public-api/actors/layer.h>
#include <dali/integration-api/debug.h>
+#include <dali/integration-api/events/hover-event-integ.h>
#include <dali/integration-api/events/key-event-integ.h>
#include <dali/integration-api/events/touch-event-integ.h>
-#include <dali/integration-api/events/hover-event-integ.h>
#include <dali/integration-api/events/wheel-event-integ.h>
+#include <dali/public-api/actors/actor.h>
+#include <dali/public-api/actors/layer.h>
+#include <dali/public-api/common/dali-common.h>
+#include <sys/time.h>
// INTERNAL INCLUDES
#include <dali/internal/adaptor/common/adaptor-impl.h>
namespace Dali
{
-
namespace Internal
{
-
namespace Adaptor
{
-
namespace
{
-
#if defined(DEBUG_ENABLED)
-Debug::Filter* gSceneHolderLogFilter = Debug::Filter::New( Debug::NoLogging, false, "LOG_SCENE_HOLDER" );
+Debug::Filter* gSceneHolderLogFilter = Debug::Filter::New(Debug::NoLogging, false, "LOG_SCENE_HOLDER");
#endif
// Copied from x server
{
struct timeval tv;
- struct timespec tp;
+ struct timespec tp;
static clockid_t clockid;
- if (!clockid)
+ if(!clockid)
{
#ifdef CLOCK_MONOTONIC_COARSE
- if (clock_getres(CLOCK_MONOTONIC_COARSE, &tp) == 0 &&
- (tp.tv_nsec / 1000) <= 1000 && clock_gettime(CLOCK_MONOTONIC_COARSE, &tp) == 0)
+ if(clock_getres(CLOCK_MONOTONIC_COARSE, &tp) == 0 &&
+ (tp.tv_nsec / 1000) <= 1000 && clock_gettime(CLOCK_MONOTONIC_COARSE, &tp) == 0)
{
clockid = CLOCK_MONOTONIC_COARSE;
}
else
#endif
- if (clock_gettime(CLOCK_MONOTONIC, &tp) == 0)
+ if(clock_gettime(CLOCK_MONOTONIC, &tp) == 0)
{
clockid = CLOCK_MONOTONIC;
}
clockid = ~0L;
}
}
- if (clockid != ~0L && clock_gettime(clockid, &tp) == 0)
+ if(clockid != ~0L && clock_gettime(clockid, &tp) == 0)
{
- return static_cast<uint32_t>( (tp.tv_sec * 1000 ) + (tp.tv_nsec / 1000000L) );
+ return static_cast<uint32_t>((tp.tv_sec * 1000) + (tp.tv_nsec / 1000000L));
}
gettimeofday(&tv, NULL);
- return static_cast<uint32_t>( (tv.tv_sec * 1000 ) + (tv.tv_usec / 1000) );
+ return static_cast<uint32_t>((tv.tv_sec * 1000) + (tv.tv_usec / 1000));
}
} // unnamed namespace
class SceneHolder::SceneHolderLifeCycleObserver : public LifeCycleObserver
{
public:
-
SceneHolderLifeCycleObserver(Adaptor*& adaptor)
- : mAdaptor( adaptor )
- {
- };
+ : mAdaptor(adaptor){};
private: // Adaptor::LifeCycleObserver interface
-
- void OnStart() override {};
- void OnPause() override {};
- void OnResume() override {};
- void OnStop() override {};
+ void OnStart() override{};
+ void OnPause() override{};
+ void OnResume() override{};
+ void OnStop() override{};
void OnDestroy() override
{
mAdaptor = nullptr;
Adaptor*& mAdaptor;
};
-
SceneHolder::SceneHolder()
-: mLifeCycleObserver( new SceneHolderLifeCycleObserver( mAdaptor ) ),
- mId( mSceneHolderCounter++ ),
- mSurface( nullptr ),
- mAdaptor( nullptr ),
+: mLifeCycleObserver(new SceneHolderLifeCycleObserver(mAdaptor)),
+ mId(mSceneHolderCounter++),
+ mSurface(nullptr),
+ mAdaptor(nullptr),
mDpi(),
- mIsBeingDeleted( false ),
- mAdaptorStarted( false ),
- mVisible( true )
+ mIsBeingDeleted(false),
+ mAdaptorStarted(false),
+ mVisible(true)
{
}
SceneHolder::~SceneHolder()
{
- if ( mAdaptor )
+ if(mAdaptor)
{
- mAdaptor->RemoveObserver( *mLifeCycleObserver.get() );
- mAdaptor->RemoveWindow( this );
+ mAdaptor->RemoveObserver(*mLifeCycleObserver.get());
+ mAdaptor->RemoveWindow(this);
- mAdaptor->DeleteSurface( *mSurface.get() );
+ mAdaptor->DeleteSurface(*mSurface.get());
mAdaptor = nullptr;
}
- if ( mScene )
+ if(mScene)
{
mScene.Discard();
}
}
-void SceneHolder::Add( Dali::Actor actor )
+void SceneHolder::Add(Dali::Actor actor)
{
- if ( mScene )
+ if(mScene)
{
- mScene.Add( actor );
+ mScene.Add(actor);
}
}
-void SceneHolder::Remove( Dali::Actor actor )
+void SceneHolder::Remove(Dali::Actor actor)
{
- if ( mScene )
+ if(mScene)
{
- mScene.Remove( actor );
+ mScene.Remove(actor);
}
}
void SceneHolder::SetSurface(Dali::RenderSurfaceInterface* surface)
{
- mSurface.reset( surface );
+ mSurface.reset(surface);
mScene.SurfaceReplaced();
InitializeDpi();
- mSurface->SetAdaptor( *mAdaptor );
- mSurface->SetScene( mScene );
+ mSurface->SetAdaptor(*mAdaptor);
+ mSurface->SetScene(mScene);
- OnSurfaceSet( surface );
+ OnSurfaceSet(surface);
}
void SceneHolder::SurfaceResized()
{
PositionSize surfacePositionSize = mSurface->GetPositionSize();
- mScene.SurfaceResized( static_cast<float>( surfacePositionSize.width ), static_cast<float>( surfacePositionSize.height ) );
+ mScene.SurfaceResized(static_cast<float>(surfacePositionSize.width), static_cast<float>(surfacePositionSize.height));
- GraphicsInterface& graphics = mAdaptor->GetGraphicsInterface();
- EglGraphics* eglGraphics = static_cast<EglGraphics*>(&graphics);
- if (eglGraphics)
- {
- eglGraphics->SetFullSwapNextFrame();
- }
+ mSurface->SetFullSwapNextFrame();
}
Dali::RenderSurfaceInterface* SceneHolder::GetSurface() const
return mSurface.get();
}
-void SceneHolder::SetBackgroundColor( const Vector4& color )
+void SceneHolder::SetBackgroundColor(const Vector4& color)
{
- if( mScene )
+ if(mScene)
{
- mScene.SetBackgroundColor( color );
+ mScene.SetBackgroundColor(color);
- GraphicsInterface& graphics = mAdaptor->GetGraphicsInterface();
- EglGraphics* eglGraphics = static_cast<EglGraphics*>(&graphics);
- if (eglGraphics)
- {
- eglGraphics->SetFullSwapNextFrame();
- }
+ mSurface->SetFullSwapNextFrame();
}
}
void SceneHolder::SetAdaptor(Dali::Adaptor& adaptor)
{
// Avoid doing this more than once
- if( mAdaptorStarted )
+ if(mAdaptorStarted)
{
return;
}
// Create the scene
PositionSize surfacePositionSize = mSurface->GetPositionSize();
- mScene = Dali::Integration::Scene::New( Size(static_cast<float>( surfacePositionSize.width ), static_cast<float>( surfacePositionSize.height )) );
+ mScene = Dali::Integration::Scene::New(Size(static_cast<float>(surfacePositionSize.width), static_cast<float>(surfacePositionSize.height)));
- Internal::Adaptor::Adaptor& adaptorImpl = Internal::Adaptor::Adaptor::GetImplementation( adaptor );
- mAdaptor = &adaptorImpl;
+ Internal::Adaptor::Adaptor& adaptorImpl = Internal::Adaptor::Adaptor::GetImplementation(adaptor);
+ mAdaptor = &adaptorImpl;
// Create an observer for the adaptor lifecycle
- mAdaptor->AddObserver( *mLifeCycleObserver );
+ mAdaptor->AddObserver(*mLifeCycleObserver);
InitializeDpi();
- mSurface->SetAdaptor( *mAdaptor );
- mSurface->SetScene( mScene );
+ mSurface->SetAdaptor(*mAdaptor);
+ mSurface->SetScene(mScene);
- OnAdaptorSet( adaptor );
+ OnAdaptorSet(adaptor);
}
void SceneHolder::Pause()
OnResume();
}
-void SceneHolder::FeedTouchPoint( Dali::Integration::Point& point, int timeStamp )
+void SceneHolder::FeedTouchPoint(Dali::Integration::Point& point, int timeStamp)
{
- if( timeStamp < 1 )
+ if(timeStamp < 1)
{
timeStamp = GetCurrentMilliSeconds();
}
- RecalculateTouchPosition( point );
+ RecalculateTouchPosition(point);
- Integration::TouchEvent touchEvent;
- Integration::HoverEvent hoverEvent;
+ Integration::TouchEvent touchEvent;
+ Integration::HoverEvent hoverEvent;
Integration::TouchEventCombiner::EventDispatchType type = mCombiner.GetNextTouchEvent(point, timeStamp, touchEvent, hoverEvent);
- if( type != Integration::TouchEventCombiner::DISPATCH_NONE )
+ if(type != Integration::TouchEventCombiner::DISPATCH_NONE)
{
- DALI_LOG_INFO( gSceneHolderLogFilter, Debug::Verbose, "%d: Device %d: Button state %d (%.2f, %.2f)\n", timeStamp, point.GetDeviceId(), point.GetState(), point.GetScreenPosition().x, point.GetScreenPosition().y );
+ DALI_LOG_INFO(gSceneHolderLogFilter, Debug::Verbose, "%d: Device %d: Button state %d (%.2f, %.2f)\n", timeStamp, point.GetDeviceId(), point.GetState(), point.GetScreenPosition().x, point.GetScreenPosition().y);
// Signals can be emitted while processing core events, and the scene holder could be deleted in the signal callback.
// Keep the handle alive until the core events are processed.
- Dali::BaseHandle sceneHolder( this );
+ Dali::BaseHandle sceneHolder(this);
// First the touch and/or hover event & related gesture events are queued
- if( type == Integration::TouchEventCombiner::DISPATCH_TOUCH || type == Integration::TouchEventCombiner::DISPATCH_BOTH )
+ if(type == Integration::TouchEventCombiner::DISPATCH_TOUCH || type == Integration::TouchEventCombiner::DISPATCH_BOTH)
{
- mScene.QueueEvent( touchEvent );
+ mScene.QueueEvent(touchEvent);
}
- if( type == Integration::TouchEventCombiner::DISPATCH_HOVER || type == Integration::TouchEventCombiner::DISPATCH_BOTH )
+ if(type == Integration::TouchEventCombiner::DISPATCH_HOVER || type == Integration::TouchEventCombiner::DISPATCH_BOTH)
{
- mScene.QueueEvent( hoverEvent );
+ mScene.QueueEvent(hoverEvent);
}
// Next the events are processed with a single call into Core
}
}
-void SceneHolder::FeedWheelEvent( Dali::Integration::WheelEvent& wheelEvent )
+void SceneHolder::FeedWheelEvent(Dali::Integration::WheelEvent& wheelEvent)
{
// Signals can be emitted while processing core events, and the scene holder could be deleted in the signal callback.
// Keep the handle alive until the core events are processed.
- Dali::BaseHandle sceneHolder( this );
+ Dali::BaseHandle sceneHolder(this);
- mScene.QueueEvent( wheelEvent );
+ mScene.QueueEvent(wheelEvent);
mAdaptor->ProcessCoreEvents();
}
-void SceneHolder::FeedKeyEvent( Dali::Integration::KeyEvent& keyEvent )
+void SceneHolder::FeedKeyEvent(Dali::Integration::KeyEvent& keyEvent)
{
Dali::PhysicalKeyboard physicalKeyboard = PhysicalKeyboard::Get();
- if( physicalKeyboard )
+ if(physicalKeyboard)
{
- if( ! KeyLookup::IsDeviceButton( keyEvent.keyName.c_str() ) )
+ if(!KeyLookup::IsDeviceButton(keyEvent.keyName.c_str()))
{
- GetImplementation( physicalKeyboard ).KeyReceived( keyEvent.time > 1 );
+ GetImplementation(physicalKeyboard).KeyReceived(keyEvent.time > 1);
}
}
// Signals can be emitted while processing core events, and the scene holder could be deleted in the signal callback.
// Keep the handle alive until the core events are processed.
- Dali::BaseHandle sceneHolder( this );
+ Dali::BaseHandle sceneHolder(this);
// Create send KeyEvent to Core.
- mScene.QueueEvent( keyEvent );
+ mScene.QueueEvent(keyEvent);
mAdaptor->ProcessCoreEvents();
}
-void SceneHolder::AddFrameRenderedCallback( std::unique_ptr< CallbackBase > callback, int32_t frameId )
+void SceneHolder::AddFrameRenderedCallback(std::unique_ptr<CallbackBase> callback, int32_t frameId)
{
- mScene.AddFrameRenderedCallback( std::move( callback ), frameId );
+ mScene.AddFrameRenderedCallback(std::move(callback), frameId);
- DALI_LOG_INFO( gSceneHolderLogFilter, Debug::General, "SceneHolder::AddFrameRenderedCallback:: Added [%d]\n", frameId );
+ DALI_LOG_INFO(gSceneHolderLogFilter, Debug::General, "SceneHolder::AddFrameRenderedCallback:: Added [%d]\n", frameId);
}
-void SceneHolder::AddFramePresentedCallback( std::unique_ptr< CallbackBase > callback, int32_t frameId )
+void SceneHolder::AddFramePresentedCallback(std::unique_ptr<CallbackBase> callback, int32_t frameId)
{
- mScene.AddFramePresentedCallback( std::move( callback ), frameId );
+ mScene.AddFramePresentedCallback(std::move(callback), frameId);
- DALI_LOG_INFO( gSceneHolderLogFilter, Debug::General, "SceneHolder::AddFramePresentedCallback:: Added [%d]\n", frameId );
+ DALI_LOG_INFO(gSceneHolderLogFilter, Debug::General, "SceneHolder::AddFramePresentedCallback:: Added [%d]\n", frameId);
}
-Dali::Integration::SceneHolder SceneHolder::Get( Dali::Actor actor )
+Dali::Integration::SceneHolder SceneHolder::Get(Dali::Actor actor)
{
SceneHolder* sceneHolderImpl = nullptr;
- if ( Internal::Adaptor::Adaptor::IsAvailable() )
+ if(Internal::Adaptor::Adaptor::IsAvailable())
{
- Dali::Internal::Adaptor::Adaptor& adaptor = Internal::Adaptor::Adaptor::GetImplementation( Internal::Adaptor::Adaptor::Get() );
- sceneHolderImpl = adaptor.GetWindow( actor );
+ Dali::Internal::Adaptor::Adaptor& adaptor = Internal::Adaptor::Adaptor::GetImplementation(Internal::Adaptor::Adaptor::Get());
+ sceneHolderImpl = adaptor.GetWindow(actor);
}
- return Dali::Integration::SceneHolder( sceneHolderImpl );
+ return Dali::Integration::SceneHolder(sceneHolderImpl);
}
void SceneHolder::Reset()
// Any touch listeners should be told of the interruption.
Integration::TouchEvent event;
- Integration::Point point;
- point.SetState( PointState::INTERRUPTED );
- event.AddPoint( point );
+ Integration::Point point;
+ point.SetState(PointState::INTERRUPTED);
+ event.AddPoint(point);
// First the touch event & related gesture events are queued
- mScene.QueueEvent( event );
+ mScene.QueueEvent(event);
// Next the events are processed with a single call into Core
mAdaptor->ProcessCoreEvents();
unsigned int dpiHorizontal, dpiVertical;
dpiHorizontal = dpiVertical = 0;
- mSurface->GetDpi( dpiHorizontal, dpiVertical );
- mScene.SetDpi( Vector2( static_cast<float>( dpiHorizontal ), static_cast<float>( dpiVertical ) ) );
+ mSurface->GetDpi(dpiHorizontal, dpiVertical);
+ mScene.SetDpi(Vector2(static_cast<float>(dpiHorizontal), static_cast<float>(dpiVertical)));
- mDpi.SetX( dpiHorizontal );
- mDpi.SetY( dpiVertical );
+ mDpi.SetX(dpiHorizontal);
+ mDpi.SetY(dpiVertical);
}
-}// Adaptor
+} // namespace Adaptor
-}// Internal
+} // namespace Internal
-} // Dali
+} // namespace Dali
*/
// EXTERNAL INCLUDES
-#include <memory>
-#include <vector>
-#include <atomic>
-#include <dali/public-api/object/base-object.h>
-#include <dali/public-api/common/intrusive-ptr.h>
-#include <dali/public-api/math/uint-16-pair.h>
-#include <dali/integration-api/scene.h>
#include <dali/integration-api/events/key-event-integ.h>
#include <dali/integration-api/events/point.h>
#include <dali/integration-api/events/touch-event-combiner.h>
+#include <dali/integration-api/scene.h>
+#include <dali/public-api/common/intrusive-ptr.h>
+#include <dali/public-api/math/uint-16-pair.h>
+#include <dali/public-api/object/base-object.h>
+#include <atomic>
+#include <memory>
+#include <vector>
// INTERNAL INCLUDES
#include <dali/integration-api/adaptor-framework/render-surface-interface.h>
namespace Dali
{
-
class Any;
class Adaptor;
class Actor;
namespace Integration
{
-
class Scene;
struct Point;
struct KeyEvent;
struct WheelEvent;
-}
+} // namespace Integration
namespace Internal
{
-
namespace Adaptor
{
-
class Adaptor;
class SceneHolder;
-using SceneHolderPtr = IntrusivePtr< SceneHolder >;
+using SceneHolderPtr = IntrusivePtr<SceneHolder>;
/**
* @brief SceneHolder creates a Scene for rendering.
*/
class DALI_ADAPTOR_API SceneHolder : public BaseObject
{
-
public:
-
/**
* @copydoc Dali::Integration::SceneHolder::Add
*/
- void Add( Dali::Actor actor );
+ void Add(Dali::Actor actor);
/**
* @copydoc Dali::Integration::SceneHolder::Remove
*/
- void Remove( Dali::Actor actor );
+ void Remove(Dali::Actor actor);
/**
* @copydoc Dali::Integration::SceneHolder::GetRootLayer
* @brief Set the render surface
* @param[in] surface The render surface
*/
- void SetSurface( Dali::RenderSurfaceInterface* surface );
+ void SetSurface(Dali::RenderSurfaceInterface* surface);
/**
* @brief Called when the surface set is resized.
* @brief Set the adaptor to the scene holder
* @param[in] adaptor An initialized adaptor
*/
- void SetAdaptor( Dali::Adaptor& adaptor );
+ void SetAdaptor(Dali::Adaptor& adaptor);
/**
* @copydoc Dali::Integration::SceneHolder::SetBackgroundColor
*/
- void SetBackgroundColor( const Dali::Vector4& color );
+ void SetBackgroundColor(const Dali::Vector4& color);
/**
* @copydoc Dali::Integration::SceneHolder::GetBackgroundColor
*
* @return true if this scene holder is being deleted in the event thread, or false if not.
*/
- bool IsBeingDeleted() const { return mIsBeingDeleted; }
+ bool IsBeingDeleted() const
+ {
+ return mIsBeingDeleted;
+ }
/**
* @copydoc Dali::Integration::SceneHolder::FeedTouchPoint
*/
- void FeedTouchPoint( Dali::Integration::Point& point, int timeStamp );
+ void FeedTouchPoint(Dali::Integration::Point& point, int timeStamp);
/**
* @copydoc Dali::Integration::SceneHolder::FeedWheelEvent
*/
- void FeedWheelEvent( Dali::Integration::WheelEvent& wheelEvent );
+ void FeedWheelEvent(Dali::Integration::WheelEvent& wheelEvent);
/**
* @copydoc Dali::Integration::SceneHolder::FeedKeyEvent
*/
- void FeedKeyEvent( Dali::Integration::KeyEvent& keyEvent );
+ void FeedKeyEvent(Dali::Integration::KeyEvent& keyEvent);
/**
* @brief Adds a callback that is called when the frame rendering is done by the graphics driver.
*
* @note Ownership of the callback is passed onto this class.
*/
- void AddFrameRenderedCallback( std::unique_ptr< CallbackBase > callback, int32_t frameId );
+ void AddFrameRenderedCallback(std::unique_ptr<CallbackBase> callback, int32_t frameId);
/**
* @brief Adds a callback that is called when the frame rendering is done by the graphics driver.
*
* @note Ownership of the callback is passed onto this class.
*/
- void AddFramePresentedCallback( std::unique_ptr< CallbackBase > callback, int32_t frameId );
+ void AddFramePresentedCallback(std::unique_ptr<CallbackBase> callback, int32_t frameId);
/**
* @copydoc Dali::Integration::SceneHolder::Get()
*/
- static Dali::Integration::SceneHolder Get( Dali::Actor actor );
+ static Dali::Integration::SceneHolder Get(Dali::Actor actor);
/**
* @copydoc Dali::Integration::SceneHolder::KeyEventSignal()
*/
- Dali::Integration::SceneHolder::KeyEventSignalType& KeyEventSignal() { return mScene.KeyEventSignal(); }
+ Dali::Integration::SceneHolder::KeyEventSignalType& KeyEventSignal()
+ {
+ return mScene.KeyEventSignal();
+ }
/**
* @copydoc Dali::Integration::SceneHolder::KeyEventGeneratedSignal()
*/
- Dali::Integration::SceneHolder::KeyEventGeneratedSignalType& KeyEventGeneratedSignal() { return mScene.KeyEventGeneratedSignal(); }
+ Dali::Integration::SceneHolder::KeyEventGeneratedSignalType& KeyEventGeneratedSignal()
+ {
+ return mScene.KeyEventGeneratedSignal();
+ }
/**
* @copydoc Dali::Integration::SceneHolder::TouchedSignal()
*/
- Dali::Integration::SceneHolder::TouchEventSignalType& TouchedSignal() { return mScene.TouchedSignal(); }
+ Dali::Integration::SceneHolder::TouchEventSignalType& TouchedSignal()
+ {
+ return mScene.TouchedSignal();
+ }
/**
* @copydoc Dali::Integration::SceneHolder::WheelEventSignal()
*/
- Dali::Integration::SceneHolder::WheelEventSignalType& WheelEventSignal() { return mScene.WheelEventSignal(); }
+ Dali::Integration::SceneHolder::WheelEventSignalType& WheelEventSignal()
+ {
+ return mScene.WheelEventSignal();
+ }
public: // The following methods can be overridden if required
-
/**
* @brief Returns whether the Scene is visible or not.
* @return True if the Scene is visible, false otherwise.
virtual bool IsVisible() const;
public: // The following methods must be overridden
-
/**
* @copydoc Dali::Integration::SceneHolder::GetNativeHandle
*/
virtual Dali::Any GetNativeHandle() const = 0;
protected:
-
// Constructor
SceneHolder();
/**
* virtual destructor
*/
- virtual ~SceneHolder();
+ ~SceneHolder() override;
private: // The following methods can be overridden if required
-
/**
* @brief Called by the base class to inform deriving classes that the adaptor has been set.
* @param[in] adaptor The adaptor
*/
- virtual void OnAdaptorSet( Dali::Adaptor& adaptor ) {};
+ virtual void OnAdaptorSet(Dali::Adaptor& adaptor){};
/**
* @brief Called by the base class to inform deriving classes that a new surface has been set.
* @param[in] surface The new render surface
*/
- virtual void OnSurfaceSet( Dali::RenderSurfaceInterface* surface ) {};
+ virtual void OnSurfaceSet(Dali::RenderSurfaceInterface* surface){};
/**
* @brief Called by the base class to inform deriving classes that we are being paused.
*/
- virtual void OnPause() {};
+ virtual void OnPause(){};
/**
* @brief Called by the base class to inform deriving classes that we are resuming from a paused state.
*/
- virtual void OnResume() {};
+ virtual void OnResume(){};
/**
* Recalculate the touch position if required
* @param[in,out] point The touch point
*/
- virtual void RecalculateTouchPosition( Integration::Point& point ) {};
+ virtual void RecalculateTouchPosition(Integration::Point& point){};
private:
-
/**
* Resets the event handling.
*/
void InitializeDpi();
private:
-
- static uint32_t mSceneHolderCounter; ///< A counter to track the SceneHolder creation
+ static uint32_t mSceneHolderCounter; ///< A counter to track the SceneHolder creation
class SceneHolderLifeCycleObserver;
- std::unique_ptr< SceneHolderLifeCycleObserver > mLifeCycleObserver; ///< The adaptor life cycle observer
+ std::unique_ptr<SceneHolderLifeCycleObserver> mLifeCycleObserver; ///< The adaptor life cycle observer
protected:
+ uint32_t mId; ///< A unique ID to identify the SceneHolder starting from 0
+ Dali::Integration::Scene mScene; ///< The Scene
+ std::string mName; ///< The name of the SceneHolder
- uint32_t mId; ///< A unique ID to identify the SceneHolder starting from 0
- Dali::Integration::Scene mScene; ///< The Scene
- std::string mName; ///< The name of the SceneHolder
-
- std::unique_ptr< Dali::RenderSurfaceInterface > mSurface; ///< The window rendering surface
- Adaptor* mAdaptor; ///< The adaptor
-
- Dali::Integration::TouchEventCombiner mCombiner; ///< Combines multi-touch events.
+ std::unique_ptr<Dali::RenderSurfaceInterface> mSurface; ///< The window rendering surface
+ Adaptor* mAdaptor; ///< The adaptor
+ Dali::Integration::TouchEventCombiner mCombiner; ///< Combines multi-touch events.
- Uint16Pair mDpi; ///< The DPI for this SceneHolder.
+ Uint16Pair mDpi; ///< The DPI for this SceneHolder.
- std::atomic<bool> mIsBeingDeleted; ///< This is set only from the event thread and read only from the render thread
+ std::atomic<bool> mIsBeingDeleted; ///< This is set only from the event thread and read only from the render thread
- bool mAdaptorStarted:1; ///< Whether the adaptor has started or not
- bool mVisible:1; ///< Whether the scene is visible or not
+ bool mAdaptorStarted : 1; ///< Whether the adaptor has started or not
+ bool mVisible : 1; ///< Whether the scene is visible or not
};
-} // Adaptor
+} // namespace Adaptor
-} // Internal
+} // namespace Internal
// Get impl of handle
-inline Internal::Adaptor::SceneHolder& GetImplementation( Dali::Integration::SceneHolder& sceneHolder )
+inline Internal::Adaptor::SceneHolder& GetImplementation(Dali::Integration::SceneHolder& sceneHolder)
{
- DALI_ASSERT_ALWAYS( sceneHolder && "SceneHolder handle is empty" );
+ DALI_ASSERT_ALWAYS(sceneHolder && "SceneHolder handle is empty");
Dali::RefObject& object = sceneHolder.GetBaseObject();
- return static_cast<Internal::Adaptor::SceneHolder&>( object );
+ return static_cast<Internal::Adaptor::SceneHolder&>(object);
}
-inline const Internal::Adaptor::SceneHolder& GetImplementation( const Dali::Integration::SceneHolder& sceneHolder )
+inline const Internal::Adaptor::SceneHolder& GetImplementation(const Dali::Integration::SceneHolder& sceneHolder)
{
- DALI_ASSERT_ALWAYS( sceneHolder && "SceneHolder handle is empty" );
+ DALI_ASSERT_ALWAYS(sceneHolder && "SceneHolder handle is empty");
const Dali::RefObject& object = sceneHolder.GetBaseObject();
- return static_cast<const Internal::Adaptor::SceneHolder&>( object );
+ return static_cast<const Internal::Adaptor::SceneHolder&>(object);
}
-} // Dali
+} // namespace Dali
#endif // DALI_INTEGRATION_INTERNAL_SCENEHOLDER_H
#include <dali/integration-api/adaptor-framework/scene-holder.h>
// EXTERNAL INCLUDES
-#include <dali/public-api/events/wheel-event.h>
#include <dali/integration-api/events/key-event-integ.h>
#include <dali/integration-api/events/touch-event-integ.h>
#include <dali/integration-api/events/wheel-event-integ.h>
+#include <dali/public-api/events/wheel-event.h>
// INTERNAL INCLUDES
-#include <dali/public-api/actors/layer.h>
#include <dali/integration-api/adaptor-framework/scene-holder-impl.h>
+#include <dali/public-api/actors/layer.h>
namespace Dali
{
-
namespace Integration
{
-
SceneHolder::SceneHolder()
{
}
{
}
-SceneHolder::SceneHolder( const SceneHolder& handle )
-:BaseHandle(handle)
+SceneHolder::SceneHolder(const SceneHolder& handle)
+: BaseHandle(handle)
{
}
-SceneHolder::SceneHolder( Internal::Adaptor::SceneHolder* internal )
+SceneHolder::SceneHolder(Internal::Adaptor::SceneHolder* internal)
: BaseHandle(internal)
{
}
-SceneHolder& SceneHolder::operator=( const SceneHolder& rhs )
+SceneHolder& SceneHolder::operator=(const SceneHolder& rhs)
{
BaseHandle::operator=(rhs);
return *this;
}
-void SceneHolder::Add( Actor actor )
+void SceneHolder::Add(Actor actor)
{
- GetImplementation(*this).Add( actor );
+ GetImplementation(*this).Add(actor);
}
-void SceneHolder::Remove( Actor actor )
+void SceneHolder::Remove(Actor actor)
{
- GetImplementation(*this).Remove( actor );
+ GetImplementation(*this).Remove(actor);
}
Layer SceneHolder::GetRootLayer() const
return GetImplementation(*this).GetRootLayer();
}
-void SceneHolder::SetBackgroundColor( Vector4 color )
+void SceneHolder::SetBackgroundColor(Vector4 color)
{
- GetImplementation(*this).SetBackgroundColor( color );
+ GetImplementation(*this).SetBackgroundColor(color);
}
Vector4 SceneHolder::GetBackgroundColor() const
return GetImplementation(*this).GetNativeHandle();
}
-void SceneHolder::FeedTouchPoint( Dali::TouchPoint& point, int timeStamp )
+void SceneHolder::FeedTouchPoint(Dali::TouchPoint& point, int timeStamp)
{
- Integration::Point convertedPoint( point );
- GetImplementation(*this).FeedTouchPoint( convertedPoint, timeStamp );
+ Integration::Point convertedPoint(point);
+ GetImplementation(*this).FeedTouchPoint(convertedPoint, timeStamp);
}
-void SceneHolder::FeedWheelEvent( Dali::WheelEvent& wheelEvent )
+void SceneHolder::FeedWheelEvent(Dali::WheelEvent& wheelEvent)
{
- Integration::WheelEvent event( static_cast< Integration::WheelEvent::Type >( wheelEvent.GetType() ), wheelEvent.GetDirection(), wheelEvent.GetModifiers(), wheelEvent.GetPoint(), wheelEvent.GetDelta(), wheelEvent.GetTime() );
- GetImplementation(*this).FeedWheelEvent( event );
+ Integration::WheelEvent event(static_cast<Integration::WheelEvent::Type>(wheelEvent.GetType()), wheelEvent.GetDirection(), wheelEvent.GetModifiers(), wheelEvent.GetPoint(), wheelEvent.GetDelta(), wheelEvent.GetTime());
+ GetImplementation(*this).FeedWheelEvent(event);
}
-void SceneHolder::FeedKeyEvent( Dali::KeyEvent& keyEvent )
+void SceneHolder::FeedKeyEvent(Dali::KeyEvent& keyEvent)
{
- Integration::KeyEvent event( keyEvent.GetKeyName(), keyEvent.GetLogicalKey(), keyEvent.GetKeyString(), keyEvent.GetKeyCode(), keyEvent.GetKeyModifier(), keyEvent.GetTime(), static_cast< Integration::KeyEvent::State >( keyEvent.GetState() ), keyEvent.GetCompose(), keyEvent.GetDeviceName(), keyEvent.GetDeviceClass(), keyEvent.GetDeviceSubclass() );
- GetImplementation(*this).FeedKeyEvent( event );
+ Integration::KeyEvent event(keyEvent.GetKeyName(), keyEvent.GetLogicalKey(), keyEvent.GetKeyString(), keyEvent.GetKeyCode(), keyEvent.GetKeyModifier(), keyEvent.GetTime(), static_cast<Integration::KeyEvent::State>(keyEvent.GetState()), keyEvent.GetCompose(), keyEvent.GetDeviceName(), keyEvent.GetDeviceClass(), keyEvent.GetDeviceSubclass());
+ GetImplementation(*this).FeedKeyEvent(event);
}
-SceneHolder SceneHolder::Get( Actor actor )
+SceneHolder SceneHolder::Get(Actor actor)
{
- return Internal::Adaptor::SceneHolder::Get( actor );
+ return Internal::Adaptor::SceneHolder::Get(actor);
}
SceneHolder::KeyEventSignalType& SceneHolder::KeyEventSignal()
return GetImplementation(*this).WheelEventSignal();
}
-}// Integration
+} // namespace Integration
-} // Dali
+} // namespace Dali
// EXTERNAL INCLUDES
#include <dali/public-api/dali-adaptor-common.h>
-#include <dali/public-api/object/base-handle.h>
#include <dali/public-api/math/vector4.h>
+#include <dali/public-api/object/base-handle.h>
#include <dali/public-api/signals/dali-signal.h>
namespace Dali
{
-
class Actor;
class Layer;
class Any;
namespace Internal DALI_INTERNAL
{
-
namespace Adaptor
{
-
class SceneHolder;
}
-}
+} // namespace DALI_INTERNAL
namespace Integration
{
-
/**
* @brief SceneHolder is responsible for creating a Scene for rendering.
*/
class DALI_ADAPTOR_API SceneHolder : public BaseHandle
{
public:
+ typedef Signal<void(const Dali::KeyEvent&)> KeyEventSignalType; ///< Key event signal type
- typedef Signal< void (const Dali::KeyEvent&) > KeyEventSignalType; ///< Key event signal type
-
- typedef Signal< bool (const Dali::KeyEvent&) > KeyEventGeneratedSignalType; ///< Key event generated signal type
+ typedef Signal<bool(const Dali::KeyEvent&)> KeyEventGeneratedSignalType; ///< Key event generated signal type
- typedef Signal< void (const Dali::TouchEvent&) > TouchEventSignalType; ///< Touch signal type
+ typedef Signal<void(const Dali::TouchEvent&)> TouchEventSignalType; ///< Touch signal type
- typedef Signal< void (const Dali::WheelEvent&) > WheelEventSignalType; ///< Touched signal type
+ typedef Signal<void(const Dali::WheelEvent&)> WheelEventSignalType; ///< Touched signal type
/**
* @brief Create an uninitialized SceneHolder handle.
*
* @param [in] handle A reference to the copied handle
*/
- SceneHolder( const SceneHolder& handle );
+ SceneHolder(const SceneHolder& handle);
/**
* @brief This assignment operator is required for (smart) pointer semantics.
* @param [in] rhs A reference to the copied handle
* @return A reference to this
*/
- SceneHolder& operator=( const SceneHolder& rhs );
+ SceneHolder& operator=(const SceneHolder& rhs);
/**
* @brief Adds a child Actor to the SceneHolder.
* @pre The actor has been initialized.
* @pre The actor does not have a parent.
*/
- void Add( Actor actor );
+ void Add(Actor actor);
/**
* @brief Removes a child Actor from the SceneHolder.
* @param[in] actor The child
* @pre The actor has been added to the SceneHolder.
*/
- void Remove( Actor actor );
+ void Remove(Actor actor);
/**
* @brief Returns the Scene's Root Layer.
*
* @param[in] color The new background color
*/
- void SetBackgroundColor( Vector4 color );
+ void SetBackgroundColor(Vector4 color);
/**
* @brief Gets the background color.
* @param[in] point The touch point
* @param[in] timeStamp The time stamp
*/
- void FeedTouchPoint( Dali::TouchPoint& point, int timeStamp );
+ void FeedTouchPoint(Dali::TouchPoint& point, int timeStamp);
/**
* @brief Feed (Send) wheel event to core
* @param[in] wheelEvent The wheel event
*/
- void FeedWheelEvent( Dali::WheelEvent& wheelEvent );
+ void FeedWheelEvent(Dali::WheelEvent& wheelEvent);
/**
* @brief Feed (Send) key event to core
* @param[in] keyEvent The key event holding the key information.
*/
- void FeedKeyEvent( Dali::KeyEvent& keyEvent );
+ void FeedKeyEvent(Dali::KeyEvent& keyEvent);
/**
* @brief Retrieve the SceneHolder that the given actor is added to.
* @param[in] actor The actor
* @return The SceneHolder the actor is added to or an empty handle if the actor is not added to any SceneHolder.
*/
- static SceneHolder Get( Actor actor );
+ static SceneHolder Get(Actor actor);
/**
* @brief This signal is emitted when key event is received.
WheelEventSignalType& WheelEventSignal();
public: // Not intended for application developers
-
/**
* @brief This constructor is used internally to create additional SceneHolder handles.
*
* @param[in] sceneHolder A pointer to a newly allocated Dali resource
*/
- explicit SceneHolder( Internal::Adaptor::SceneHolder* sceneHolder );
-
+ explicit SceneHolder(Internal::Adaptor::SceneHolder* sceneHolder);
};
} // namespace Integration
#define DALI_INTEGRATION_THREAD_SYNCHRONIZATION_INTERFACE_H
/*
- * Copyright (c) 2019 Samsung Electronics Co., Ltd.
+ * Copyright (c) 2020 Samsung Electronics Co., Ltd.
*
* Licensed under the Apache License, Version 2.0 (the "License");
* you may not use this file except in compliance with the License.
*
*/
-
namespace Dali
{
-
/**
* @brief Interface for the ThreadSyncrhonization handler.
*
class ThreadSynchronizationInterface
{
public:
-
/////////////////////////////////////////////////////////////////////////////////////////////////
// Called by the Event Thread if post-rendering is required
/////////////////////////////////////////////////////////////////////////////////////////////////
virtual void PostRenderWaitForCompletion() = 0;
protected:
-
/**
* @brief Protected constructor, no creation through this interface
*/
- ThreadSynchronizationInterface( ) { }
+ ThreadSynchronizationInterface()
+ {
+ }
/**
* Virtual protected destructor, no deletion through this interface
*/
- virtual ~ThreadSynchronizationInterface() { }
+ virtual ~ThreadSynchronizationInterface()
+ {
+ }
private:
-
// Undefined copy constructor.
- ThreadSynchronizationInterface( const ThreadSynchronizationInterface& );
+ ThreadSynchronizationInterface(const ThreadSynchronizationInterface&);
// Undefined assignment operator.
- ThreadSynchronizationInterface& operator=( const ThreadSynchronizationInterface& );
+ ThreadSynchronizationInterface& operator=(const ThreadSynchronizationInterface&);
};
} // namespace Dali
#define DALI_INTEGRATION_TRIGGER_EVENT_FACTORY_H
/*
- * Copyright (c) 2019 Samsung Electronics Co., Ltd.
+ * Copyright (c) 2020 Samsung Electronics Co., Ltd.
*
* Licensed under the Apache License, Version 2.0 (the "License");
* you may not use this file except in compliance with the License.
#include <dali/public-api/signals/callback.h>
// INTERNAL INCLUDES
-#include <dali/public-api/dali-adaptor-common.h>
#include <dali/integration-api/adaptor-framework/trigger-event-interface.h>
+#include <dali/public-api/dali-adaptor-common.h>
namespace Dali
{
-
/**
* @brief Trigger interface factory class
*
class DALI_ADAPTOR_API TriggerEventFactory
{
public:
-
/**
* @copydoc TriggerEventFactoryInterface::CreateTriggerEvent
*/
- static TriggerEventInterface* CreateTriggerEvent( CallbackBase* callback, TriggerEventInterface::Options options );
+ static TriggerEventInterface* CreateTriggerEvent(CallbackBase* callback, TriggerEventInterface::Options options);
/**
* @copydoc TriggerEventFactoryInterface::DestroyTriggerEvent
*/
- static void DestroyTriggerEvent( TriggerEventInterface* triggerEventInterface );
-
+ static void DestroyTriggerEvent(TriggerEventInterface* triggerEventInterface);
};
} // namespace Dali
#define DALI_INTEGRATION_TRIGGER_EVENT_INTERFACE_H
/*
- * Copyright (c) 2019 Samsung Electronics Co., Ltd.
+ * Copyright (c) 2020 Samsung Electronics Co., Ltd.
*
* Licensed under the Apache License, Version 2.0 (the "License");
* you may not use this file except in compliance with the License.
*
*/
-
namespace Dali
{
-
/**
* @brief Interface for a trigger event class.
*
*/
class TriggerEventInterface
{
-
public:
-
/**
* @brief trigger event options
*/
enum Options
{
KEEP_ALIVE_AFTER_TRIGGER,
- DELETE_AFTER_TRIGGER, // automatically delete the trigger event object, after Trigger() is called.
+ DELETE_AFTER_TRIGGER, // automatically delete the trigger event object, after Trigger() is called.
};
/**
virtual void Trigger() = 0;
protected:
-
/**
* @brief Constructor
*/
- TriggerEventInterface( )
+ TriggerEventInterface()
{
}
}
private:
-
// Undefined copy constructor.
- TriggerEventInterface( const TriggerEventInterface& );
+ TriggerEventInterface(const TriggerEventInterface&);
// Undefined assignment operator.
- TriggerEventInterface& operator=( const TriggerEventInterface& );
-
-
+ TriggerEventInterface& operator=(const TriggerEventInterface&);
};
} // namespace Dali
/**
* Destructor.
*/
- virtual ~AccessibilityAdaptor();
+ ~AccessibilityAdaptor() override;
private:
/**
* Virtual destructor.
*/
- virtual ~AccessibilityGestureDetector();
+ ~AccessibilityGestureDetector() override;
/**
* Set the handler to handle accessibility gestures.
/**
* Destructor
*/
- virtual ~TtsPlayerGeneric();
+ ~TtsPlayerGeneric() override;
private:
/**
* Virtual destructor.
*/
- virtual ~Adaptor();
+ ~Adaptor() override;
/**
* @copydoc Dali::Adaptor::Get()
/**
* @return the Core instance
*/
- virtual Dali::Integration::Core& GetCore();
+ Dali::Integration::Core& GetCore() override;
/**
* @copydoc Dali::Adaptor::SetRenderRefreshRate()
/**
* @copydoc Dali::Internal::Adaptor::AdaptorInternalServices::GetPlatformAbstractionInterface()
*/
- virtual Dali::Integration::PlatformAbstraction& GetPlatformAbstractionInterface();
+ Dali::Integration::PlatformAbstraction& GetPlatformAbstractionInterface() override;
/**
* @copydoc Dali::Internal::Adaptor::AdaptorInternalServices::GetDisplayConnectionInterface()
*/
- virtual Dali::DisplayConnection& GetDisplayConnectionInterface();
+ Dali::DisplayConnection& GetDisplayConnectionInterface() override;
/**
* @copydoc Dali::Internal::Adaptor::AdaptorInternalServices::GetGraphicsInterface()
*/
- virtual GraphicsInterface& GetGraphicsInterface();
+ GraphicsInterface& GetGraphicsInterface() override;
/**
* @copydoc Dali::Internal::Adaptor::AdaptorInternalServices::GetTriggerEventInterface()
*/
- virtual TriggerEventInterface& GetProcessCoreEventsTrigger();
+ TriggerEventInterface& GetProcessCoreEventsTrigger() override;
/**
* @copydoc Dali::Internal::Adaptor::AdaptorInternalServices::GetSocketFactoryInterface()
*/
- virtual SocketFactoryInterface& GetSocketFactoryInterface();
+ SocketFactoryInterface& GetSocketFactoryInterface() override;
/**
* @copydoc Dali::Internal::Adaptor::AdaptorInternalServices::GetRenderSurfaceInterface()
*/
- virtual Dali::RenderSurfaceInterface* GetRenderSurfaceInterface();
+ Dali::RenderSurfaceInterface* GetRenderSurfaceInterface() override;
/**
* @copydoc Dali::Internal::Adaptor::AdaptorInternalServices::GetPerformanceInterface()
*/
- virtual PerformanceInterface* GetPerformanceInterface();
+ PerformanceInterface* GetPerformanceInterface() override;
/**
* copydoc Dali::Internal::Adaptor::AdaptorInternalServices::GetKernelTraceInterface()
*/
- virtual TraceInterface& GetKernelTraceInterface();
+ TraceInterface& GetKernelTraceInterface() override;
/**
* copydoc Dali::Internal::Adaptor::AdaptorInternalServices::GetSystemTraceInterface()
*/
- virtual TraceInterface& GetSystemTraceInterface();
+ TraceInterface& GetSystemTraceInterface() override;
/**
* copydoc Dali::Internal::Adaptor::AdaptorInternalServices::GetWindowContainerInterface()
*/
- virtual void GetWindowContainerInterface( WindowContainer& windows );
+ void GetWindowContainerInterface( WindowContainer& windows ) override;
public: // Signals
/**
* @copydoc Dali::Internal::Adaptor:CoreEventInterface:::ProcessCoreEvents()
*/
- virtual void ProcessCoreEvents();
+ void ProcessCoreEvents() override;
private: // From Dali::Internal::Adaptor::CoreEventInterface
/**
* @copydoc Dali::Internal::Adaptor::CoreEventInterface::QueueCoreEvent()
*/
- virtual void QueueCoreEvent(const Dali::Integration::Event& event);
+ void QueueCoreEvent(const Dali::Integration::Event& event) override;
private: // From Dali::Integration::RenderController
/**
* @copydoc Dali::Integration::RenderController::RequestUpdate()
*/
- virtual void RequestUpdate( bool forceUpdate );
+ void RequestUpdate( bool forceUpdate ) override;
/**
* @copydoc Dali::Integration::RenderController::RequestProcessEventsOnIdle()
*/
- virtual void RequestProcessEventsOnIdle( bool forceProcess );
+ void RequestProcessEventsOnIdle( bool forceProcess ) override;
public: // From Dali::Internal::Adaptor::WindowVisibilityObserver
/**
* Called when the window becomes fully or partially visible.
*/
- virtual void OnWindowShown();
+ void OnWindowShown() override;
/**
* Called when the window is fully hidden.
*/
- virtual void OnWindowHidden();
+ void OnWindowHidden() override;
private: // From Dali::Internal::Adaptor::DamageObserver
/**
* @copydoc Dali::Internal::Adaptor::DamageObserver::OnDamaged()
*/
- void OnDamaged( const DamageArea& area );
+ void OnDamaged( const DamageArea& area ) override;
private:
/**
* Called when the framework is initialised.
*/
- virtual void OnInit();
+ void OnInit() override;
/**
* Called when the framework is terminated.
*/
- virtual void OnTerminate();
+ void OnTerminate() override;
/**
* Called when the framework is paused.
*/
- virtual void OnPause();
+ void OnPause() override;
/**
* Called when the framework resumes from a paused state.
*/
- virtual void OnResume();
+ void OnResume() override;
/**
* Called when the framework received AppControlSignal.
* @param[in] The bundle data of AppControl event.
*/
- virtual void OnAppControl(void *data);
+ void OnAppControl(void *data) override;
/**
* Called when the framework informs the application that it should reset itself.
*/
- virtual void OnReset();
+ void OnReset() override;
/**
* Called when the framework informs the application that the language of the device has changed.
*/
- virtual void OnLanguageChanged();
+ void OnLanguageChanged() override;
/**
* Called when the framework informs the application that the region of the device has changed.
*/
- virtual void OnRegionChanged();
+ void OnRegionChanged() override;
/**
* Called when the framework informs the application that the battery level of the device is low.
*/
- virtual void OnBatteryLow( Dali::DeviceStatus::Battery::Status status );
+ void OnBatteryLow( Dali::DeviceStatus::Battery::Status status ) override;
/**
* Called when the framework informs the application that the memory level of the device is low.
*/
- virtual void OnMemoryLow( Dali::DeviceStatus::Memory::Status status );
+ void OnMemoryLow( Dali::DeviceStatus::Memory::Status status ) override;
/**
* Called when the framework informs the application that the platform surface is created.
*/
- virtual void OnSurfaceCreated( Any newSurface );
+ void OnSurfaceCreated( Any newSurface ) override;
/**
* Called when the framework informs the application that the platform surface is destroyed.
*/
- virtual void OnSurfaceDestroyed( Any newSurface );
+ void OnSurfaceDestroyed( Any newSurface ) override;
public:
/**
* Destructor
*/
- virtual ~Application();
+ ~Application() override;
// Undefined
Application(const Application&);
// clear previous frame damaged render items rects, buffer history is tracked on surface level
mDamagedRects.clear();
- // If user damaged areas are not set
- if (!eglImpl.DamageAreasSet())
- {
- // Collect damage rects
- mCore.PreRender( scene, mDamagedRects );
- }
+ // Collect damage rects
+ mCore.PreRender( scene, mDamagedRects );
// Render off-screen frame buffers first if any
mCore.RenderScene( windowRenderStatus, scene, true );
/**
* @copydoc ThreadControllerInterface::Initialize()
*/
- virtual void Initialize();
+ void Initialize() override;
/**
* @copydoc ThreadControllerInterface::Start()
*/
- virtual void Start();
+ void Start() override;
/**
* @copydoc ThreadControllerInterface::Pause()
*/
- virtual void Pause();
+ void Pause() override;
/**
* @copydoc ThreadControllerInterface::Resume()
*/
- virtual void Resume();
+ void Resume() override;
/**
* @copydoc ThreadControllerInterface::Stop()
*/
- virtual void Stop();
+ void Stop() override;
/**
* @copydoc ThreadControllerInterface::RequestUpdate()
*/
- virtual void RequestUpdate();
+ void RequestUpdate() override;
/**
* @copydoc ThreadControllerInterface::RequestUpdateOnce()
*/
- virtual void RequestUpdateOnce( UpdateMode updateMode );
+ void RequestUpdateOnce( UpdateMode updateMode ) override;
/**
* @copydoc ThreadControllerInterface::ReplaceSurface()
*/
- virtual void ReplaceSurface( Dali::RenderSurfaceInterface* surface );
+ void ReplaceSurface( Dali::RenderSurfaceInterface* surface ) override;
/**
* @copydoc ThreadControllerInterface::DeleteSurface()
*/
- virtual void DeleteSurface( Dali::RenderSurfaceInterface* surface );
+ void DeleteSurface( Dali::RenderSurfaceInterface* surface ) override;
/**
* @copydoc ThreadControllerInterface::ResizeSurface()
*/
- virtual void ResizeSurface();
+ void ResizeSurface() override;
/**
* @copydoc ThreadControllerInterface::WaitForGraphicsInitialization()
*/
- virtual void WaitForGraphicsInitialization();
+ void WaitForGraphicsInitialization() override;
/**
* @copydoc ThreadControllerInterface::SetRenderRefreshRate()
*/
- virtual void SetRenderRefreshRate( unsigned int numberOfFramesPerRender );
+ void SetRenderRefreshRate( unsigned int numberOfFramesPerRender ) override;
/**
* @copydoc ThreadControllerInterface::SetPreRenderCallback
/**
* @copydoc ThreadControllerInterface::AddSurface()
*/
- virtual void AddSurface( Dali::RenderSurfaceInterface* surface );
+ void AddSurface( Dali::RenderSurfaceInterface* surface ) override;
private:
/**
* @copydoc ThreadSynchronizationInterface::PostRenderComplete()
*/
- virtual void PostRenderComplete();
+ void PostRenderComplete() override;
/////////////////////////////////////////////////////////////////////////////////////////////////
//// Called by the Render Thread if post-rendering is required
/**
* @copydoc ThreadSynchronizationInterface::PostRenderStarted()
*/
- virtual void PostRenderStarted();
+ void PostRenderStarted() override;
/**
* @copydoc ThreadSynchronizationInterface::PostRenderStarted()
*/
- virtual void PostRenderWaitForCompletion();
+ void PostRenderWaitForCompletion() override;
private:
/**
* Virtual Destructor.
*/
- virtual ~LifecycleController();
+ ~LifecycleController() override;
private:
/**
* Called when the framework is Component Application Created.
*/
- virtual Any OnCreate();
+ Any OnCreate() override;
public:
CreateSignal mCreateSignal;
if (region != nullptr)
{
mRegion = std::string( region );
+ free( region );
}
if ( language != nullptr)
{
mLanguage = std::string( language );
+ free( language );
}
}
/**
* Called when the framework is initialised.
*/
- virtual void OnInit();
+ void OnInit() override;
/**
* Called when the framework is terminated.
*/
- virtual void OnTerminate();
+ void OnTerminate() override;
/**
* Called when the framework is paused.
*/
- virtual void OnPause();
+ void OnPause() override;
/**
* Called when the framework resumes from a paused state.
*/
- virtual void OnResume();
+ void OnResume() override;
/**
* Called every second
/**
* Destructor.
*/
- virtual ~ClipboardEventNotifier();
+ ~ClipboardEventNotifier() override;
// Undefined
ClipboardEventNotifier( const ClipboardEventNotifier& );
/**
* Destructor
*/
- virtual ~Clipboard();
+ ~Clipboard() override;
/**
* @copydoc Dali::Clipboard::SetItem()
/**
* @copydoc Dali::Integration::GlContextHelperAbstraction::MakeSurfacelessContextCurrent()
*/
- virtual void MakeSurfacelessContextCurrent() override;
+ void MakeSurfacelessContextCurrent() override;
/**
* @copydoc Dali::Integration::GlContextHelperAbstraction::MakeContextNull()
*/
- virtual void MakeContextNull() override;
+ void MakeContextNull() override;
/**
* @copydoc Dali::Integration::GlContextHelperAbstraction::WaitClient()
*/
- virtual void WaitClient() override;
+ void WaitClient() override;
private:
/**
* Destructor
*/
- virtual ~GraphicsFactory();
+ ~GraphicsFactory() override;
/**
* @copydoc Dali::Internal::Adaptor::GraphicsFactoryInterface::Create()
/**
* @copydoc Dali::Internal::Adaptor::GraphicsFactoryInterface::Destroy()
*/
- void Destroy();
+ void Destroy() override;
};
} // Adaptor
return mEglImageExtensions.get();
}
-void EglGraphics::SetDamagedAreas(std::vector<Dali::Rect<int>>& areas)
-{
- mEglImplementation->SetDamageAreas(areas);
-}
-
-void EglGraphics::SetFullSwapNextFrame()
-{
- mEglImplementation->SetFullSwapNextFrame();
-}
-
} // Adaptor
} // Internal
} // Dali
EglImageExtensions* GetImageExtensions();
/**
- * Sets fixed damaged areas for partial rendering. This overrides automatic partial rendering.
- */
- void SetDamagedAreas( std::vector<Dali::Rect<int>>& areas );
-
- /**
- * Instructs egl implementation to do full swap regardless of stored data, resets the data.
- */
- void SetFullSwapNextFrame();
-
- /**
* @copydoc Dali::Internal::Adaptor::GraphicsInterface::Destroy()
*/
void Destroy() override;
mIsKhrCreateContextSupported( false ),
mSwapBufferCountAfterResume( 0 ),
mEglSetDamageRegionKHR( 0 ),
- mEglSwapBuffersWithDamageKHR( 0 ),
- mBufferAge( 0 ),
- mFullSwapNextFrame( true )
+ mEglSwapBuffersWithDamageKHR( 0 )
{
}
// DALI_LOG_ERROR("EglImplementation::SwapBuffers()\n");
eglSwapBuffers( mEglDisplay, eglSurface );
- mFullSwapNextFrame = false;
#ifndef DALI_PROFILE_UBUNTU
if( mSwapBufferCountAfterResume < THRESHOLD_SWAPBUFFER_COUNT )
return age;
}
-bool EglImplementation::DamageAreasSet() const
+void EglImplementation::SetDamageRegion( EGLSurface& eglSurface, std::vector< Rect< int > >& damagedRects )
{
- return (mDamagedAreas.size() ? true : false);
-}
-
-void EglImplementation::SetDamageAreas( std::vector<Dali::Rect<int>>& damagedAreas )
-{
- mFullSwapNextFrame = true;
- mDamagedAreas = damagedAreas;
-}
-
-void EglImplementation::SetFullSwapNextFrame()
-{
- mFullSwapNextFrame = true;
-}
-
-void mergeRects(Rect<int>& mergingRect, const std::vector<Rect<int>>& rects)
-{
- uint32_t i = 0;
- if (mergingRect.IsEmpty())
- {
- for (;i < rects.size(); i++)
- {
- if (!rects[i].IsEmpty())
- {
- mergingRect = rects[i];
- break;
- }
- }
- }
-
- for (;i < rects.size(); i++)
- {
- mergingRect.Merge(rects[i]);
- }
-}
-
-void insertRects(std::list<std::vector<Rect<int>>>& damagedRectsList, const std::vector<Rect<int>>& damagedRects)
-{
- damagedRectsList.push_front(damagedRects);
- if (damagedRectsList.size() > 4) // past triple buffers + current
- {
- damagedRectsList.pop_back();
- }
-}
-
-void EglImplementation::SetDamage( EGLSurface& eglSurface, const std::vector<Rect<int>>& damagedRects, Rect<int>& clippingRect )
-{
- if (!mPartialUpdateRequired)
+ if( !mPartialUpdateRequired )
{
return;
}
- if (eglSurface != EGL_NO_SURFACE) // skip if using surfaceless context
+ if( eglSurface != EGL_NO_SURFACE ) // skip if using surfaceless context
{
- EGLint width = 0;
- EGLint height = 0;
- eglQuerySurface(mEglDisplay, eglSurface, EGL_WIDTH, &width);
- eglQuerySurface(mEglDisplay, eglSurface, EGL_HEIGHT, &height);
- Rect<int> surfaceRect(0, 0, width, height);
-
- mSurfaceRect = surfaceRect;
-
- if (mFullSwapNextFrame)
- {
- mBufferAge = 0;
- insertRects(mBufferDamagedRects, std::vector<Rect<int>>(1, surfaceRect));
- clippingRect = Rect<int>();
- return;
- }
-
- EGLint bufferAge = GetBufferAge(eglSurface);
- if (mDamagedAreas.size())
- {
- mBufferAge = bufferAge;
- if (bufferAge == 0)
- {
- // Buffer age is reset
- clippingRect = Rect<int>();
- return;
- }
-
- mergeRects(clippingRect, mDamagedAreas);
- }
- else
- {
- // Buffer age 0 means the back buffer in invalid and requires full swap
- if (!damagedRects.size() || bufferAge != mBufferAge || bufferAge == 0)
- {
- // No damage or buffer is out of order or buffer age is reset
- mBufferAge = bufferAge;
- insertRects(mBufferDamagedRects, std::vector<Rect<int>>(1, surfaceRect));
- clippingRect = Rect<int>();
- return;
- }
-
- // We push current frame damaged rects here, zero index for current frame
- mBufferAge = bufferAge;
- insertRects(mBufferDamagedRects, damagedRects);
-
- // Merge damaged rects into clipping rect
- auto bufferDamagedRects = mBufferDamagedRects.begin();
- while (bufferAge-- >= 0 && bufferDamagedRects != mBufferDamagedRects.end())
- {
- const std::vector<Rect<int>>& rects = *bufferDamagedRects++;
- mergeRects(clippingRect, rects);
- }
- }
-
- if (!clippingRect.Intersect(surfaceRect) || clippingRect.Area() > surfaceRect.Area() * 0.8)
- {
- // clipping area too big or doesn't intersect surface rect
- clippingRect = Rect<int>();
- return;
- }
-
- // DALI_LOG_ERROR("eglSetDamageRegionKHR(%d, %d, %d, %d)\n", clippingRect.x, clippingRect.y, clippingRect.width, clippingRect.height);
- EGLBoolean result = mEglSetDamageRegionKHR(mEglDisplay, eglSurface, reinterpret_cast<int*>(&clippingRect), 1);
+ EGLBoolean result = mEglSetDamageRegionKHR( mEglDisplay, eglSurface, reinterpret_cast< int* >( damagedRects.data() ), 1 );
if (result == EGL_FALSE)
{
- DALI_LOG_ERROR("eglSetDamageRegionKHR(%d)\n", eglGetError());
+ DALI_LOG_ERROR( "eglSetDamageRegionKHR(%d)\n", eglGetError() );
}
}
}
{
if (eglSurface != EGL_NO_SURFACE ) // skip if using surfaceless context
{
- if (!mPartialUpdateRequired || mFullSwapNextFrame || mBufferAge == 0 || !damagedRects.size())
+ if (!mPartialUpdateRequired )
{
SwapBuffers(eglSurface);
return;
}
#endif //DALI_PROFILE_UBUNTU
- if (mDamagedAreas.size())
- {
- // DALI_LOG_ERROR("EglImplementation::SwapBuffers(%d)\n", mDamagedAreas.size());
- EGLBoolean result = mEglSwapBuffersWithDamageKHR(mEglDisplay, eglSurface, reinterpret_cast<int*>(mDamagedAreas.data()), mDamagedAreas.size());
- if (result == EGL_FALSE)
- {
- DALI_LOG_ERROR("eglSwapBuffersWithDamageKHR(%d)\n", eglGetError());
- }
-
-#ifndef DALI_PROFILE_UBUNTU
- if( mSwapBufferCountAfterResume < THRESHOLD_SWAPBUFFER_COUNT )
- {
- DALI_LOG_RELEASE_INFO( "EglImplementation::SwapBuffers finished.\n" );
- mSwapBufferCountAfterResume++;
- }
-#endif //DALI_PROFILE_UBUNTU
- return;
- }
-
- // current frame damaged rects were pushed by EglImplementation::SetDamage() to 0 index.
- EGLint bufferAge = mBufferAge;
- mCombinedDamagedRects.clear();
-
- // Combine damaged rects from previous frames (beginning from bufferAge index) with the current frame (0 index)
- auto bufferDamagedRects = mBufferDamagedRects.begin();
- while (bufferAge-- >= 0 && bufferDamagedRects != mBufferDamagedRects.end())
- {
- const std::vector<Rect<int>>& rects = *bufferDamagedRects++;
- mCombinedDamagedRects.insert(mCombinedDamagedRects.end(), rects.begin(), rects.end());
- }
-
- // Merge intersecting rects, form an array of non intersecting rects to help driver a bit
- // Could be optional and can be removed, needs to be checked with and without on platform
- const int n = mCombinedDamagedRects.size();
- for (int i = 0; i < n-1; i++)
- {
- if (mCombinedDamagedRects[i].IsEmpty())
- {
- continue;
- }
-
- for (int j = i+1; j < n; j++)
- {
- if (mCombinedDamagedRects[j].IsEmpty())
- {
- continue;
- }
-
- if (mCombinedDamagedRects[i].Intersects(mCombinedDamagedRects[j]))
- {
- mCombinedDamagedRects[i].Merge(mCombinedDamagedRects[j]);
- mCombinedDamagedRects[j].width = 0;
- mCombinedDamagedRects[j].height = 0;
- }
- }
- }
-
- int j = 0;
- for (int i = 0; i < n; i++)
- {
- if (!mCombinedDamagedRects[i].IsEmpty())
- {
- mCombinedDamagedRects[j++] = mCombinedDamagedRects[i];
- }
- }
-
- if (j != 0)
- {
- mCombinedDamagedRects.resize(j);
- }
-
- if (!mCombinedDamagedRects.size() || (mCombinedDamagedRects[0].Area() > mSurfaceRect.Area() * 0.8))
- {
- SwapBuffers(eglSurface);
- return;
- }
-
- // DALI_LOG_ERROR("EglImplementation::SwapBuffers(%d)\n", mCombinedDamagedRects.size());
- EGLBoolean result = mEglSwapBuffersWithDamageKHR(mEglDisplay, eglSurface, reinterpret_cast<int*>(mCombinedDamagedRects.data()), mCombinedDamagedRects.size());
+ EGLBoolean result = mEglSwapBuffersWithDamageKHR(mEglDisplay, eglSurface, reinterpret_cast<int*>(const_cast< std::vector< Rect< int > >& >( damagedRects ).data()), damagedRects.size());
if (result == EGL_FALSE)
{
DALI_LOG_ERROR("eglSwapBuffersWithDamageKHR(%d)\n", eglGetError());
}
}
+bool EglImplementation::IsPartialUpdateRequired() const
+{
+ return mPartialUpdateRequired;
+}
+
} // namespace Adaptor
} // namespace Internal
/**
* Destructor
*/
- virtual ~EglImplementation();
+ ~EglImplementation() override;
public:
* Create the OpenGL context for the shared resource.
* @return true if successful
*/
- virtual bool CreateContext();
+ bool CreateContext() override;
/**
* Create the OpenGL context for the window.
/**
* Make the OpenGL context current
*/
- virtual void MakeContextCurrent( EGLSurface eglSurface, EGLContext eglContext );
+ void MakeContextCurrent( EGLSurface eglSurface, EGLContext eglContext ) override;
/**
* clear the OpenGL context
/**
* Terminate GL
*/
- virtual void TerminateGles();
+ void TerminateGles() override;
/**
* Checks if GL is initialised
/**
* Performs an OpenGL swap buffers command
*/
- virtual void SwapBuffers( EGLSurface& eglSurface );
+ void SwapBuffers( EGLSurface& eglSurface ) override;
/**
* Gets current back buffer age
EGLint GetBufferAge( EGLSurface& eglSurface ) const;
/**
- * Gets if user set damaged areas
- */
- bool DamageAreasSet() const;
-
- /**
- * Sets damaged areas, overrides auto calculated ones
- */
- void SetDamageAreas( std::vector<Dali::Rect<int>>& damagedArea );
-
- /**
- * Forces full surface swap next frame, resets current partial update state.
- */
- void SetFullSwapNextFrame();
-
- /**
* Performs an OpenGL set damage command with damaged rects
*/
- virtual void SetDamage( EGLSurface& eglSurface, const std::vector<Rect<int>>& damagedRects, Rect<int>& clippingRect );
+ void SetDamageRegion( EGLSurface& eglSurface, std::vector< Rect< int > >& damagedRects );
/**
* Performs an OpenGL swap buffers command with damaged rects
/**
* Performs an OpenGL copy buffers command
*/
- virtual void CopyBuffers( EGLSurface& eglSurface );
+ void CopyBuffers( EGLSurface& eglSurface ) override;
/**
* Performs an EGL wait GL command
*/
- virtual void WaitGL();
+ void WaitGL() override;
/**
* Choose config of egl
*/
void WaitClient();
+ /**
+ * @brief Returns whether the partial update is required.
+ * @return true if the partial update is required.
+ */
+ bool IsPartialUpdateRequired() const;
+
private:
Vector<EGLint> mContextAttribs;
PFNEGLSETDAMAGEREGIONKHRPROC mEglSetDamageRegionKHR;
PFNEGLSWAPBUFFERSWITHDAMAGEEXTPROC mEglSwapBuffersWithDamageKHR;
- EGLint mBufferAge;
- std::list<std::vector<Rect<int>>> mBufferDamagedRects;
- std::vector<Rect<int>> mCombinedDamagedRects;
- std::vector<Rect<int>> mDamagedAreas;
- Rect<int> mSurfaceRect;
- bool mFullSwapNextFrame;
};
} // namespace Adaptor
/**
* @copydoc Dali::Integration::GlSyncAbstraction::SyncObject::IsSynced()
*/
- virtual bool IsSynced();
+ bool IsSynced() override;
private:
#ifdef _ARCH_ARM_
/**
* @copydoc Dali::Integration::GlSyncAbstraction::CreateSyncObject()
*/
- virtual SyncObject* CreateSyncObject();
+ SyncObject* CreateSyncObject() override;
/**
* @copydoc Dali::Integration::GlSyncAbstraction::DestroySyncObject()
*/
- virtual void DestroySyncObject(SyncObject* syncObject);
+ void DestroySyncObject(SyncObject* syncObject) override;
private:
/**
virtual ~GlImplementation() {}
- void PreRender()
+ void PreRender() override
{
/* Do nothing in main implementation */
}
- void PostRender()
+ void PostRender() override
{
/* Do nothing in main implementation */
}
mIsSurfacelessContextSupported = isSupported;
}
- bool IsSurfacelessContextSupported() const
+ bool IsSurfacelessContextSupported() const override
{
return mIsSurfacelessContextSupported;
}
- bool TextureRequiresConverting( const GLenum imageGlFormat, const GLenum textureGlFormat, const bool isSubImage ) const
+ bool TextureRequiresConverting( const GLenum imageGlFormat, const GLenum textureGlFormat, const bool isSubImage ) const override
{
bool convert = ( ( imageGlFormat == GL_RGB ) && ( textureGlFormat == GL_RGBA ) );
if( mGlesVersion >= 30 )
/* OpenGL ES 2.0 */
- void ActiveTexture( GLenum texture )
+ void ActiveTexture( GLenum texture ) override
{
glActiveTexture( texture );
}
- void AttachShader( GLuint program, GLuint shader )
+ void AttachShader( GLuint program, GLuint shader ) override
{
glAttachShader( program, shader );
}
- void BindAttribLocation( GLuint program, GLuint index, const char* name )
+ void BindAttribLocation( GLuint program, GLuint index, const char* name ) override
{
glBindAttribLocation( program, index, name );
}
- void BindBuffer( GLenum target, GLuint buffer )
+ void BindBuffer( GLenum target, GLuint buffer ) override
{
glBindBuffer( target, buffer );
}
- void BindFramebuffer( GLenum target, GLuint framebuffer )
+ void BindFramebuffer( GLenum target, GLuint framebuffer ) override
{
glBindFramebuffer( target, framebuffer );
}
- void BindRenderbuffer( GLenum target, GLuint renderbuffer )
+ void BindRenderbuffer( GLenum target, GLuint renderbuffer ) override
{
glBindRenderbuffer( target, renderbuffer );
}
- void BindTexture( GLenum target, GLuint texture )
+ void BindTexture( GLenum target, GLuint texture ) override
{
glBindTexture( target, texture );
}
- void BlendColor( GLclampf red, GLclampf green, GLclampf blue, GLclampf alpha )
+ void BlendColor( GLclampf red, GLclampf green, GLclampf blue, GLclampf alpha ) override
{
glBlendColor( red, green, blue, alpha );
}
- void BlendEquation( GLenum mode )
+ void BlendEquation( GLenum mode ) override
{
glBlendEquation( mode );
}
- void BlendEquationSeparate( GLenum modeRGB, GLenum modeAlpha )
+ void BlendEquationSeparate( GLenum modeRGB, GLenum modeAlpha ) override
{
glBlendEquationSeparate( modeRGB, modeAlpha );
}
- void BlendFunc( GLenum sfactor, GLenum dfactor )
+ void BlendFunc( GLenum sfactor, GLenum dfactor ) override
{
glBlendFunc( sfactor, dfactor );
}
- void BlendFuncSeparate( GLenum srcRGB, GLenum dstRGB, GLenum srcAlpha, GLenum dstAlpha )
+ void BlendFuncSeparate( GLenum srcRGB, GLenum dstRGB, GLenum srcAlpha, GLenum dstAlpha ) override
{
glBlendFuncSeparate( srcRGB, dstRGB, srcAlpha, dstAlpha );
}
- void BufferData( GLenum target, GLsizeiptr size, const void* data, GLenum usage )
+ void BufferData( GLenum target, GLsizeiptr size, const void* data, GLenum usage ) override
{
glBufferData( target, size, data, usage );
}
- void BufferSubData( GLenum target, GLintptr offset, GLsizeiptr size, const void* data )
+ void BufferSubData( GLenum target, GLintptr offset, GLsizeiptr size, const void* data ) override
{
glBufferSubData( target, offset, size, data );
}
- GLenum CheckFramebufferStatus( GLenum target )
+ GLenum CheckFramebufferStatus( GLenum target ) override
{
return glCheckFramebufferStatus( target );
}
- void Clear( GLbitfield mask )
+ void Clear( GLbitfield mask ) override
{
glClear( mask );
}
- void ClearColor( GLclampf red, GLclampf green, GLclampf blue, GLclampf alpha )
+ void ClearColor( GLclampf red, GLclampf green, GLclampf blue, GLclampf alpha ) override
{
glClearColor( red, green, blue, alpha );
}
- void ClearDepthf( GLclampf depth )
+ void ClearDepthf( GLclampf depth ) override
{
glClearDepthf( depth );
}
- void ClearStencil( GLint s )
+ void ClearStencil( GLint s ) override
{
glClearStencil( s );
}
- void ColorMask( GLboolean red, GLboolean green, GLboolean blue, GLboolean alpha )
+ void ColorMask( GLboolean red, GLboolean green, GLboolean blue, GLboolean alpha ) override
{
glColorMask( red, green, blue, alpha );
}
- void CompileShader( GLuint shader )
+ void CompileShader( GLuint shader ) override
{
glCompileShader( shader );
}
- void CompressedTexImage2D( GLenum target, GLint level, GLenum internalformat, GLsizei width, GLsizei height, GLint border, GLsizei imageSize, const void* data )
+ void CompressedTexImage2D( GLenum target, GLint level, GLenum internalformat, GLsizei width, GLsizei height, GLint border, GLsizei imageSize, const void* data ) override
{
glCompressedTexImage2D( target, level, internalformat, width, height, border, imageSize, data );
}
- void CompressedTexSubImage2D( GLenum target, GLint level, GLint xoffset, GLint yoffset, GLsizei width, GLsizei height, GLenum format, GLsizei imageSize, const void* data )
+ void CompressedTexSubImage2D( GLenum target, GLint level, GLint xoffset, GLint yoffset, GLsizei width, GLsizei height, GLenum format, GLsizei imageSize, const void* data ) override
{
glCompressedTexSubImage2D( target, level, xoffset, yoffset, width, height, format, imageSize, data );
}
- void CopyTexImage2D( GLenum target, GLint level, GLenum internalformat, GLint x, GLint y, GLsizei width, GLsizei height, GLint border )
+ void CopyTexImage2D( GLenum target, GLint level, GLenum internalformat, GLint x, GLint y, GLsizei width, GLsizei height, GLint border ) override
{
glCopyTexImage2D( target, level, internalformat, x, y, width, height, border );
}
- void CopyTexSubImage2D( GLenum target, GLint level, GLint xoffset, GLint yoffset, GLint x, GLint y, GLsizei width, GLsizei height )
+ void CopyTexSubImage2D( GLenum target, GLint level, GLint xoffset, GLint yoffset, GLint x, GLint y, GLsizei width, GLsizei height ) override
{
glCopyTexSubImage2D( target, level, xoffset, yoffset, x, y, width, height );
}
- GLuint CreateProgram( void )
+ GLuint CreateProgram( void ) override
{
return glCreateProgram();
}
- GLuint CreateShader( GLenum type )
+ GLuint CreateShader( GLenum type ) override
{
return glCreateShader( type );
}
- void CullFace( GLenum mode )
+ void CullFace( GLenum mode ) override
{
glCullFace( mode );
}
- void DeleteBuffers( GLsizei n, const GLuint* buffers )
+ void DeleteBuffers( GLsizei n, const GLuint* buffers ) override
{
glDeleteBuffers( n, buffers );
}
- void DeleteFramebuffers( GLsizei n, const GLuint* framebuffers )
+ void DeleteFramebuffers( GLsizei n, const GLuint* framebuffers ) override
{
glDeleteFramebuffers( n, framebuffers );
}
- void DeleteProgram( GLuint program )
+ void DeleteProgram( GLuint program ) override
{
glDeleteProgram( program );
}
- void DeleteRenderbuffers( GLsizei n, const GLuint* renderbuffers )
+ void DeleteRenderbuffers( GLsizei n, const GLuint* renderbuffers ) override
{
glDeleteRenderbuffers( n, renderbuffers );
}
- void DeleteShader( GLuint shader )
+ void DeleteShader( GLuint shader ) override
{
glDeleteShader( shader );
}
- void DeleteTextures( GLsizei n, const GLuint* textures )
+ void DeleteTextures( GLsizei n, const GLuint* textures ) override
{
glDeleteTextures( n, textures );
}
- void DepthFunc( GLenum func )
+ void DepthFunc( GLenum func ) override
{
glDepthFunc( func );
}
- void DepthMask( GLboolean flag )
+ void DepthMask( GLboolean flag ) override
{
glDepthMask( flag );
}
- void DepthRangef( GLclampf zNear, GLclampf zFar )
+ void DepthRangef( GLclampf zNear, GLclampf zFar ) override
{
glDepthRangef( zNear, zFar );
}
- void DetachShader( GLuint program, GLuint shader )
+ void DetachShader( GLuint program, GLuint shader ) override
{
glDetachShader( program, shader );
}
- void Disable( GLenum cap )
+ void Disable( GLenum cap ) override
{
glDisable( cap );
}
- void DisableVertexAttribArray( GLuint index )
+ void DisableVertexAttribArray( GLuint index ) override
{
glDisableVertexAttribArray( index );
}
- void DrawArrays( GLenum mode, GLint first, GLsizei count )
+ void DrawArrays( GLenum mode, GLint first, GLsizei count ) override
{
glDrawArrays( mode, first, count );
}
- void DrawElements( GLenum mode, GLsizei count, GLenum type, const void* indices )
+ void DrawElements( GLenum mode, GLsizei count, GLenum type, const void* indices ) override
{
glDrawElements( mode, count, type, indices );
}
- void Enable( GLenum cap )
+ void Enable( GLenum cap ) override
{
glEnable( cap );
}
- void EnableVertexAttribArray( GLuint index )
+ void EnableVertexAttribArray( GLuint index ) override
{
glEnableVertexAttribArray( index );
}
- void Finish( void )
+ void Finish( void ) override
{
glFinish();
}
- void Flush( void )
+ void Flush( void ) override
{
glFlush();
}
- void FramebufferRenderbuffer( GLenum target, GLenum attachment, GLenum renderbuffertarget, GLuint renderbuffer )
+ void FramebufferRenderbuffer( GLenum target, GLenum attachment, GLenum renderbuffertarget, GLuint renderbuffer ) override
{
glFramebufferRenderbuffer( target, attachment, renderbuffertarget, renderbuffer );
}
- void FramebufferTexture2D( GLenum target, GLenum attachment, GLenum textarget, GLuint texture, GLint level )
+ void FramebufferTexture2D( GLenum target, GLenum attachment, GLenum textarget, GLuint texture, GLint level ) override
{
glFramebufferTexture2D( target, attachment, textarget, texture, level );
}
- void FrontFace( GLenum mode )
+ void FrontFace( GLenum mode ) override
{
glFrontFace( mode );
}
- void GenBuffers( GLsizei n, GLuint* buffers )
+ void GenBuffers( GLsizei n, GLuint* buffers ) override
{
glGenBuffers( n, buffers );
}
- void GenerateMipmap( GLenum target )
+ void GenerateMipmap( GLenum target ) override
{
glGenerateMipmap( target );
}
- void GenFramebuffers( GLsizei n, GLuint* framebuffers )
+ void GenFramebuffers( GLsizei n, GLuint* framebuffers ) override
{
glGenFramebuffers( n, framebuffers );
}
- void GenRenderbuffers( GLsizei n, GLuint* renderbuffers )
+ void GenRenderbuffers( GLsizei n, GLuint* renderbuffers ) override
{
glGenRenderbuffers( n, renderbuffers );
}
- void GenTextures( GLsizei n, GLuint* textures )
+ void GenTextures( GLsizei n, GLuint* textures ) override
{
glGenTextures( n, textures );
}
- void GetActiveAttrib( GLuint program, GLuint index, GLsizei bufsize, GLsizei* length, GLint* size, GLenum* type, char* name )
+ void GetActiveAttrib( GLuint program, GLuint index, GLsizei bufsize, GLsizei* length, GLint* size, GLenum* type, char* name ) override
{
glGetActiveAttrib( program, index, bufsize, length, size, type, name );
}
- void GetActiveUniform( GLuint program, GLuint index, GLsizei bufsize, GLsizei* length, GLint* size, GLenum* type, char* name )
+ void GetActiveUniform( GLuint program, GLuint index, GLsizei bufsize, GLsizei* length, GLint* size, GLenum* type, char* name ) override
{
glGetActiveUniform( program, index, bufsize, length, size, type, name );
}
- void GetAttachedShaders( GLuint program, GLsizei maxcount, GLsizei* count, GLuint* shaders )
+ void GetAttachedShaders( GLuint program, GLsizei maxcount, GLsizei* count, GLuint* shaders ) override
{
glGetAttachedShaders( program, maxcount, count, shaders );
}
- int GetAttribLocation( GLuint program, const char* name )
+ int GetAttribLocation( GLuint program, const char* name ) override
{
return glGetAttribLocation( program, name );
}
- void GetBooleanv( GLenum pname, GLboolean* params )
+ void GetBooleanv( GLenum pname, GLboolean* params ) override
{
glGetBooleanv( pname, params );
}
- void GetBufferParameteriv( GLenum target, GLenum pname, GLint* params )
+ void GetBufferParameteriv( GLenum target, GLenum pname, GLint* params ) override
{
glGetBufferParameteriv( target, pname, params );
}
- GLenum GetError( void )
+ GLenum GetError( void ) override
{
return glGetError();
}
- void GetFloatv( GLenum pname, GLfloat* params )
+ void GetFloatv( GLenum pname, GLfloat* params ) override
{
glGetFloatv( pname, params );
}
- void GetFramebufferAttachmentParameteriv( GLenum target, GLenum attachment, GLenum pname, GLint* params )
+ void GetFramebufferAttachmentParameteriv( GLenum target, GLenum attachment, GLenum pname, GLint* params ) override
{
glGetFramebufferAttachmentParameteriv( target, attachment, pname, params );
}
- void GetIntegerv( GLenum pname, GLint* params )
+ void GetIntegerv( GLenum pname, GLint* params ) override
{
glGetIntegerv( pname, params );
}
- void GetProgramiv( GLuint program, GLenum pname, GLint* params )
+ void GetProgramiv( GLuint program, GLenum pname, GLint* params ) override
{
glGetProgramiv( program, pname, params );
}
- void GetProgramInfoLog( GLuint program, GLsizei bufsize, GLsizei* length, char* infolog )
+ void GetProgramInfoLog( GLuint program, GLsizei bufsize, GLsizei* length, char* infolog ) override
{
glGetProgramInfoLog( program, bufsize, length, infolog );
}
- void GetRenderbufferParameteriv( GLenum target, GLenum pname, GLint* params )
+ void GetRenderbufferParameteriv( GLenum target, GLenum pname, GLint* params ) override
{
glGetRenderbufferParameteriv( target, pname, params );
}
- void GetShaderiv( GLuint shader, GLenum pname, GLint* params )
+ void GetShaderiv( GLuint shader, GLenum pname, GLint* params ) override
{
glGetShaderiv( shader, pname, params );
}
- void GetShaderInfoLog( GLuint shader, GLsizei bufsize, GLsizei* length, char* infolog )
+ void GetShaderInfoLog( GLuint shader, GLsizei bufsize, GLsizei* length, char* infolog ) override
{
glGetShaderInfoLog( shader, bufsize, length, infolog );
}
- void GetShaderPrecisionFormat( GLenum shadertype, GLenum precisiontype, GLint* range, GLint* precision )
+ void GetShaderPrecisionFormat( GLenum shadertype, GLenum precisiontype, GLint* range, GLint* precision ) override
{
glGetShaderPrecisionFormat( shadertype, precisiontype, range, precision );
}
- void GetShaderSource( GLuint shader, GLsizei bufsize, GLsizei* length, char* source )
+ void GetShaderSource( GLuint shader, GLsizei bufsize, GLsizei* length, char* source ) override
{
glGetShaderSource( shader, bufsize, length, source );
}
- const GLubyte* GetString( GLenum name )
+ const GLubyte* GetString( GLenum name ) override
{
return glGetString( name );
}
- void GetTexParameterfv( GLenum target, GLenum pname, GLfloat* params )
+ void GetTexParameterfv( GLenum target, GLenum pname, GLfloat* params ) override
{
glGetTexParameterfv( target, pname, params );
}
- void GetTexParameteriv( GLenum target, GLenum pname, GLint* params )
+ void GetTexParameteriv( GLenum target, GLenum pname, GLint* params ) override
{
glGetTexParameteriv( target, pname, params );
}
- void GetUniformfv( GLuint program, GLint location, GLfloat* params )
+ void GetUniformfv( GLuint program, GLint location, GLfloat* params ) override
{
glGetUniformfv( program, location, params );
}
- void GetUniformiv( GLuint program, GLint location, GLint* params )
+ void GetUniformiv( GLuint program, GLint location, GLint* params ) override
{
glGetUniformiv( program, location, params );
}
- int GetUniformLocation( GLuint program, const char* name )
+ int GetUniformLocation( GLuint program, const char* name ) override
{
return glGetUniformLocation( program, name );
}
- void GetVertexAttribfv( GLuint index, GLenum pname, GLfloat* params )
+ void GetVertexAttribfv( GLuint index, GLenum pname, GLfloat* params ) override
{
glGetVertexAttribfv( index, pname, params );
}
- void GetVertexAttribiv( GLuint index, GLenum pname, GLint* params )
+ void GetVertexAttribiv( GLuint index, GLenum pname, GLint* params ) override
{
glGetVertexAttribiv( index, pname, params );
}
- void GetVertexAttribPointerv( GLuint index, GLenum pname, void** pointer )
+ void GetVertexAttribPointerv( GLuint index, GLenum pname, void** pointer ) override
{
glGetVertexAttribPointerv( index, pname, pointer );
}
- void Hint( GLenum target, GLenum mode )
+ void Hint( GLenum target, GLenum mode ) override
{
glHint( target, mode );
}
- GLboolean IsBuffer( GLuint buffer )
+ GLboolean IsBuffer( GLuint buffer ) override
{
return glIsBuffer( buffer );
}
- GLboolean IsEnabled( GLenum cap )
+ GLboolean IsEnabled( GLenum cap ) override
{
return glIsEnabled( cap );
}
- GLboolean IsFramebuffer( GLuint framebuffer )
+ GLboolean IsFramebuffer( GLuint framebuffer ) override
{
return glIsFramebuffer( framebuffer );
}
- GLboolean IsProgram( GLuint program )
+ GLboolean IsProgram( GLuint program ) override
{
return glIsProgram( program );
}
- GLboolean IsRenderbuffer( GLuint renderbuffer )
+ GLboolean IsRenderbuffer( GLuint renderbuffer ) override
{
return glIsRenderbuffer( renderbuffer );
}
- GLboolean IsShader( GLuint shader )
+ GLboolean IsShader( GLuint shader ) override
{
return glIsShader( shader );
}
- GLboolean IsTexture( GLuint texture )
+ GLboolean IsTexture( GLuint texture ) override
{
return glIsTexture( texture );
}
- void LineWidth( GLfloat width )
+ void LineWidth( GLfloat width ) override
{
glLineWidth( width );
}
- void LinkProgram( GLuint program )
+ void LinkProgram( GLuint program ) override
{
glLinkProgram( program );
}
- void PixelStorei( GLenum pname, GLint param )
+ void PixelStorei( GLenum pname, GLint param ) override
{
glPixelStorei( pname, param );
}
- void PolygonOffset( GLfloat factor, GLfloat units )
+ void PolygonOffset( GLfloat factor, GLfloat units ) override
{
glPolygonOffset( factor, units );
}
- void ReadPixels( GLint x, GLint y, GLsizei width, GLsizei height, GLenum format, GLenum type, void* pixels )
+ void ReadPixels( GLint x, GLint y, GLsizei width, GLsizei height, GLenum format, GLenum type, void* pixels ) override
{
glReadPixels( x, y, width, height, format, type, pixels );
}
- void ReleaseShaderCompiler( void )
+ void ReleaseShaderCompiler( void ) override
{
glReleaseShaderCompiler();
}
- void RenderbufferStorage( GLenum target, GLenum internalformat, GLsizei width, GLsizei height )
+ void RenderbufferStorage( GLenum target, GLenum internalformat, GLsizei width, GLsizei height ) override
{
glRenderbufferStorage( target, internalformat, width, height );
}
- void SampleCoverage( GLclampf value, GLboolean invert )
+ void SampleCoverage( GLclampf value, GLboolean invert ) override
{
glSampleCoverage( value, invert );
}
- void Scissor( GLint x, GLint y, GLsizei width, GLsizei height )
+ void Scissor( GLint x, GLint y, GLsizei width, GLsizei height ) override
{
glScissor( x, y, width, height );
}
- void ShaderBinary( GLsizei n, const GLuint* shaders, GLenum binaryformat, const void* binary, GLsizei length )
+ void ShaderBinary( GLsizei n, const GLuint* shaders, GLenum binaryformat, const void* binary, GLsizei length ) override
{
glShaderBinary( n, shaders, binaryformat, binary, length );
}
- void ShaderSource( GLuint shader, GLsizei count, const char** string, const GLint* length )
+ void ShaderSource( GLuint shader, GLsizei count, const char** string, const GLint* length ) override
{
glShaderSource( shader, count, string, length );
}
- void StencilFunc( GLenum func, GLint ref, GLuint mask )
+ void StencilFunc( GLenum func, GLint ref, GLuint mask ) override
{
glStencilFunc( func, ref, mask );
}
- void StencilFuncSeparate( GLenum face, GLenum func, GLint ref, GLuint mask )
+ void StencilFuncSeparate( GLenum face, GLenum func, GLint ref, GLuint mask ) override
{
glStencilFuncSeparate( face, func, ref, mask );
}
- void StencilMask( GLuint mask )
+ void StencilMask( GLuint mask ) override
{
glStencilMask( mask );
}
- void StencilMaskSeparate( GLenum face, GLuint mask )
+ void StencilMaskSeparate( GLenum face, GLuint mask ) override
{
glStencilMaskSeparate( face, mask );
}
- void StencilOp( GLenum fail, GLenum zfail, GLenum zpass )
+ void StencilOp( GLenum fail, GLenum zfail, GLenum zpass ) override
{
glStencilOp( fail, zfail, zpass );
}
- void StencilOpSeparate( GLenum face, GLenum fail, GLenum zfail, GLenum zpass )
+ void StencilOpSeparate( GLenum face, GLenum fail, GLenum zfail, GLenum zpass ) override
{
glStencilOpSeparate( face, fail, zfail, zpass );
}
- void TexImage2D( GLenum target, GLint level, GLint internalformat, GLsizei width, GLsizei height, GLint border, GLenum format, GLenum type, const void* pixels )
+ void TexImage2D( GLenum target, GLint level, GLint internalformat, GLsizei width, GLsizei height, GLint border, GLenum format, GLenum type, const void* pixels ) override
{
glTexImage2D( target, level, internalformat, width, height, border, format, type, pixels );
}
- void TexParameterf( GLenum target, GLenum pname, GLfloat param )
+ void TexParameterf( GLenum target, GLenum pname, GLfloat param ) override
{
glTexParameterf( target, pname, param );
}
- void TexParameterfv( GLenum target, GLenum pname, const GLfloat* params )
+ void TexParameterfv( GLenum target, GLenum pname, const GLfloat* params ) override
{
glTexParameterfv( target, pname, params );
}
- void TexParameteri( GLenum target, GLenum pname, GLint param )
+ void TexParameteri( GLenum target, GLenum pname, GLint param ) override
{
glTexParameteri( target, pname, param );
}
- void TexParameteriv( GLenum target, GLenum pname, const GLint* params )
+ void TexParameteriv( GLenum target, GLenum pname, const GLint* params ) override
{
glTexParameteriv( target, pname, params );
}
- void TexSubImage2D( GLenum target, GLint level, GLint xoffset, GLint yoffset, GLsizei width, GLsizei height, GLenum format, GLenum type, const void* pixels )
+ void TexSubImage2D( GLenum target, GLint level, GLint xoffset, GLint yoffset, GLsizei width, GLsizei height, GLenum format, GLenum type, const void* pixels ) override
{
glTexSubImage2D( target, level, xoffset, yoffset, width, height, format, type, pixels );
}
- void Uniform1f( GLint location, GLfloat x )
+ void Uniform1f( GLint location, GLfloat x ) override
{
glUniform1f( location, x );
}
- void Uniform1fv( GLint location, GLsizei count, const GLfloat* v )
+ void Uniform1fv( GLint location, GLsizei count, const GLfloat* v ) override
{
glUniform1fv( location, count, v );
}
- void Uniform1i( GLint location, GLint x )
+ void Uniform1i( GLint location, GLint x ) override
{
glUniform1i( location, x );
}
- void Uniform1iv( GLint location, GLsizei count, const GLint* v )
+ void Uniform1iv( GLint location, GLsizei count, const GLint* v ) override
{
glUniform1iv( location, count, v );
}
- void Uniform2f( GLint location, GLfloat x, GLfloat y )
+ void Uniform2f( GLint location, GLfloat x, GLfloat y ) override
{
glUniform2f( location, x, y );
}
- void Uniform2fv( GLint location, GLsizei count, const GLfloat* v )
+ void Uniform2fv( GLint location, GLsizei count, const GLfloat* v ) override
{
glUniform2fv( location, count, v );
}
- void Uniform2i( GLint location, GLint x, GLint y )
+ void Uniform2i( GLint location, GLint x, GLint y ) override
{
glUniform2i( location, x, y );
}
- void Uniform2iv( GLint location, GLsizei count, const GLint* v )
+ void Uniform2iv( GLint location, GLsizei count, const GLint* v ) override
{
glUniform2iv( location, count, v );
}
- void Uniform3f( GLint location, GLfloat x, GLfloat y, GLfloat z )
+ void Uniform3f( GLint location, GLfloat x, GLfloat y, GLfloat z ) override
{
glUniform3f( location, x, y, z );
}
- void Uniform3fv( GLint location, GLsizei count, const GLfloat* v )
+ void Uniform3fv( GLint location, GLsizei count, const GLfloat* v ) override
{
glUniform3fv( location, count, v );
}
- void Uniform3i( GLint location, GLint x, GLint y, GLint z )
+ void Uniform3i( GLint location, GLint x, GLint y, GLint z ) override
{
glUniform3i( location, x, y, z );
}
- void Uniform3iv( GLint location, GLsizei count, const GLint* v )
+ void Uniform3iv( GLint location, GLsizei count, const GLint* v ) override
{
glUniform3iv( location, count, v );
}
- void Uniform4f( GLint location, GLfloat x, GLfloat y, GLfloat z, GLfloat w )
+ void Uniform4f( GLint location, GLfloat x, GLfloat y, GLfloat z, GLfloat w ) override
{
glUniform4f( location, x, y, z, w );
}
- void Uniform4fv( GLint location, GLsizei count, const GLfloat* v )
+ void Uniform4fv( GLint location, GLsizei count, const GLfloat* v ) override
{
glUniform4fv( location, count, v );
}
- void Uniform4i( GLint location, GLint x, GLint y, GLint z, GLint w )
+ void Uniform4i( GLint location, GLint x, GLint y, GLint z, GLint w ) override
{
glUniform4i( location, x, y, z, w );
}
- void Uniform4iv( GLint location, GLsizei count, const GLint* v )
+ void Uniform4iv( GLint location, GLsizei count, const GLint* v ) override
{
glUniform4iv( location, count, v );
}
- void UniformMatrix2fv( GLint location, GLsizei count, GLboolean transpose, const GLfloat* value )
+ void UniformMatrix2fv( GLint location, GLsizei count, GLboolean transpose, const GLfloat* value ) override
{
glUniformMatrix2fv( location, count, transpose, value );
}
- void UniformMatrix3fv( GLint location, GLsizei count, GLboolean transpose, const GLfloat* value )
+ void UniformMatrix3fv( GLint location, GLsizei count, GLboolean transpose, const GLfloat* value ) override
{
glUniformMatrix3fv( location, count, transpose, value );
}
- void UniformMatrix4fv( GLint location, GLsizei count, GLboolean transpose, const GLfloat* value )
+ void UniformMatrix4fv( GLint location, GLsizei count, GLboolean transpose, const GLfloat* value ) override
{
glUniformMatrix4fv( location, count, transpose, value );
}
- void UseProgram( GLuint program )
+ void UseProgram( GLuint program ) override
{
glUseProgram( program );
}
- void ValidateProgram( GLuint program )
+ void ValidateProgram( GLuint program ) override
{
glValidateProgram( program );
}
- void VertexAttrib1f( GLuint indx, GLfloat x )
+ void VertexAttrib1f( GLuint indx, GLfloat x ) override
{
glVertexAttrib1f( indx, x );
}
- void VertexAttrib1fv( GLuint indx, const GLfloat* values )
+ void VertexAttrib1fv( GLuint indx, const GLfloat* values ) override
{
glVertexAttrib1fv( indx, values );
}
- void VertexAttrib2f( GLuint indx, GLfloat x, GLfloat y )
+ void VertexAttrib2f( GLuint indx, GLfloat x, GLfloat y ) override
{
glVertexAttrib2f( indx, x, y );
}
- void VertexAttrib2fv( GLuint indx, const GLfloat* values )
+ void VertexAttrib2fv( GLuint indx, const GLfloat* values ) override
{
glVertexAttrib2fv( indx, values );
}
- void VertexAttrib3f( GLuint indx, GLfloat x, GLfloat y, GLfloat z )
+ void VertexAttrib3f( GLuint indx, GLfloat x, GLfloat y, GLfloat z ) override
{
glVertexAttrib3f( indx, x, y, z );
}
- void VertexAttrib3fv( GLuint indx, const GLfloat* values )
+ void VertexAttrib3fv( GLuint indx, const GLfloat* values ) override
{
glVertexAttrib3fv( indx, values );
}
- void VertexAttrib4f( GLuint indx, GLfloat x, GLfloat y, GLfloat z, GLfloat w )
+ void VertexAttrib4f( GLuint indx, GLfloat x, GLfloat y, GLfloat z, GLfloat w ) override
{
glVertexAttrib4f( indx, x, y, z, w );
}
- void VertexAttrib4fv( GLuint indx, const GLfloat* values )
+ void VertexAttrib4fv( GLuint indx, const GLfloat* values ) override
{
glVertexAttrib4fv( indx, values );
}
- void VertexAttribPointer( GLuint indx, GLint size, GLenum type, GLboolean normalized, GLsizei stride, const void* ptr )
+ void VertexAttribPointer( GLuint indx, GLint size, GLenum type, GLboolean normalized, GLsizei stride, const void* ptr ) override
{
glVertexAttribPointer( indx, size, type, normalized, stride, ptr );
}
- void Viewport( GLint x, GLint y, GLsizei width, GLsizei height )
+ void Viewport( GLint x, GLint y, GLsizei width, GLsizei height ) override
{
glViewport( x, y, width, height );
}
/* OpenGL ES 3.0 */
- void ReadBuffer( GLenum mode )
+ void ReadBuffer( GLenum mode ) override
{
mImpl->ReadBuffer( mode );
}
- void DrawRangeElements( GLenum mode, GLuint start, GLuint end, GLsizei count, GLenum type, const GLvoid* indices )
+ void DrawRangeElements( GLenum mode, GLuint start, GLuint end, GLsizei count, GLenum type, const GLvoid* indices ) override
{
mImpl->DrawRangeElements( mode, start, end, count, type, indices );
}
- void TexImage3D( GLenum target, GLint level, GLint internalformat, GLsizei width, GLsizei height, GLsizei depth, GLint border, GLenum format, GLenum type, const GLvoid* pixels )
+ void TexImage3D( GLenum target, GLint level, GLint internalformat, GLsizei width, GLsizei height, GLsizei depth, GLint border, GLenum format, GLenum type, const GLvoid* pixels ) override
{
mImpl->TexImage3D( target, level, internalformat, width, height, depth, border, format, type, pixels );
}
- void TexSubImage3D( GLenum target, GLint level, GLint xoffset, GLint yoffset, GLint zoffset, GLsizei width, GLsizei height, GLsizei depth, GLenum format, GLenum type, const GLvoid* pixels )
+ void TexSubImage3D( GLenum target, GLint level, GLint xoffset, GLint yoffset, GLint zoffset, GLsizei width, GLsizei height, GLsizei depth, GLenum format, GLenum type, const GLvoid* pixels ) override
{
mImpl->TexSubImage3D( target, level, xoffset, yoffset, zoffset, width, height, depth, format, type, pixels );
}
- void CopyTexSubImage3D( GLenum target, GLint level, GLint xoffset, GLint yoffset, GLint zoffset, GLint x, GLint y, GLsizei width, GLsizei height )
+ void CopyTexSubImage3D( GLenum target, GLint level, GLint xoffset, GLint yoffset, GLint zoffset, GLint x, GLint y, GLsizei width, GLsizei height ) override
{
mImpl->CopyTexSubImage3D( target, level, xoffset, yoffset, zoffset, x, y, width, height );
}
- void CompressedTexImage3D( GLenum target, GLint level, GLenum internalformat, GLsizei width, GLsizei height, GLsizei depth, GLint border, GLsizei imageSize, const GLvoid* data )
+ void CompressedTexImage3D( GLenum target, GLint level, GLenum internalformat, GLsizei width, GLsizei height, GLsizei depth, GLint border, GLsizei imageSize, const GLvoid* data ) override
{
mImpl->CompressedTexImage3D( target, level, internalformat, width, height, depth, border, imageSize, data );
}
- void CompressedTexSubImage3D( GLenum target, GLint level, GLint xoffset, GLint yoffset, GLint zoffset, GLsizei width, GLsizei height, GLsizei depth, GLenum format, GLsizei imageSize, const GLvoid* data )
+ void CompressedTexSubImage3D( GLenum target, GLint level, GLint xoffset, GLint yoffset, GLint zoffset, GLsizei width, GLsizei height, GLsizei depth, GLenum format, GLsizei imageSize, const GLvoid* data ) override
{
mImpl->CompressedTexSubImage3D( target, level, xoffset, yoffset, zoffset, width, height, depth, format, imageSize, data );
}
- void GenQueries( GLsizei n, GLuint* ids )
+ void GenQueries( GLsizei n, GLuint* ids ) override
{
mImpl->GenQueries( n, ids );
}
- void DeleteQueries( GLsizei n, const GLuint* ids )
+ void DeleteQueries( GLsizei n, const GLuint* ids ) override
{
mImpl->DeleteQueries( n, ids );
}
- GLboolean IsQuery( GLuint id )
+ GLboolean IsQuery( GLuint id ) override
{
return mImpl->IsQuery( id );
}
- void BeginQuery( GLenum target, GLuint id )
+ void BeginQuery( GLenum target, GLuint id ) override
{
mImpl->BeginQuery( target, id );
}
- void EndQuery( GLenum target )
+ void EndQuery( GLenum target ) override
{
mImpl->EndQuery( target );
}
- void GetQueryiv( GLenum target, GLenum pname, GLint* params )
+ void GetQueryiv( GLenum target, GLenum pname, GLint* params ) override
{
mImpl->GetQueryiv( target, pname, params );
}
- void GetQueryObjectuiv( GLuint id, GLenum pname, GLuint* params )
+ void GetQueryObjectuiv( GLuint id, GLenum pname, GLuint* params ) override
{
mImpl->GetQueryObjectuiv( id, pname, params );
}
- GLboolean UnmapBuffer( GLenum target )
+ GLboolean UnmapBuffer( GLenum target ) override
{
return mImpl->UnmapBuffer( target );
}
- void GetBufferPointerv( GLenum target, GLenum pname, GLvoid** params )
+ void GetBufferPointerv( GLenum target, GLenum pname, GLvoid** params ) override
{
mImpl->GetBufferPointerv( target, pname, params );
}
- void DrawBuffers( GLsizei n, const GLenum* bufs )
+ void DrawBuffers( GLsizei n, const GLenum* bufs ) override
{
mImpl->DrawBuffers( n, bufs );
}
- void UniformMatrix2x3fv( GLint location, GLsizei count, GLboolean transpose, const GLfloat* value )
+ void UniformMatrix2x3fv( GLint location, GLsizei count, GLboolean transpose, const GLfloat* value ) override
{
mImpl->UniformMatrix2x3fv( location, count, transpose, value );
}
- void UniformMatrix3x2fv( GLint location, GLsizei count, GLboolean transpose, const GLfloat* value )
+ void UniformMatrix3x2fv( GLint location, GLsizei count, GLboolean transpose, const GLfloat* value ) override
{
mImpl->UniformMatrix3x2fv( location, count, transpose, value );
}
- void UniformMatrix2x4fv( GLint location, GLsizei count, GLboolean transpose, const GLfloat* value )
+ void UniformMatrix2x4fv( GLint location, GLsizei count, GLboolean transpose, const GLfloat* value ) override
{
mImpl->UniformMatrix2x4fv( location, count, transpose, value );
}
- void UniformMatrix4x2fv( GLint location, GLsizei count, GLboolean transpose, const GLfloat* value )
+ void UniformMatrix4x2fv( GLint location, GLsizei count, GLboolean transpose, const GLfloat* value ) override
{
mImpl->UniformMatrix4x2fv( location, count, transpose, value );
}
- void UniformMatrix3x4fv( GLint location, GLsizei count, GLboolean transpose, const GLfloat* value )
+ void UniformMatrix3x4fv( GLint location, GLsizei count, GLboolean transpose, const GLfloat* value ) override
{
mImpl->UniformMatrix3x4fv( location, count, transpose, value );
}
- void UniformMatrix4x3fv( GLint location, GLsizei count, GLboolean transpose, const GLfloat* value )
+ void UniformMatrix4x3fv( GLint location, GLsizei count, GLboolean transpose, const GLfloat* value ) override
{
mImpl->UniformMatrix4x3fv( location, count, transpose, value );
}
- void BlitFramebuffer( GLint srcX0, GLint srcY0, GLint srcX1, GLint srcY1, GLint dstX0, GLint dstY0, GLint dstX1, GLint dstY1, GLbitfield mask, GLenum filter )
+ void BlitFramebuffer( GLint srcX0, GLint srcY0, GLint srcX1, GLint srcY1, GLint dstX0, GLint dstY0, GLint dstX1, GLint dstY1, GLbitfield mask, GLenum filter ) override
{
mImpl->BlitFramebuffer( srcX0, srcY0, srcX1, srcY1, dstX0, dstY0, dstX1, dstY1, mask, filter );
}
- void RenderbufferStorageMultisample( GLenum target, GLsizei samples, GLenum internalformat, GLsizei width, GLsizei height )
+ void RenderbufferStorageMultisample( GLenum target, GLsizei samples, GLenum internalformat, GLsizei width, GLsizei height ) override
{
mImpl->RenderbufferStorageMultisample( target, samples, internalformat, width, height );
}
- void FramebufferTextureLayer( GLenum target, GLenum attachment, GLuint texture, GLint level, GLint layer )
+ void FramebufferTextureLayer( GLenum target, GLenum attachment, GLuint texture, GLint level, GLint layer ) override
{
mImpl->FramebufferTextureLayer( target, attachment, texture, level, layer );
}
- GLvoid* MapBufferRange( GLenum target, GLintptr offset, GLsizeiptr length, GLbitfield access )
+ GLvoid* MapBufferRange( GLenum target, GLintptr offset, GLsizeiptr length, GLbitfield access ) override
{
return mImpl->MapBufferRange( target, offset, length, access );
}
- void FlushMappedBufferRange( GLenum target, GLintptr offset, GLsizeiptr length )
+ void FlushMappedBufferRange( GLenum target, GLintptr offset, GLsizeiptr length ) override
{
mImpl->FlushMappedBufferRange( target, offset, length );
}
- void BindVertexArray( GLuint array )
+ void BindVertexArray( GLuint array ) override
{
mImpl->BindVertexArray( array );
}
- void DeleteVertexArrays( GLsizei n, const GLuint* arrays )
+ void DeleteVertexArrays( GLsizei n, const GLuint* arrays ) override
{
mImpl->DeleteVertexArrays( n, arrays );
}
- void GenVertexArrays( GLsizei n, GLuint* arrays )
+ void GenVertexArrays( GLsizei n, GLuint* arrays ) override
{
mImpl->GenVertexArrays( n, arrays );
}
- GLboolean IsVertexArray( GLuint array )
+ GLboolean IsVertexArray( GLuint array ) override
{
return mImpl->IsVertexArray( array );
}
- void GetIntegeri_v( GLenum target, GLuint index, GLint* data )
+ void GetIntegeri_v( GLenum target, GLuint index, GLint* data ) override
{
mImpl->GetIntegeri_v( target, index, data );
}
- void BeginTransformFeedback( GLenum primitiveMode )
+ void BeginTransformFeedback( GLenum primitiveMode ) override
{
mImpl->BeginTransformFeedback( primitiveMode );
}
- void EndTransformFeedback( void )
+ void EndTransformFeedback( void ) override
{
mImpl->EndTransformFeedback();
}
- void BindBufferRange( GLenum target, GLuint index, GLuint buffer, GLintptr offset, GLsizeiptr size )
+ void BindBufferRange( GLenum target, GLuint index, GLuint buffer, GLintptr offset, GLsizeiptr size ) override
{
mImpl->BindBufferRange( target, index, buffer, offset, size );
}
- void BindBufferBase( GLenum target, GLuint index, GLuint buffer )
+ void BindBufferBase( GLenum target, GLuint index, GLuint buffer ) override
{
mImpl->BindBufferBase( target, index, buffer );
}
- void TransformFeedbackVaryings( GLuint program, GLsizei count, const GLchar* const* varyings, GLenum bufferMode )
+ void TransformFeedbackVaryings( GLuint program, GLsizei count, const GLchar* const* varyings, GLenum bufferMode ) override
{
mImpl->TransformFeedbackVaryings( program, count, varyings, bufferMode );
}
- void GetTransformFeedbackVarying( GLuint program, GLuint index, GLsizei bufSize, GLsizei* length, GLsizei* size, GLenum* type, GLchar* name )
+ void GetTransformFeedbackVarying( GLuint program, GLuint index, GLsizei bufSize, GLsizei* length, GLsizei* size, GLenum* type, GLchar* name ) override
{
mImpl->GetTransformFeedbackVarying( program, index, bufSize, length, size, type, name );
}
- void VertexAttribIPointer( GLuint index, GLint size, GLenum type, GLsizei stride, const GLvoid* pointer )
+ void VertexAttribIPointer( GLuint index, GLint size, GLenum type, GLsizei stride, const GLvoid* pointer ) override
{
mImpl->VertexAttribIPointer( index, size, type, stride, pointer );
}
- void GetVertexAttribIiv( GLuint index, GLenum pname, GLint* params )
+ void GetVertexAttribIiv( GLuint index, GLenum pname, GLint* params ) override
{
mImpl->GetVertexAttribIiv( index, pname, params );
}
- void GetVertexAttribIuiv( GLuint index, GLenum pname, GLuint* params )
+ void GetVertexAttribIuiv( GLuint index, GLenum pname, GLuint* params ) override
{
mImpl->GetVertexAttribIuiv( index, pname, params );
}
- void VertexAttribI4i( GLuint index, GLint x, GLint y, GLint z, GLint w )
+ void VertexAttribI4i( GLuint index, GLint x, GLint y, GLint z, GLint w ) override
{
mImpl->VertexAttribI4i( index, x, y, z, w );
}
- void VertexAttribI4ui( GLuint index, GLuint x, GLuint y, GLuint z, GLuint w )
+ void VertexAttribI4ui( GLuint index, GLuint x, GLuint y, GLuint z, GLuint w ) override
{
mImpl->VertexAttribI4ui( index, x, y, z, w );
}
- void VertexAttribI4iv( GLuint index, const GLint* v )
+ void VertexAttribI4iv( GLuint index, const GLint* v ) override
{
mImpl->VertexAttribI4iv( index, v );
}
- void VertexAttribI4uiv( GLuint index, const GLuint* v )
+ void VertexAttribI4uiv( GLuint index, const GLuint* v ) override
{
mImpl->VertexAttribI4uiv( index, v );
}
- void GetUniformuiv( GLuint program, GLint location, GLuint* params )
+ void GetUniformuiv( GLuint program, GLint location, GLuint* params ) override
{
mImpl->GetUniformuiv( program, location, params );
}
- GLint GetFragDataLocation( GLuint program, const GLchar *name )
+ GLint GetFragDataLocation( GLuint program, const GLchar *name ) override
{
return mImpl->GetFragDataLocation( program, name );
}
- void Uniform1ui( GLint location, GLuint v0 )
+ void Uniform1ui( GLint location, GLuint v0 ) override
{
mImpl->Uniform1ui( location, v0 );
}
- void Uniform2ui( GLint location, GLuint v0, GLuint v1 )
+ void Uniform2ui( GLint location, GLuint v0, GLuint v1 ) override
{
mImpl->Uniform2ui( location, v0, v1 );
}
- void Uniform3ui( GLint location, GLuint v0, GLuint v1, GLuint v2 )
+ void Uniform3ui( GLint location, GLuint v0, GLuint v1, GLuint v2 ) override
{
mImpl->Uniform3ui( location, v0, v1, v2 );
}
- void Uniform4ui( GLint location, GLuint v0, GLuint v1, GLuint v2, GLuint v3 )
+ void Uniform4ui( GLint location, GLuint v0, GLuint v1, GLuint v2, GLuint v3 ) override
{
mImpl->Uniform4ui( location, v0, v1, v2, v3 );
}
- void Uniform1uiv( GLint location, GLsizei count, const GLuint* value )
+ void Uniform1uiv( GLint location, GLsizei count, const GLuint* value ) override
{
mImpl->Uniform1uiv( location, count, value );
}
- void Uniform2uiv( GLint location, GLsizei count, const GLuint* value )
+ void Uniform2uiv( GLint location, GLsizei count, const GLuint* value ) override
{
mImpl->Uniform2uiv( location, count, value );
}
- void Uniform3uiv( GLint location, GLsizei count, const GLuint* value )
+ void Uniform3uiv( GLint location, GLsizei count, const GLuint* value ) override
{
mImpl->Uniform3uiv( location, count, value );
}
- void Uniform4uiv( GLint location, GLsizei count, const GLuint* value )
+ void Uniform4uiv( GLint location, GLsizei count, const GLuint* value ) override
{
mImpl->Uniform4uiv( location, count, value );
}
- void ClearBufferiv( GLenum buffer, GLint drawbuffer, const GLint* value )
+ void ClearBufferiv( GLenum buffer, GLint drawbuffer, const GLint* value ) override
{
mImpl->ClearBufferiv( buffer, drawbuffer, value );
}
- void ClearBufferuiv( GLenum buffer, GLint drawbuffer, const GLuint* value )
+ void ClearBufferuiv( GLenum buffer, GLint drawbuffer, const GLuint* value ) override
{
mImpl->ClearBufferuiv( buffer, drawbuffer, value );
}
- void ClearBufferfv( GLenum buffer, GLint drawbuffer, const GLfloat* value )
+ void ClearBufferfv( GLenum buffer, GLint drawbuffer, const GLfloat* value ) override
{
mImpl->ClearBufferfv( buffer, drawbuffer, value );
}
- void ClearBufferfi( GLenum buffer, GLint drawbuffer, GLfloat depth, GLint stencil )
+ void ClearBufferfi( GLenum buffer, GLint drawbuffer, GLfloat depth, GLint stencil ) override
{
mImpl->ClearBufferfi( buffer, drawbuffer, depth, stencil );
}
- const GLubyte* GetStringi( GLenum name, GLuint index )
+ const GLubyte* GetStringi( GLenum name, GLuint index ) override
{
return mImpl->GetStringi( name, index );
}
- void CopyBufferSubData( GLenum readTarget, GLenum writeTarget, GLintptr readOffset, GLintptr writeOffset, GLsizeiptr size )
+ void CopyBufferSubData( GLenum readTarget, GLenum writeTarget, GLintptr readOffset, GLintptr writeOffset, GLsizeiptr size ) override
{
mImpl->CopyBufferSubData( readTarget, writeTarget, readOffset, writeOffset, size );
}
- void GetUniformIndices( GLuint program, GLsizei uniformCount, const GLchar* const* uniformNames, GLuint* uniformIndices )
+ void GetUniformIndices( GLuint program, GLsizei uniformCount, const GLchar* const* uniformNames, GLuint* uniformIndices ) override
{
mImpl->GetUniformIndices( program, uniformCount, uniformNames, uniformIndices );
}
- void GetActiveUniformsiv( GLuint program, GLsizei uniformCount, const GLuint* uniformIndices, GLenum pname, GLint* params )
+ void GetActiveUniformsiv( GLuint program, GLsizei uniformCount, const GLuint* uniformIndices, GLenum pname, GLint* params ) override
{
mImpl->GetActiveUniformsiv( program, uniformCount, uniformIndices, pname, params );
}
- GLuint GetUniformBlockIndex( GLuint program, const GLchar* uniformBlockName )
+ GLuint GetUniformBlockIndex( GLuint program, const GLchar* uniformBlockName ) override
{
return mImpl->GetUniformBlockIndex( program, uniformBlockName );
}
- void GetActiveUniformBlockiv( GLuint program, GLuint uniformBlockIndex, GLenum pname, GLint* params )
+ void GetActiveUniformBlockiv( GLuint program, GLuint uniformBlockIndex, GLenum pname, GLint* params ) override
{
mImpl->GetActiveUniformBlockiv( program, uniformBlockIndex, pname, params );
}
- void GetActiveUniformBlockName( GLuint program, GLuint uniformBlockIndex, GLsizei bufSize, GLsizei* length, GLchar* uniformBlockName )
+ void GetActiveUniformBlockName( GLuint program, GLuint uniformBlockIndex, GLsizei bufSize, GLsizei* length, GLchar* uniformBlockName ) override
{
mImpl->GetActiveUniformBlockName( program, uniformBlockIndex, bufSize, length, uniformBlockName );
}
- void UniformBlockBinding( GLuint program, GLuint uniformBlockIndex, GLuint uniformBlockBinding )
+ void UniformBlockBinding( GLuint program, GLuint uniformBlockIndex, GLuint uniformBlockBinding ) override
{
mImpl->UniformBlockBinding( program, uniformBlockIndex, uniformBlockBinding );
}
- void DrawArraysInstanced( GLenum mode, GLint first, GLsizei count, GLsizei instanceCount )
+ void DrawArraysInstanced( GLenum mode, GLint first, GLsizei count, GLsizei instanceCount ) override
{
mImpl->DrawArraysInstanced( mode, first, count, instanceCount );
}
- void DrawElementsInstanced( GLenum mode, GLsizei count, GLenum type, const GLvoid* indices, GLsizei instanceCount )
+ void DrawElementsInstanced( GLenum mode, GLsizei count, GLenum type, const GLvoid* indices, GLsizei instanceCount ) override
{
mImpl->DrawElementsInstanced( mode, count, type, indices, instanceCount );
}
- GLsync FenceSync( GLenum condition, GLbitfield flags )
+ GLsync FenceSync( GLenum condition, GLbitfield flags ) override
{
return mImpl->FenceSync( condition, flags );
}
- GLboolean IsSync( GLsync sync )
+ GLboolean IsSync( GLsync sync ) override
{
return mImpl->IsSync( sync );
}
- void DeleteSync( GLsync sync )
+ void DeleteSync( GLsync sync ) override
{
mImpl->DeleteSync( sync );
}
- GLenum ClientWaitSync( GLsync sync, GLbitfield flags, GLuint64 timeout )
+ GLenum ClientWaitSync( GLsync sync, GLbitfield flags, GLuint64 timeout ) override
{
return mImpl->ClientWaitSync( sync, flags, timeout );
}
- void WaitSync( GLsync sync, GLbitfield flags, GLuint64 timeout )
+ void WaitSync( GLsync sync, GLbitfield flags, GLuint64 timeout ) override
{
mImpl->WaitSync( sync, flags, timeout );
}
- void GetInteger64v( GLenum pname, GLint64* params )
+ void GetInteger64v( GLenum pname, GLint64* params ) override
{
mImpl->GetInteger64v( pname, params );
}
- void GetSynciv( GLsync sync, GLenum pname, GLsizei bufSize, GLsizei* length, GLint* values )
+ void GetSynciv( GLsync sync, GLenum pname, GLsizei bufSize, GLsizei* length, GLint* values ) override
{
mImpl->GetSynciv( sync, pname, bufSize, length, values );
}
- void GetInteger64i_v( GLenum target, GLuint index, GLint64* data )
+ void GetInteger64i_v( GLenum target, GLuint index, GLint64* data ) override
{
mImpl->GetInteger64i_v( target, index, data );
}
- void GetBufferParameteri64v( GLenum target, GLenum pname, GLint64* params )
+ void GetBufferParameteri64v( GLenum target, GLenum pname, GLint64* params ) override
{
mImpl->GetBufferParameteri64v( target, pname, params );
}
- void GenSamplers( GLsizei count, GLuint* samplers )
+ void GenSamplers( GLsizei count, GLuint* samplers ) override
{
mImpl->GenSamplers( count, samplers );
}
- void DeleteSamplers( GLsizei count, const GLuint* samplers )
+ void DeleteSamplers( GLsizei count, const GLuint* samplers ) override
{
mImpl->DeleteSamplers( count, samplers );
}
- GLboolean IsSampler( GLuint sampler )
+ GLboolean IsSampler( GLuint sampler ) override
{
return mImpl->IsSampler( sampler );
}
- void BindSampler( GLuint unit, GLuint sampler )
+ void BindSampler( GLuint unit, GLuint sampler ) override
{
mImpl->BindSampler( unit, sampler );
}
- void SamplerParameteri( GLuint sampler, GLenum pname, GLint param )
+ void SamplerParameteri( GLuint sampler, GLenum pname, GLint param ) override
{
mImpl->SamplerParameteri( sampler, pname, param );
}
- void SamplerParameteriv( GLuint sampler, GLenum pname, const GLint* param )
+ void SamplerParameteriv( GLuint sampler, GLenum pname, const GLint* param ) override
{
mImpl->SamplerParameteriv( sampler, pname, param );
}
- void SamplerParameterf( GLuint sampler, GLenum pname, GLfloat param )
+ void SamplerParameterf( GLuint sampler, GLenum pname, GLfloat param ) override
{
mImpl->SamplerParameterf( sampler, pname, param );
}
- void SamplerParameterfv( GLuint sampler, GLenum pname, const GLfloat* param )
+ void SamplerParameterfv( GLuint sampler, GLenum pname, const GLfloat* param ) override
{
mImpl->SamplerParameterfv( sampler, pname, param );
}
- void GetSamplerParameteriv( GLuint sampler, GLenum pname, GLint* params )
+ void GetSamplerParameteriv( GLuint sampler, GLenum pname, GLint* params ) override
{
mImpl->GetSamplerParameteriv( sampler, pname, params );
}
- void GetSamplerParameterfv( GLuint sampler, GLenum pname, GLfloat* params )
+ void GetSamplerParameterfv( GLuint sampler, GLenum pname, GLfloat* params ) override
{
mImpl->GetSamplerParameterfv( sampler, pname, params );
}
- void VertexAttribDivisor( GLuint index, GLuint divisor )
+ void VertexAttribDivisor( GLuint index, GLuint divisor ) override
{
mImpl->VertexAttribDivisor( index, divisor );
}
- void BindTransformFeedback( GLenum target, GLuint id )
+ void BindTransformFeedback( GLenum target, GLuint id ) override
{
mImpl->BindTransformFeedback( target, id );
}
- void DeleteTransformFeedbacks( GLsizei n, const GLuint* ids )
+ void DeleteTransformFeedbacks( GLsizei n, const GLuint* ids ) override
{
mImpl->DeleteTransformFeedbacks( n, ids );
}
- void GenTransformFeedbacks( GLsizei n, GLuint* ids )
+ void GenTransformFeedbacks( GLsizei n, GLuint* ids ) override
{
mImpl->GenTransformFeedbacks( n, ids );
}
- GLboolean IsTransformFeedback( GLuint id )
+ GLboolean IsTransformFeedback( GLuint id ) override
{
return mImpl->IsTransformFeedback( id );
}
- void PauseTransformFeedback( void )
+ void PauseTransformFeedback( void ) override
{
mImpl->PauseTransformFeedback();
}
- void ResumeTransformFeedback( void )
+ void ResumeTransformFeedback( void ) override
{
mImpl->ResumeTransformFeedback();
}
- void GetProgramBinary( GLuint program, GLsizei bufSize, GLsizei* length, GLenum* binaryFormat, GLvoid* binary )
+ void GetProgramBinary( GLuint program, GLsizei bufSize, GLsizei* length, GLenum* binaryFormat, GLvoid* binary ) override
{
mImpl->GetProgramBinary( program, bufSize, length, binaryFormat, binary );
}
- void ProgramBinary( GLuint program, GLenum binaryFormat, const GLvoid* binary, GLsizei length )
+ void ProgramBinary( GLuint program, GLenum binaryFormat, const GLvoid* binary, GLsizei length ) override
{
mImpl->ProgramBinary( program, binaryFormat, binary, length );
}
- void ProgramParameteri( GLuint program, GLenum pname, GLint value )
+ void ProgramParameteri( GLuint program, GLenum pname, GLint value ) override
{
mImpl->ProgramParameteri( program, pname, value );
}
- void InvalidateFramebuffer( GLenum target, GLsizei numAttachments, const GLenum* attachments )
+ void InvalidateFramebuffer( GLenum target, GLsizei numAttachments, const GLenum* attachments ) override
{
mImpl->InvalidateFramebuffer( target, numAttachments, attachments );
}
- void InvalidateSubFramebuffer( GLenum target, GLsizei numAttachments, const GLenum* attachments, GLint x, GLint y, GLsizei width, GLsizei height )
+ void InvalidateSubFramebuffer( GLenum target, GLsizei numAttachments, const GLenum* attachments, GLint x, GLint y, GLsizei width, GLsizei height ) override
{
mImpl->InvalidateSubFramebuffer( target, numAttachments, attachments, x, y, width, height );
}
- void TexStorage2D( GLenum target, GLsizei levels, GLenum internalformat, GLsizei width, GLsizei height )
+ void TexStorage2D( GLenum target, GLsizei levels, GLenum internalformat, GLsizei width, GLsizei height ) override
{
mImpl->TexStorage2D( target, levels, internalformat, width, height );
}
- void TexStorage3D( GLenum target, GLsizei levels, GLenum internalformat, GLsizei width, GLsizei height, GLsizei depth )
+ void TexStorage3D( GLenum target, GLsizei levels, GLenum internalformat, GLsizei width, GLsizei height, GLsizei depth ) override
{
mImpl->TexStorage3D( target, levels, internalformat, width, height, depth );
}
- void GetInternalformativ( GLenum target, GLenum internalformat, GLenum pname, GLsizei bufSize, GLint* params )
+ void GetInternalformativ( GLenum target, GLenum internalformat, GLenum pname, GLsizei bufSize, GLint* params ) override
{
mImpl->GetInternalformativ( target, internalformat, pname, bufSize, params );
}
/**
* @copydoc GlAbstraction::PreRender();
*/
- virtual void PreRender();
+ void PreRender() override;
/**
* @copydoc GlAbstraction::PostRender();
*/
- virtual void PostRender();
+ void PostRender() override;
/* OpenGL ES 2.0 API */
- virtual void Clear( GLbitfield mask );
-
- virtual void GenBuffers( GLsizei n, GLuint* buffers );
- virtual void DeleteBuffers( GLsizei n, const GLuint* buffers );
- virtual void BindBuffer( GLenum target, GLuint buffer );
-
- virtual void GenTextures( GLsizei n, GLuint* textures );
- virtual void DeleteTextures( GLsizei n, const GLuint* textures );
- virtual void ActiveTexture( GLenum texture );
- virtual void BindTexture( GLenum target, GLuint texture );
-
- virtual void DrawArrays( GLenum mode, GLint first, GLsizei count );
- virtual void DrawElements( GLenum mode, GLsizei count, GLenum type, const void* indices );
-
- virtual void Uniform1f ( GLint location, GLfloat x );
- virtual void Uniform1fv( GLint location, GLsizei count, const GLfloat* v );
- virtual void Uniform1i ( GLint location, GLint x );
- virtual void Uniform1iv( GLint location, GLsizei count, const GLint* v );
- virtual void Uniform2f ( GLint location, GLfloat x, GLfloat y );
- virtual void Uniform2fv( GLint location, GLsizei count, const GLfloat* v );
- virtual void Uniform2i ( GLint location, GLint x, GLint y );
- virtual void Uniform2iv( GLint location, GLsizei count, const GLint* v );
- virtual void Uniform3f ( GLint location, GLfloat x, GLfloat y, GLfloat z );
- virtual void Uniform3fv( GLint location, GLsizei count, const GLfloat* v );
- virtual void Uniform3i ( GLint location, GLint x, GLint y, GLint z );
- virtual void Uniform3iv( GLint location, GLsizei count, const GLint* v );
- virtual void Uniform4f ( GLint location, GLfloat x, GLfloat y, GLfloat z, GLfloat w );
- virtual void Uniform4fv( GLint location, GLsizei count, const GLfloat* v );
- virtual void Uniform4i ( GLint location, GLint x, GLint y, GLint z, GLint w );
- virtual void Uniform4iv( GLint location, GLsizei count, const GLint* v );
- virtual void UniformMatrix2fv( GLint location, GLsizei count, GLboolean transpose, const GLfloat* value );
- virtual void UniformMatrix3fv( GLint location, GLsizei count, GLboolean transpose, const GLfloat* value );
- virtual void UniformMatrix4fv( GLint location, GLsizei count, GLboolean transpose, const GLfloat* value );
-
- virtual GLuint CreateProgram( void );
- virtual void DeleteProgram( GLuint program );
- virtual void UseProgram( GLuint program );
+ void Clear( GLbitfield mask ) override;
+
+ void GenBuffers( GLsizei n, GLuint* buffers ) override;
+ void DeleteBuffers( GLsizei n, const GLuint* buffers ) override;
+ void BindBuffer( GLenum target, GLuint buffer ) override;
+
+ void GenTextures( GLsizei n, GLuint* textures ) override;
+ void DeleteTextures( GLsizei n, const GLuint* textures ) override;
+ void ActiveTexture( GLenum texture ) override;
+ void BindTexture( GLenum target, GLuint texture ) override;
+
+ void DrawArrays( GLenum mode, GLint first, GLsizei count ) override;
+ void DrawElements( GLenum mode, GLsizei count, GLenum type, const void* indices ) override;
+
+ void Uniform1f ( GLint location, GLfloat x ) override;
+ void Uniform1fv( GLint location, GLsizei count, const GLfloat* v ) override;
+ void Uniform1i ( GLint location, GLint x ) override;
+ void Uniform1iv( GLint location, GLsizei count, const GLint* v ) override;
+ void Uniform2f ( GLint location, GLfloat x, GLfloat y ) override;
+ void Uniform2fv( GLint location, GLsizei count, const GLfloat* v ) override;
+ void Uniform2i ( GLint location, GLint x, GLint y ) override;
+ void Uniform2iv( GLint location, GLsizei count, const GLint* v ) override;
+ void Uniform3f ( GLint location, GLfloat x, GLfloat y, GLfloat z ) override;
+ void Uniform3fv( GLint location, GLsizei count, const GLfloat* v ) override;
+ void Uniform3i ( GLint location, GLint x, GLint y, GLint z ) override;
+ void Uniform3iv( GLint location, GLsizei count, const GLint* v ) override;
+ void Uniform4f ( GLint location, GLfloat x, GLfloat y, GLfloat z, GLfloat w ) override;
+ void Uniform4fv( GLint location, GLsizei count, const GLfloat* v ) override;
+ void Uniform4i ( GLint location, GLint x, GLint y, GLint z, GLint w ) override;
+ void Uniform4iv( GLint location, GLsizei count, const GLint* v ) override;
+ void UniformMatrix2fv( GLint location, GLsizei count, GLboolean transpose, const GLfloat* value ) override;
+ void UniformMatrix3fv( GLint location, GLsizei count, GLboolean transpose, const GLfloat* value ) override;
+ void UniformMatrix4fv( GLint location, GLsizei count, GLboolean transpose, const GLfloat* value ) override;
+
+ GLuint CreateProgram( void ) override;
+ void DeleteProgram( GLuint program ) override;
+ void UseProgram( GLuint program ) override;
private: // Helpers
/**
* Virtual Destructor
*/
- virtual ~FeedbackPlayer();
+ ~FeedbackPlayer() override;
// Undefined
FeedbackPlayer(const FeedbackPlayer&);
/**
* @brief Destructor
*/
- virtual ~AnimatedImageLoading() = default;
+ ~AnimatedImageLoading() override = default;
/**
* @copydoc Dali::AnimatedImageLoading::LoadNextNFrames()
*
* Release the pixel buffer if exists.
*/
- ~PixelBuffer();
+ ~PixelBuffer() override;
public:
/**
* @copydoc Dali::NativeImageSource::GetTextureTarget()
*/
- virtual int GetTextureTarget() const;
+ int GetTextureTarget() const override;
/**
* @copydoc Dali::NativeImageSource::GetCustomFragmentPrefix()
*/
- virtual const char* GetCustomFragmentPrefix() const;
+ const char* GetCustomFragmentPrefix() const override;
/**
* @copydoc Dali::NativeImageSource::GetCustomSamplerTypename()
*/
- virtual const char* GetCustomSamplerTypename() const;
+ const char* GetCustomSamplerTypename() const override;
/**
* @copydoc Dali::NativeImageSource::GetNativeImageHandle()
*/
- virtual Any GetNativeImageHandle() const;
+ Any GetNativeImageHandle() const override;
/**
* @copydoc Dali::NativeImageSource::SourceChanged()
*/
- virtual bool SourceChanged() const;
+ bool SourceChanged() const override;
/**
/**
* A reference counted object may only be deleted by calling Unreference()
*/
- virtual ~PhysicalKeyboard();
+ ~PhysicalKeyboard() override;
private:
/**
* Destructor
*/
- virtual ~TizenPlatformAbstraction();
+ ~TizenPlatformAbstraction() override;
public: // PlatformAbstraction overrides
/**
* @copydoc PlatformAbstraction::GetClosestImageSize()
*/
- virtual ImageDimensions GetClosestImageSize( const std::string& filename,
- ImageDimensions size,
- FittingMode::Type fittingMode,
- SamplingMode::Type samplingMode,
- bool orientationCorrection );
+ ImageDimensions GetClosestImageSize( const std::string& filename,
+ ImageDimensions size,
+ FittingMode::Type fittingMode,
+ SamplingMode::Type samplingMode,
+ bool orientationCorrection ) override;
/**
* @copydoc PlatformAbstraction::GetClosestImageSize()
*/
- virtual ImageDimensions GetClosestImageSize( Integration::ResourcePointer resourceBuffer,
- ImageDimensions size,
- FittingMode::Type fittingMode,
- SamplingMode::Type samplingMode,
- bool orientationCorrection );
+ ImageDimensions GetClosestImageSize( Integration::ResourcePointer resourceBuffer,
+ ImageDimensions size,
+ FittingMode::Type fittingMode,
+ SamplingMode::Type samplingMode,
+ bool orientationCorrection ) override;
/**
* @copydoc PlatformAbstraction::LoadImageSynchronously()
*/
- virtual Integration::ResourcePointer LoadImageSynchronously(const Integration::BitmapResourceType& resource, const std::string& resourcePath);
+ Integration::ResourcePointer LoadImageSynchronously(const Integration::BitmapResourceType& resource, const std::string& resourcePath) override;
/**
* @copydoc PlatformAbstraction::DecodeBuffer()
*/
- virtual Integration::BitmapPtr DecodeBuffer( const Integration::BitmapResourceType& resource, uint8_t * buffer, size_t size );
+ Integration::BitmapPtr DecodeBuffer( const Integration::BitmapResourceType& resource, uint8_t * buffer, size_t size ) override;
/**
* @copydoc PlatformAbstraction::LoadShaderBinaryFile()
*/
- virtual bool LoadShaderBinaryFile( const std::string& filename, Dali::Vector< unsigned char >& buffer ) const;
+ bool LoadShaderBinaryFile( const std::string& filename, Dali::Vector< unsigned char >& buffer ) const override;
/**
* @copydoc PlatformAbstraction::SaveShaderBinaryFile()
*/
- virtual bool SaveShaderBinaryFile( const std::string& filename, const unsigned char * buffer, unsigned int numBytes ) const;
+ bool SaveShaderBinaryFile( const std::string& filename, const unsigned char * buffer, unsigned int numBytes ) const override;
/**
* @copydoc PlatformAbstraction::StartTimer()
*/
- virtual uint32_t StartTimer( uint32_t milliseconds, CallbackBase* callback );
+ uint32_t StartTimer( uint32_t milliseconds, CallbackBase* callback ) override;
/**
* @copydoc PlatformAbstraction::CancelTimer()
*/
- virtual void CancelTimer ( uint32_t timerId );
+ void CancelTimer ( uint32_t timerId ) override;
/**
* Sets path for data/resource storage.
/**
* @copydoc ClientSendDataInterface::ClientSendDataInterface()
*/
- virtual void SendData( const char* const data, unsigned int bufferSizeInBytes, unsigned int clientId );
+ void SendData( const char* const data, unsigned int bufferSizeInBytes, unsigned int clientId ) override;
private:
/**
* @brief destructor
*/
- virtual ~SocketFactory()
+ ~SocketFactory() override
{
}
/**
* @copydoc SocketFactoryInterface::NewSocket()
*/
- virtual SocketInterface* NewSocket( SocketInterface::Protocol protocol );
+ SocketInterface* NewSocket( SocketInterface::Protocol protocol ) override;
/**
* @copydoc SocketFactoryInterface::DestroySocket()
*/
- virtual void DestroySocket( SocketInterface* socket );
+ void DestroySocket( SocketInterface* socket ) override;
};
/**
* @copydoc Dali::Internal::Adaptor::SocketIsOpen()
*/
- virtual bool SocketIsOpen() const;
+ bool SocketIsOpen() const override;
/**
* @copydoc Dali::Internal::Adaptor::SocketInterface::CloseSocket
*/
- virtual bool CloseSocket();
+ bool CloseSocket() override;
/**
* @copydoc Dali::Internal::Adaptor::SocketInterface::Bind
*/
- virtual bool Bind( uint16_t port ) ;
+ bool Bind( uint16_t port ) override;
/**
* @copydoc Dali::Internal::Adaptor::SocketInterface::Listen
*/
- virtual bool Listen( int blacklog);
+ bool Listen( int blacklog) override;
/**
* @copydoc Dali::Internal::Adaptor::SocketInterface::Accept
*/
- virtual SocketInterface* Accept() const ;
+ SocketInterface* Accept() const override;
/**
* @copydoc Dali::Internal::Adaptor::SocketInterface::Select
*/
- virtual SelectReturn Select( );
+ SelectReturn Select( ) override;
/**
* @copydoc Dali::Internal::Adaptor::SocketInterface::ExitSelect
*/
- virtual void ExitSelect();
+ void ExitSelect() override;
/**
* @copydoc Dali::Internal::Adaptor::SocketInterface::Recieve
*/
- virtual bool Read( void* buffer, unsigned int bufferSizeInBytes, unsigned int& bytesRead );
+ bool Read( void* buffer, unsigned int bufferSizeInBytes, unsigned int& bytesRead ) override;
/**
* @copydoc Dali::Internal::Adaptor::SocketInterface::Send
*/
- virtual bool Write( const void* buffer, unsigned int bufferLength );
+ bool Write( const void* buffer, unsigned int bufferLength ) override;
/**
* @copydoc Dali::Internal::Adaptor::SocketInterface::ReuseAddress
*/
- virtual bool ReuseAddress( bool reUse );
+ bool ReuseAddress( bool reUse ) override;
/**
* @copydoc Dali::Internal::Adaptor::SocketInterface::SetBufferSize
*
*/
- virtual bool SetBufferSize( SocketInterface::BufferType type, unsigned int bufferSizeInBytes );
+ bool SetBufferSize( SocketInterface::BufferType type, unsigned int bufferSizeInBytes ) override;
/**
* @brief Virtual destructor
/**
* Virtual Destructor.
*/
- virtual ~StyleMonitor();
+ ~StyleMonitor() override;
private:
/**
* @copydoc CallbackManager::AddIdleCallback()
*/
- virtual bool AddIdleCallback( CallbackBase* callback, bool hasReturnValue );
+ bool AddIdleCallback( CallbackBase* callback, bool hasReturnValue ) override;
/**
* @copydoc CallbackManager::RemoveIdleCallback()
*/
- virtual void RemoveIdleCallback( CallbackBase* callback );
+ void RemoveIdleCallback( CallbackBase* callback ) override;
/**
* @copydoc CallbackManager::ProcessIdle()
*/
- virtual bool ProcessIdle();
+ bool ProcessIdle() override;
/**
* @copydoc CallbackManager::ProcessIdle()
*/
- virtual void ClearIdleCallbacks();
+ void ClearIdleCallbacks() override;
/**
* @copydoc CallbackManager::AddIdleEntererCallback()
*/
- virtual bool AddIdleEntererCallback( CallbackBase* callback );
+ bool AddIdleEntererCallback( CallbackBase* callback ) override;
/**
* @copydoc CallbackManager::RemoveIdleEntererCallback()
*/
- virtual void RemoveIdleEntererCallback( CallbackBase* callback );
+ void RemoveIdleEntererCallback( CallbackBase* callback ) override;
/**
* @copydoc CallbackManager::Start()
*/
- virtual void Start();
+ void Start() override;
/**
* @copydoc CallbackManager::Stop()
*/
- virtual void Stop();
+ void Stop() override;
private:
/**
* @brief Destructor.
*/
- virtual ~ColorController();
+ ~ColorController() override;
private:
/**
* Install the log function for the current thread.
*/
- virtual void InstallLogFunction() const;
+ void InstallLogFunction() const override;
/**
* Un-install the log function for the current thread.
/**
* Destructor
*/
- virtual ~KernelTrace();
+ ~KernelTrace() override;
/**
* @copydoc KernelTracerInterface::KernelTrace()
*/
- virtual void Trace( const PerformanceMarker& marker, const std::string& traceMessage );
+ void Trace( const PerformanceMarker& marker, const std::string& traceMessage ) override;
private:
/**
* Destructor.
*/
- virtual ~PerformanceLogger();
+ ~PerformanceLogger() override;
/**
* Add a performance marker
/**
* @copydoc PerformanceLogger::AddContext()
*/
- virtual ContextId AddContext( const char* name );
+ ContextId AddContext( const char* name ) override;
/**
* @copydoc PerformanceLogger::RemoveContext()
*/
- virtual void RemoveContext( ContextId contextId );
+ void RemoveContext( ContextId contextId ) override;
/**
* @copydoc PerformanceInterface::AddMarker( MarkerType markerType )
*/
- virtual void AddMarker( MarkerType markerType );
+ void AddMarker( MarkerType markerType ) override;
/**
* @copydoc PerformanceLogger::AddMarker( MarkerType markerType, ContextId contextId )
*/
- virtual void AddMarker( MarkerType markerType, ContextId contextId );
+ void AddMarker( MarkerType markerType, ContextId contextId ) override;
/**
* @copydoc PerformanceInterface::SetLogging()
/**
* @copydoc PerformanceLogger::SetLoggingFrequency()
*/
- virtual void SetLoggingFrequency( unsigned int logFrequency, ContextId contextId );
+ void SetLoggingFrequency( unsigned int logFrequency, ContextId contextId ) override;
/**
* @copydoc PerformanceLogger::EnableLogging()
*/
- virtual void EnableLogging( bool enable, ContextId contextId );
+ void EnableLogging( bool enable, ContextId contextId ) override;
public: //StatLogInterface
/**
* @copydoc StatLogInterface::LogContextStatistics()
*/
- virtual void LogContextStatistics( const char* const text );
+ void LogContextStatistics( const char* const text ) override;
private:
/**
* Destructor
*/
- virtual ~SoundPlayer();
+ ~SoundPlayer() override;
/**
* Emits the SoundPlayFinished signal.
/**
* Destructor
*/
- virtual ~SystemTrace();
+ ~SystemTrace() override;
/**
* @copydoc KernelTracerInterface::KernelTrace()
*/
- virtual void Trace( const PerformanceMarker& marker, const std::string& traceMessage );
+ void Trace( const PerformanceMarker& marker, const std::string& traceMessage ) override;
};
/**
* @copydoc Dali::Timer::Start()
*/
- virtual void Start();
+ void Start() override;
/**
* @copydoc Dali::Timer::Stop()
*/
- virtual void Stop();
+ void Stop() override;
/**
* @copydoc Dali::Timer::Pause()
*/
- virtual void Pause();
+ void Pause() override;
/**
* @copydoc Dali::Timer::Resume()
*/
- virtual void Resume();
+ void Resume() override;
/**
* @copydoc Dali::Timer::SetInterval()
*/
- virtual void SetInterval( unsigned int interval, bool restart );
+ void SetInterval( unsigned int interval, bool restart ) override;
/**
* @copydoc Dali::Timer::GetInterval()
*/
- virtual unsigned int GetInterval() const;
+ unsigned int GetInterval() const override;
/**
* @copydoc Dali::Timer::IsRunning()
*/
- virtual bool IsRunning() const;
+ bool IsRunning() const override;
/**
* Tick
/**
* @copydoc CallbackManager::AddIdleCallback()
*/
- virtual bool AddIdleCallback( CallbackBase* callback, bool hasReturnValue );
+ bool AddIdleCallback( CallbackBase* callback, bool hasReturnValue ) override;
/**
* @copydoc CallbackManager::RemoveIdleCallback()
*/
- virtual void RemoveIdleCallback( CallbackBase* callback );
+ void RemoveIdleCallback( CallbackBase* callback ) override;
/**
* @copydoc CallbackManager::ProcessIdle()
*/
- virtual bool ProcessIdle();
+ bool ProcessIdle() override;
/**
* @copydoc CallbackManager::ProcessIdle()
*/
- virtual void ClearIdleCallbacks();
+ void ClearIdleCallbacks() override;
/**
* @copydoc CallbackManager::AddIdleEntererCallback()
*/
- virtual bool AddIdleEntererCallback( CallbackBase* callback );
+ bool AddIdleEntererCallback( CallbackBase* callback ) override;
/**
* @copydoc CallbackManager::RemoveIdleEntererCallback()
*/
- virtual void RemoveIdleEntererCallback( CallbackBase* callback );
+ void RemoveIdleEntererCallback( CallbackBase* callback ) override;
/**
* @copydoc CallbackManager::Start()
*/
- virtual void Start();
+ void Start() override;
/**
* @copydoc CallbackManager::Stop()
*/
- virtual void Stop();
+ void Stop() override;
private:
/**
* @copydoc Dali::Internal::Adaptor::Application::OnInit()
*/
- virtual void OnInit();
+ void OnInit() override;
/**
* @copydoc Dali::WidgetApplication::RegisterWidgetCreator()
/**
* @copydoc CallbackManager::AddIdleCallback()
*/
- virtual bool AddIdleCallback( CallbackBase* callback, bool hasReturnValue );
+ bool AddIdleCallback( CallbackBase* callback, bool hasReturnValue ) override;
/**
* @copydoc CallbackManager::RemoveIdleCallback()
*/
- virtual void RemoveIdleCallback( CallbackBase* callback );
+ void RemoveIdleCallback( CallbackBase* callback ) override;
/**
* @copydoc CallbackManager::ProcessIdle()
*/
- virtual bool ProcessIdle();
+ bool ProcessIdle() override;
/**
* @copydoc CallbackManager::ClearIdleCallbacks()
*/
- virtual void ClearIdleCallbacks();
+ void ClearIdleCallbacks() override;
/**
* @brief Adds a @p callback to be run when entering an idle state.
*
* @return true on success
*/
- virtual bool AddIdleEntererCallback( CallbackBase* callback );
+ bool AddIdleEntererCallback( CallbackBase* callback ) override;
/**
* @brief Removes a previously added the idle enterer callback.
*
* @param[in] callback The callback to be removed.
*/
- virtual void RemoveIdleEntererCallback( CallbackBase* callback );
+ void RemoveIdleEntererCallback( CallbackBase* callback ) override;
/**
* @copydoc CallbackManager::Start()
*/
- virtual void Start();
+ void Start() override;
/**
* @copydoc CallbackManager::Stop()
*/
- virtual void Stop();
+ void Stop() override;
private:
std::set<CallbackBase*> mCallbacks;
/**
* Obtain the LogContextFunction method (Android specific) used for tracing
*/
- virtual Dali::Integration::Trace::LogContextFunction GetLogContextFunction() final;
+ Dali::Integration::Trace::LogContextFunction GetLogContextFunction() final;
private:
/**
* Obtain the LogContextFunction method (Generic specific) used for tracing
*/
- virtual Dali::Integration::Trace::LogContextFunction GetLogContextFunction() final;
+ Dali::Integration::Trace::LogContextFunction GetLogContextFunction() final;
private:
/**
* Obtain the LogContextFunction method (Tizen specific) used for tracing
*/
- virtual Dali::Integration::Trace::LogContextFunction GetLogContextFunction() final;
+ Dali::Integration::Trace::LogContextFunction GetLogContextFunction() final;
private:
/**
* @copydoc Dali::Internal::Adaptor::WindowBase::GetNativeWindow()
*/
- virtual Any GetNativeWindow() override;
+ Any GetNativeWindow() override;
/**
* @copydoc Dali::Internal::Adaptor::WindowBase::GetNativeWindowId()
*/
- virtual int GetNativeWindowId() override;
+ int GetNativeWindowId() override;
/**
* @copydoc Dali::Internal::Adaptor::WindowBase::CreateEglWindow()
*/
- virtual EGLNativeWindowType CreateEglWindow( int width, int height ) override;
+ EGLNativeWindowType CreateEglWindow( int width, int height ) override;
/**
* @copydoc Dali::Internal::Adaptor::WindowBase::DestroyEglWindow()
*/
- virtual void DestroyEglWindow() override;
+ void DestroyEglWindow() override;
/**
* @copydoc Dali::Internal::Adaptor::WindowBase::SetEglWindowRotation()
*/
- virtual void SetEglWindowRotation( int angle ) override;
+ void SetEglWindowRotation( int angle ) override;
/**
* @copydoc Dali::Internal::Adaptor::WindowBase::SetEglWindowBufferTransform()
*/
- virtual void SetEglWindowBufferTransform( int angle ) override;
+ void SetEglWindowBufferTransform( int angle ) override;
/**
* @copydoc Dali::Internal::Adaptor::WindowBase::SetEglWindowTransform()
*/
- virtual void SetEglWindowTransform( int angle ) override;
+ void SetEglWindowTransform( int angle ) override;
/**
* @copydoc Dali::Internal::Adaptor::WindowBase::ResizeEglWindow()
*/
- virtual void ResizeEglWindow( PositionSize positionSize ) override;
+ void ResizeEglWindow( PositionSize positionSize ) override;
/**
* @copydoc Dali::Internal::Adaptor::WindowBase::IsEglWindowRotationSupported()
*/
- virtual bool IsEglWindowRotationSupported() override;
+ bool IsEglWindowRotationSupported() override;
/**
* @copydoc Dali::Internal::Adaptor::WindowBase::Move()
*/
- virtual void Move( PositionSize positionSize ) override;
+ void Move( PositionSize positionSize ) override;
/**
* @copydoc Dali::Internal::Adaptor::WindowBase::Resize()
*/
- virtual void Resize( PositionSize positionSize ) override;
+ void Resize( PositionSize positionSize ) override;
/**
* @copydoc Dali::Internal::Adaptor::WindowBase::MoveResize()
*/
- virtual void MoveResize( PositionSize positionSize ) override;
+ void MoveResize( PositionSize positionSize ) override;
/**
* @copydoc Dali::Internal::Adaptor::WindowBase::SetClass()
*/
- virtual void SetClass( const std::string& name, const std::string& className ) override;
+ void SetClass( const std::string& name, const std::string& className ) override;
/**
* @copydoc Dali::Internal::Adaptor::WindowBase::Raise()
*/
- virtual void Raise() override;
+ void Raise() override;
/**
* @copydoc Dali::Internal::Adaptor::WindowBase::Lower()
*/
- virtual void Lower() override;
+ void Lower() override;
/**
* @copydoc Dali::Internal::Adaptor::WindowBase::Activate()
*/
- virtual void Activate() override;
+ void Activate() override;
/**
* @copydoc Dali::Internal::Adaptor::WindowBase::SetAvailableAnlges()
*/
- virtual void SetAvailableAnlges( const std::vector< int >& angles ) override;
+ void SetAvailableAnlges( const std::vector< int >& angles ) override;
/**
* @copydoc Dali::Internal::Adaptor::WindowBase::SetPreferredAngle()
*/
- virtual void SetPreferredAngle( int angle ) override;
+ void SetPreferredAngle( int angle ) override;
/**
* @copydoc Dali::Internal::Adaptor::WindowBase::SetAcceptFocus()
*/
- virtual void SetAcceptFocus( bool accept ) override;
+ void SetAcceptFocus( bool accept ) override;
/**
* @copydoc Dali::Internal::Adaptor::WindowBase::Show()
*/
- virtual void Show() override;
+ void Show() override;
/**
* @copydoc Dali::Internal::Adaptor::WindowBase::Hide()
*/
- virtual void Hide() override;
+ void Hide() override;
/**
* @copydoc Dali::Internal::Adaptor::WindowBase::GetSupportedAuxiliaryHintCount()
*/
- virtual unsigned int GetSupportedAuxiliaryHintCount() const override;
+ unsigned int GetSupportedAuxiliaryHintCount() const override;
/**
* @copydoc Dali::Internal::Adaptor::WindowBase::GetSupportedAuxiliaryHint()
*/
- virtual std::string GetSupportedAuxiliaryHint( unsigned int index ) const override;
+ std::string GetSupportedAuxiliaryHint( unsigned int index ) const override;
/**
* @copydoc Dali::Internal::Adaptor::WindowBase::AddAuxiliaryHint()
*/
- virtual unsigned int AddAuxiliaryHint( const std::string& hint, const std::string& value ) override;
+ unsigned int AddAuxiliaryHint( const std::string& hint, const std::string& value ) override;
/**
* @copydoc Dali::Internal::Adaptor::WindowBase::RemoveAuxiliaryHint()
*/
- virtual bool RemoveAuxiliaryHint( unsigned int id ) override;
+ bool RemoveAuxiliaryHint( unsigned int id ) override;
/**
* @copydoc Dali::Internal::Adaptor::WindowBase::SetAuxiliaryHintValue()
*/
- virtual bool SetAuxiliaryHintValue( unsigned int id, const std::string& value ) override;
+ bool SetAuxiliaryHintValue( unsigned int id, const std::string& value ) override;
/**
* @copydoc Dali::Internal::Adaptor::WindowBase::GetAuxiliaryHintValue()
*/
- virtual std::string GetAuxiliaryHintValue( unsigned int id ) const override;
+ std::string GetAuxiliaryHintValue( unsigned int id ) const override;
/**
* @copydoc Dali::Internal::Adaptor::WindowBase::GetAuxiliaryHintId()
*/
- virtual unsigned int GetAuxiliaryHintId( const std::string& hint ) const override;
+ unsigned int GetAuxiliaryHintId( const std::string& hint ) const override;
/**
* @copydoc Dali::Internal::Adaptor::WindowBase::SetInputRegion()
*/
- virtual void SetInputRegion( const Rect< int >& inputRegion ) override;
+ void SetInputRegion( const Rect< int >& inputRegion ) override;
/**
* @copydoc Dali::Internal::Adaptor::WindowBase::SetType()
*/
- virtual void SetType( Dali::Window::Type type ) override;
+ void SetType( Dali::Window::Type type ) override;
/**
* @copydoc Dali::Internal::Adaptor::WindowBase::SetNotificationLevel()
*/
- virtual bool SetNotificationLevel( Dali::Window::NotificationLevel::Type level ) override;
+ bool SetNotificationLevel( Dali::Window::NotificationLevel::Type level ) override;
/**
* @copydoc Dali::Internal::Adaptor::WindowBase::GetNotificationLevel()
*/
- virtual Dali::Window::NotificationLevel::Type GetNotificationLevel() const override;
+ Dali::Window::NotificationLevel::Type GetNotificationLevel() const override;
/**
* @copydoc Dali::Internal::Adaptor::WindowBase::SetOpaqueState()
*/
- virtual void SetOpaqueState( bool opaque ) override;
+ void SetOpaqueState( bool opaque ) override;
/**
* @copydoc Dali::Internal::Adaptor::WindowBase::SetScreenOffMode()
*/
- virtual bool SetScreenOffMode(Dali::Window::ScreenOffMode::Type screenOffMode) override;
+ bool SetScreenOffMode(Dali::Window::ScreenOffMode::Type screenOffMode) override;
/**
* @copydoc Dali::Internal::Adaptor::WindowBase::GetScreenOffMode()
*/
- virtual Dali::Window::ScreenOffMode::Type GetScreenOffMode() const override;
+ Dali::Window::ScreenOffMode::Type GetScreenOffMode() const override;
/**
* @copydoc Dali::Internal::Adaptor::WindowBase::SetBrightness()
*/
- virtual bool SetBrightness( int brightness ) override;
+ bool SetBrightness( int brightness ) override;
/**
* @copydoc Dali::Internal::Adaptor::WindowBase::GetBrightness()
*/
- virtual int GetBrightness() const override;
+ int GetBrightness() const override;
/**
* @copydoc Dali::Internal::Adaptor::WindowBase::GrabKey()
*/
- virtual bool GrabKey( Dali::KEY key, KeyGrab::KeyGrabMode grabMode ) override;
+ bool GrabKey( Dali::KEY key, KeyGrab::KeyGrabMode grabMode ) override;
/**
* @copydoc Dali::Internal::Adaptor::WindowBase::UngrabKey()
*/
- virtual bool UngrabKey( Dali::KEY key ) override;
+ bool UngrabKey( Dali::KEY key ) override;
/**
* @copydoc Dali::Internal::Adaptor::WindowBase::GrabKeyList()
*/
- virtual bool GrabKeyList( const Dali::Vector< Dali::KEY >& key, const Dali::Vector< KeyGrab::KeyGrabMode >& grabMode, Dali::Vector< bool >& result ) override;
+ bool GrabKeyList( const Dali::Vector< Dali::KEY >& key, const Dali::Vector< KeyGrab::KeyGrabMode >& grabMode, Dali::Vector< bool >& result ) override;
/**
* @copydoc Dali::Internal::Adaptor::WindowBase::UngrabKeyList()
*/
- virtual bool UngrabKeyList( const Dali::Vector< Dali::KEY >& key, Dali::Vector< bool >& result ) override;
+ bool UngrabKeyList( const Dali::Vector< Dali::KEY >& key, Dali::Vector< bool >& result ) override;
/**
* @copydoc Dali::Internal::Adaptor::WindowBase::GetDpi()
*/
- virtual void GetDpi( unsigned int& dpiHorizontal, unsigned int& dpiVertical ) override;
+ void GetDpi( unsigned int& dpiHorizontal, unsigned int& dpiVertical ) override;
/**
* @copydoc Dali::Internal::Adaptor::WindowBase::GetScreenRotationAngle()
*/
- virtual int GetScreenRotationAngle() override;
+ int GetScreenRotationAngle() override;
/**
* @copydoc Dali::Internal::Adaptor::WindowBase::SetWindowRotationAngle()
*/
- virtual void SetWindowRotationAngle( int degree ) override;
+ void SetWindowRotationAngle( int degree ) override;
/**
* @copydoc Dali::Internal::Adaptor::WindowBase::WindowRotationCompleted()
*/
- virtual void WindowRotationCompleted( int degree, int width, int height ) override;
+ void WindowRotationCompleted( int degree, int width, int height ) override;
/**
* @copydoc Dali::Internal::Adaptor::WindowBase::SetTransparency()
*/
- virtual void SetTransparency( bool transparent ) override;
+ void SetTransparency( bool transparent ) override;
/**
* @copydoc Dali::Internal::Adaptor::WindowBase::SetParent()
*/
- virtual void SetParent( WindowBase* parentWinBase ) override;
+ void SetParent( WindowBase* parentWinBase ) override;
/**
* @copydoc Dali::Internal::Adaptor::WindowBase::CreateFrameRenderedSyncFence()
*/
- virtual int CreateFrameRenderedSyncFence() override;
+ int CreateFrameRenderedSyncFence() override;
/**
* @copydoc Dali::Internal::Adaptor::WindowBase::CreateFramePresentedSyncFence()
*/
- virtual int CreateFramePresentedSyncFence() override;
+ int CreateFramePresentedSyncFence() override;
private:
/**
* Destructor.
*/
- ~EventHandler();
+ ~EventHandler() override;
/**
* Called when the adaptor is paused.
/**
* Destructor
*/
- virtual ~Orientation();
+ ~Orientation() override;
public:
return mKeyboardRepeatSettingsChangedSignal;
}
+WindowBase::WindowRedrawRequestSignalType& WindowBase::WindowRedrawRequestSignal()
+{
+ return mWindowRedrawRequestSignal;
+}
+
} // namespace Adaptor
} // namespace Internal
typedef Signal< void ( const RotationEvent& ) > RotationSignalType;
typedef Signal< void ( DevelWindow::EffectState, DevelWindow::EffectType ) > TransitionEffectEventSignalType;
typedef Signal< void ( ) > KeyboardRepeatSettingsChangedSignalType;
+ typedef Signal< void ( ) > WindowRedrawRequestSignalType;
// Input events
typedef Signal< void ( Integration::Point&, uint32_t ) > TouchEventSignalType;
*/
KeyboardRepeatSettingsChangedSignalType& KeyboardRepeatSettingsChangedSignal();
+ /**
+ * @brief This signal is emitted when the window redraw is requested.
+ */
+ WindowRedrawRequestSignalType& WindowRedrawRequestSignal();
+
protected:
// Undefined
AccessibilitySignalType mAccessibilitySignal;
TransitionEffectEventSignalType mTransitionEffectEventSignal;
KeyboardRepeatSettingsChangedSignalType mKeyboardRepeatSettingsChangedSignal;
+ WindowRedrawRequestSignalType mWindowRedrawRequestSignal;
};
} // namespace Adaptor
mWindowBase->DeleteRequestSignal().Connect( this, &Window::OnDeleteRequest );
mWindowBase->TransitionEffectEventSignal().Connect( this, &Window::OnTransitionEffectEvent );
mWindowBase->KeyboardRepeatSettingsChangedSignal().Connect( this, &Window::OnKeyboardRepeatSettingsChanged );
+ mWindowBase->WindowRedrawRequestSignal().Connect( this, &Window::OnWindowRedrawRequest );
mWindowSurface->OutputTransformedSignal().Connect( this, &Window::OnOutputTransformed );
{
mWindowBase->Raise();
- GraphicsInterface& graphics = mAdaptor->GetGraphicsInterface();
- EglGraphics* eglGraphics = static_cast<EglGraphics*>(&graphics);
- if (eglGraphics)
- {
- eglGraphics->SetFullSwapNextFrame();
- }
+ mSurface->SetFullSwapNextFrame();
DALI_LOG_RELEASE_INFO( "Window (%p), WinId (%d), Raise() \n", this, mNativeWindowId );
}
{
mWindowBase->Lower();
- GraphicsInterface& graphics = mAdaptor->GetGraphicsInterface();
- EglGraphics* eglGraphics = static_cast<EglGraphics*>(&graphics);
- if (eglGraphics)
- {
- eglGraphics->SetFullSwapNextFrame();
- }
+ mSurface->SetFullSwapNextFrame();
DALI_LOG_RELEASE_INFO( "Window (%p), WinId (%d), Lower() \n", this, mNativeWindowId );
}
{
mWindowBase->Activate();
- GraphicsInterface& graphics = mAdaptor->GetGraphicsInterface();
- EglGraphics* eglGraphics = static_cast<EglGraphics*>(&graphics);
- if (eglGraphics)
- {
- eglGraphics->SetFullSwapNextFrame();
- }
+ mSurface->SetFullSwapNextFrame();
DALI_LOG_RELEASE_INFO( "Window (%p), WinId (%d), Activate() \n", this, mNativeWindowId );
}
mVisibilityChangedSignal.Emit( handle, true );
}
- GraphicsInterface& graphics = mAdaptor->GetGraphicsInterface();
- EglGraphics* eglGraphics = static_cast<EglGraphics*>(&graphics);
- if (eglGraphics)
- {
- eglGraphics->SetFullSwapNextFrame();
- }
+ mSurface->SetFullSwapNextFrame();
DALI_LOG_RELEASE_INFO( "Window (%p), WinId (%d), Show(): iconified = %d, visible = %d\n", this, mNativeWindowId, mIconified, mVisible );
}
mVisibilityChangedSignal.Emit( handle, false );
}
-
- GraphicsInterface& graphics = mAdaptor->GetGraphicsInterface();
- EglGraphics* eglGraphics = static_cast<EglGraphics*>(&graphics);
- if (eglGraphics)
- {
- eglGraphics->SetFullSwapNextFrame();
- }
-
DALI_LOG_RELEASE_INFO( "Window (%p), WinId (%d), Hide(): iconified = %d, visible = %d\n", this, mNativeWindowId, mIconified, mVisible );
}
{
mWindowBase->SetInputRegion( inputRegion );
- GraphicsInterface& graphics = mAdaptor->GetGraphicsInterface();
- EglGraphics* eglGraphics = static_cast<EglGraphics*>(&graphics);
- if (eglGraphics)
- {
- eglGraphics->SetFullSwapNextFrame();
- }
-
DALI_LOG_INFO( gWindowLogFilter, Debug::Verbose, "Window::SetInputRegion: x = %d, y = %d, w = %d, h = %d\n", inputRegion.x, inputRegion.y, inputRegion.width, inputRegion.height );
}
mAdaptor->SurfaceResizeComplete( mSurface.get(), newSize );
}
- GraphicsInterface& graphics = mAdaptor->GetGraphicsInterface();
- EglGraphics* eglGraphics = static_cast<EglGraphics*>(&graphics);
- if (eglGraphics)
- {
- eglGraphics->SetFullSwapNextFrame();
- }
+ mSurface->SetFullSwapNextFrame();
}
Dali::Window::WindowSize Window::GetSize() const
mWindowSurface->MoveResize( PositionSize( position.GetX(), position.GetY(), oldRect.width, oldRect.height ) );
- GraphicsInterface& graphics = mAdaptor->GetGraphicsInterface();
- EglGraphics* eglGraphics = static_cast<EglGraphics*>(&graphics);
- if (eglGraphics)
- {
- eglGraphics->SetFullSwapNextFrame();
- }
+ mSurface->SetFullSwapNextFrame();
}
Dali::Window::WindowPosition Window::GetPosition() const
mAdaptor->SurfaceResizeComplete( mSurface.get(), newSize );
}
- GraphicsInterface& graphics = mAdaptor->GetGraphicsInterface();
- EglGraphics* eglGraphics = static_cast<EglGraphics*>(&graphics);
- if (eglGraphics)
- {
- eglGraphics->SetFullSwapNextFrame();
- }
+ mSurface->SetFullSwapNextFrame();
}
Dali::Layer Window::GetRootLayer() const
DALI_LOG_RELEASE_INFO( "Window (%p), WinId (%d), Deiconified: visible = %d\n", this, mNativeWindowId, mVisible );
}
- GraphicsInterface& graphics = mAdaptor->GetGraphicsInterface();
- EglGraphics* eglGraphics = static_cast<EglGraphics*>(&graphics);
- if (eglGraphics)
- {
- eglGraphics->SetFullSwapNextFrame();
- }
+ mSurface->SetFullSwapNextFrame();
}
void Window::OnFocusChanged( bool focusIn )
Dali::Window handle( this );
mFocusChangeSignal.Emit( handle, focusIn );
- GraphicsInterface& graphics = mAdaptor->GetGraphicsInterface();
- EglGraphics* eglGraphics = static_cast<EglGraphics*>(&graphics);
- if (eglGraphics)
- {
- eglGraphics->SetFullSwapNextFrame();
- }
+ mSurface->SetFullSwapNextFrame();
}
void Window::OnOutputTransformed()
mKeyboardRepeatSettingsChangedSignal.Emit();
}
+void Window::OnWindowRedrawRequest()
+{
+ mAdaptor->RenderOnce();
+}
+
void Window::OnTouchPoint( Dali::Integration::Point& point, int timeStamp )
{
FeedTouchPoint( point, timeStamp );
{
mEventHandler->Pause();
}
-
- GraphicsInterface& graphics = mAdaptor->GetGraphicsInterface();
- EglGraphics* eglGraphics = static_cast<EglGraphics*>(&graphics);
- if (eglGraphics)
- {
- eglGraphics->SetFullSwapNextFrame();
- }
}
void Window::OnResume()
mEventHandler->Resume();
}
- GraphicsInterface& graphics = mAdaptor->GetGraphicsInterface();
- EglGraphics* eglGraphics = static_cast<EglGraphics*>(&graphics);
- if (eglGraphics)
- {
- eglGraphics->SetFullSwapNextFrame();
- }
+ mSurface->SetFullSwapNextFrame();
}
void Window::RecalculateTouchPosition( Integration::Point& point )
return mWindowBase->GetNativeWindowId();
}
-void Window::SetDamagedAreas(std::vector<Dali::Rect<int>>& areas)
-{
- GraphicsInterface& graphics = mAdaptor->GetGraphicsInterface();
- EglGraphics* eglGraphics = static_cast<EglGraphics*>(&graphics);
- if (eglGraphics)
- {
- eglGraphics->SetDamagedAreas(areas);
- }
-}
-
} // Adaptor
} // Internal
*/
void SetAvailableOrientations( const Dali::Vector<Dali::Window::WindowOrientation>& orientations );
- /**
- * @copydoc Dali::DevelWindow::SetDamagedAreas()
- */
- void SetDamagedAreas(std::vector<Dali::Rect<int>>& areas);
-
public: // Dali::Internal::Adaptor::SceneHolder
/**
/**
* Destructor
*/
- virtual ~Window();
+ ~Window() override;
/**
* Second stage initialization
void OnKeyboardRepeatSettingsChanged();
/**
+ * @brief Called when the window redraw is requested.
+ */
+ void OnWindowRedrawRequest();
+
+ /**
* @brief Set available orientation to window base.
*/
void SetAvailableAnlges( const std::vector< int >& angles );
{
const int MINIMUM_DIMENSION_CHANGE( 1 ); ///< Minimum change for window to be considered to have moved
+const float FULL_UPDATE_RATIO( 0.8f ); ///< Force full update when the dirty area is larget than this ratio
#if defined(DEBUG_ENABLED)
Debug::Filter* gWindowRenderSurfaceLogFilter = Debug::Filter::New(Debug::Verbose, false, "LOG_WINDOW_RENDER_SURFACE");
#endif
+void MergeRects( Rect< int >& mergingRect, const std::vector< Rect< int > >& rects )
+{
+ uint32_t i = 0;
+ if( mergingRect.IsEmpty() )
+ {
+ for( ; i < rects.size(); i++ )
+ {
+ if( !rects[i].IsEmpty() )
+ {
+ mergingRect = rects[i];
+ break;
+ }
+ }
+ }
+
+ for( ; i < rects.size(); i++ )
+ {
+ mergingRect.Merge( rects[i] );
+ }
+}
+
+void InsertRects( WindowRenderSurface::DamagedRectsContainer& damagedRectsList, const std::vector< Rect< int > >& damagedRects )
+{
+ damagedRectsList.push_front( damagedRects );
+ if( damagedRectsList.size() > 4 ) // past triple buffers + current
+ {
+ damagedRectsList.pop_back();
+ }
+}
+
} // unnamed namespace
WindowRenderSurface::WindowRenderSurface( Dali::PositionSize positionSize, Any surface, bool isTransparent )
mColorDepth( isTransparent ? COLOR_DEPTH_32 : COLOR_DEPTH_24 ),
mOutputTransformedSignal(),
mFrameCallbackInfoContainer(),
+ mBufferDamagedRects(),
mMutex(),
mRotationAngle( 0 ),
mScreenRotationAngle( 0 ),
+ mDpiHorizontal( 0 ),
+ mDpiVertical( 0 ),
mOwnSurface( false ),
mRotationSupported( false ),
mRotationFinished( true ),
mScreenRotationFinished( true ),
- mResizeFinished( true ),
- mDpiHorizontal( 0 ),
- mDpiVertical( 0 )
+ mResizeFinished( true )
{
DALI_LOG_INFO( gWindowRenderSurfaceLogFilter, Debug::Verbose, "Creating Window\n" );
Initialize( surface );
MakeContextCurrent();
- auto eglGraphics = static_cast<EglGraphics *>(mGraphics);
-
if( resizingSurface )
{
// Window rotate or screen rotate
DALI_LOG_INFO( gWindowRenderSurfaceLogFilter, Debug::Verbose, "WindowRenderSurface::PreRender: Set resize\n" );
}
- if (eglGraphics)
- {
- Internal::Adaptor::EglImplementation& eglImpl = eglGraphics->GetEglImplementation();
- eglImpl.SetFullSwapNextFrame();
- }
+ SetFullSwapNextFrame();
}
- if (eglGraphics)
- {
- Internal::Adaptor::EglImplementation& eglImpl = eglGraphics->GetEglImplementation();
- eglImpl.SetDamage( mEGLSurface, damagedRects, clippingRect );
- }
+ SetBufferDamagedRects( damagedRects, clippingRect );
return true;
}
}
}
- Internal::Adaptor::EglImplementation& eglImpl = eglGraphics->GetEglImplementation();
- eglImpl.SwapBuffers( mEGLSurface, damagedRects );
+ SwapBuffers( damagedRects );
if( mRenderNotification )
{
}
}
+void WindowRenderSurface::SetBufferDamagedRects( const std::vector< Rect< int > >& damagedRects, Rect< int >& clippingRect )
+{
+ auto eglGraphics = static_cast< EglGraphics* >( mGraphics );
+ if ( eglGraphics )
+ {
+ Internal::Adaptor::EglImplementation& eglImpl = eglGraphics->GetEglImplementation();
+ if( !eglImpl.IsPartialUpdateRequired() )
+ {
+ return;
+ }
+
+ Rect< int > surfaceRect( 0, 0, mPositionSize.width, mPositionSize.height );
+
+ if( mFullSwapNextFrame )
+ {
+ InsertRects( mBufferDamagedRects, std::vector< Rect< int > >( 1, surfaceRect ) );
+ clippingRect = Rect< int >();
+ return;
+ }
+
+ EGLint bufferAge = eglImpl.GetBufferAge( mEGLSurface );
+
+ // Buffer age 0 means the back buffer in invalid and requires full swap
+ if( !damagedRects.size() || bufferAge == 0 )
+ {
+ InsertRects( mBufferDamagedRects, std::vector< Rect< int > >( 1, surfaceRect ) );
+ clippingRect = Rect< int >();
+ return;
+ }
+
+ // We push current frame damaged rects here, zero index for current frame
+ InsertRects( mBufferDamagedRects, damagedRects );
+
+ // Merge damaged rects into clipping rect
+ auto bufferDamagedRects = mBufferDamagedRects.begin();
+ while( bufferAge-- >= 0 && bufferDamagedRects != mBufferDamagedRects.end() )
+ {
+ const std::vector< Rect< int > >& rects = *bufferDamagedRects++;
+ MergeRects( clippingRect, rects );
+ }
+
+ if( !clippingRect.Intersect( surfaceRect ) || clippingRect.Area() > surfaceRect.Area() * FULL_UPDATE_RATIO )
+ {
+ // clipping area too big or doesn't intersect surface rect
+ clippingRect = Rect< int >();
+ return;
+ }
+
+ std::vector< Rect< int > > damagedRegion;
+ damagedRegion.push_back( clippingRect );
+
+ eglImpl.SetDamageRegion( mEGLSurface, damagedRegion );
+ }
+}
+
+void WindowRenderSurface::SwapBuffers( const std::vector<Rect<int>>& damagedRects )
+{
+ auto eglGraphics = static_cast< EglGraphics* >( mGraphics );
+ if( eglGraphics )
+ {
+ Rect< int > surfaceRect( 0, 0, mPositionSize.width, mPositionSize.height );
+
+ Internal::Adaptor::EglImplementation& eglImpl = eglGraphics->GetEglImplementation();
+
+ if( !eglImpl.IsPartialUpdateRequired() || mFullSwapNextFrame || !damagedRects.size() || (damagedRects[0].Area() > surfaceRect.Area() * FULL_UPDATE_RATIO) )
+ {
+ mFullSwapNextFrame = false;
+ eglImpl.SwapBuffers( mEGLSurface );
+ return;
+ }
+
+ mFullSwapNextFrame = false;
+
+ std::vector< Rect< int > > mergedRects = damagedRects;
+
+ // Merge intersecting rects, form an array of non intersecting rects to help driver a bit
+ // Could be optional and can be removed, needs to be checked with and without on platform
+ const int n = mergedRects.size();
+ for( int i = 0; i < n - 1; i++ )
+ {
+ if( mergedRects[i].IsEmpty() )
+ {
+ continue;
+ }
+
+ for( int j = i + 1; j < n; j++ )
+ {
+ if( mergedRects[j].IsEmpty() )
+ {
+ continue;
+ }
+
+ if( mergedRects[i].Intersects( mergedRects[j] ) )
+ {
+ mergedRects[i].Merge( mergedRects[j] );
+ mergedRects[j].width = 0;
+ mergedRects[j].height = 0;
+ }
+ }
+ }
+
+ int j = 0;
+ for( int i = 0; i < n; i++ )
+ {
+ if( !mergedRects[i].IsEmpty() )
+ {
+ mergedRects[j++] = mergedRects[i];
+ }
+ }
+
+ if( j != 0 )
+ {
+ mergedRects.resize( j );
+ }
+
+ if( !mergedRects.size() || ( mergedRects[0].Area() > surfaceRect.Area() * FULL_UPDATE_RATIO ) )
+ {
+ eglImpl.SwapBuffers( mEGLSurface );
+ }
+ else
+ {
+ eglImpl.SwapBuffers( mEGLSurface, mergedRects );
+ }
+ }
+}
+
} // namespace Adaptor
} // namespace internal
{
public:
- typedef Signal< void ( ) > OutputSignalType;
+ using OutputSignalType = Signal< void ( ) >;
+ using DamagedRectsContainer = std::list< std::vector< Rect< int > > >;
/**
* Uses an window surface to render to.
/**
* @copydoc Dali::RenderSurfaceInterface::GetPositionSize()
*/
- virtual PositionSize GetPositionSize() const override;
+ PositionSize GetPositionSize() const override;
/**
*/
- virtual void GetDpi( unsigned int& dpiHorizontal, unsigned int& dpiVertical ) override;
+ void GetDpi( unsigned int& dpiHorizontal, unsigned int& dpiVertical ) override;
/**
* @copydoc Dali::RenderSurfaceInterface::InitializeGraphics()
*/
- virtual void InitializeGraphics() override;
+ void InitializeGraphics() override;
/**
* @copydoc Dali::RenderSurfaceInterface::CreateSurface()
*/
- virtual void CreateSurface() override;
+ void CreateSurface() override;
/**
* @copydoc Dali::RenderSurfaceInterface::DestroySurface()
*/
- virtual void DestroySurface() override;
+ void DestroySurface() override;
/**
* @copydoc Dali::RenderSurfaceInterface::ReplaceGraphicsSurface()
*/
- virtual bool ReplaceGraphicsSurface() override;
+ bool ReplaceGraphicsSurface() override;
/**
* @copydoc Dali::RenderSurfaceInterface::MoveResize()
*/
- virtual void MoveResize( Dali::PositionSize positionSize) override;
+ void MoveResize( Dali::PositionSize positionSize) override;
/**
* @copydoc Dali::RenderSurfaceInterface::StartRender()
*/
- virtual void StartRender() override;
+ void StartRender() override;
/**
* @copydoc Dali::RenderSurfaceInterface::PreRender()
*/
- virtual bool PreRender( bool resizingSurface, const std::vector<Rect<int>>& damagedRects, Rect<int>& clippingRect ) override;
+ bool PreRender( bool resizingSurface, const std::vector<Rect<int>>& damagedRects, Rect<int>& clippingRect ) override;
/**
* @copydoc Dali::RenderSurfaceInterface::PostRender()
*/
- virtual void PostRender( bool renderToFbo, bool replacingSurface, bool resizingSurface, const std::vector<Rect<int>>& damagedRects ) override;
+ void PostRender( bool renderToFbo, bool replacingSurface, bool resizingSurface, const std::vector<Rect<int>>& damagedRects ) override;
/**
* @copydoc Dali::RenderSurfaceInterface::StopRender()
*/
- virtual void StopRender() override;
+ void StopRender() override;
/**
* @copydoc Dali::RenderSurfaceInterface::SetThreadSynchronization
*/
- virtual void SetThreadSynchronization( ThreadSynchronizationInterface& threadSynchronization ) override;
+ void SetThreadSynchronization( ThreadSynchronizationInterface& threadSynchronization ) override;
/**
* @copydoc Dali::RenderSurfaceInterface::ReleaseLock()
*/
- virtual void ReleaseLock() override;
+ void ReleaseLock() override;
/**
* @copydoc Dali::RenderSurfaceInterface::GetSurfaceType()
*/
- virtual Dali::RenderSurfaceInterface::Type GetSurfaceType() override;
+ Dali::RenderSurfaceInterface::Type GetSurfaceType() override;
/**
* @copydoc Dali::RenderSurfaceInterface::MakeContextCurrent()
*/
- virtual void MakeContextCurrent() override;
+ void MakeContextCurrent() override;
/**
* @copydoc Dali::RenderSurfaceInterface::GetDepthBufferRequired()
*/
- virtual Integration::DepthBufferAvailable GetDepthBufferRequired() override;
+ Integration::DepthBufferAvailable GetDepthBufferRequired() override;
/**
* @copydoc Dali::RenderSurfaceInterface::GetStencilBufferRequired()
*/
- virtual Integration::StencilBufferAvailable GetStencilBufferRequired() override;
+ Integration::StencilBufferAvailable GetStencilBufferRequired() override;
private:
*/
void OnFileDescriptorEventDispatched( FileDescriptorMonitor::EventType eventBitMask, int fileDescriptor );
+ /**
+ * @brief Set the buffer damage rects.
+ * @param[in] damagedRects List of damaged rects
+ * @param[in] clippingRect The rect to clip rendered scene
+ */
+ void SetBufferDamagedRects( const std::vector< Rect< int > >& damagedRects, Rect< int >& clippingRect );
+
+ /**
+ * @brief Swap buffers.
+ * @param[in] damagedRects List of damaged rects
+ */
+ void SwapBuffers( const std::vector<Rect<int>>& damagedRects );
+
protected:
// Undefined
ColorDepth mColorDepth; ///< Color depth of surface (32 bit or 24 bit)
OutputSignalType mOutputTransformedSignal;
FrameCallbackInfoContainer mFrameCallbackInfoContainer;
+ DamagedRectsContainer mBufferDamagedRects;
Dali::Mutex mMutex;
int mRotationAngle;
int mScreenRotationAngle;
+ uint32_t mDpiHorizontal;
+ uint32_t mDpiVertical;
bool mOwnSurface; ///< Whether we own the surface (responsible for deleting it)
bool mRotationSupported;
bool mRotationFinished;
bool mScreenRotationFinished;
bool mResizeFinished;
- uint32_t mDpiHorizontal;
- uint32_t mDpiVertical;
-
}; // class WindowRenderSurface
} // namespace Adaptor
/**
* @copydoc Dali::Internal::Adaptor::WindowBase::GetNativeWindow()
*/
- virtual Any GetNativeWindow() override;
+ Any GetNativeWindow() override;
/**
* @copydoc Dali::Internal::Adaptor::WindowBase::GetNativeWindowId()
*/
- virtual int GetNativeWindowId() override;
+ int GetNativeWindowId() override;
/**
* @copydoc Dali::Internal::Adaptor::WindowBase::CreateEglWindow()
*/
- virtual EGLNativeWindowType CreateEglWindow( int width, int height ) override;
+ EGLNativeWindowType CreateEglWindow( int width, int height ) override;
/**
* @copydoc Dali::Internal::Adaptor::WindowBase::DestroyEglWindow()
*/
- virtual void DestroyEglWindow() override;
+ void DestroyEglWindow() override;
/**
* @copydoc Dali::Internal::Adaptor::WindowBase::SetEglWindowRotation()
*/
- virtual void SetEglWindowRotation( int angle ) override;
+ void SetEglWindowRotation( int angle ) override;
/**
* @copydoc Dali::Internal::Adaptor::WindowBase::SetEglWindowBufferTransform()
*/
- virtual void SetEglWindowBufferTransform( int angle ) override;
+ void SetEglWindowBufferTransform( int angle ) override;
/**
* @copydoc Dali::Internal::Adaptor::WindowBase::SetEglWindowTransform()
*/
- virtual void SetEglWindowTransform( int angle ) override;
+ void SetEglWindowTransform( int angle ) override;
/**
* @copydoc Dali::Internal::Adaptor::WindowBase::ResizeEglWindow()
*/
- virtual void ResizeEglWindow( PositionSize positionSize ) override;
+ void ResizeEglWindow( PositionSize positionSize ) override;
/**
* @copydoc Dali::Internal::Adaptor::WindowBase::IsEglWindowRotationSupported()
*/
- virtual bool IsEglWindowRotationSupported() override;
+ bool IsEglWindowRotationSupported() override;
/**
* @copydoc Dali::Internal::Adaptor::WindowBase::Move()
*/
- virtual void Move( PositionSize positionSize ) override;
+ void Move( PositionSize positionSize ) override;
/**
* @copydoc Dali::Internal::Adaptor::WindowBase::Resize()
*/
- virtual void Resize( PositionSize positionSize ) override;
+ void Resize( PositionSize positionSize ) override;
/**
* @copydoc Dali::Internal::Adaptor::WindowBase::MoveResize()
*/
- virtual void MoveResize( PositionSize positionSize ) override;
+ void MoveResize( PositionSize positionSize ) override;
/**
* @copydoc Dali::Internal::Adaptor::WindowBase::SetClass()
*/
- virtual void SetClass( const std::string& name, const std::string& className ) override;
+ void SetClass( const std::string& name, const std::string& className ) override;
/**
* @copydoc Dali::Internal::Adaptor::WindowBase::Raise()
*/
- virtual void Raise() override;
+ void Raise() override;
/**
* @copydoc Dali::Internal::Adaptor::WindowBase::Lower()
*/
- virtual void Lower() override;
+ void Lower() override;
/**
* @copydoc Dali::Internal::Adaptor::WindowBase::Activate()
*/
- virtual void Activate() override;
+ void Activate() override;
/**
* @copydoc Dali::Internal::Adaptor::WindowBase::SetAvailableAnlges()
*/
- virtual void SetAvailableAnlges( const std::vector< int >& angles ) override;
+ void SetAvailableAnlges( const std::vector< int >& angles ) override;
/**
* @copydoc Dali::Internal::Adaptor::WindowBase::SetPreferredAngle()
*/
- virtual void SetPreferredAngle( int angle ) override;
+ void SetPreferredAngle( int angle ) override;
/**
* @copydoc Dali::Internal::Adaptor::WindowBase::SetAcceptFocus()
*/
- virtual void SetAcceptFocus( bool accept ) override;
+ void SetAcceptFocus( bool accept ) override;
/**
* @copydoc Dali::Internal::Adaptor::WindowBase::Show()
*/
- virtual void Show() override;
+ void Show() override;
/**
* @copydoc Dali::Internal::Adaptor::WindowBase::Hide()
*/
- virtual void Hide() override;
+ void Hide() override;
/**
* @copydoc Dali::Internal::Adaptor::WindowBase::GetSupportedAuxiliaryHintCount()
*/
- virtual unsigned int GetSupportedAuxiliaryHintCount() const override;
+ unsigned int GetSupportedAuxiliaryHintCount() const override;
/**
* @copydoc Dali::Internal::Adaptor::WindowBase::GetSupportedAuxiliaryHint()
*/
- virtual std::string GetSupportedAuxiliaryHint( unsigned int index ) const override;
+ std::string GetSupportedAuxiliaryHint( unsigned int index ) const override;
/**
* @copydoc Dali::Internal::Adaptor::WindowBase::AddAuxiliaryHint()
*/
- virtual unsigned int AddAuxiliaryHint( const std::string& hint, const std::string& value ) override;
+ unsigned int AddAuxiliaryHint( const std::string& hint, const std::string& value ) override;
/**
* @copydoc Dali::Internal::Adaptor::WindowBase::RemoveAuxiliaryHint()
*/
- virtual bool RemoveAuxiliaryHint( unsigned int id ) override;
+ bool RemoveAuxiliaryHint( unsigned int id ) override;
/**
* @copydoc Dali::Internal::Adaptor::WindowBase::SetAuxiliaryHintValue()
*/
- virtual bool SetAuxiliaryHintValue( unsigned int id, const std::string& value ) override;
+ bool SetAuxiliaryHintValue( unsigned int id, const std::string& value ) override;
/**
* @copydoc Dali::Internal::Adaptor::WindowBase::GetAuxiliaryHintValue()
*/
- virtual std::string GetAuxiliaryHintValue( unsigned int id ) const override;
+ std::string GetAuxiliaryHintValue( unsigned int id ) const override;
/**
* @copydoc Dali::Internal::Adaptor::WindowBase::GetAuxiliaryHintId()
*/
- virtual unsigned int GetAuxiliaryHintId( const std::string& hint ) const override;
+ unsigned int GetAuxiliaryHintId( const std::string& hint ) const override;
/**
* @copydoc Dali::Internal::Adaptor::WindowBase::SetInputRegion()
*/
- virtual void SetInputRegion( const Rect< int >& inputRegion ) override;
+ void SetInputRegion( const Rect< int >& inputRegion ) override;
/**
* @copydoc Dali::Internal::Adaptor::WindowBase::SetType()
*/
- virtual void SetType( Dali::Window::Type type ) override;
+ void SetType( Dali::Window::Type type ) override;
/**
* @copydoc Dali::Internal::Adaptor::WindowBase::SetNotificationLevel()
*/
- virtual bool SetNotificationLevel( Dali::Window::NotificationLevel::Type level ) override;
+ bool SetNotificationLevel( Dali::Window::NotificationLevel::Type level ) override;
/**
* @copydoc Dali::Internal::Adaptor::WindowBase::GetNotificationLevel()
*/
- virtual Dali::Window::NotificationLevel::Type GetNotificationLevel() const override;
+ Dali::Window::NotificationLevel::Type GetNotificationLevel() const override;
/**
* @copydoc Dali::Internal::Adaptor::WindowBase::SetOpaqueState()
*/
- virtual void SetOpaqueState( bool opaque ) override;
+ void SetOpaqueState( bool opaque ) override;
/**
* @copydoc Dali::Internal::Adaptor::WindowBase::SetScreenOffMode()
*/
- virtual bool SetScreenOffMode(Dali::Window::ScreenOffMode::Type screenOffMode) override;
+ bool SetScreenOffMode(Dali::Window::ScreenOffMode::Type screenOffMode) override;
/**
* @copydoc Dali::Internal::Adaptor::WindowBase::GetScreenOffMode()
*/
- virtual Dali::Window::ScreenOffMode::Type GetScreenOffMode() const override;
+ Dali::Window::ScreenOffMode::Type GetScreenOffMode() const override;
/**
* @copydoc Dali::Internal::Adaptor::WindowBase::SetBrightness()
*/
- virtual bool SetBrightness( int brightness ) override;
+ bool SetBrightness( int brightness ) override;
/**
* @copydoc Dali::Internal::Adaptor::WindowBase::GetBrightness()
*/
- virtual int GetBrightness() const override;
+ int GetBrightness() const override;
/**
* @copydoc Dali::Internal::Adaptor::WindowBase::GrabKey()
*/
- virtual bool GrabKey( Dali::KEY key, KeyGrab::KeyGrabMode grabMode ) override;
+ bool GrabKey( Dali::KEY key, KeyGrab::KeyGrabMode grabMode ) override;
/**
* @copydoc Dali::Internal::Adaptor::WindowBase::UngrabKey()
*/
- virtual bool UngrabKey( Dali::KEY key ) override;
+ bool UngrabKey( Dali::KEY key ) override;
/**
* @copydoc Dali::Internal::Adaptor::WindowBase::GrabKeyList()
*/
- virtual bool GrabKeyList( const Dali::Vector< Dali::KEY >& key, const Dali::Vector< KeyGrab::KeyGrabMode >& grabMode, Dali::Vector< bool >& result ) override;
+ bool GrabKeyList( const Dali::Vector< Dali::KEY >& key, const Dali::Vector< KeyGrab::KeyGrabMode >& grabMode, Dali::Vector< bool >& result ) override;
/**
* @copydoc Dali::Internal::Adaptor::WindowBase::UngrabKeyList()
*/
- virtual bool UngrabKeyList( const Dali::Vector< Dali::KEY >& key, Dali::Vector< bool >& result ) override;
+ bool UngrabKeyList( const Dali::Vector< Dali::KEY >& key, Dali::Vector< bool >& result ) override;
/**
* @copydoc Dali::Internal::Adaptor::WindowBase::GetDpi()
*/
- virtual void GetDpi( unsigned int& dpiHorizontal, unsigned int& dpiVertical ) override;
+ void GetDpi( unsigned int& dpiHorizontal, unsigned int& dpiVertical ) override;
/**
* @copydoc Dali::Internal::Adaptor::WindowBase::GetScreenRotationAngle()
*/
- virtual int GetScreenRotationAngle() override;
+ int GetScreenRotationAngle() override;
/**
* @copydoc Dali::Internal::Adaptor::WindowBase::SetWindowRotationAngle()
*/
- virtual void SetWindowRotationAngle( int degree ) override;
+ void SetWindowRotationAngle( int degree ) override;
/**
* @copydoc Dali::Internal::Adaptor::WindowBase::WindowRotationCompleted()
*/
- virtual void WindowRotationCompleted( int degree, int width, int height ) override;
+ void WindowRotationCompleted( int degree, int width, int height ) override;
/**
* @copydoc Dali::Internal::Adaptor::WindowBase::SetTransparency()
*/
- virtual void SetTransparency( bool transparent ) override;
+ void SetTransparency( bool transparent ) override;
/**
* @copydoc Dali::Internal::Adaptor::WindowBase::SetParent()
*/
- virtual void SetParent( WindowBase* parentWinBase ) override;
+ void SetParent( WindowBase* parentWinBase ) override;
/**
* @copydoc Dali::Internal::Adaptor::WindowBase::CreateFrameRenderedSyncFence()
*/
- virtual int CreateFrameRenderedSyncFence() override;
+ int CreateFrameRenderedSyncFence() override;
/**
* @copydoc Dali::Internal::Adaptor::WindowBase::CreateFramePresentedSyncFence()
*/
- virtual int CreateFramePresentedSyncFence() override;
+ int CreateFramePresentedSyncFence() override;
private:
}
/////////////////////////////////////////////////////////////////////////////////////////////////
+// Window Redraw Request Event Callbacks
+/////////////////////////////////////////////////////////////////////////////////////////////////
+
+static Eina_Bool EcoreEventWindowRedrawRequest(void *data, int type, void *event)
+{
+ Ecore_Wl2_Event_Window_Redraw_Request *windowRedrawRequest = static_cast<Ecore_Wl2_Event_Window_Redraw_Request *>(event);
+ WindowBaseEcoreWl2 *windowBase = static_cast<WindowBaseEcoreWl2 *>(data);
+ DALI_LOG_INFO( gWindowBaseLogFilter, Debug::General, "WindowBaseEcoreWl2::EcoreEventWindowRedrawRequest, window[ %d ]\n", windowRedrawRequest->win );
+ if ( windowBase )
+ {
+ windowBase->OnEcoreEventWindowRedrawRequest();
+ }
+
+ return ECORE_CALLBACK_RENEW;
+}
+
+/////////////////////////////////////////////////////////////////////////////////////////////////
// ElDBus Accessibility Callbacks
/////////////////////////////////////////////////////////////////////////////////////////////////
// Register Keyboard repeat event
mEcoreEventHandler.PushBack( ecore_event_handler_add( ECORE_WL2_EVENT_SEAT_KEYBOARD_REPEAT_CHANGED, EcoreEventSeatKeyboardRepeatChanged, this ) );
+ // Register Window redraw request event
+ mEcoreEventHandler.PushBack( ecore_event_handler_add( ECORE_WL2_EVENT_WINDOW_REDRAW_REQUEST, EcoreEventWindowRedrawRequest, this ) );
+
// Register Vconf notify - font name and size
vconf_notify_key_changed( DALI_VCONFKEY_SETAPPL_ACCESSIBILITY_FONT_NAME, VconfNotifyFontNameChanged, this );
vconf_notify_key_changed( VCONFKEY_SETAPPL_ACCESSIBILITY_FONT_SIZE, VconfNotifyFontSizeChanged, this );
mKeyboardRepeatSettingsChangedSignal.Emit();
}
+void WindowBaseEcoreWl2::OnEcoreEventWindowRedrawRequest()
+{
+ mWindowRedrawRequestSignal.Emit();
+}
+
void WindowBaseEcoreWl2::KeymapChanged(void *data, int type, void *event)
{
Ecore_Wl2_Event_Seat_Keymap_Changed *changed = static_cast<Ecore_Wl2_Event_Seat_Keymap_Changed*>( event );
*/
void OnKeyboardRepeatSettingsChanged();
+ /**
+ * @brief Called when a window redraw is requested.
+ */
+ void OnEcoreEventWindowRedrawRequest();
+
#ifdef DALI_ELDBUS_AVAILABLE
/**
* @brief Called when Ecore ElDBus accessibility event is received.
/**
* @copydoc Dali::Internal::Adaptor::WindowBase::GetNativeWindow()
*/
- virtual Any GetNativeWindow() override;
+ Any GetNativeWindow() override;
/**
* @copydoc Dali::Internal::Adaptor::WindowBase::GetNativeWindowId()
*/
- virtual int GetNativeWindowId() override;
+ int GetNativeWindowId() override;
/**
* @copydoc Dali::Internal::Adaptor::WindowBase::CreateEglWindow()
*/
- virtual EGLNativeWindowType CreateEglWindow( int width, int height ) override;
+ EGLNativeWindowType CreateEglWindow( int width, int height ) override;
/**
* @copydoc Dali::Internal::Adaptor::WindowBase::DestroyEglWindow()
*/
- virtual void DestroyEglWindow() override;
+ void DestroyEglWindow() override;
/**
* @copydoc Dali::Internal::Adaptor::WindowBase::SetEglWindowRotation()
*/
- virtual void SetEglWindowRotation( int angle ) override;
+ void SetEglWindowRotation( int angle ) override;
/**
* @copydoc Dali::Internal::Adaptor::WindowBase::SetEglWindowBufferTransform()
*/
- virtual void SetEglWindowBufferTransform( int angle ) override;
+ void SetEglWindowBufferTransform( int angle ) override;
/**
* @copydoc Dali::Internal::Adaptor::WindowBase::SetEglWindowTransform()
*/
- virtual void SetEglWindowTransform( int angle ) override;
+ void SetEglWindowTransform( int angle ) override;
/**
* @copydoc Dali::Internal::Adaptor::WindowBase::ResizeEglWindow()
*/
- virtual void ResizeEglWindow( PositionSize positionSize ) override;
+ void ResizeEglWindow( PositionSize positionSize ) override;
/**
* @copydoc Dali::Internal::Adaptor::WindowBase::IsEglWindowRotationSupported()
*/
- virtual bool IsEglWindowRotationSupported() override;
+ bool IsEglWindowRotationSupported() override;
/**
* @copydoc Dali::Internal::Adaptor::WindowBase::Move()
*/
- virtual void Move( PositionSize positionSize ) override;
+ void Move( PositionSize positionSize ) override;
/**
* @copydoc Dali::Internal::Adaptor::WindowBase::Resize()
*/
- virtual void Resize( PositionSize positionSize ) override;
+ void Resize( PositionSize positionSize ) override;
/**
* @copydoc Dali::Internal::Adaptor::WindowBase::MoveResize()
*/
- virtual void MoveResize( PositionSize positionSize ) override;
+ void MoveResize( PositionSize positionSize ) override;
/**
* @copydoc Dali::Internal::Adaptor::WindowBase::SetClass()
*/
- virtual void SetClass( const std::string& name, const std::string& className ) override;
+ void SetClass( const std::string& name, const std::string& className ) override;
/**
* @copydoc Dali::Internal::Adaptor::WindowBase::Raise()
*/
- virtual void Raise() override;
+ void Raise() override;
/**
* @copydoc Dali::Internal::Adaptor::WindowBase::Lower()
*/
- virtual void Lower() override;
+ void Lower() override;
/**
* @copydoc Dali::Internal::Adaptor::WindowBase::Activate()
*/
- virtual void Activate() override;
+ void Activate() override;
/**
* @copydoc Dali::Internal::Adaptor::WindowBase::SetAvailableAnlges()
*/
- virtual void SetAvailableAnlges( const std::vector< int >& angles ) override;
+ void SetAvailableAnlges( const std::vector< int >& angles ) override;
/**
* @copydoc Dali::Internal::Adaptor::WindowBase::SetPreferredAngle()
*/
- virtual void SetPreferredAngle( int angle ) override;
+ void SetPreferredAngle( int angle ) override;
/**
* @copydoc Dali::Internal::Adaptor::WindowBase::SetAcceptFocus()
*/
- virtual void SetAcceptFocus( bool accept ) override;
+ void SetAcceptFocus( bool accept ) override;
/**
* @copydoc Dali::Internal::Adaptor::WindowBase::Show()
*/
- virtual void Show() override;
+ void Show() override;
/**
* @copydoc Dali::Internal::Adaptor::WindowBase::Hide()
*/
- virtual void Hide() override;
+ void Hide() override;
/**
* @copydoc Dali::Internal::Adaptor::WindowBase::GetSupportedAuxiliaryHintCount()
*/
- virtual unsigned int GetSupportedAuxiliaryHintCount() const override;
+ unsigned int GetSupportedAuxiliaryHintCount() const override;
/**
* @copydoc Dali::Internal::Adaptor::WindowBase::GetSupportedAuxiliaryHint()
*/
- virtual std::string GetSupportedAuxiliaryHint( unsigned int index ) const override;
+ std::string GetSupportedAuxiliaryHint( unsigned int index ) const override;
/**
* @copydoc Dali::Internal::Adaptor::WindowBase::AddAuxiliaryHint()
*/
- virtual unsigned int AddAuxiliaryHint( const std::string& hint, const std::string& value ) override;
+ unsigned int AddAuxiliaryHint( const std::string& hint, const std::string& value ) override;
/**
* @copydoc Dali::Internal::Adaptor::WindowBase::RemoveAuxiliaryHint()
*/
- virtual bool RemoveAuxiliaryHint( unsigned int id ) override;
+ bool RemoveAuxiliaryHint( unsigned int id ) override;
/**
* @copydoc Dali::Internal::Adaptor::WindowBase::SetAuxiliaryHintValue()
*/
- virtual bool SetAuxiliaryHintValue( unsigned int id, const std::string& value ) override;
+ bool SetAuxiliaryHintValue( unsigned int id, const std::string& value ) override;
/**
* @copydoc Dali::Internal::Adaptor::WindowBase::GetAuxiliaryHintValue()
*/
- virtual std::string GetAuxiliaryHintValue( unsigned int id ) const override;
+ std::string GetAuxiliaryHintValue( unsigned int id ) const override;
/**
* @copydoc Dali::Internal::Adaptor::WindowBase::GetAuxiliaryHintId()
*/
- virtual unsigned int GetAuxiliaryHintId( const std::string& hint ) const override;
+ unsigned int GetAuxiliaryHintId( const std::string& hint ) const override;
/**
* @copydoc Dali::Internal::Adaptor::WindowBase::SetInputRegion()
*/
- virtual void SetInputRegion( const Rect< int >& inputRegion ) override;
+ void SetInputRegion( const Rect< int >& inputRegion ) override;
/**
* @copydoc Dali::Internal::Adaptor::WindowBase::SetType()
*/
- virtual void SetType( Dali::Window::Type type ) override;
+ void SetType( Dali::Window::Type type ) override;
/**
* @copydoc Dali::Internal::Adaptor::WindowBase::SetNotificationLevel()
*/
- virtual bool SetNotificationLevel( Dali::Window::NotificationLevel::Type level ) override;
+ bool SetNotificationLevel( Dali::Window::NotificationLevel::Type level ) override;
/**
* @copydoc Dali::Internal::Adaptor::WindowBase::GetNotificationLevel()
*/
- virtual Dali::Window::NotificationLevel::Type GetNotificationLevel() const override;
+ Dali::Window::NotificationLevel::Type GetNotificationLevel() const override;
/**
* @copydoc Dali::Internal::Adaptor::WindowBase::SetOpaqueState()
*/
- virtual void SetOpaqueState( bool opaque ) override;
+ void SetOpaqueState( bool opaque ) override;
/**
* @copydoc Dali::Internal::Adaptor::WindowBase::SetScreenOffMode()
*/
- virtual bool SetScreenOffMode(Dali::Window::ScreenOffMode::Type screenOffMode) override;
+ bool SetScreenOffMode(Dali::Window::ScreenOffMode::Type screenOffMode) override;
/**
* @copydoc Dali::Internal::Adaptor::WindowBase::GetScreenOffMode()
*/
- virtual Dali::Window::ScreenOffMode::Type GetScreenOffMode() const override;
+ Dali::Window::ScreenOffMode::Type GetScreenOffMode() const override;
/**
* @copydoc Dali::Internal::Adaptor::WindowBase::SetBrightness()
*/
- virtual bool SetBrightness( int brightness ) override;
+ bool SetBrightness( int brightness ) override;
/**
* @copydoc Dali::Internal::Adaptor::WindowBase::GetBrightness()
*/
- virtual int GetBrightness() const override;
+ int GetBrightness() const override;
/**
* @copydoc Dali::Internal::Adaptor::WindowBase::GrabKey()
*/
- virtual bool GrabKey( Dali::KEY key, KeyGrab::KeyGrabMode grabMode ) override;
+ bool GrabKey( Dali::KEY key, KeyGrab::KeyGrabMode grabMode ) override;
/**
* @copydoc Dali::Internal::Adaptor::WindowBase::UngrabKey()
*/
- virtual bool UngrabKey( Dali::KEY key ) override;
+ bool UngrabKey( Dali::KEY key ) override;
/**
* @copydoc Dali::Internal::Adaptor::WindowBase::GrabKeyList()
*/
- virtual bool GrabKeyList( const Dali::Vector< Dali::KEY >& key, const Dali::Vector< KeyGrab::KeyGrabMode >& grabMode, Dali::Vector< bool >& result ) override;
+ bool GrabKeyList( const Dali::Vector< Dali::KEY >& key, const Dali::Vector< KeyGrab::KeyGrabMode >& grabMode, Dali::Vector< bool >& result ) override;
/**
* @copydoc Dali::Internal::Adaptor::WindowBase::UngrabKeyList()
*/
- virtual bool UngrabKeyList( const Dali::Vector< Dali::KEY >& key, Dali::Vector< bool >& result ) override;
+ bool UngrabKeyList( const Dali::Vector< Dali::KEY >& key, Dali::Vector< bool >& result ) override;
/**
* @copydoc Dali::Internal::Adaptor::WindowBase::GetDpi()
*/
- virtual void GetDpi( unsigned int& dpiHorizontal, unsigned int& dpiVertical ) override;
+ void GetDpi( unsigned int& dpiHorizontal, unsigned int& dpiVertical ) override;
/**
* @copydoc Dali::Internal::Adaptor::WindowBase::GetScreenRotationAngle()
*/
- virtual int GetScreenRotationAngle() override;
+ int GetScreenRotationAngle() override;
/**
* @copydoc Dali::Internal::Adaptor::WindowBase::SetWindowRotationAngle()
*/
- virtual void SetWindowRotationAngle( int degree ) override;
+ void SetWindowRotationAngle( int degree ) override;
/**
* @copydoc Dali::Internal::Adaptor::WindowBase::WindowRotationCompleted()
*/
- virtual void WindowRotationCompleted( int degree, int width, int height ) override;
+ void WindowRotationCompleted( int degree, int width, int height ) override;
/**
* @copydoc Dali::Internal::Adaptor::WindowBase::SetTransparency()
*/
- virtual void SetTransparency( bool transparent ) override;
+ void SetTransparency( bool transparent ) override;
/**
* @copydoc Dali::Internal::Adaptor::WindowBase::SetParent()
*/
- virtual void SetParent( WindowBase* parentWinBase ) override;
+ void SetParent( WindowBase* parentWinBase ) override;
/**
* @copydoc Dali::Internal::Adaptor::WindowBase::CreateFrameRenderedSyncFence()
*/
- virtual int CreateFrameRenderedSyncFence() override;
+ int CreateFrameRenderedSyncFence() override;
/**
* @copydoc Dali::Internal::Adaptor::WindowBase::CreateFramePresentedSyncFence()
*/
- virtual int CreateFramePresentedSyncFence() override;
+ int CreateFramePresentedSyncFence() override;
private:
bool NativeRenderSurfaceEcoreWl::PreRender( bool resizingSurface, const std::vector<Rect<int>>& damagedRects, Rect<int>& clippingRect )
{
- auto eglGraphics = static_cast<Internal::Adaptor::EglGraphics*>(mGraphics);
- if (eglGraphics)
- {
- Internal::Adaptor::EglImplementation& eglImpl = eglGraphics->GetEglImplementation();
- if (resizingSurface)
- {
- eglImpl.SetFullSwapNextFrame();
- }
-
- eglImpl.SetDamage(mEGLSurface, damagedRects, clippingRect);
- }
-
+ //TODO: Need to support partial update
return true;
}
/**
* @copydoc Dali::NativeRenderSurface::GetSurface()
*/
- virtual Any GetDrawable() override;
+ Any GetDrawable() override;
/**
* @copydoc Dali::NativeRenderSurface::SetRenderNotification()
*/
- virtual void SetRenderNotification( TriggerEventInterface* renderNotification ) override;
+ void SetRenderNotification( TriggerEventInterface* renderNotification ) override;
/**
* @copydoc Dali::NativeRenderSurface::WaitUntilSurfaceReplaced()
*/
- virtual void WaitUntilSurfaceReplaced() override;
+ void WaitUntilSurfaceReplaced() override;
public: // from Dali::RenderSurfaceInterface
/**
* @copydoc Dali::RenderSurfaceInterface::GetPositionSize()
*/
- virtual PositionSize GetPositionSize() const override;
+ PositionSize GetPositionSize() const override;
/**
* @copydoc Dali::RenderSurfaceInterface::GetDpi()
*/
- virtual void GetDpi( unsigned int& dpiHorizontal, unsigned int& dpiVertical ) override;
+ void GetDpi( unsigned int& dpiHorizontal, unsigned int& dpiVertical ) override;
/**
* @copydoc Dali::RenderSurfaceInterface::InitializeGraphics()
*/
- virtual void InitializeGraphics() override;
+ void InitializeGraphics() override;
/**
* @copydoc Dali::RenderSurfaceInterface::CreateSurface()
*/
- virtual void CreateSurface() override;
+ void CreateSurface() override;
/**
* @copydoc Dali::RenderSurfaceInterface::DestroySurface()
*/
- virtual void DestroySurface() override;
+ void DestroySurface() override;
/**
* @copydoc Dali::RenderSurfaceInterface::ReplaceGraphicsSurface()
*/
- virtual bool ReplaceGraphicsSurface() override;
+ bool ReplaceGraphicsSurface() override;
/**
* @copydoc Dali::RenderSurfaceInterface::MoveResize()
*/
- virtual void MoveResize( Dali::PositionSize positionSize) override;
+ void MoveResize( Dali::PositionSize positionSize) override;
/**
* @copydoc Dali::RenderSurfaceInterface::StartRender()
*/
- virtual void StartRender() override;
+ void StartRender() override;
/**
* @copydoc Dali::RenderSurfaceInterface::PreRender()
*/
- virtual bool PreRender( bool resizingSurface, const std::vector<Rect<int>>& damagedRects, Rect<int>& clippingRect ) override;
+ bool PreRender( bool resizingSurface, const std::vector<Rect<int>>& damagedRects, Rect<int>& clippingRect ) override;
/**
* @copydoc Dali::RenderSurfaceInterface::PostRender()
*/
- virtual void PostRender( bool renderToFbo, bool replacingSurface, bool resizingSurface, const std::vector<Rect<int>>& damagedRects ) override;
+ void PostRender( bool renderToFbo, bool replacingSurface, bool resizingSurface, const std::vector<Rect<int>>& damagedRects ) override;
/**
* @copydoc Dali::RenderSurfaceInterface::StopRender()
*/
- virtual void StopRender() override;
+ void StopRender() override;
/**
* @copydoc Dali::RenderSurfaceInterface::SetThreadSynchronization
*/
- virtual void SetThreadSynchronization( ThreadSynchronizationInterface& threadSynchronization )override;
+ void SetThreadSynchronization( ThreadSynchronizationInterface& threadSynchronization )override;
/**
* @copydoc Dali::RenderSurfaceInterface::GetSurfaceType()
*/
- virtual Dali::RenderSurfaceInterface::Type GetSurfaceType() override;
+ Dali::RenderSurfaceInterface::Type GetSurfaceType() override;
/**
* @copydoc Dali::RenderSurfaceInterface::MakeContextCurrent()
*/
- virtual void MakeContextCurrent() override;
+ void MakeContextCurrent() override;
/**
* @copydoc Dali::RenderSurfaceInterface::GetDepthBufferRequired()
*/
- virtual Integration::DepthBufferAvailable GetDepthBufferRequired() override;
+ Integration::DepthBufferAvailable GetDepthBufferRequired() override;
/**
* @copydoc Dali::RenderSurfaceInterface::GetStencilBufferRequired()
*/
- virtual Integration::StencilBufferAvailable GetStencilBufferRequired() override;
+ Integration::StencilBufferAvailable GetStencilBufferRequired() override;
private:
/**
* @copydoc Dali::RenderSurfaceInterface::ReleaseLock()
*/
- virtual void ReleaseLock() override;
+ void ReleaseLock() override;
/**
* @copydoc Dali::NativeRenderSurface::CreateNativeRenderable()
*/
- virtual void CreateNativeRenderable() override;
+ void CreateNativeRenderable() override;
/**
* @copydoc Dali::NativeRenderSurface::ReleaseDrawable()
*/
- virtual void ReleaseDrawable() override;
+ void ReleaseDrawable() override;
private: // Data
/**
* @copydoc Dali::Internal::Adaptor::PixmapRenderSurface::GetSurface()
*/
- virtual Any GetSurface() override;
+ Any GetSurface() override;
/**
* @copydoc Dali::Internal::Adaptor::PixmapRenderSurface::SetRenderNotification()
*/
- virtual void SetRenderNotification( TriggerEventInterface* renderNotification ) override;
+ void SetRenderNotification( TriggerEventInterface* renderNotification ) override;
public: // from Dali::RenderSurfaceInterface
/**
* @copydoc Dali::RenderSurfaceInterface::GetPositionSize()
*/
- virtual PositionSize GetPositionSize() const override;
+ PositionSize GetPositionSize() const override;
/**
* @copydoc Dali::RenderSurfaceInterface::GetDpi()
*/
- virtual void GetDpi( unsigned int& dpiHorizontal, unsigned int& dpiVertical ) override;
+ void GetDpi( unsigned int& dpiHorizontal, unsigned int& dpiVertical ) override;
/**
* @copydoc Dali::RenderSurfaceInterface::InitializeGraphics()
*/
- virtual void InitializeGraphics() override;
+ void InitializeGraphics() override;
/**
* @copydoc Dali::RenderSurfaceInterface::CreateSurface()
*/
- virtual void CreateSurface() override;
+ void CreateSurface() override;
/**
* @copydoc Dali::RenderSurfaceInterface::DestroySurface()
*/
- virtual void DestroySurface() override;
+ void DestroySurface() override;
/**
* @copydoc Dali::RenderSurfaceInterface::ReplaceGraphicsSurface()
*/
- virtual bool ReplaceGraphicsSurface() override;
+ bool ReplaceGraphicsSurface() override;
/**
* @copydoc Dali::RenderSurfaceInterface::MoveResize()
/**
* @copydoc Dali::RenderSurfaceInterface::StartRender()
*/
- virtual void StartRender() override;
+ void StartRender() override;
/**
* @copydoc Dali::RenderSurfaceInterface::PreRender()
*/
- virtual bool PreRender( bool resizingSurface, const std::vector<Rect<int>>& damagedRects, Rect<int>& clippingRect ) override;
+ bool PreRender( bool resizingSurface, const std::vector<Rect<int>>& damagedRects, Rect<int>& clippingRect ) override;
/**
* @copydoc Dali::RenderSurfaceInterface::PostRender()
*/
- virtual void PostRender( bool renderToFbo, bool replacingSurface, bool resizingSurface, const std::vector<Rect<int>>& damagedRects ) override;
+ void PostRender( bool renderToFbo, bool replacingSurface, bool resizingSurface, const std::vector<Rect<int>>& damagedRects ) override;
/**
* @copydoc Dali::RenderSurfaceInterface::StopRender()
*/
- virtual void StopRender() override;
+ void StopRender() override;
/**
* @copydoc Dali::RenderSurfaceInterface::SetThreadSynchronization
*/
- virtual void SetThreadSynchronization( ThreadSynchronizationInterface& threadSynchronization ) override;
+ void SetThreadSynchronization( ThreadSynchronizationInterface& threadSynchronization ) override;
/**
* @copydoc Dali::RenderSurfaceInterface::GetSurfaceType()
*/
- virtual Dali::RenderSurfaceInterface::Type GetSurfaceType() override;
+ Dali::RenderSurfaceInterface::Type GetSurfaceType() override;
/**
* @copydoc Dali::RenderSurfaceInterface::MakeContextCurrent()
*/
- virtual void MakeContextCurrent() override;
+ void MakeContextCurrent() override;
private: // from PixmapRenderSurface
/**
* @copydoc Dali::RenderSurfaceInterface::ReleaseLock()
*/
- virtual void ReleaseLock() override;
+ void ReleaseLock() override;
/**
* @copydoc Dali::Internal::Adaptor::PixmapRenderSurface::Initialize()
*/
- virtual void Initialize( Any surface ) override;
+ void Initialize( Any surface ) override;
/**
* @copydoc Dali::Internal::Adaptor::PixmapRenderSurface::Initialize()
*/
- virtual void CreateRenderable() override;
+ void CreateRenderable() override;
/**
* @copydoc Dali::Internal::Adaptor::PixmapRenderSurface::Initialize()
*/
- virtual void UseExistingRenderable( unsigned int surfaceId ) override;
+ void UseExistingRenderable( unsigned int surfaceId ) override;
private:
{
if( selectionNotifyEvent->selection == ECORE_X_SELECTION_SECONDARY )
{
- mSelectionDataReceivedSignal.Emit( event );
+ mSelectionDataReceivedSignal.Emit( event );
}
}
}
/**
* @copydoc Dali::Internal::Adaptor::WindowBase::GetNativeWindow()
*/
- virtual Any GetNativeWindow() override;
+ Any GetNativeWindow() override;
/**
* @copydoc Dali::Internal::Adaptor::WindowBase::GetNativeWindowId()
*/
- virtual int GetNativeWindowId() override;
+ int GetNativeWindowId() override;
/**
* @copydoc Dali::Internal::Adaptor::WindowBase::CreateEglWindow()
*/
- virtual EGLNativeWindowType CreateEglWindow( int width, int height ) override;
+ EGLNativeWindowType CreateEglWindow( int width, int height ) override;
/**
* @copydoc Dali::Internal::Adaptor::WindowBase::DestroyEglWindow()
*/
- virtual void DestroyEglWindow() override;
+ void DestroyEglWindow() override;
/**
* @copydoc Dali::Internal::Adaptor::WindowBase::SetEglWindowRotation()
*/
- virtual void SetEglWindowRotation( int angle ) override;
+ void SetEglWindowRotation( int angle ) override;
/**
* @copydoc Dali::Internal::Adaptor::WindowBase::SetEglWindowBufferTransform()
*/
- virtual void SetEglWindowBufferTransform( int angle ) override;
+ void SetEglWindowBufferTransform( int angle ) override;
/**
* @copydoc Dali::Internal::Adaptor::WindowBase::SetEglWindowTransform()
*/
- virtual void SetEglWindowTransform( int angle ) override;
+ void SetEglWindowTransform( int angle ) override;
/**
* @copydoc Dali::Internal::Adaptor::WindowBase::ResizeEglWindow()
*/
- virtual void ResizeEglWindow( PositionSize positionSize ) override;
+ void ResizeEglWindow( PositionSize positionSize ) override;
/**
* @copydoc Dali::Internal::Adaptor::WindowBase::IsEglWindowRotationSupported()
*/
- virtual bool IsEglWindowRotationSupported() override;
+ bool IsEglWindowRotationSupported() override;
/**
* @copydoc Dali::Internal::Adaptor::WindowBase::Move()
*/
- virtual void Move( PositionSize positionSize ) override;
+ void Move( PositionSize positionSize ) override;
/**
* @copydoc Dali::Internal::Adaptor::WindowBase::Resize()
*/
- virtual void Resize( PositionSize positionSize ) override;
+ void Resize( PositionSize positionSize ) override;
/**
* @copydoc Dali::Internal::Adaptor::WindowBase::MoveResize()
*/
- virtual void MoveResize( PositionSize positionSize ) override;
+ void MoveResize( PositionSize positionSize ) override;
/**
* @copydoc Dali::Internal::Adaptor::WindowBase::SetClass()
*/
- virtual void SetClass( const std::string& name, const std::string& className ) override;
+ void SetClass( const std::string& name, const std::string& className ) override;
/**
* @copydoc Dali::Internal::Adaptor::WindowBase::Raise()
*/
- virtual void Raise() override;
+ void Raise() override;
/**
* @copydoc Dali::Internal::Adaptor::WindowBase::Lower()
*/
- virtual void Lower() override;
+ void Lower() override;
/**
* @copydoc Dali::Internal::Adaptor::WindowBase::Activate()
*/
- virtual void Activate() override;
+ void Activate() override;
/**
* @copydoc Dali::Internal::Adaptor::WindowBase::SetAvailableAnlges()
*/
- virtual void SetAvailableAnlges( const std::vector< int >& angles ) override;
+ void SetAvailableAnlges( const std::vector< int >& angles ) override;
/**
* @copydoc Dali::Internal::Adaptor::WindowBase::SetPreferredAngle()
*/
- virtual void SetPreferredAngle( int angle ) override;
+ void SetPreferredAngle( int angle ) override;
/**
* @copydoc Dali::Internal::Adaptor::WindowBase::SetAcceptFocus()
*/
- virtual void SetAcceptFocus( bool accept ) override;
+ void SetAcceptFocus( bool accept ) override;
/**
* @copydoc Dali::Internal::Adaptor::WindowBase::Show()
*/
- virtual void Show() override;
+ void Show() override;
/**
* @copydoc Dali::Internal::Adaptor::WindowBase::Hide()
*/
- virtual void Hide() override;
+ void Hide() override;
/**
* @copydoc Dali::Internal::Adaptor::WindowBase::GetSupportedAuxiliaryHintCount()
*/
- virtual unsigned int GetSupportedAuxiliaryHintCount() const override;
+ unsigned int GetSupportedAuxiliaryHintCount() const override;
/**
* @copydoc Dali::Internal::Adaptor::WindowBase::GetSupportedAuxiliaryHint()
*/
- virtual std::string GetSupportedAuxiliaryHint( unsigned int index ) const override;
+ std::string GetSupportedAuxiliaryHint( unsigned int index ) const override;
/**
* @copydoc Dali::Internal::Adaptor::WindowBase::AddAuxiliaryHint()
*/
- virtual unsigned int AddAuxiliaryHint( const std::string& hint, const std::string& value ) override;
+ unsigned int AddAuxiliaryHint( const std::string& hint, const std::string& value ) override;
/**
* @copydoc Dali::Internal::Adaptor::WindowBase::RemoveAuxiliaryHint()
*/
- virtual bool RemoveAuxiliaryHint( unsigned int id ) override;
+ bool RemoveAuxiliaryHint( unsigned int id ) override;
/**
* @copydoc Dali::Internal::Adaptor::WindowBase::SetAuxiliaryHintValue()
*/
- virtual bool SetAuxiliaryHintValue( unsigned int id, const std::string& value ) override;
+ bool SetAuxiliaryHintValue( unsigned int id, const std::string& value ) override;
/**
* @copydoc Dali::Internal::Adaptor::WindowBase::GetAuxiliaryHintValue()
*/
- virtual std::string GetAuxiliaryHintValue( unsigned int id ) const override;
+ std::string GetAuxiliaryHintValue( unsigned int id ) const override;
/**
* @copydoc Dali::Internal::Adaptor::WindowBase::GetAuxiliaryHintId()
*/
- virtual unsigned int GetAuxiliaryHintId( const std::string& hint ) const override;
+ unsigned int GetAuxiliaryHintId( const std::string& hint ) const override;
/**
* @copydoc Dali::Internal::Adaptor::WindowBase::SetInputRegion()
*/
- virtual void SetInputRegion( const Rect< int >& inputRegion ) override;
+ void SetInputRegion( const Rect< int >& inputRegion ) override;
/**
* @copydoc Dali::Internal::Adaptor::WindowBase::SetType()
*/
- virtual void SetType( Dali::Window::Type type ) override;
+ void SetType( Dali::Window::Type type ) override;
/**
* @copydoc Dali::Internal::Adaptor::WindowBase::SetNotificationLevel()
*/
- virtual bool SetNotificationLevel( Dali::Window::NotificationLevel::Type level ) override;
+ bool SetNotificationLevel( Dali::Window::NotificationLevel::Type level ) override;
/**
* @copydoc Dali::Internal::Adaptor::WindowBase::GetNotificationLevel()
*/
- virtual Dali::Window::NotificationLevel::Type GetNotificationLevel() const override;
+ Dali::Window::NotificationLevel::Type GetNotificationLevel() const override;
/**
* @copydoc Dali::Internal::Adaptor::WindowBase::SetOpaqueState()
*/
- virtual void SetOpaqueState( bool opaque ) override;
+ void SetOpaqueState( bool opaque ) override;
/**
* @copydoc Dali::Internal::Adaptor::WindowBase::SetScreenOffMode()
*/
- virtual bool SetScreenOffMode(Dali::Window::ScreenOffMode::Type screenOffMode) override;
+ bool SetScreenOffMode(Dali::Window::ScreenOffMode::Type screenOffMode) override;
/**
* @copydoc Dali::Internal::Adaptor::WindowBase::GetScreenOffMode()
*/
- virtual Dali::Window::ScreenOffMode::Type GetScreenOffMode() const override;
+ Dali::Window::ScreenOffMode::Type GetScreenOffMode() const override;
/**
* @copydoc Dali::Internal::Adaptor::WindowBase::SetBrightness()
*/
- virtual bool SetBrightness( int brightness ) override;
+ bool SetBrightness( int brightness ) override;
/**
* @copydoc Dali::Internal::Adaptor::WindowBase::GetBrightness()
*/
- virtual int GetBrightness() const override;
+ int GetBrightness() const override;
/**
* @copydoc Dali::Internal::Adaptor::WindowBase::GrabKey()
*/
- virtual bool GrabKey( Dali::KEY key, KeyGrab::KeyGrabMode grabMode ) override;
+ bool GrabKey( Dali::KEY key, KeyGrab::KeyGrabMode grabMode ) override;
/**
* @copydoc Dali::Internal::Adaptor::WindowBase::UngrabKey()
*/
- virtual bool UngrabKey( Dali::KEY key ) override;
+ bool UngrabKey( Dali::KEY key ) override;
/**
* @copydoc Dali::Internal::Adaptor::WindowBase::GrabKeyList()
*/
- virtual bool GrabKeyList( const Dali::Vector< Dali::KEY >& key, const Dali::Vector< KeyGrab::KeyGrabMode >& grabMode, Dali::Vector< bool >& result ) override;
+ bool GrabKeyList( const Dali::Vector< Dali::KEY >& key, const Dali::Vector< KeyGrab::KeyGrabMode >& grabMode, Dali::Vector< bool >& result ) override;
/**
* @copydoc Dali::Internal::Adaptor::WindowBase::UngrabKeyList()
*/
- virtual bool UngrabKeyList( const Dali::Vector< Dali::KEY >& key, Dali::Vector< bool >& result ) override;
+ bool UngrabKeyList( const Dali::Vector< Dali::KEY >& key, Dali::Vector< bool >& result ) override;
/**
* @copydoc Dali::Internal::Adaptor::WindowBase::GetDpi()
*/
- virtual void GetDpi( unsigned int& dpiHorizontal, unsigned int& dpiVertical ) override;
+ void GetDpi( unsigned int& dpiHorizontal, unsigned int& dpiVertical ) override;
/**
* @copydoc Dali::Internal::Adaptor::WindowBase::GetScreenRotationAngle()
*/
- virtual int GetScreenRotationAngle() override;
+ int GetScreenRotationAngle() override;
/**
* @copydoc Dali::Internal::Adaptor::WindowBase::SetWindowRotationAngle()
*/
- virtual void SetWindowRotationAngle( int degree ) override;
+ void SetWindowRotationAngle( int degree ) override;
/**
* @copydoc Dali::Internal::Adaptor::WindowBase::WindowRotationCompleted()
*/
- virtual void WindowRotationCompleted( int degree, int width, int height ) override;
+ void WindowRotationCompleted( int degree, int width, int height ) override;
/**
* @copydoc Dali::Internal::Adaptor::WindowBase::SetTransparency()
*/
- virtual void SetTransparency( bool transparent ) override;
+ void SetTransparency( bool transparent ) override;
/**
* @copydoc Dali::Internal::Adaptor::WindowBase::SetParent()
*/
- virtual void SetParent( WindowBase* parentWinBase ) override;
+ void SetParent( WindowBase* parentWinBase ) override;
/**
* @copydoc Dali::Internal::Adaptor::WindowBase::CreateFrameRenderedSyncFence()
*/
- virtual int CreateFrameRenderedSyncFence() override;
+ int CreateFrameRenderedSyncFence() override;
/**
* @copydoc Dali::Internal::Adaptor::WindowBase::CreateFramePresentedSyncFence()
*/
- virtual int CreateFramePresentedSyncFence() override;
+ int CreateFramePresentedSyncFence() override;
private:
/**
* @copydoc Dali::Internal::Adaptor::WindowBase::GetNativeWindow()
*/
- virtual Any GetNativeWindow() override;
+ Any GetNativeWindow() override;
/**
* @copydoc Dali::Internal::Adaptor::WindowBase::GetNativeWindowId()
*/
- virtual int GetNativeWindowId() override;
+ int GetNativeWindowId() override;
/**
* @copydoc Dali::Internal::Adaptor::WindowBase::CreateEglWindow()
*/
- virtual EGLNativeWindowType CreateEglWindow( int width, int height ) override;
+ EGLNativeWindowType CreateEglWindow( int width, int height ) override;
/**
* @copydoc Dali::Internal::Adaptor::WindowBase::DestroyEglWindow()
*/
- virtual void DestroyEglWindow() override;
+ void DestroyEglWindow() override;
/**
* @copydoc Dali::Internal::Adaptor::WindowBase::SetEglWindowRotation()
*/
- virtual void SetEglWindowRotation( int angle ) override;
+ void SetEglWindowRotation( int angle ) override;
/**
* @copydoc Dali::Internal::Adaptor::WindowBase::SetEglWindowBufferTransform()
*/
- virtual void SetEglWindowBufferTransform( int angle ) override;
+ void SetEglWindowBufferTransform( int angle ) override;
/**
* @copydoc Dali::Internal::Adaptor::WindowBase::SetEglWindowTransform()
*/
- virtual void SetEglWindowTransform( int angle ) override;
+ void SetEglWindowTransform( int angle ) override;
/**
* @copydoc Dali::Internal::Adaptor::WindowBase::ResizeEglWindow()
*/
- virtual void ResizeEglWindow( PositionSize positionSize ) override;
+ void ResizeEglWindow( PositionSize positionSize ) override;
/**
* @copydoc Dali::Internal::Adaptor::WindowBase::IsEglWindowRotationSupported()
*/
- virtual bool IsEglWindowRotationSupported() override;
+ bool IsEglWindowRotationSupported() override;
/**
* @copydoc Dali::Internal::Adaptor::WindowBase::Move()
*/
- virtual void Move( PositionSize positionSize ) override;
+ void Move( PositionSize positionSize ) override;
/**
* @copydoc Dali::Internal::Adaptor::WindowBase::Resize()
*/
- virtual void Resize( PositionSize positionSize ) override;
+ void Resize( PositionSize positionSize ) override;
/**
* @copydoc Dali::Internal::Adaptor::WindowBase::MoveResize()
*/
- virtual void MoveResize( PositionSize positionSize ) override;
+ void MoveResize( PositionSize positionSize ) override;
/**
* @copydoc Dali::Internal::Adaptor::WindowBase::SetClass()
*/
- virtual void SetClass( const std::string& name, const std::string& className ) override;
+ void SetClass( const std::string& name, const std::string& className ) override;
/**
* @copydoc Dali::Internal::Adaptor::WindowBase::Raise()
*/
- virtual void Raise() override;
+ void Raise() override;
/**
* @copydoc Dali::Internal::Adaptor::WindowBase::Lower()
*/
- virtual void Lower() override;
+ void Lower() override;
/**
* @copydoc Dali::Internal::Adaptor::WindowBase::Activate()
*/
- virtual void Activate() override;
+ void Activate() override;
/**
* @copydoc Dali::Internal::Adaptor::WindowBase::SetAvailableAnlges()
*/
- virtual void SetAvailableAnlges( const std::vector< int >& angles ) override;
+ void SetAvailableAnlges( const std::vector< int >& angles ) override;
/**
* @copydoc Dali::Internal::Adaptor::WindowBase::SetPreferredAngle()
*/
- virtual void SetPreferredAngle( int angle ) override;
+ void SetPreferredAngle( int angle ) override;
/**
* @copydoc Dali::Internal::Adaptor::WindowBase::SetAcceptFocus()
*/
- virtual void SetAcceptFocus( bool accept ) override;
+ void SetAcceptFocus( bool accept ) override;
/**
* @copydoc Dali::Internal::Adaptor::WindowBase::Show()
*/
- virtual void Show() override;
+ void Show() override;
/**
* @copydoc Dali::Internal::Adaptor::WindowBase::Hide()
*/
- virtual void Hide() override;
+ void Hide() override;
/**
* @copydoc Dali::Internal::Adaptor::WindowBase::GetSupportedAuxiliaryHintCount()
*/
- virtual unsigned int GetSupportedAuxiliaryHintCount() const override;
+ unsigned int GetSupportedAuxiliaryHintCount() const override;
/**
* @copydoc Dali::Internal::Adaptor::WindowBase::GetSupportedAuxiliaryHint()
*/
- virtual std::string GetSupportedAuxiliaryHint( unsigned int index ) const override;
+ std::string GetSupportedAuxiliaryHint( unsigned int index ) const override;
/**
* @copydoc Dali::Internal::Adaptor::WindowBase::AddAuxiliaryHint()
*/
- virtual unsigned int AddAuxiliaryHint( const std::string& hint, const std::string& value ) override;
+ unsigned int AddAuxiliaryHint( const std::string& hint, const std::string& value ) override;
/**
* @copydoc Dali::Internal::Adaptor::WindowBase::RemoveAuxiliaryHint()
*/
- virtual bool RemoveAuxiliaryHint( unsigned int id ) override;
+ bool RemoveAuxiliaryHint( unsigned int id ) override;
/**
* @copydoc Dali::Internal::Adaptor::WindowBase::SetAuxiliaryHintValue()
*/
- virtual bool SetAuxiliaryHintValue( unsigned int id, const std::string& value ) override;
+ bool SetAuxiliaryHintValue( unsigned int id, const std::string& value ) override;
/**
* @copydoc Dali::Internal::Adaptor::WindowBase::GetAuxiliaryHintValue()
*/
- virtual std::string GetAuxiliaryHintValue( unsigned int id ) const override;
+ std::string GetAuxiliaryHintValue( unsigned int id ) const override;
/**
* @copydoc Dali::Internal::Adaptor::WindowBase::GetAuxiliaryHintId()
*/
- virtual unsigned int GetAuxiliaryHintId( const std::string& hint ) const override;
+ unsigned int GetAuxiliaryHintId( const std::string& hint ) const override;
/**
* @copydoc Dali::Internal::Adaptor::WindowBase::SetInputRegion()
*/
- virtual void SetInputRegion( const Rect< int >& inputRegion ) override;
+ void SetInputRegion( const Rect< int >& inputRegion ) override;
/**
* @copydoc Dali::Internal::Adaptor::WindowBase::SetType()
*/
- virtual void SetType( Dali::Window::Type type ) override;
+ void SetType( Dali::Window::Type type ) override;
/**
* @copydoc Dali::Internal::Adaptor::WindowBase::SetNotificationLevel()
*/
- virtual bool SetNotificationLevel( Dali::Window::NotificationLevel::Type level ) override;
+ bool SetNotificationLevel( Dali::Window::NotificationLevel::Type level ) override;
/**
* @copydoc Dali::Internal::Adaptor::WindowBase::GetNotificationLevel()
*/
- virtual Dali::Window::NotificationLevel::Type GetNotificationLevel() const override;
+ Dali::Window::NotificationLevel::Type GetNotificationLevel() const override;
/**
* @copydoc Dali::Internal::Adaptor::WindowBase::SetOpaqueState()
*/
- virtual void SetOpaqueState( bool opaque ) override;
+ void SetOpaqueState( bool opaque ) override;
/**
* @copydoc Dali::Internal::Adaptor::WindowBase::SetScreenOffMode()
*/
- virtual bool SetScreenOffMode(Dali::Window::ScreenOffMode::Type screenOffMode) override;
+ bool SetScreenOffMode(Dali::Window::ScreenOffMode::Type screenOffMode) override;
/**
* @copydoc Dali::Internal::Adaptor::WindowBase::GetScreenOffMode()
*/
- virtual Dali::Window::ScreenOffMode::Type GetScreenOffMode() const override;
+ Dali::Window::ScreenOffMode::Type GetScreenOffMode() const override;
/**
* @copydoc Dali::Internal::Adaptor::WindowBase::SetBrightness()
*/
- virtual bool SetBrightness( int brightness ) override;
+ bool SetBrightness( int brightness ) override;
/**
* @copydoc Dali::Internal::Adaptor::WindowBase::GetBrightness()
*/
- virtual int GetBrightness() const override;
+ int GetBrightness() const override;
/**
* @copydoc Dali::Internal::Adaptor::WindowBase::GrabKey()
*/
- virtual bool GrabKey( Dali::KEY key, KeyGrab::KeyGrabMode grabMode ) override;
+ bool GrabKey( Dali::KEY key, KeyGrab::KeyGrabMode grabMode ) override;
/**
* @copydoc Dali::Internal::Adaptor::WindowBase::UngrabKey()
*/
- virtual bool UngrabKey( Dali::KEY key ) override;
+ bool UngrabKey( Dali::KEY key ) override;
/**
* @copydoc Dali::Internal::Adaptor::WindowBase::GrabKeyList()
*/
- virtual bool GrabKeyList( const Dali::Vector< Dali::KEY >& key, const Dali::Vector< KeyGrab::KeyGrabMode >& grabMode, Dali::Vector< bool >& result ) override;
+ bool GrabKeyList( const Dali::Vector< Dali::KEY >& key, const Dali::Vector< KeyGrab::KeyGrabMode >& grabMode, Dali::Vector< bool >& result ) override;
/**
* @copydoc Dali::Internal::Adaptor::WindowBase::UngrabKeyList()
*/
- virtual bool UngrabKeyList( const Dali::Vector< Dali::KEY >& key, Dali::Vector< bool >& result ) override;
+ bool UngrabKeyList( const Dali::Vector< Dali::KEY >& key, Dali::Vector< bool >& result ) override;
/**
* @copydoc Dali::Internal::Adaptor::WindowBase::GetDpi()
*/
- virtual void GetDpi( unsigned int& dpiHorizontal, unsigned int& dpiVertical ) override;
+ void GetDpi( unsigned int& dpiHorizontal, unsigned int& dpiVertical ) override;
/**
* @copydoc Dali::Internal::Adaptor::WindowBase::GetScreenRotationAngle()
*/
- virtual int GetScreenRotationAngle() override;
+ int GetScreenRotationAngle() override;
/**
* @copydoc Dali::Internal::Adaptor::WindowBase::SetWindowRotationAngle()
*/
- virtual void SetWindowRotationAngle( int degree ) override;
+ void SetWindowRotationAngle( int degree ) override;
/**
* @copydoc Dali::Internal::Adaptor::WindowBase::WindowRotationCompleted()
*/
- virtual void WindowRotationCompleted( int degree, int width, int height ) override;
+ void WindowRotationCompleted( int degree, int width, int height ) override;
/**
* @copydoc Dali::Internal::Adaptor::WindowBase::SetTransparency()
*/
- virtual void SetTransparency( bool transparent ) override;
+ void SetTransparency( bool transparent ) override;
/**
* @copydoc Dali::Internal::Adaptor::WindowBase::SetParent()
*/
- virtual void SetParent( WindowBase* parentWinBase ) override;
+ void SetParent( WindowBase* parentWinBase ) override;
/**
* @copydoc Dali::Internal::Adaptor::WindowBase::CreateFrameRenderedSyncFence()
*/
- virtual int CreateFrameRenderedSyncFence() override;
+ int CreateFrameRenderedSyncFence() override;
/**
* @copydoc Dali::Internal::Adaptor::WindowBase::CreateFramePresentedSyncFence()
*/
- virtual int CreateFramePresentedSyncFence() override;
+ int CreateFramePresentedSyncFence() override;
private:
#include <dali/public-api/adaptor-framework/application.h>
// EXTERNAL INCLUDES
-#include <dali/public-api/object/object-registry.h>
#include <dali/integration-api/debug.h>
+#include <dali/public-api/object/object-registry.h>
// INTERNAL INCLUDES
#include <dali/internal/adaptor/common/application-impl.h>
namespace Dali
{
-
Application Application::New()
{
- return New( NULL, NULL );
+ return New(NULL, NULL);
}
-Application Application::New( int* argc, char **argv[] )
+Application Application::New(int* argc, char** argv[])
{
Internal::Adaptor::ApplicationPtr internal = Internal::Adaptor::Application::GetPreInitializedApplication();
- if( internal )
+ if(internal)
{
// pre-initialized application
- internal->SetCommandLineOptions( argc, argv );
- if( argc && ( *argc > 0 ) )
+ internal->SetCommandLineOptions(argc, argv);
+ if(argc && (*argc > 0))
{
- internal->GetWindow().SetClass( (*argv)[0], "" );
+ internal->GetWindow().SetClass((*argv)[0], "");
}
- return Application( internal.Get() );
+ return Application(internal.Get());
}
else
{
- internal = Internal::Adaptor::Application::New( argc, argv, "", OPAQUE, PositionSize(),
- Internal::Adaptor::Framework::NORMAL);
+ internal = Internal::Adaptor::Application::New(argc, argv, "", OPAQUE, PositionSize(), Internal::Adaptor::Framework::NORMAL);
return Application(internal.Get());
}
}
-Application Application::New( int* argc, char **argv[], const std::string& stylesheet )
+Application Application::New(int* argc, char** argv[], const std::string& stylesheet)
{
Internal::Adaptor::ApplicationPtr internal = Internal::Adaptor::Application::GetPreInitializedApplication();
- if( internal )
+ if(internal)
{
// pre-initialized application
- internal->SetCommandLineOptions( argc, argv );
- if( argc && ( *argc > 0 ) )
+ internal->SetCommandLineOptions(argc, argv);
+ if(argc && (*argc > 0))
{
- internal->GetWindow().SetClass( (*argv)[0], "" );
+ internal->GetWindow().SetClass((*argv)[0], "");
}
- internal->SetStyleSheet( stylesheet );
+ internal->SetStyleSheet(stylesheet);
- return Application( internal.Get() );
+ return Application(internal.Get());
}
else
{
- internal = Internal::Adaptor::Application::New( argc, argv, stylesheet, OPAQUE, PositionSize(),
- Internal::Adaptor::Framework::NORMAL);
+ internal = Internal::Adaptor::Application::New(argc, argv, stylesheet, OPAQUE, PositionSize(), Internal::Adaptor::Framework::NORMAL);
return Application(internal.Get());
}
}
-Application Application::New( int* argc, char **argv[], const std::string& stylesheet, WINDOW_MODE windowMode )
+Application Application::New(int* argc, char** argv[], const std::string& stylesheet, WINDOW_MODE windowMode)
{
Internal::Adaptor::ApplicationPtr internal = Internal::Adaptor::Application::GetPreInitializedApplication();
- if( internal )
+ if(internal)
{
// pre-initialized application
- internal->SetCommandLineOptions( argc, argv );
- if( argc && ( *argc > 0 ) )
+ internal->SetCommandLineOptions(argc, argv);
+ if(argc && (*argc > 0))
{
- internal->GetWindow().SetClass( (*argv)[0], "" );
+ internal->GetWindow().SetClass((*argv)[0], "");
}
- internal->SetStyleSheet( stylesheet );
+ internal->SetStyleSheet(stylesheet);
- internal->GetWindow().SetTransparency( ( windowMode == Application::OPAQUE ? false : true ) );
+ internal->GetWindow().SetTransparency((windowMode == Application::OPAQUE ? false : true));
- return Application( internal.Get() );
+ return Application(internal.Get());
}
else
{
- internal = Internal::Adaptor::Application::New( argc, argv, stylesheet, windowMode, PositionSize(),
- Internal::Adaptor::Framework::NORMAL);
+ internal = Internal::Adaptor::Application::New(argc, argv, stylesheet, windowMode, PositionSize(), Internal::Adaptor::Framework::NORMAL);
return Application(internal.Get());
}
}
-Application Application::New( int* argc, char **argv[], const std::string& stylesheet, Application::WINDOW_MODE windowMode, PositionSize positionSize )
+Application Application::New(int* argc, char** argv[], const std::string& stylesheet, Application::WINDOW_MODE windowMode, PositionSize positionSize)
{
Internal::Adaptor::ApplicationPtr internal = Internal::Adaptor::Application::GetPreInitializedApplication();
- if( internal )
+ if(internal)
{
// pre-initialized application
- internal->SetCommandLineOptions( argc, argv );
- if( argc && ( *argc > 0 ) )
+ internal->SetCommandLineOptions(argc, argv);
+ if(argc && (*argc > 0))
{
- internal->GetWindow().SetClass( (*argv)[0], "" );
+ internal->GetWindow().SetClass((*argv)[0], "");
}
- internal->SetStyleSheet( stylesheet );
+ internal->SetStyleSheet(stylesheet);
- internal->GetWindow().SetTransparency( ( windowMode == Application::OPAQUE ? false : true ) );
- internal->GetWindow().SetSize( Window::WindowSize( positionSize.width, positionSize.height ) );
- internal->GetWindow().SetPosition( Window::WindowPosition( positionSize.x, positionSize.y ) );
+ internal->GetWindow().SetTransparency((windowMode == Application::OPAQUE ? false : true));
+ internal->GetWindow().SetSize(Window::WindowSize(positionSize.width, positionSize.height));
+ internal->GetWindow().SetPosition(Window::WindowPosition(positionSize.x, positionSize.y));
- return Application( internal.Get() );
+ return Application(internal.Get());
}
else
{
- internal = Internal::Adaptor::Application::New( argc, argv, stylesheet, windowMode, positionSize, Internal::Adaptor::Framework::NORMAL );
- return Application( internal.Get() );
+ internal = Internal::Adaptor::Application::New(argc, argv, stylesheet, windowMode, positionSize, Internal::Adaptor::Framework::NORMAL);
+ return Application(internal.Get());
}
}
{
}
-Application::Application( const Application& copy ) = default;
+Application::Application(const Application& copy) = default;
-Application& Application::operator=( const Application& rhs ) = default;
+Application& Application::operator=(const Application& rhs) = default;
-Application::Application( Application&& rhs ) = default;
+Application::Application(Application&& rhs) = default;
-Application& Application::operator=( Application&& rhs ) = default;
+Application& Application::operator=(Application&& rhs) = default;
void Application::MainLoop()
{
Internal::Adaptor::GetImplementation(*this).Quit();
}
-bool Application::AddIdle( CallbackBase* callback )
+bool Application::AddIdle(CallbackBase* callback)
{
- return Internal::Adaptor::GetImplementation(*this).AddIdle( callback, false );
+ return Internal::Adaptor::GetImplementation(*this).AddIdle(callback, false);
}
Window Application::GetWindow()
return Internal::Adaptor::GetImplementation(*this).ResetSignal();
}
-Application::AppControlSignalType & Application::AppControlSignal()
+Application::AppControlSignalType& Application::AppControlSignal()
{
return Internal::Adaptor::GetImplementation(*this).AppControlSignal();
}
{
}
-
} // namespace Dali
namespace Dali
{
-
class ObjectRegistry;
/**
{
class Application;
}
-}
+} // namespace DALI_INTERNAL
/**
* @brief An Application class object should be created by every application
* that wishes to use Dali.
class DALI_ADAPTOR_API Application : public BaseHandle
{
public:
-
- typedef Signal< void (DeviceStatus::Battery::Status) > LowBatterySignalType; ///< Application device signal type @SINCE_1_2.62
- typedef Signal< void (DeviceStatus::Memory::Status) > LowMemorySignalType; ///< Application device signal type @SINCE_1_2.62
- typedef Signal< void (Application&) > AppSignalType; ///< Application lifecycle signal and system signal callback type @SINCE_1_0.0
- typedef Signal< void (Application&, void *) > AppControlSignalType; ///< Application control signal callback type @SINCE_1_0.0
+ typedef Signal<void(DeviceStatus::Battery::Status)> LowBatterySignalType; ///< Application device signal type @SINCE_1_2.62
+ typedef Signal<void(DeviceStatus::Memory::Status)> LowMemorySignalType; ///< Application device signal type @SINCE_1_2.62
+ typedef Signal<void(Application&)> AppSignalType; ///< Application lifecycle signal and system signal callback type @SINCE_1_0.0
+ typedef Signal<void(Application&, void*)> AppControlSignalType; ///< Application control signal callback type @SINCE_1_0.0
/**
* @brief Enumeration for deciding whether a Dali application window is opaque or transparent.
*/
enum WINDOW_MODE
{
- OPAQUE = 0, ///< The window will be opaque @SINCE_1_0.0
- TRANSPARENT = 1 ///< The window transparency will match the alpha value set in Dali::Stage::SetBackgroundcolor() @SINCE_1_0.0
+ OPAQUE = 0, ///< The window will be opaque @SINCE_1_0.0
+ TRANSPARENT = 1 ///< The window transparency will match the alpha value set in Dali::Stage::SetBackgroundcolor() @SINCE_1_0.0
};
public:
-
/**
* @brief This is the constructor for applications without an argument list.
* @SINCE_1_0.0
* @param[in,out] argv A pointer to the argument list
* @return A handle to the Application
*/
- static Application New( int* argc, char **argv[] );
+ static Application New(int* argc, char** argv[]);
/**
* @brief This is the constructor for applications with a name.
* @return A handle to the Application
* @note If the stylesheet is not specified, then the library's default stylesheet will not be overridden.
*/
- static Application New( int* argc, char **argv[], const std::string& stylesheet );
+ static Application New(int* argc, char** argv[], const std::string& stylesheet);
/**
* @brief This is the constructor for applications with a name.
* @return A handle to the Application
* @note If the stylesheet is not specified, then the library's default stylesheet will not be overridden.
*/
- static Application New( int* argc, char **argv[], const std::string& stylesheet, WINDOW_MODE windowMode );
+ static Application New(int* argc, char** argv[], const std::string& stylesheet, WINDOW_MODE windowMode);
/**
* @brief This is the constructor for applications.
* @return A handle to the Application
* @note If the stylesheet is not specified, then the library's default stylesheet will not be overridden.
*/
- static Application New( int* argc, char **argv[], const std::string& stylesheet, Application::WINDOW_MODE windowMode, PositionSize positionSize );
+ static Application New(int* argc, char** argv[], const std::string& stylesheet, Application::WINDOW_MODE windowMode, PositionSize positionSize);
/**
* @brief Constructs an empty handle.
* @SINCE_1_0.0
* @param[in] application Handle to an object
*/
- Application( const Application& application );
+ Application(const Application& application);
/**
* @brief Assignment operator.
* @param[in] application Handle to an object
* @return A reference to this
*/
- Application& operator=( const Application& application );
+ Application& operator=(const Application& application);
/**
* @brief Move constructor.
* @SINCE_1_9.24
* @param[in] rhs A reference to the moved handle
*/
- Application( Application&& rhs );
+ Application(Application&& rhs);
/**
* @brief Move assignment operator.
* @param[in] rhs A reference to the moved handle
* @return A reference to this handle
*/
- Application& operator=( Application&& rhs );
+ Application& operator=(Application&& rhs);
/**
* @brief Destructor.
*
* @note Ownership of the callback is passed onto this class.
*/
- bool AddIdle( CallbackBase* callback );
+ bool AddIdle(CallbackBase* callback);
/**
* @brief Retrieves the main window used by the Application class.
*/
ObjectRegistry GetObjectRegistry() const;
-public: // Signals
-
+public: // Signals
/**
* @brief The user should connect to this signal to determine when they should initialize
* their application.
#define DALI_DEVICE_STATUS_H
/*
- * Copyright (c) 2019 Samsung Electronics Co., Ltd.
+ * Copyright (c) 2020 Samsung Electronics Co., Ltd.
*
* Licensed under the Apache License, Version 2.0 (the "License");
* you may not use this file except in compliance with the License.
};
};
-}// namespace DeviceStatus
+} // namespace DeviceStatus
/**
* @}
*/
namespace InputMethod
{
-
/**
* @brief Enumeration for settings that can be changed in the system Input Method.
*
*/
namespace Category
{
-
/**
* @brief Enumeration for Category type.
*
*/
enum Type
{
- PANEL_LAYOUT, ///< Set Keyboard layout @SINCE_1_3.20
- BUTTON_ACTION, ///< Set Button Action @SINCE_1_3.20
- AUTO_CAPITALIZE, ///< Set Auto capitalize of input @SINCE_1_3.20
- VARIATION ///< Set variation @SINCE_1_3.20
+ PANEL_LAYOUT, ///< Set Keyboard layout @SINCE_1_3.20
+ BUTTON_ACTION, ///< Set Button Action @SINCE_1_3.20
+ AUTO_CAPITALIZE, ///< Set Auto capitalize of input @SINCE_1_3.20
+ VARIATION ///< Set variation @SINCE_1_3.20
};
} // namespace Category
*/
namespace PanelLayout
{
-
/**
* @brief Enumeration for PanelLayout type.
*
*/
enum Type
{
- NORMAL, ///< Default layout @SINCE_1_3.20
- NUMBER, ///< Number layout @SINCE_1_3.20
- EMAIL, ///< Email layout @SINCE_1_3.20
- URL, ///< URL layout @SINCE_1_3.20
- PHONENUMBER, ///< Phone Number layout @SINCE_1_3.20
- IP, ///< IP layout @SINCE_1_3.20
- MONTH, ///< Month layout @SINCE_1_3.20
- NUMBER_ONLY, ///< Number Only layout @SINCE_1_3.20
- HEX, ///< Hexadecimal layout @SINCE_1_3.20
- TERMINAL, ///< Command-line terminal layout including ESC, Alt, Ctrl key, so on (no auto-correct, no auto-capitalization) @SINCE_1_3.20
- PASSWORD, ///< Like normal, but no auto-correct, no auto-capitalization etc @SINCE_1_3.20
- DATE_TIME, ///< Date and time layout @SINCE_1_3.20
- EMOTICON ///< Emoticon layout @SINCE_1_3.20
+ NORMAL, ///< Default layout @SINCE_1_3.20
+ NUMBER, ///< Number layout @SINCE_1_3.20
+ EMAIL, ///< Email layout @SINCE_1_3.20
+ URL, ///< URL layout @SINCE_1_3.20
+ PHONENUMBER, ///< Phone Number layout @SINCE_1_3.20
+ IP, ///< IP layout @SINCE_1_3.20
+ MONTH, ///< Month layout @SINCE_1_3.20
+ NUMBER_ONLY, ///< Number Only layout @SINCE_1_3.20
+ HEX, ///< Hexadecimal layout @SINCE_1_3.20
+ TERMINAL, ///< Command-line terminal layout including ESC, Alt, Ctrl key, so on (no auto-correct, no auto-capitalization) @SINCE_1_3.20
+ PASSWORD, ///< Like normal, but no auto-correct, no auto-capitalization etc @SINCE_1_3.20
+ DATE_TIME, ///< Date and time layout @SINCE_1_3.20
+ EMOTICON ///< Emoticon layout @SINCE_1_3.20
};
} // namespace PanelLayout
*/
namespace ButtonAction
{
-
/**
* @brief Enumeration for ButtonAction type.
*
*/
enum Type
{
- DEFAULT, ///< Default action @SINCE_1_3.20
- DONE, ///< Done @SINCE_1_3.20
- GO, ///< Go action @SINCE_1_3.20
- JOIN, ///< Join action @SINCE_1_3.20
- LOGIN, ///< Login action @SINCE_1_3.20
- NEXT, ///< Next action @SINCE_1_3.20
- PREVIOUS, ///< Previous action @SINCE_1_3.20
- SEARCH, ///< Search action @SINCE_1_3.20
- SEND, ///< Send action @SINCE_1_3.20
- SIGNIN, ///< Sign in action @SINCE_1_3.20
- UNSPECIFIED, ///< Unspecified action @SINCE_1_3.20
- NONE ///< Nothing to do @SINCE_1_3.20
+ DEFAULT, ///< Default action @SINCE_1_3.20
+ DONE, ///< Done @SINCE_1_3.20
+ GO, ///< Go action @SINCE_1_3.20
+ JOIN, ///< Join action @SINCE_1_3.20
+ LOGIN, ///< Login action @SINCE_1_3.20
+ NEXT, ///< Next action @SINCE_1_3.20
+ PREVIOUS, ///< Previous action @SINCE_1_3.20
+ SEARCH, ///< Search action @SINCE_1_3.20
+ SEND, ///< Send action @SINCE_1_3.20
+ SIGNIN, ///< Sign in action @SINCE_1_3.20
+ UNSPECIFIED, ///< Unspecified action @SINCE_1_3.20
+ NONE ///< Nothing to do @SINCE_1_3.20
};
} // namespace ButtonAction
-
/**
* @brief Sets Autocapitalization Types.
*
*/
namespace AutoCapital
{
-
/**
* @brief Enumeration for AutoCapital type.
*
} // namespace AutoCapital
-
/////////////////////////// VARIATION based on PANEL_LAYOUT //////////////////////////////////
/**
*/
namespace NormalLayout
{
-
/**
* @brief Enumeration for NormalLayout Variation type.
*
*/
enum Type
{
- NORMAL, ///< The plain normal layout @SINCE_1_3.20
- WITH_FILENAME, ///< Filename layout. Symbols such as '/' should be disabled @SINCE_1_3.20
- WITH_PERSON_NAME ///< The name of a person @SINCE_1_3.20
+ NORMAL, ///< The plain normal layout @SINCE_1_3.20
+ WITH_FILENAME, ///< Filename layout. Symbols such as '/' should be disabled @SINCE_1_3.20
+ WITH_PERSON_NAME ///< The name of a person @SINCE_1_3.20
};
} // namespace NormalLayout
*/
namespace NumberOnlyLayout
{
-
/**
* @brief Enumeration for NumberOnlyLayout Variation type.
*
*/
namespace PasswordLayout
{
-
/**
* @brief Enumeration for PasswordLayout Variation type.
*
*/
enum Type
{
- NORMAL, ///< The normal password layout @SINCE_1_3.20
- WITH_NUMBER_ONLY ///< The password layout to allow only number @SINCE_1_3.20
+ NORMAL, ///< The normal password layout @SINCE_1_3.20
+ WITH_NUMBER_ONLY ///< The password layout to allow only number @SINCE_1_3.20
};
} // namespace PasswordLayout
#define DALI_KEY_GRAB_H
/*
- * Copyright (c) 2019 Samsung Electronics Co., Ltd.
+ * Copyright (c) 2020 Samsung Electronics Co., Ltd.
*
* Licensed under the Apache License, Version 2.0 (the "License");
* you may not use this file except in compliance with the License.
*/
// INTERNAL INCLUDES
-#include <dali/public-api/dali-adaptor-common.h>
#include <dali/public-api/common/dali-vector.h>
+#include <dali/public-api/dali-adaptor-common.h>
// EXTERNAL INCLUDES
#include <dali/public-api/adaptor-framework/key.h>
*/
namespace KeyGrab
{
-
/**
* @brief Grabs the key specified by @a key for @a window only when @a window is the topmost window.
*
* @param[in] daliKey The key code to grab (defined in key.h)
* @return true if the grab succeeds
*/
-DALI_ADAPTOR_API bool GrabKeyTopmost( Window window, Dali::KEY daliKey );
+DALI_ADAPTOR_API bool GrabKeyTopmost(Window window, Dali::KEY daliKey);
/**
* @brief Ungrabs the key specified by @a key for @a window.
* @note If this function is called between key down and up events of a grabbed key,
* an application doesn't receive the key up event.
*/
-DALI_ADAPTOR_API bool UngrabKeyTopmost( Window window, Dali::KEY daliKey );
+DALI_ADAPTOR_API bool UngrabKeyTopmost(Window window, Dali::KEY daliKey);
/**
* @brief Enumeration for key grab mode for platform-level APIs.
*/
enum KeyGrabMode
{
- TOPMOST = 0, ///< Grab a key only when on the top of the grabbing-window stack mode. @SINCE_1_0.0
- SHARED, ///< Grab a key together with the other client window(s) mode. @SINCE_1_0.0
- OVERRIDE_EXCLUSIVE, ///< Grab a key exclusively regardless of the grabbing-window's position on the window stack with the possibility of overriding the grab by the other client window mode. @SINCE_1_0.0
- EXCLUSIVE ///< Grab a key exclusively regardless of the grabbing-window's position on the window stack mode. @SINCE_1_0.0
+ TOPMOST = 0, ///< Grab a key only when on the top of the grabbing-window stack mode. @SINCE_1_0.0
+ SHARED, ///< Grab a key together with the other client window(s) mode. @SINCE_1_0.0
+ OVERRIDE_EXCLUSIVE, ///< Grab a key exclusively regardless of the grabbing-window's position on the window stack with the possibility of overriding the grab by the other client window mode. @SINCE_1_0.0
+ EXCLUSIVE ///< Grab a key exclusively regardless of the grabbing-window's position on the window stack mode. @SINCE_1_0.0
};
/**
* @param[in] grabMode The grab mode for the key
* @return true if the grab succeeds
*/
-DALI_ADAPTOR_API bool GrabKey( Window window, Dali::KEY daliKey, KeyGrabMode grabMode );
+DALI_ADAPTOR_API bool GrabKey(Window window, Dali::KEY daliKey, KeyGrabMode grabMode);
/**
* @PLATFORM
* @note If this function is called between key down and up events of a grabbed key,
* an application doesn't receive the key up event.
*/
-DALI_ADAPTOR_API bool UngrabKey( Window window, Dali::KEY daliKey );
-
+DALI_ADAPTOR_API bool UngrabKey(Window window, Dali::KEY daliKey);
/**
* @PLATFORM
* @param[in] returnVector The Dali::Vector of return boolean values for the results of multiple grab succeeds/fails
* @return bool false when error occurs
*/
-DALI_ADAPTOR_API bool GrabKeyList( Window window, const Dali::Vector<Dali::KEY>& daliKeyVector, const Dali::Vector<KeyGrabMode>& grabModeVector, Dali::Vector<bool>& returnVector);
-
+DALI_ADAPTOR_API bool GrabKeyList(Window window, const Dali::Vector<Dali::KEY>& daliKeyVector, const Dali::Vector<KeyGrabMode>& grabModeVector, Dali::Vector<bool>& returnVector);
/**
* @PLATFORM
* @note If this function is called between key down and up events of a grabbed key,
* an application doesn't receive the key up event.
*/
-DALI_ADAPTOR_API bool UngrabKeyList( Window window, const Dali::Vector<Dali::KEY>& daliKeyVector, Dali::Vector<bool>& returnVector);
-
+DALI_ADAPTOR_API bool UngrabKeyList(Window window, const Dali::Vector<Dali::KEY>& daliKeyVector, Dali::Vector<bool>& returnVector);
} // namespace KeyGrab
/*
- * Copyright (c) 2015 Samsung Electronics Co., Ltd.
+ * Copyright (c) 2020 Samsung Electronics Co., Ltd.
*
* Licensed under the Apache License, Version 2.0 (the "License");
* you may not use this file except in compliance with the License.
namespace Dali
{
-
-bool IsKey( const KeyEvent& keyEvent, KEY daliKey)
+bool IsKey(const KeyEvent& keyEvent, KEY daliKey)
{
- return Internal::Adaptor::KeyLookup::IsKey( keyEvent, daliKey );
+ return Internal::Adaptor::KeyLookup::IsKey(keyEvent, daliKey);
}
-}
+} // namespace Dali
#define DALI_KEYCODE_H
/*
- * Copyright (c) 2019 Samsung Electronics Co., Ltd.
+ * Copyright (c) 2020 Samsung Electronics Co., Ltd.
*
* Licensed under the Apache License, Version 2.0 (the "License");
* you may not use this file except in compliance with the License.
enum KEY
{
- DALI_KEY_INVALID = -1, ///< Invalid key value @SINCE_1_0.0
- DALI_KEY_ESCAPE = 9, ///< Escape key @SINCE_1_0.0
- DALI_KEY_BACKSPACE = 22, ///< Backspace key @SINCE_1_0.0
- DALI_KEY_SHIFT_LEFT = 50, ///< Shift Left key @SINCE_1_0.0
- DALI_KEY_SHIFT_RIGHT = 62, ///< Shift Right key @SINCE_1_0.0
- DALI_KEY_CURSOR_UP = 111, ///< Cursor up key @SINCE_1_0.0
- DALI_KEY_CURSOR_LEFT = 113, ///< Cursor left key @SINCE_1_0.0
- DALI_KEY_CURSOR_RIGHT = 114, ///< Cursor right key @SINCE_1_0.0
- DALI_KEY_CURSOR_DOWN = 116, ///< Cursor down key @SINCE_1_0.0
- DALI_KEY_BACK = 166, ///< Back key @SINCE_1_0.0
- DALI_KEY_CAMERA = 167, ///< Camera key @SINCE_1_0.0
- DALI_KEY_CONFIG = 168, ///< Config key @SINCE_1_0.0
- DALI_KEY_POWER = 169, ///< Power key @SINCE_1_0.0
- DALI_KEY_PAUSE = 170, ///< Pause key @SINCE_1_0.0
- DALI_KEY_CANCEL = 171, ///< Cancel key @SINCE_1_0.0
- DALI_KEY_PLAY_CD = 172, ///< Play CD key @SINCE_1_0.0
- DALI_KEY_STOP_CD = 173, ///< Stop CD key @SINCE_1_0.0
- DALI_KEY_PAUSE_CD = 174, ///< Pause CD key @SINCE_1_0.0
- DALI_KEY_NEXT_SONG = 175, ///< Next song key @SINCE_1_0.0
- DALI_KEY_PREVIOUS_SONG = 176, ///< Previous song key @SINCE_1_0.0
- DALI_KEY_REWIND = 177, ///< Rewind key @SINCE_1_0.0
- DALI_KEY_FASTFORWARD = 178, ///< Fastforward key @SINCE_1_0.0
- DALI_KEY_MEDIA = 179, ///< Media key @SINCE_1_0.0
- DALI_KEY_PLAY_PAUSE = 180, ///< Play pause key @SINCE_1_0.0
- DALI_KEY_MUTE = 181, ///< Mute key @SINCE_1_0.0
- DALI_KEY_MENU = 182, ///< Menu key @SINCE_1_0.0
- DALI_KEY_HOME = 183, ///< Home key @SINCE_1_0.0
- DALI_KEY_HOMEPAGE = 187, ///< Homepage key @SINCE_1_0.0
- DALI_KEY_WEBPAGE = 188, ///< Webpage key @SINCE_1_0.0
- DALI_KEY_MAIL = 189, ///< Mail key @SINCE_1_0.0
- DALI_KEY_SCREENSAVER = 190, ///< Screensaver key @SINCE_1_0.0
- DALI_KEY_BRIGHTNESS_UP = 191, ///< Brightness up key @SINCE_1_0.0
- DALI_KEY_BRIGHTNESS_DOWN = 192, ///< Brightness down key @SINCE_1_0.0
- DALI_KEY_SOFT_KBD = 193, ///< Soft KBD key @SINCE_1_0.0
- DALI_KEY_QUICK_PANEL = 194, ///< Quick panel key @SINCE_1_0.0
- DALI_KEY_TASK_SWITCH = 195, ///< Task switch key @SINCE_1_0.0
- DALI_KEY_APPS = 196, ///< Apps key @SINCE_1_0.0
- DALI_KEY_SEARCH = 197, ///< Search key @SINCE_1_0.0
- DALI_KEY_VOICE = 198, ///< Voice key @SINCE_1_0.0
- DALI_KEY_LANGUAGE = 199, ///< Language key @SINCE_1_0.0
- DALI_KEY_VOLUME_UP = 200, ///< Volume up key @SINCE_1_0.0
- DALI_KEY_VOLUME_DOWN = 201 ///< Volume down key @SINCE_1_0.0
+ DALI_KEY_INVALID = -1, ///< Invalid key value @SINCE_1_0.0
+ DALI_KEY_ESCAPE = 9, ///< Escape key @SINCE_1_0.0
+ DALI_KEY_BACKSPACE = 22, ///< Backspace key @SINCE_1_0.0
+ DALI_KEY_SHIFT_LEFT = 50, ///< Shift Left key @SINCE_1_0.0
+ DALI_KEY_SHIFT_RIGHT = 62, ///< Shift Right key @SINCE_1_0.0
+ DALI_KEY_CURSOR_UP = 111, ///< Cursor up key @SINCE_1_0.0
+ DALI_KEY_CURSOR_LEFT = 113, ///< Cursor left key @SINCE_1_0.0
+ DALI_KEY_CURSOR_RIGHT = 114, ///< Cursor right key @SINCE_1_0.0
+ DALI_KEY_CURSOR_DOWN = 116, ///< Cursor down key @SINCE_1_0.0
+ DALI_KEY_BACK = 166, ///< Back key @SINCE_1_0.0
+ DALI_KEY_CAMERA = 167, ///< Camera key @SINCE_1_0.0
+ DALI_KEY_CONFIG = 168, ///< Config key @SINCE_1_0.0
+ DALI_KEY_POWER = 169, ///< Power key @SINCE_1_0.0
+ DALI_KEY_PAUSE = 170, ///< Pause key @SINCE_1_0.0
+ DALI_KEY_CANCEL = 171, ///< Cancel key @SINCE_1_0.0
+ DALI_KEY_PLAY_CD = 172, ///< Play CD key @SINCE_1_0.0
+ DALI_KEY_STOP_CD = 173, ///< Stop CD key @SINCE_1_0.0
+ DALI_KEY_PAUSE_CD = 174, ///< Pause CD key @SINCE_1_0.0
+ DALI_KEY_NEXT_SONG = 175, ///< Next song key @SINCE_1_0.0
+ DALI_KEY_PREVIOUS_SONG = 176, ///< Previous song key @SINCE_1_0.0
+ DALI_KEY_REWIND = 177, ///< Rewind key @SINCE_1_0.0
+ DALI_KEY_FASTFORWARD = 178, ///< Fastforward key @SINCE_1_0.0
+ DALI_KEY_MEDIA = 179, ///< Media key @SINCE_1_0.0
+ DALI_KEY_PLAY_PAUSE = 180, ///< Play pause key @SINCE_1_0.0
+ DALI_KEY_MUTE = 181, ///< Mute key @SINCE_1_0.0
+ DALI_KEY_MENU = 182, ///< Menu key @SINCE_1_0.0
+ DALI_KEY_HOME = 183, ///< Home key @SINCE_1_0.0
+ DALI_KEY_HOMEPAGE = 187, ///< Homepage key @SINCE_1_0.0
+ DALI_KEY_WEBPAGE = 188, ///< Webpage key @SINCE_1_0.0
+ DALI_KEY_MAIL = 189, ///< Mail key @SINCE_1_0.0
+ DALI_KEY_SCREENSAVER = 190, ///< Screensaver key @SINCE_1_0.0
+ DALI_KEY_BRIGHTNESS_UP = 191, ///< Brightness up key @SINCE_1_0.0
+ DALI_KEY_BRIGHTNESS_DOWN = 192, ///< Brightness down key @SINCE_1_0.0
+ DALI_KEY_SOFT_KBD = 193, ///< Soft KBD key @SINCE_1_0.0
+ DALI_KEY_QUICK_PANEL = 194, ///< Quick panel key @SINCE_1_0.0
+ DALI_KEY_TASK_SWITCH = 195, ///< Task switch key @SINCE_1_0.0
+ DALI_KEY_APPS = 196, ///< Apps key @SINCE_1_0.0
+ DALI_KEY_SEARCH = 197, ///< Search key @SINCE_1_0.0
+ DALI_KEY_VOICE = 198, ///< Voice key @SINCE_1_0.0
+ DALI_KEY_LANGUAGE = 199, ///< Language key @SINCE_1_0.0
+ DALI_KEY_VOLUME_UP = 200, ///< Volume up key @SINCE_1_0.0
+ DALI_KEY_VOLUME_DOWN = 201 ///< Volume down key @SINCE_1_0.0
};
/**
* @param daliKey Dali key enum
* @return @c true if the key is matched, @c false if not
*/
-DALI_ADAPTOR_API bool IsKey( const Dali::KeyEvent& keyEvent, Dali::KEY daliKey);
+DALI_ADAPTOR_API bool IsKey(const Dali::KeyEvent& keyEvent, Dali::KEY daliKey);
/**
* @}
#include <dali/public-api/object/any.h>
// INTERNAL INCLUDES
-#include <dali/internal/imaging/common/native-image-source-impl.h>
#include <dali/internal/imaging/common/native-image-source-factory.h>
+#include <dali/internal/imaging/common/native-image-source-impl.h>
namespace Dali
{
-
-NativeImageSourcePtr NativeImageSource::New( unsigned int width, unsigned int height, ColorDepth depth )
+NativeImageSourcePtr NativeImageSource::New(unsigned int width, unsigned int height, ColorDepth depth)
{
- Any empty;
- NativeImageSourcePtr image = new NativeImageSource( width, height, depth, empty );
+ Any empty;
+ NativeImageSourcePtr image = new NativeImageSource(width, height, depth, empty);
return image;
}
return mImpl->GetNativeImageSource();
}
-NativeImageSourcePtr NativeImageSource::New( Any nativeImageSource )
+NativeImageSourcePtr NativeImageSource::New(Any nativeImageSource)
{
NativeImageSourcePtr image = new NativeImageSource(0, 0, COLOR_DEPTH_DEFAULT, nativeImageSource);
return image;
}
-bool NativeImageSource::GetPixels( std::vector<unsigned char> &pixbuf, unsigned int &width, unsigned int &height, Pixel::Format& pixelFormat ) const
+bool NativeImageSource::GetPixels(std::vector<unsigned char>& pixbuf, unsigned int& width, unsigned int& height, Pixel::Format& pixelFormat) const
{
- return mImpl->GetPixels( pixbuf, width, height, pixelFormat );
+ return mImpl->GetPixels(pixbuf, width, height, pixelFormat);
}
bool NativeImageSource::EncodeToFile(const std::string& filename) const
{
- return mImpl->EncodeToFile( filename );
+ return mImpl->EncodeToFile(filename);
}
-void NativeImageSource::SetSource( Any source )
+void NativeImageSource::SetSource(Any source)
{
- mImpl->SetSource( source );
+ mImpl->SetSource(source);
}
-bool NativeImageSource::IsColorDepthSupported( ColorDepth colorDepth )
+bool NativeImageSource::IsColorDepthSupported(ColorDepth colorDepth)
{
- return mImpl->IsColorDepthSupported( colorDepth );
+ return mImpl->IsColorDepthSupported(colorDepth);
}
bool NativeImageSource::CreateResource()
return mImpl->GetNativeImageInterfaceExtension();
}
-NativeImageSource::NativeImageSource( unsigned int width, unsigned int height, ColorDepth depth, Any nativeImageSource )
+NativeImageSource::NativeImageSource(unsigned int width, unsigned int height, ColorDepth depth, Any nativeImageSource)
{
auto factory = Dali::Internal::Adaptor::GetNativeImageSourceFactory();
- mImpl = factory->CreateNativeImageSource( width, height, depth, nativeImageSource ).release();
+ mImpl = factory->CreateNativeImageSource(width, height, depth, nativeImageSource).release();
}
NativeImageSource::~NativeImageSource()
#define DALI_NATIVE_IMAGE_SOURCE_H
/*
- * Copyright (c) 2019 Samsung Electronics Co., Ltd.
+ * Copyright (c) 2020 Samsung Electronics Co., Ltd.
*
* Licensed under the Apache License, Version 2.0 (the "License");
* you may not use this file except in compliance with the License.
{
class NativeImageSource;
}
-}
+} // namespace DALI_INTERNAL
class NativeImageSource;
/**
class DALI_ADAPTOR_API NativeImageSource : public NativeImageInterface
{
public:
-
- /**
+ /**
* @brief Enumeration for the instance when creating a native image, the color depth has to be specified.
* @SINCE_1_0.0
*/
- enum ColorDepth
- {
- COLOR_DEPTH_DEFAULT, ///< Uses the current screen default depth (recommended) @SINCE_1_0.0
- COLOR_DEPTH_8, ///< 8 bits per pixel @SINCE_1_0.0
- COLOR_DEPTH_16, ///< 16 bits per pixel @SINCE_1_0.0
- COLOR_DEPTH_24, ///< 24 bits per pixel @SINCE_1_0.0
- COLOR_DEPTH_32 ///< 32 bits per pixel @SINCE_1_0.0
- };
+ enum ColorDepth
+ {
+ COLOR_DEPTH_DEFAULT, ///< Uses the current screen default depth (recommended) @SINCE_1_0.0
+ COLOR_DEPTH_8, ///< 8 bits per pixel @SINCE_1_0.0
+ COLOR_DEPTH_16, ///< 16 bits per pixel @SINCE_1_0.0
+ COLOR_DEPTH_24, ///< 24 bits per pixel @SINCE_1_0.0
+ COLOR_DEPTH_32 ///< 32 bits per pixel @SINCE_1_0.0
+ };
/**
* @brief Creates a new NativeImageSource.
* @param[in] depth color depth of the image
* @return A smart-pointer to a newly allocated image
*/
- static NativeImageSourcePtr New( unsigned int width, unsigned int height, ColorDepth depth );
+ static NativeImageSourcePtr New(unsigned int width, unsigned int height, ColorDepth depth);
/**
* @brief Creates a new NativeImageSource from an existing native image source.
* @return A smart-pointer to a newly allocated image
* @see NativeImageInterface
*/
- static NativeImageSourcePtr New( Any nativeImageSource );
+ static NativeImageSourcePtr New(Any nativeImageSource);
/**
* @brief Retrieves the internal native image.
* @param[out] pixelFormat pixel format used by image
* @return @c true if the pixels were gotten, and @c false otherwise
*/
- bool GetPixels( std::vector<unsigned char>& pixbuf, unsigned int& width, unsigned int& height, Pixel::Format& pixelFormat ) const;
+ bool GetPixels(std::vector<unsigned char>& pixbuf, unsigned int& width, unsigned int& height, Pixel::Format& pixelFormat) const;
/**
* @brief Converts the current pixel contents to either a JPEG or PNG format
* @SINCE_1_1.19
* @param[in] source Any handle with the source
*/
- void SetSource( Any source );
+ void SetSource(Any source);
/**
* @brief Checks if the specified color depth is supported.
* @param[in] colorDepth The color depth to check
* @return @c true if colorDepth is supported, @c false otherwise
*/
- bool IsColorDepthSupported( ColorDepth colorDepth );
+ bool IsColorDepthSupported(ColorDepth colorDepth);
/**
* @copydoc Dali::NativeImageInterface::GetTextureTarget()
*/
const char* GetCustomSamplerTypename() const override;
-private: // native image
-
+private: // native image
/**
* @copydoc Dali::NativeImageInterface::CreateResource()
*/
/**
* @copydoc Dali::NativeImageInterface::GetExtension()
*/
- NativeImageInterface::Extension* GetExtension();
+ NativeImageInterface::Extension* GetExtension() override;
private:
-
/// @cond internal
/**
* @brief Private constructor.
* @param[in] depth color depth of the image
* @param[in] nativeImageSource contains either: native image source or is empty
*/
- DALI_INTERNAL NativeImageSource( unsigned int width, unsigned int height, ColorDepth depth, Any nativeImageSource );
+ DALI_INTERNAL NativeImageSource(unsigned int width, unsigned int height, ColorDepth depth, Any nativeImageSource);
/**
* @brief A reference counted object may only be deleted by calling Unreference().
* The implementation should destroy the NativeImage resources.
* @SINCE_1_0.0
*/
- DALI_INTERNAL virtual ~NativeImageSource();
+ DALI_INTERNAL ~NativeImageSource() override;
/**
* @brief Undefined copy constructor.
* @SINCE_1_0.0
* @param[in] nativeImageSource A reference to the object to copy
*/
- DALI_INTERNAL NativeImageSource( const NativeImageSource& nativeImageSource );
+ DALI_INTERNAL NativeImageSource(const NativeImageSource& nativeImageSource);
/**
* @brief Undefined assignment operator.
/// @endcond
private:
-
/// @cond internal
Internal::Adaptor::NativeImageSource* mImpl; ///< Implementation pointer
friend class Internal::Adaptor::NativeImageSource;
#define DALI_STYLE_CHANGE_H
/*
- * Copyright (c) 2019 Samsung Electronics Co., Ltd.
+ * Copyright (c) 2020 Samsung Electronics Co., Ltd.
*
* Licensed under the Apache License, Version 2.0 (the "License");
* you may not use this file except in compliance with the License.
*/
namespace StyleChange
{
-
/**
* @brief Enumeration for StyleChange type.
* @SINCE_1_0.0
#include <dali/public-api/adaptor-framework/timer.h>
// INTERNAL INCLUDES
-#include <dali/public-api/dali-adaptor-common.h>
#include <dali/internal/system/common/timer-impl.h>
+#include <dali/public-api/dali-adaptor-common.h>
namespace Dali
{
-
Timer::Timer()
{
}
-Timer Timer::New( unsigned int milliSec )
+Timer Timer::New(unsigned int milliSec)
{
- Internal::Adaptor::TimerPtr internal = Internal::Adaptor::Timer::New( milliSec );
+ Internal::Adaptor::TimerPtr internal = Internal::Adaptor::Timer::New(milliSec);
return Timer(internal.Get());
}
-Timer::Timer( const Timer& copy ) = default;
+Timer::Timer(const Timer& copy) = default;
-Timer& Timer::operator=( const Timer& rhs ) = default;
+Timer& Timer::operator=(const Timer& rhs) = default;
-Timer::Timer( Timer&& rhs ) = default;
+Timer::Timer(Timer&& rhs) = default;
-Timer& Timer::operator=( Timer&& rhs ) = default;
+Timer& Timer::operator=(Timer&& rhs) = default;
Timer::~Timer()
{
}
-Timer Timer::DownCast( BaseHandle handle )
+Timer Timer::DownCast(BaseHandle handle)
{
- return Timer( dynamic_cast<Internal::Adaptor::Timer*>( handle.GetObjectPtr() ) );
+ return Timer(dynamic_cast<Internal::Adaptor::Timer*>(handle.GetObjectPtr()));
}
void Timer::Start()
Internal::Adaptor::GetImplementation(*this).Resume();
}
-void Timer::SetInterval( unsigned int interval )
+void Timer::SetInterval(unsigned int interval)
{
- Internal::Adaptor::GetImplementation(*this).SetInterval( interval, true );
+ Internal::Adaptor::GetImplementation(*this).SetInterval(interval, true);
}
-void Timer::SetInterval( unsigned int interval, bool restart )
+void Timer::SetInterval(unsigned int interval, bool restart)
{
- Internal::Adaptor::GetImplementation(*this).SetInterval( interval, restart );
+ Internal::Adaptor::GetImplementation(*this).SetInterval(interval, restart);
}
unsigned int Timer::GetInterval() const
{
}
-
} // namespace Dali
{
class Timer;
}
-}
+} // namespace DALI_INTERNAL
/**
* @brief Mechanism to issue simple periodic or one-shot events.
*/
class DALI_ADAPTOR_API Timer : public BaseHandle
{
-public: // Signal typedefs
-
- typedef Signal< bool () > TimerSignalType; ///< Timer finished signal callback type @SINCE_1_0.0
+public: // Signal typedefs
+ typedef Signal<bool()> TimerSignalType; ///< Timer finished signal callback type @SINCE_1_0.0
public: // API
-
/**
* @brief Constructor, creates an uninitialized timer.
*
* @param[in] milliSec Interval in milliseconds
* @return A new timer
*/
- static Timer New( unsigned int milliSec );
+ static Timer New(unsigned int milliSec);
/**
* @brief Copy constructor.
* @SINCE_1_0.0
* @param[in] timer The handle to copy. The copied handle will point at the same implementation
*/
- Timer( const Timer& timer );
+ Timer(const Timer& timer);
/**
* @brief Assignment operator.
* as the copied handle
* @return Reference to this timer handle
*/
- Timer& operator=( const Timer& timer );
+ Timer& operator=(const Timer& timer);
/**
* @brief Move constructor.
* @SINCE_1_9.24
* @param[in] rhs A reference to the moved handle
*/
- Timer( Timer&& rhs );
+ Timer(Timer&& rhs);
/**
* @brief Move assignment operator.
* @param[in] rhs A reference to the moved handle
* @return A reference to this handle
*/
- Timer& operator=( Timer&& rhs );
+ Timer& operator=(Timer&& rhs);
/**
* @brief Destructor.
* @param[in] handle to An object
* @return handle to a Timer object or an uninitialized handle
*/
- static Timer DownCast( BaseHandle handle );
+ static Timer DownCast(BaseHandle handle);
/**
* @brief Starts timer.
* @SINCE_1_0.0
* @param[in] milliSec Interval in milliseconds
*/
- void SetInterval( unsigned int milliSec );
+ void SetInterval(unsigned int milliSec);
/**
* @brief Sets a new interval on the timer with option to restart the timer.
* @param[in] milliSec Interval in milliseconds
* @param[in] restart Flag to set enabled to restart or not.
*/
- void SetInterval( unsigned int milliSec, bool restart );
+ void SetInterval(unsigned int milliSec, bool restart);
/**
* @brief Gets the interval of timer.
bool IsRunning() const;
public: // Signals
-
/**
* @brief Signal emitted after specified time interval.
*
/*
- * Copyright (c) 2015 Samsung Electronics Co., Ltd.
+ * Copyright (c) 2020 Samsung Electronics Co., Ltd.
*
* Licensed under the Apache License, Version 2.0 (the "License");
* you may not use this file except in compliance with the License.
namespace Dali
{
-
TtsPlayer::TtsPlayer()
{
}
{
TtsPlayer ttsPlayer;
- if ( Adaptor::IsAvailable() )
+ if(Adaptor::IsAvailable())
{
- ttsPlayer = Internal::Adaptor::Adaptor::GetImplementation( Adaptor::Get() ).GetTtsPlayer(mode);
+ ttsPlayer = Internal::Adaptor::Adaptor::GetImplementation(Adaptor::Get()).GetTtsPlayer(mode);
}
return ttsPlayer;
{
}
-TtsPlayer::TtsPlayer( const TtsPlayer& copy ) = default;
+TtsPlayer::TtsPlayer(const TtsPlayer& copy) = default;
-TtsPlayer& TtsPlayer::operator=( const TtsPlayer& rhs ) = default;
+TtsPlayer& TtsPlayer::operator=(const TtsPlayer& rhs) = default;
-TtsPlayer::TtsPlayer( TtsPlayer&& rhs ) = default;
+TtsPlayer::TtsPlayer(TtsPlayer&& rhs) = default;
-TtsPlayer& TtsPlayer::operator=( TtsPlayer&& rhs ) = default;
+TtsPlayer& TtsPlayer::operator=(TtsPlayer&& rhs) = default;
void TtsPlayer::Play(const std::string& text)
{
return GetImplementation(*this).StateChangedSignal();
}
-TtsPlayer::TtsPlayer( Internal::Adaptor::TtsPlayer* player )
-: BaseHandle( player )
+TtsPlayer::TtsPlayer(Internal::Adaptor::TtsPlayer* player)
+: BaseHandle(player)
{
}
{
class TtsPlayer;
}
-}
+} // namespace DALI_INTERNAL
/**
* @brief The Text-to-speech (TTS) Player.
class DALI_ADAPTOR_API TtsPlayer : public BaseHandle
{
public: // ENUMs
-
/**
* @brief Enumeration for the instance of TTS mode.
* @SINCE_1_0.0
*/
enum Mode
{
- DEFAULT = 0, ///< Default mode for normal application @SINCE_1_0.0
- NOTIFICATION, ///< Notification mode, such as playing utterance is started or completed @SINCE_1_0.0
+ DEFAULT = 0, ///< Default mode for normal application @SINCE_1_0.0
+ NOTIFICATION, ///< Notification mode, such as playing utterance is started or completed @SINCE_1_0.0
SCREEN_READER, ///< Screen reader mode. To help visually impaired users interact with their devices, screen reader reads text or graphic elements on the screen using the TTS engine. @SINCE_1_0.0
MODE_NUM
};
*/
enum State
{
- UNAVAILABLE = 0, ///< Player is not available @SINCE_1_0.0
- READY, ///< Player is ready to play @SINCE_1_0.0
- PLAYING, ///< Player is playing @SINCE_1_0.0
- PAUSED ///< Player is paused @SINCE_1_0.0
+ UNAVAILABLE = 0, ///< Player is not available @SINCE_1_0.0
+ READY, ///< Player is ready to play @SINCE_1_0.0
+ PLAYING, ///< Player is playing @SINCE_1_0.0
+ PAUSED ///< Player is paused @SINCE_1_0.0
};
public: // Typedefs
-
/**
* @brief Type of signal emitted when the TTS state changes.
* @SINCE_1_0.0
*/
- typedef Signal< void ( const Dali::TtsPlayer::State, const Dali::TtsPlayer::State ) > StateChangedSignalType;
+ typedef Signal<void(const Dali::TtsPlayer::State, const Dali::TtsPlayer::State)> StateChangedSignalType;
public: // API
-
/**
* @brief Creates an uninitialized handle.
*
* @SINCE_1_9.24
* @param[in] rhs A reference to the moved handle
*/
- TtsPlayer( TtsPlayer&& rhs );
+ TtsPlayer(TtsPlayer&& rhs);
/**
* @brief Move assignment operator.
* @param[in] rhs A reference to the moved handle
* @return A reference to this handle
*/
- TtsPlayer& operator=( TtsPlayer&& rhs );
+ TtsPlayer& operator=(TtsPlayer&& rhs);
/**
* @brief Starts playing the audio data synthesized from the specified text.
Dali::TtsPlayer::StateChangedSignalType& StateChangedSignal();
public: // Not intended for application developers
-
/// @cond internal
/**
* @brief This constructor is used by TtsPlayer::Get().
* @SINCE_1_0.0
* @param[in] ttsPlayer A pointer to the TTS player
*/
- explicit DALI_INTERNAL TtsPlayer( Internal::Adaptor::TtsPlayer* ttsPlayer );
+ explicit DALI_INTERNAL TtsPlayer(Internal::Adaptor::TtsPlayer* ttsPlayer);
/// @endcond
};
namespace Dali
{
-
-WidgetApplication WidgetApplication::New( int* argc, char **argv[], const std::string& stylesheet )
+WidgetApplication WidgetApplication::New(int* argc, char** argv[], const std::string& stylesheet)
{
- Internal::Adaptor::WidgetApplicationPtr internal = Internal::Adaptor::WidgetApplication::New( argc, argv, stylesheet);
+ Internal::Adaptor::WidgetApplicationPtr internal = Internal::Adaptor::WidgetApplication::New(argc, argv, stylesheet);
return WidgetApplication(internal.Get());
}
{
}
-WidgetApplication::WidgetApplication( const WidgetApplication& copy ) = default;
+WidgetApplication::WidgetApplication(const WidgetApplication& copy) = default;
-WidgetApplication& WidgetApplication::operator=( const WidgetApplication& rhs ) = default;
+WidgetApplication& WidgetApplication::operator=(const WidgetApplication& rhs) = default;
-WidgetApplication::WidgetApplication( WidgetApplication&& rhs ) = default;
+WidgetApplication::WidgetApplication(WidgetApplication&& rhs) = default;
-WidgetApplication& WidgetApplication::operator=( WidgetApplication&& rhs ) = default;
+WidgetApplication& WidgetApplication::operator=(WidgetApplication&& rhs) = default;
-void WidgetApplication::RegisterWidgetCreatingFunction( const std::string& widgetName, CreateWidgetFunction createFunction )
+void WidgetApplication::RegisterWidgetCreatingFunction(const std::string& widgetName, CreateWidgetFunction createFunction)
{
- Internal::Adaptor::GetImplementation(*this).RegisterWidgetCreatingFunction( widgetName, createFunction );
+ Internal::Adaptor::GetImplementation(*this).RegisterWidgetCreatingFunction(widgetName, createFunction);
}
WidgetApplication::WidgetApplication(Internal::Adaptor::WidgetApplication* widgetApplication)
namespace Internal DALI_INTERNAL
{
-
namespace Adaptor
{
class WidgetApplication;
}
-}
+} // namespace DALI_INTERNAL
class Widget;
class DALI_ADAPTOR_API WidgetApplication : public Application
{
public:
-
/**
* @brief This is the typedef for Widget creator.
* @SINCE_1_3_5
*/
- typedef Widget(*CreateWidgetFunction)(const std::string&);
+ typedef Widget (*CreateWidgetFunction)(const std::string&);
public:
-
/**
* @brief This is the constructor for WidgetApplications with a name.
*
* @return A handle to the WidgetApplication
* @note If the stylesheet is not specified, then the library's default stylesheet will not be overridden.
*/
- static WidgetApplication New( int* argc, char **argv[], const std::string& stylesheet );
+ static WidgetApplication New(int* argc, char** argv[], const std::string& stylesheet);
/**
* @brief The default constructor.
* @SINCE_1_3_5
* @param[in] widgetApplication Handle to an object
*/
- WidgetApplication( const WidgetApplication& widgetApplication );
+ WidgetApplication(const WidgetApplication& widgetApplication);
/**
* @brief Assignment operator.
* @param[in] widgetApplication Handle to an object
* @return A reference to this
*/
- WidgetApplication& operator=( const WidgetApplication& widgetApplication );
+ WidgetApplication& operator=(const WidgetApplication& widgetApplication);
/**
* @brief Move constructor.
* @SINCE_1_9.24
* @param[in] rhs A reference to the moved handle
*/
- WidgetApplication( WidgetApplication&& rhs );
+ WidgetApplication(WidgetApplication&& rhs);
/**
* @brief Move assignment operator.
* @param[in] rhs A reference to the moved handle
* @return A reference to this handle
*/
- WidgetApplication& operator=( WidgetApplication&& rhs );
+ WidgetApplication& operator=(WidgetApplication&& rhs);
- /**
+ /**
* @brief Destructor
* @SINCE_1_3_5
*/
* @param[in] widgetName Name of widget
* @param[in] createFunction Function pointer for widget creation.
*/
- void RegisterWidgetCreatingFunction( const std::string& widgetName, CreateWidgetFunction createFunction );
+ void RegisterWidgetCreatingFunction(const std::string& widgetName, CreateWidgetFunction createFunction);
public: // Not intended for application developers
/// @cond internal
/*
- * Copyright (c) 2017 Samsung Electronics Co., Ltd.
+ * Copyright (c) 2020 Samsung Electronics Co., Ltd.
*
* Licensed under the Apache License, Version 2.0 (the "License");
* you may not use this file except in compliance with the License.
namespace Dali
{
-
namespace Internal
{
-
namespace Adaptor
{
-
WidgetPtr Widget::New()
{
return new Widget();
}
Widget::Widget()
-: mImpl( nullptr )
+: mImpl(nullptr)
{
}
Widget::~Widget()
{
- if( mImpl != nullptr )
+ if(mImpl != nullptr)
{
delete mImpl;
}
}
-void Widget::OnCreate( const std::string& contentInfo, Dali::Window window )
+void Widget::OnCreate(const std::string& contentInfo, Dali::Window window)
{
}
-void Widget::OnTerminate( const std::string& contentInfo, Dali::Widget::Termination type )
+void Widget::OnTerminate(const std::string& contentInfo, Dali::Widget::Termination type)
{
}
{
}
-void Widget::OnResize( Dali::Window window )
+void Widget::OnResize(Dali::Window window)
{
}
-void Widget::OnUpdate( const std::string& contentInfo, int force )
+void Widget::OnUpdate(const std::string& contentInfo, int force)
{
}
-void Widget::SignalConnected( SlotObserver* slotObserver, CallbackBase* callback )
+void Widget::SignalConnected(SlotObserver* slotObserver, CallbackBase* callback)
{
- mImpl->SignalConnected( slotObserver, callback );
+ mImpl->SignalConnected(slotObserver, callback);
}
-void Widget::SignalDisconnected( SlotObserver* slotObserver, CallbackBase* callback )
+void Widget::SignalDisconnected(SlotObserver* slotObserver, CallbackBase* callback)
{
- mImpl->SignalDisconnected( slotObserver, callback );
+ mImpl->SignalDisconnected(slotObserver, callback);
}
-void Widget::SetContentInfo( const std::string& contentInfo )
+void Widget::SetContentInfo(const std::string& contentInfo)
{
- if( mImpl != nullptr )
+ if(mImpl != nullptr)
{
- mImpl->SetContentInfo( contentInfo );
+ mImpl->SetContentInfo(contentInfo);
}
}
-void Widget::SetImpl( Impl* impl )
+void Widget::SetImpl(Impl* impl)
{
mImpl = impl;
}
return static_cast<const Internal::Adaptor::Widget&>(handle);
}
-} // Adaptor
+} // namespace Adaptor
-} // Internal
+} // namespace Internal
-} // Dali
+} // namespace Dali
#define DALI_INTERNAL_WIDGET_H
/*
- * Copyright (c) 2018 Samsung Electronics Co., Ltd.
+ * Copyright (c) 2020 Samsung Electronics Co., Ltd.
*
* Licensed under the Apache License, Version 2.0 (the "License");
* you may not use this file except in compliance with the License.
namespace Dali
{
-
/**
* @addtogroup dali_adaptor_framework
* @{
namespace Internal
{
-
namespace Adaptor
{
-
class Widget;
typedef IntrusivePtr<Widget> WidgetPtr;
class DALI_ADAPTOR_API Widget : public BaseObject, public ConnectionTrackerInterface
{
public:
-
/**
* @brief Creates a new WidgetImpl instance.
*
* @param[in] contentInfo Information from WidgetView for creating. It contains previous status of widget which is sent by SetContentInfo before.
* @param[in] window Window handle for widget
*/
- virtual void OnCreate( const std::string& contentInfo, Dali::Window window );
+ virtual void OnCreate(const std::string& contentInfo, Dali::Window window);
/**
* @brief The user should override this function to determine when they terminate widget.
* @param[in] contentInfo Data from WidgetView for deleting
* @param[in] type Termination type. When user delete widget view, termination type is PERMANENT.
*/
- virtual void OnTerminate( const std::string& contentInfo, Dali::Widget::Termination type );
+ virtual void OnTerminate(const std::string& contentInfo, Dali::Widget::Termination type);
/**
* @brief The user should override this function to determine when they pause widget.
* @SINCE_1_3_5
* @param[in] window Window handle for widget
*/
- virtual void OnResize( Dali::Window window );
+ virtual void OnResize(Dali::Window window);
/**
* @brief The user should override this function to determine when they update widget.
* @param[in] contentInfo Data from WidgetView for updating
* @param[in] force Although the widget is paused, if it is true, the widget can be updated
*/
- virtual void OnUpdate( const std::string& contentInfo, int force );
+ virtual void OnUpdate(const std::string& contentInfo, int force);
// From ConnectionTrackerInterface
/**
* @copydoc ConnectionTrackerInterface::SignalConnected
*/
- virtual void SignalConnected( SlotObserver* slotObserver, CallbackBase* callback );
+ void SignalConnected(SlotObserver* slotObserver, CallbackBase* callback) override;
/**
* @copydoc ConnectionTrackerInterface::SignalDisconnected
*/
- virtual void SignalDisconnected( SlotObserver* slotObserver, CallbackBase* callback );
+ void SignalDisconnected(SlotObserver* slotObserver, CallbackBase* callback) override;
/**
* @brief Set content info to WidgetView.
* @SINCE_1_3_5
* @param[in] contentInfo Content info is kind of context information which contains current status of widget.
*/
- void SetContentInfo( const std::string& contentInfo );
+ void SetContentInfo(const std::string& contentInfo);
protected:
-
/**
* @brief WidgetImpl constructor
*/
/**
* @brief Virtual destructor
*/
- virtual ~Widget();
+ ~Widget() override;
/// @cond internal
public:
* Set pointer of WidgetImpl Internal.
* @SINCE_1_3_5
*/
- void SetImpl( Impl* impl );
+ void SetImpl(Impl* impl);
private:
Impl* mImpl;
DALI_INTERNAL Widget(const Widget&);
DALI_INTERNAL Widget& operator=(Widget&);
/// @endcond
-
};
/**
* @return Implementation
* @pre handle is initialized and points to a widget
*/
-DALI_ADAPTOR_API Internal::Adaptor::Widget& GetImplementation( Dali::Widget& widget );
+DALI_ADAPTOR_API Internal::Adaptor::Widget& GetImplementation(Dali::Widget& widget);
/**
* @brief Gets implementation from the handle.
* @return Implementation
* @pre Handle is initialized and points to a widget.
*/
-DALI_ADAPTOR_API const Internal::Adaptor::Widget& GetImplementation( const Dali::Widget& widget );
+DALI_ADAPTOR_API const Internal::Adaptor::Widget& GetImplementation(const Dali::Widget& widget);
} // namespace Adaptor
namespace Dali
{
-
Widget Widget::New()
{
Internal::Adaptor::WidgetPtr internal = Internal::Adaptor::Widget::New();
{
}
-Widget::Widget( const Widget& copy ) = default;
+Widget::Widget(const Widget& copy) = default;
-Widget& Widget::operator=( const Widget& rhs ) = default;
+Widget& Widget::operator=(const Widget& rhs) = default;
-Widget::Widget( Widget&& rhs ) = default;
+Widget::Widget(Widget&& rhs) = default;
-Widget& Widget::operator=( Widget&& rhs ) = default;
+Widget& Widget::operator=(Widget&& rhs) = default;
Widget::Widget(Internal::Adaptor::Widget* widget)
: BaseHandle(widget)
namespace Dali
{
-
- /**
+/**
* @addtogroup dali_adaptor_framework
* @{
*/
namespace Internal
{
-
namespace Adaptor
{
class Widget;
}
-}
-
+} // namespace Internal
/**
* @brief Widget class is the base class for custom widget.
class DALI_ADAPTOR_API Widget : public BaseHandle
{
public:
-
/**
* @brief Enumeration class for termination type of widget instance.
* @SINCE_1_3_5
};
public:
-
/**
* @brief This is the constructor for Widget.
* @SINCE_1_3_5
* @SINCE_1_3_5
* @param[in] widget Handle to an object
*/
- Widget( const Widget& widget );
+ Widget(const Widget& widget);
/**
* @brief Assignment operator.
* @param[in] widget Handle to an object
* @return A reference to this
*/
- Widget& operator=( const Widget& widget );
+ Widget& operator=(const Widget& widget);
/**
* @brief Move constructor.
* @SINCE_1_9.24
* @param[in] rhs A reference to the moved handle
*/
- Widget( Widget&& rhs );
+ Widget(Widget&& rhs);
/**
* @brief Move assignment operator.
* @param[in] rhs A reference to the moved handle
* @return A reference to this handle
*/
- Widget& operator=( Widget&& rhs );
+ Widget& operator=(Widget&& rhs);
/**
* @brief Destructor
#include <dali/integration-api/debug.h>
// INTERNAL INCLUDES
-#include <dali/public-api/actors/actor.h>
-#include <dali/internal/window-system/common/window-impl.h>
#include <dali/internal/window-system/common/orientation-impl.h>
+#include <dali/internal/window-system/common/window-impl.h>
+#include <dali/public-api/actors/actor.h>
namespace Dali
{
-
Window Window::New(PositionSize posSize, const std::string& name, bool isTransparent)
{
return Dali::Window::New(posSize, name, "", isTransparent);
Window newWindow;
const bool isAdaptorAvailable = Dali::Adaptor::IsAvailable();
- bool isNewWindowAllowed = true;
+ bool isNewWindowAllowed = true;
- if (isAdaptorAvailable)
+ if(isAdaptorAvailable)
{
Dali::Adaptor& adaptor = Internal::Adaptor::Adaptor::Get();
- isNewWindowAllowed = Internal::Adaptor::Adaptor::GetImplementation(adaptor).IsMultipleWindowSupported();
+ isNewWindowAllowed = Internal::Adaptor::Adaptor::GetImplementation(adaptor).IsMultipleWindowSupported();
}
- if (isNewWindowAllowed)
+ if(isNewWindowAllowed)
{
Internal::Adaptor::Window* window = Internal::Adaptor::Window::New(posSize, name, className, isTransparent);
Integration::SceneHolder sceneHolder = Integration::SceneHolder(window);
- if (isAdaptorAvailable)
+ if(isAdaptorAvailable)
{
Dali::Adaptor& adaptor = Internal::Adaptor::Adaptor::Get();
Internal::Adaptor::Adaptor::GetImplementation(adaptor).AddWindow(sceneHolder);
{
}
-Window::Window( const Window& copy ) = default;
+Window::Window(const Window& copy) = default;
-Window& Window::operator=( const Window& rhs ) = default;
+Window& Window::operator=(const Window& rhs) = default;
-Window::Window( Window&& rhs ) = default;
+Window::Window(Window&& rhs) = default;
-Window& Window::operator=( Window&& rhs ) = default;
+Window& Window::operator=(Window&& rhs) = default;
-void Window::Add( Dali::Actor actor )
+void Window::Add(Dali::Actor actor)
{
- GetImplementation( *this ).Add( actor );
+ GetImplementation(*this).Add(actor);
}
-void Window::Remove( Dali::Actor actor )
+void Window::Remove(Dali::Actor actor)
{
- GetImplementation( *this ).Remove( actor );
+ GetImplementation(*this).Remove(actor);
}
-void Window::SetBackgroundColor( const Vector4& color )
+void Window::SetBackgroundColor(const Vector4& color)
{
- GetImplementation( *this ).SetBackgroundColor( color );
+ GetImplementation(*this).SetBackgroundColor(color);
}
Vector4 Window::GetBackgroundColor() const
{
- return GetImplementation( *this ).GetBackgroundColor();
+ return GetImplementation(*this).GetBackgroundColor();
}
Layer Window::GetRootLayer() const
{
- return GetImplementation( *this ).GetRootLayer();
+ return GetImplementation(*this).GetRootLayer();
}
uint32_t Window::GetLayerCount() const
{
- return GetImplementation( *this ).GetLayerCount();
+ return GetImplementation(*this).GetLayerCount();
}
-Layer Window::GetLayer( uint32_t depth ) const
+Layer Window::GetLayer(uint32_t depth) const
{
- return GetImplementation( *this ).GetLayer( depth );
+ return GetImplementation(*this).GetLayer(depth);
}
Uint16Pair Window::GetDpi() const
return GetImplementation(*this).GetDpi();
}
-void Window::SetClass( std::string name, std::string klass )
+void Window::SetClass(std::string name, std::string klass)
{
- GetImplementation(*this).SetClass( name, klass );
+ GetImplementation(*this).SetClass(name, klass);
}
void Window::Raise()
GetImplementation(*this).Activate();
}
-void Window::AddAvailableOrientation( WindowOrientation orientation )
+void Window::AddAvailableOrientation(WindowOrientation orientation)
{
- GetImplementation(*this).AddAvailableOrientation( orientation );
+ GetImplementation(*this).AddAvailableOrientation(orientation);
}
-void Window::RemoveAvailableOrientation( WindowOrientation orientation )
+void Window::RemoveAvailableOrientation(WindowOrientation orientation)
{
- GetImplementation(*this).RemoveAvailableOrientation( orientation );
+ GetImplementation(*this).RemoveAvailableOrientation(orientation);
}
-void Window::SetPreferredOrientation( WindowOrientation orientation )
+void Window::SetPreferredOrientation(WindowOrientation orientation)
{
- GetImplementation(*this).SetPreferredOrientation( orientation );
+ GetImplementation(*this).SetPreferredOrientation(orientation);
}
Dali::Window::WindowOrientation Window::GetPreferredOrientation()
return GetImplementation(*this).FocusChangeSignal();
}
-void Window::SetAcceptFocus( bool accept )
+void Window::SetAcceptFocus(bool accept)
{
- GetImplementation(*this).SetAcceptFocus( accept );
+ GetImplementation(*this).SetAcceptFocus(accept);
}
bool Window::IsFocusAcceptable() const
return GetImplementation(*this).GetSupportedAuxiliaryHintCount();
}
-std::string Window::GetSupportedAuxiliaryHint( unsigned int index ) const
+std::string Window::GetSupportedAuxiliaryHint(unsigned int index) const
{
- return GetImplementation(*this).GetSupportedAuxiliaryHint( index );
+ return GetImplementation(*this).GetSupportedAuxiliaryHint(index);
}
-unsigned int Window::AddAuxiliaryHint( const std::string& hint, const std::string& value )
+unsigned int Window::AddAuxiliaryHint(const std::string& hint, const std::string& value)
{
- return GetImplementation(*this).AddAuxiliaryHint( hint, value );
+ return GetImplementation(*this).AddAuxiliaryHint(hint, value);
}
-bool Window::RemoveAuxiliaryHint( unsigned int id )
+bool Window::RemoveAuxiliaryHint(unsigned int id)
{
- return GetImplementation(*this).RemoveAuxiliaryHint( id );
+ return GetImplementation(*this).RemoveAuxiliaryHint(id);
}
-bool Window::SetAuxiliaryHintValue( unsigned int id, const std::string& value )
+bool Window::SetAuxiliaryHintValue(unsigned int id, const std::string& value)
{
- return GetImplementation(*this).SetAuxiliaryHintValue( id, value );
+ return GetImplementation(*this).SetAuxiliaryHintValue(id, value);
}
-std::string Window::GetAuxiliaryHintValue( unsigned int id ) const
+std::string Window::GetAuxiliaryHintValue(unsigned int id) const
{
- return GetImplementation(*this).GetAuxiliaryHintValue( id );
+ return GetImplementation(*this).GetAuxiliaryHintValue(id);
}
-unsigned int Window::GetAuxiliaryHintId( const std::string& hint ) const
+unsigned int Window::GetAuxiliaryHintId(const std::string& hint) const
{
- return GetImplementation(*this).GetAuxiliaryHintId( hint );
+ return GetImplementation(*this).GetAuxiliaryHintId(hint);
}
-void Window::SetInputRegion( const Rect< int >& inputRegion )
+void Window::SetInputRegion(const Rect<int>& inputRegion)
{
- return GetImplementation(*this).SetInputRegion( inputRegion );
+ return GetImplementation(*this).SetInputRegion(inputRegion);
}
-void Window::SetType( Window::Type type )
+void Window::SetType(Window::Type type)
{
- GetImplementation(*this).SetType( type );
+ GetImplementation(*this).SetType(type);
}
Window::Type Window::GetType() const
return GetImplementation(*this).GetType();
}
-bool Window::SetNotificationLevel( Window::NotificationLevel::Type level )
+bool Window::SetNotificationLevel(Window::NotificationLevel::Type level)
{
- return GetImplementation(*this).SetNotificationLevel( level );
+ return GetImplementation(*this).SetNotificationLevel(level);
}
Window::NotificationLevel::Type Window::GetNotificationLevel() const
return GetImplementation(*this).GetNotificationLevel();
}
-void Window::SetOpaqueState( bool opaque )
+void Window::SetOpaqueState(bool opaque)
{
- GetImplementation(*this).SetOpaqueState( opaque );
+ GetImplementation(*this).SetOpaqueState(opaque);
}
bool Window::IsOpaqueState() const
return GetImplementation(*this).GetScreenOffMode();
}
-bool Window::SetBrightness( int brightness )
+bool Window::SetBrightness(int brightness)
{
- return GetImplementation(*this).SetBrightness( brightness );
+ return GetImplementation(*this).SetBrightness(brightness);
}
int Window::GetBrightness() const
return GetImplementation(*this).ResizeSignal();
}
-void Window::SetSize( Window::WindowSize size )
+void Window::SetSize(Window::WindowSize size)
{
- GetImplementation(*this).SetSize( size );
+ GetImplementation(*this).SetSize(size);
}
Window::WindowSize Window::GetSize() const
return GetImplementation(*this).GetSize();
}
-void Window::SetPosition( Window::WindowPosition position )
+void Window::SetPosition(Window::WindowPosition position)
{
- GetImplementation(*this).SetPosition( position );
+ GetImplementation(*this).SetPosition(position);
}
Window::WindowPosition Window::GetPosition() const
return GetImplementation(*this).GetPosition();
}
-void Window::SetTransparency( bool transparent )
+void Window::SetTransparency(bool transparent)
{
- GetImplementation(*this).SetTransparency( transparent );
+ GetImplementation(*this).SetTransparency(transparent);
}
Dali::RenderTaskList Window::GetRenderTaskList()
return GetImplementation(*this).TouchedSignal();
}
-Window::Window( Internal::Adaptor::Window* window )
-: BaseHandle( window )
+Window::Window(Internal::Adaptor::Window* window)
+: BaseHandle(window)
{
}
*/
// EXTERNAL INCLUDES
-#include <string>
#include <dali/public-api/math/rect.h>
#include <dali/public-api/math/uint-16-pair.h>
#include <dali/public-api/math/vector2.h>
#include <dali/public-api/math/vector4.h>
-#include <dali/public-api/object/base-handle.h>
#include <dali/public-api/object/any.h>
+#include <dali/public-api/object/base-handle.h>
#include <dali/public-api/signals/dali-signal.h>
+#include <string>
// INTERNAL INCLUDES
#include <dali/public-api/dali-adaptor-common.h>
{
class Window;
}
-}
+} // namespace DALI_INTERNAL
class DragAndDropDetector;
class Orientation;
class DALI_ADAPTOR_API Window : public BaseHandle
{
public:
+ using WindowSize = Uint16Pair; ///< Window size type @SINCE_1_2.60
+ using WindowPosition = Uint16Pair; ///< Window position type @SINCE_1_2.60
- using WindowSize = Uint16Pair ; ///< Window size type @SINCE_1_2.60
- using WindowPosition = Uint16Pair; ///< Window position type @SINCE_1_2.60
-
- using FocusChangeSignalType = Signal< void (Window,bool) >; ///< Window focus signal type @SINCE_1_4.35
- using ResizeSignalType = Signal< void (Window,WindowSize) >; ///< Window resized signal type @SINCE_1_4.35
- using KeyEventSignalType = Signal< void (const KeyEvent&) >; ///< Key event signal type @SINCE_1_9.21
- using TouchEventSignalType = Signal< void (const TouchEvent&) >; ///< Touch signal type @SINCE_1_9.28
+ using FocusChangeSignalType = Signal<void(Window, bool)>; ///< Window focus signal type @SINCE_1_4.35
+ using ResizeSignalType = Signal<void(Window, WindowSize)>; ///< Window resized signal type @SINCE_1_4.35
+ using KeyEventSignalType = Signal<void(const KeyEvent&)>; ///< Key event signal type @SINCE_1_9.21
+ using TouchEventSignalType = Signal<void(const TouchEvent&)>; ///< Touch signal type @SINCE_1_9.28
public:
-
// Enumerations
/**
*/
enum WindowOrientation
{
- PORTRAIT = 0, ///< Portrait orientation. The height of the display area is greater than the width. @SINCE_1_0.0
- LANDSCAPE = 90, ///< Landscape orientation. A wide view area is needed. @SINCE_1_0.0
- PORTRAIT_INVERSE = 180, ///< Portrait inverse orientation @SINCE_1_0.0
- LANDSCAPE_INVERSE = 270, ///< Landscape inverse orientation @SINCE_1_0.0
- NO_ORIENTATION_PREFERENCE = -1 ///< No orientation. It is used to initialize or unset the preferred orientation. @SINCE_1_4.51
+ PORTRAIT = 0, ///< Portrait orientation. The height of the display area is greater than the width. @SINCE_1_0.0
+ LANDSCAPE = 90, ///< Landscape orientation. A wide view area is needed. @SINCE_1_0.0
+ PORTRAIT_INVERSE = 180, ///< Portrait inverse orientation @SINCE_1_0.0
+ LANDSCAPE_INVERSE = 270, ///< Landscape inverse orientation @SINCE_1_0.0
+ NO_ORIENTATION_PREFERENCE = -1 ///< No orientation. It is used to initialize or unset the preferred orientation. @SINCE_1_4.51
};
/**
*/
enum Type
{
- NORMAL, ///< A default window type. Indicates a normal, top-level window. Almost every window will be created with this type. @SINCE_1_2.60
- NOTIFICATION, ///< A notification window, like a warning about battery life or a new E-Mail received. @SINCE_1_2.60
- UTILITY, ///< A persistent utility window, like a toolbox or palette. @SINCE_1_2.60
- DIALOG ///< Used for simple dialog windows. @SINCE_1_2.60
+ NORMAL, ///< A default window type. Indicates a normal, top-level window. Almost every window will be created with this type. @SINCE_1_2.60
+ NOTIFICATION, ///< A notification window, like a warning about battery life or a new E-Mail received. @SINCE_1_2.60
+ UTILITY, ///< A persistent utility window, like a toolbox or palette. @SINCE_1_2.60
+ DIALOG ///< Used for simple dialog windows. @SINCE_1_2.60
};
/**
*/
enum Type
{
- NONE = -1, ///< No notification level. Default level. This value makes the notification window place in the layer of the normal window. @SINCE_1_2.60
- BASE = 10, ///< Base notification level. @SINCE_1_2.60
- MEDIUM = 20, ///< Higher notification level than base. @SINCE_1_2.60
- HIGH = 30, ///< Higher notification level than medium. @SINCE_1_2.60
- TOP = 40 ///< The highest notification level. @SINCE_1_2.60
+ NONE = -1, ///< No notification level. Default level. This value makes the notification window place in the layer of the normal window. @SINCE_1_2.60
+ BASE = 10, ///< Base notification level. @SINCE_1_2.60
+ MEDIUM = 20, ///< Higher notification level than base. @SINCE_1_2.60
+ HIGH = 30, ///< Higher notification level than medium. @SINCE_1_2.60
+ TOP = 40 ///< The highest notification level. @SINCE_1_2.60
};
};
*/
enum Type
{
- TIMEOUT, ///< The mode which turns the screen off after a timeout. @SINCE_1_2.60
- NEVER, ///< The mode which keeps the screen turned on. @SINCE_1_2.60
+ TIMEOUT, ///< The mode which turns the screen off after a timeout. @SINCE_1_2.60
+ NEVER, ///< The mode which keeps the screen turned on. @SINCE_1_2.60
};
- static constexpr Type DEFAULT { TIMEOUT }; ///< The default mode. @SINCE_1_2.60
+ static constexpr Type DEFAULT{TIMEOUT}; ///< The default mode. @SINCE_1_2.60
};
// Methods
* @SINCE_1_9.24
* @param[in] rhs A reference to the moved handle
*/
- Window( Window&& rhs );
+ Window(Window&& rhs);
/**
* @brief Move assignment operator.
* @param[in] rhs A reference to the moved handle
* @return A reference to this handle
*/
- Window& operator=( Window&& rhs );
+ Window& operator=(Window&& rhs);
/**
* @brief Adds a child Actor to the Window.
* @pre The actor has been initialized.
* @pre The actor does not have a parent.
*/
- void Add( Actor actor );
+ void Add(Actor actor);
/**
* @brief Removes a child Actor from the Window.
* @param[in] actor The child
* @pre The actor has been added to the stage.
*/
- void Remove( Actor actor );
+ void Remove(Actor actor);
/**
* @brief Sets the background color of the Window.
* @SINCE_1_4.19
* @param[in] color The new background color
*/
- void SetBackgroundColor( const Vector4& color );
+ void SetBackgroundColor(const Vector4& color);
/**
* @brief Gets the background color of the Window.
* @return The layer found at the given depth
* @pre Depth is less than layer count; see GetLayerCount().
*/
- Layer GetLayer( uint32_t depth ) const;
+ Layer GetLayer(uint32_t depth) const;
/**
* @brief Retrieves the DPI of the window.
* @SINCE_1_0.0
* @param[in] orientation The available orientation to add
*/
- void AddAvailableOrientation( WindowOrientation orientation );
+ void AddAvailableOrientation(WindowOrientation orientation);
/**
* @brief Removes an orientation from the list of available orientations.
* @SINCE_1_0.0
* @param[in] orientation The available orientation to remove
*/
- void RemoveAvailableOrientation( WindowOrientation orientation );
+ void RemoveAvailableOrientation(WindowOrientation orientation);
/**
* @brief Sets a preferred orientation.
*
* @note To unset the preferred orientation, orientation should be set NO_ORIENTATION_PREFERENCE.
*/
- void SetPreferredOrientation( WindowOrientation orientation );
+ void SetPreferredOrientation(WindowOrientation orientation);
/**
* @brief Gets the preferred orientation.
* @SINCE_1_2.60
* @param[in] accept If focus is accepted or not. Default is true.
*/
- void SetAcceptFocus( bool accept );
+ void SetAcceptFocus(bool accept);
/**
* @brief Returns whether window accepts focus or not.
* @note The window auxiliary hint is the value which is used to decide which actions should be made available to the user by the window manager.
* If you want to set specific hint to your window, then you should check whether it exists in the supported auxiliary hints.
*/
- std::string GetSupportedAuxiliaryHint( unsigned int index ) const;
+ std::string GetSupportedAuxiliaryHint(unsigned int index) const;
/**
* @brief Creates an auxiliary hint of the window.
* @param[in] value The value string.
* @return The ID of created auxiliary hint, or @c 0 on failure.
*/
- unsigned int AddAuxiliaryHint( const std::string& hint, const std::string& value );
+ unsigned int AddAuxiliaryHint(const std::string& hint, const std::string& value);
/**
* @brief Removes an auxiliary hint of the window.
* @param[in] id The ID of the auxiliary hint.
* @return True if no error occurred, false otherwise.
*/
- bool RemoveAuxiliaryHint( unsigned int id );
+ bool RemoveAuxiliaryHint(unsigned int id);
/**
* @brief Changes a value of the auxiliary hint.
* @param[in] value The value string to be set.
* @return True if no error occurred, false otherwise.
*/
- bool SetAuxiliaryHintValue( unsigned int id, const std::string& value );
+ bool SetAuxiliaryHintValue(unsigned int id, const std::string& value);
/**
* @brief Gets a value of the auxiliary hint.
* @param[in] id The auxiliary hint ID.
* @return The string value of the auxiliary hint ID, or an empty string if none exists.
*/
- std::string GetAuxiliaryHintValue( unsigned int id ) const;
+ std::string GetAuxiliaryHintValue(unsigned int id) const;
/**
* @brief Gets a ID of the auxiliary hint string.
* @param[in] hint The auxiliary hint string.
* @return The ID of the auxiliary hint string, or @c 0 if none exists.
*/
- unsigned int GetAuxiliaryHintId( const std::string& hint ) const;
+ unsigned int GetAuxiliaryHintId(const std::string& hint) const;
/**
* @brief Sets a region to accept input events.
* @SINCE_1_2.60
* @param[in] inputRegion The region to accept input events.
*/
- void SetInputRegion( const Rect< int >& inputRegion );
+ void SetInputRegion(const Rect<int>& inputRegion);
/**
* @brief Sets a window type.
* @param[in] type The window type.
* @remarks The default window type is NORMAL.
*/
- void SetType( Type type );
+ void SetType(Type type);
/**
* @brief Gets a window type.
* @PRIVILEGE_WINDOW_PRIORITY
* @remarks This can be used for a notification type window only. The default level is NotificationLevel::NONE.
*/
- bool SetNotificationLevel( NotificationLevel::Type level );
+ bool SetNotificationLevel(NotificationLevel::Type level);
/**
* @brief Gets a priority level for the specified notification window.
* @remarks This will have no effect on an opaque window.
* It doesn't change transparent window to opaque window but lets the window manager know the visual state of the window.
*/
- void SetOpaqueState( bool opaque );
+ void SetOpaqueState(bool opaque);
/**
* @brief Returns whether a transparent window's visual state is opaque or not.
* @PRIVLEVEL_PUBLIC
* @PRIVILEGE_DISPLAY
*/
- bool SetBrightness( int brightness );
+ bool SetBrightness(int brightness);
/**
* @brief Gets preferred brightness of the window.
* @SINCE_1_2.60
* @param[in] size The new window size
*/
- void SetSize( WindowSize size );
+ void SetSize(WindowSize size);
/**
* @brief Gets a size of the window.
* @SINCE_1_2.60
* @param[in] position The new window position
*/
- void SetPosition( WindowPosition position );
+ void SetPosition(WindowPosition position);
/**
* @brief Gets a position of the window.
* @SINCE_1_2.60
* @param[in] transparent Whether the window is transparent
*/
- void SetTransparency( bool transparent );
+ void SetTransparency(bool transparent);
/**
* @brief Retrieves the list of render-tasks in the window.
RenderTaskList GetRenderTaskList();
public: // Signals
-
/**
* @brief The user should connect to this signal to get a timing when window gains focus or loses focus.
*
* @SINCE_1_0.0
* @param[in] window A pointer to the Window
*/
- explicit DALI_INTERNAL Window( Internal::Adaptor::Window* window );
+ explicit DALI_INTERNAL Window(Internal::Adaptor::Window* window);
/// @endcond
};
namespace Dali
{
-
Capture::Capture()
{
}
{
Internal::Adaptor::CapturePtr internal = Internal::Adaptor::Capture::New();
- return Capture( internal.Get() );
+ return Capture(internal.Get());
}
-Capture Capture::New( Dali::CameraActor cameraActor )
+Capture Capture::New(Dali::CameraActor cameraActor)
{
- Internal::Adaptor::CapturePtr internal = Internal::Adaptor::Capture::New( cameraActor );
+ Internal::Adaptor::CapturePtr internal = Internal::Adaptor::Capture::New(cameraActor);
- return Capture( internal.Get() );
+ return Capture(internal.Get());
}
-Capture Capture::DownCast( BaseHandle handle )
+Capture Capture::DownCast(BaseHandle handle)
{
- return Capture( dynamic_cast< Internal::Adaptor::Capture* >( handle.GetObjectPtr() ) );
+ return Capture(dynamic_cast<Internal::Adaptor::Capture*>(handle.GetObjectPtr()));
}
Capture::~Capture()
{
}
-Capture::Capture( const Capture& copy ) = default;
+Capture::Capture(const Capture& copy) = default;
-Capture& Capture::operator=( const Capture& rhs ) = default;
+Capture& Capture::operator=(const Capture& rhs) = default;
-Capture::Capture( Capture&& rhs ) = default;
+Capture::Capture(Capture&& rhs) = default;
-Capture& Capture::operator=( Capture&& rhs ) = default;
+Capture& Capture::operator=(Capture&& rhs) = default;
-void Capture::Start( Actor source, const Vector2& position, const Vector2& size, const std::string &path, const Vector4& clearColor )
+void Capture::Start(Actor source, const Vector2& position, const Vector2& size, const std::string& path, const Vector4& clearColor)
{
- GetImpl( *this ).Start( source, position, size, path, clearColor );
+ GetImpl(*this).Start(source, position, size, path, clearColor);
}
-void Capture::Start( Actor source, const Vector2& size, const std::string &path, const Vector4& clearColor, const uint32_t quality )
+void Capture::Start(Actor source, const Vector2& size, const std::string& path, const Vector4& clearColor, const uint32_t quality)
{
- GetImpl( *this ).Start( source, Vector2::ZERO, size, path, clearColor, quality );
+ GetImpl(*this).Start(source, Vector2::ZERO, size, path, clearColor, quality);
}
-void Capture::Start( Actor source, const Vector2& size, const std::string &path, const Vector4& clearColor )
+void Capture::Start(Actor source, const Vector2& size, const std::string& path, const Vector4& clearColor)
{
- GetImpl( *this ).Start( source, Vector2::ZERO, size, path, clearColor );
+ GetImpl(*this).Start(source, Vector2::ZERO, size, path, clearColor);
}
-void Capture::Start( Actor source, const Vector2& size, const std::string &path )
+void Capture::Start(Actor source, const Vector2& size, const std::string& path)
{
- GetImpl( *this ).Start( source, Vector2::ZERO, size, path, Dali::Color::TRANSPARENT );
+ GetImpl(*this).Start(source, Vector2::ZERO, size, path, Dali::Color::TRANSPARENT);
}
-void Capture::SetImageQuality( uint32_t quality )
+void Capture::SetImageQuality(uint32_t quality)
{
- return GetImpl( *this ).SetImageQuality( quality );
+ return GetImpl(*this).SetImageQuality(quality);
}
Dali::NativeImageSourcePtr Capture::GetNativeImageSource() const
{
- return GetImpl( *this ).GetNativeImageSource();
+ return GetImpl(*this).GetNativeImageSource();
}
Capture::CaptureFinishedSignalType& Capture::FinishedSignal()
{
- return GetImpl( *this ).FinishedSignal();
+ return GetImpl(*this).FinishedSignal();
}
-Capture::Capture( Internal::Adaptor::Capture* internal )
-: BaseHandle( internal )
+Capture::Capture(Internal::Adaptor::Capture* internal)
+: BaseHandle(internal)
{
}
// EXTERNAL HEADERS
#include <dali/public-api/actors/actor.h>
-#include <dali/public-api/signals/dali-signal.h>
#include <dali/public-api/actors/camera-actor.h>
+#include <dali/public-api/signals/dali-signal.h>
// INTERNAL INCLUDES
-#include <dali/public-api/dali-adaptor-common.h>
#include <dali/public-api/adaptor-framework/native-image-source.h>
+#include <dali/public-api/dali-adaptor-common.h>
namespace Dali
{
-
/**
* @addtogroup dali_adaptor_framework
* @{
{
class Capture;
}
-}
+} // namespace DALI_INTERNAL
/**
* @brief Capture snapshots the current scene and save as a file.
*/
class DALI_ADAPTOR_API Capture : public BaseHandle
{
-
public:
-
/**
* @brief The enumerations used for checking capture success
* @SINCE_1_3_4
*
* @SINCE_1_3_4
*/
- typedef Signal< void ( Capture, Capture::FinishState ) > CaptureFinishedSignalType;
+ typedef Signal<void(Capture, Capture::FinishState)> CaptureFinishedSignalType;
/**
* @brief Create an uninitialized Capture; this can be initialized with Actor::New().
* @param[in] cameraActor An initialized CameraActor.
* @return A handle to a newly allocated Dali resource.
*/
- static Capture New( Dali::CameraActor cameraActor );
+ static Capture New(Dali::CameraActor cameraActor);
/**
* @brief Downcast an Object handle to Capture handle.
* @param[in] handle to An object.
* @return handle to a Capture object or an uninitialized handle.
*/
- static Capture DownCast( BaseHandle handle );
+ static Capture DownCast(BaseHandle handle);
/**
* @brief Dali::Actor is intended as a base class.
*
* @param[in] copy A reference to the copied handle.
*/
- Capture( const Capture& copy );
+ Capture(const Capture& copy);
/**
* @brief This assignment operator is required for (smart) pointer semantics.
* @param[in] rhs A reference to the copied handle.
* @return A reference to this.
*/
- Capture& operator=( const Capture& rhs );
+ Capture& operator=(const Capture& rhs);
/**
* @brief Move constructor.
* @SINCE_1_9.24
* @param[in] rhs A reference to the moved handle
*/
- Capture( Capture&& rhs );
+ Capture(Capture&& rhs);
/**
* @brief Move assignment operator.
* @param[in] rhs A reference to the moved handle
* @return A reference to this handle
*/
- Capture& operator=( Capture&& rhs );
+ Capture& operator=(Capture&& rhs);
/**
* @brief Start capture and save the image as a file.
* in this case, if source is root of scene, the captured image includes a part of actor 'B' on the 'A'.
* however, if source is just actor 'A', the result includes only 'A'.
*/
- void Start( Actor source, const Vector2& position, const Vector2& size, const std::string &path, const Vector4& clearColor );
+ void Start(Actor source, const Vector2& position, const Vector2& size, const std::string& path, const Vector4& clearColor);
/**
* @brief Start capture and save the image as a file.
* @param[in] clearColor background color of captured scene
* @param[in] quality The value to control image quality for jpeg file format in the range [1, 100]
*/
- void Start( Actor source, const Vector2& size, const std::string &path, const Vector4& clearColor, const uint32_t quality );
+ void Start(Actor source, const Vector2& size, const std::string& path, const Vector4& clearColor, const uint32_t quality);
/**
* @brief Start capture and save the image as a file.
* If path is empty string, the captured result is not be saved as a file.
* @param[in] clearColor background color of captured scene
*/
- void Start( Actor source, const Vector2& size, const std::string &path, const Vector4& clearColor );
+ void Start(Actor source, const Vector2& size, const std::string& path, const Vector4& clearColor);
/**
* @brief Start capture and save the image as a file.
* If path is empty string, the captured result is not be saved as a file.
* @note Clear color is transparent.
*/
- void Start( Actor source, const Vector2& size, const std::string &path );
+ void Start(Actor source, const Vector2& size, const std::string& path);
/**
* @brief Set result image quality in case of jpeg
*
* @param[in] quality The value to control image quality for jpeg file format in the range [1, 100]
*/
- void SetImageQuality( uint32_t quality );
+ void SetImageQuality(uint32_t quality);
/**
* @brief Get NativeImageSourcePtr that is saved captured image.
*
* @param[in] internal A pointer to a newly allocated Dali resource.
*/
- explicit DALI_INTERNAL Capture( Internal::Adaptor::Capture* internal );
+ explicit DALI_INTERNAL Capture(Internal::Adaptor::Capture* internal);
/// @endcond
};
#define DALI_ADAPTOR_COMMON_H
/*
- * Copyright (c) 2018 Samsung Electronics Co., Ltd.
+ * Copyright (c) 2020 Samsung Electronics Co., Ltd.
*
* Licensed under the Apache License, Version 2.0 (the "License");
* you may not use this file except in compliance with the License.
* When building a library that uses DALI, HIDE_DALI_INTERNALS.
*/
#if __GNUC__ >= 4
-# ifndef HIDE_DALI_INTERNALS
-# define DALI_ADAPTOR_API
-# else
-# define DALI_ADAPTOR_API __attribute__ ((visibility ("default")))
-# endif
+#ifndef HIDE_DALI_INTERNALS
+#define DALI_ADAPTOR_API
+#else
+#define DALI_ADAPTOR_API __attribute__((visibility("default")))
+#endif
#else
#ifdef WIN32
#ifdef BUILDING_DALI_ADAPTOR
/** Visibility attribute to hide declarations */
-# define DALI_ADAPTOR_API __declspec(dllexport)
+#define DALI_ADAPTOR_API __declspec(dllexport)
#else
/** Visibility attribute to hide declarations */
-# define DALI_ADAPTOR_API __declspec(dllimport)
+#define DALI_ADAPTOR_API __declspec(dllimport)
#endif
#else
/** Visibility attribute to show declarations */
-# define DALI_ADAPTOR_API
+#define DALI_ADAPTOR_API
#endif
#endif
namespace Dali
{
-
const unsigned int ADAPTOR_MAJOR_VERSION = 1;
const unsigned int ADAPTOR_MINOR_VERSION = 9;
-const unsigned int ADAPTOR_MICRO_VERSION = 28;
-const char * const ADAPTOR_BUILD_DATE = __DATE__ " " __TIME__;
+const unsigned int ADAPTOR_MICRO_VERSION = 29;
+const char* const ADAPTOR_BUILD_DATE = __DATE__ " " __TIME__;
#ifdef DEBUG_ENABLED
namespace
#define DALI_ADAPTOR_VERSION_H
/*
- * Copyright (c) 2019 Samsung Electronics Co., Ltd.
+ * Copyright (c) 2020 Samsung Electronics Co., Ltd.
*
* Licensed under the Apache License, Version 2.0 (the "License");
* you may not use this file except in compliance with the License.
DALI_ADAPTOR_API extern const unsigned int ADAPTOR_MAJOR_VERSION; ///< The major version number of the Adaptor.
DALI_ADAPTOR_API extern const unsigned int ADAPTOR_MINOR_VERSION; ///< The minor version number of the Adaptor.
DALI_ADAPTOR_API extern const unsigned int ADAPTOR_MICRO_VERSION; ///< The micro version number of the Adaptor.
-DALI_ADAPTOR_API extern const char * const ADAPTOR_BUILD_DATE; ///< The date/time the Adaptor library was built.
+DALI_ADAPTOR_API extern const char* const ADAPTOR_BUILD_DATE; ///< The date/time the Adaptor library was built.
} // namespace Dali
#endif // DALI_ADAPTOR_VERSION_H
#define DALI_WEARABLE_H
/*
- * Copyright (c) 2019 Samsung Electronics Co., Ltd.
+ * Copyright (c) 2020 Samsung Electronics Co., Ltd.
*
* Licensed under the Apache License, Version 2.0 (the "License");
* you may not use this file except in compliance with the License.
*/
// INTERNAL INCLUDES
-#include <dali/public-api/watch/watch-application.h>
#include <dali/public-api/capture/capture.h>
+#include <dali/public-api/watch/watch-application.h>
#endif // DALI_WEARABLE_H
*/
// EXTERNAL INCLUDES
-#include <string>
#include <dali/public-api/object/base-handle.h>
#include <dali/public-api/signals/callback.h>
+#include <string>
// INTERNAL INCLUDES
-#include <dali/public-api/dali-adaptor-common.h>
#include <dali/public-api/adaptor-framework/application.h>
+#include <dali/public-api/dali-adaptor-common.h>
#include <dali/public-api/watch/watch-time.h>
namespace Dali
{
class WatchApplication;
}
-}
+} // namespace DALI_INTERNAL
/**
* @brief A WatchApplication class object should be created by every watch application
class DALI_ADAPTOR_API WatchApplication : public Application
{
public:
- typedef Signal< void (Application&, const WatchTime&) > WatchTimeSignal; ///< Watch pointer signal callback type @SINCE_1_1.37
- typedef Signal< void (Application&, bool) > WatchBoolSignal; ///< Watch bool signal callback type @SINCE_1_1.37
+ typedef Signal<void(Application&, const WatchTime&)> WatchTimeSignal; ///< Watch pointer signal callback type @SINCE_1_1.37
+ typedef Signal<void(Application&, bool)> WatchBoolSignal; ///< Watch bool signal callback type @SINCE_1_1.37
public:
-
/**
* @brief This is the constructor for applications without an argument list.
* @SINCE_1_1.37
* @param[in,out] argv A pointer the the argument list
* @return A handle to the WatchApplication
*/
- static WatchApplication New( int* argc, char **argv[] );
+ static WatchApplication New(int* argc, char** argv[]);
/**
* @brief This is the constructor for applications with a name
* @param[in] stylesheet The path to user defined theme file
* @return A handle to the WatchApplication
*/
- static WatchApplication New( int* argc, char **argv[], const std::string& stylesheet );
+ static WatchApplication New(int* argc, char** argv[], const std::string& stylesheet);
/**
* @brief Construct an empty handle
* @SINCE_1_1.37
* @param[in] implementation The WatchApplication implementation
*/
- WatchApplication( const WatchApplication& implementation );
+ WatchApplication(const WatchApplication& implementation);
/**
* @brief Assignment operator
* @param[in] application Handle to an object
* @return A reference to this
*/
- WatchApplication& operator=( const WatchApplication& application );
+ WatchApplication& operator=(const WatchApplication& application);
/**
* @brief Move constructor.
* @SINCE_1_9.24
* @param[in] rhs A reference to the moved handle
*/
- WatchApplication( WatchApplication&& rhs );
+ WatchApplication(WatchApplication&& rhs);
/**
* @brief Move assignment operator.
* @param[in] rhs A reference to the moved handle
* @return A reference to this handle
*/
- WatchApplication& operator=( WatchApplication&& rhs );
+ WatchApplication& operator=(WatchApplication&& rhs);
/**
* @brief Destructor
#define DALI_WATCH_TIME_H
/*
- * Copyright (c) 2019 Samsung Electronics Co., Ltd.
+ * Copyright (c) 2020 Samsung Electronics Co., Ltd.
*
* Licensed under the Apache License, Version 2.0 (the "License");
* you may not use this file except in compliance with the License.
*/
// EXTERNAL INCLUDES
-#include <time.h>
#include <dali/public-api/dali-core.h>
+#include <time.h>
// INTERNAL INCLUDES
#include <dali/public-api/dali-adaptor-common.h>
class DALI_ADAPTOR_API WatchTime
{
public:
-
/**
* @brief Constructor.
* @SINCE_1_1.37
bool GetDaylightSavingTimeStatus() const;
public: // Not intended for application developers
- DALI_INTERNAL WatchTime(void *time_handle);
-
-private: // Internal Data
+ DALI_INTERNAL WatchTime(void* time_handle);
+private: // Internal Data
struct Impl;
Impl* mImpl;
};
--- /dev/null
+git diff -U0 --no-color HEAD^ | clang-format-diff -i -p1
\ No newline at end of file
Name: dali2-adaptor
Summary: The DALi Tizen Adaptor
-Version: 1.9.28
+Version: 1.9.29
Release: 1
Group: System/Libraries
License: Apache-2.0 and BSD-3-Clause and MIT
--- /dev/null
+---
+Language: Cpp
+DisableFormat: true
+SortIncludes: false
+...