FILE(GLOB PO_FILES RELATIVE "${PO_DIR}" "${PO_DIR}/*.po")
SET(MSGFMT "/usr/bin/msgfmt")
-SET(MO_FILES_DIR /tmp/locale/en/LC_MESSAGES)
+SET(MO_FILES_DIR /tmp/locale)
FILE(MAKE_DIRECTORY ${MO_FILES_DIR})
-MESSAGE("mo dir: ${MO_FILES_DIR}")
FOREACH(PO_FILE ${PO_FILES})
SET(PO_FILE ${PO_DIR}/${PO_FILE})
MESSAGE("ABS_PO_FILE : ${ABS_PO_FILE}")
GET_FILENAME_COMPONENT(lang ${ABS_PO_FILE} NAME_WE)
MESSAGE("lang : ${lang}")
- SET(MO_FILE ${MO_FILES_DIR}/dali-toolkit.mo.${lang})
+ FILE(MAKE_DIRECTORY ${MO_FILES_DIR}/${lang}/LC_MESSAGES)
+ SET(MO_FILE ${MO_FILES_DIR}/${lang}/LC_MESSAGES/dali-toolkit.mo)
MESSAGE("MO_FILE : ${MO_FILE}")
ADD_CUSTOM_COMMAND(OUTPUT ${MO_FILE}
COMMAND ${MSGFMT} -o ${MO_FILE} ${ABS_PO_FILE}
If you are planning on running tests on device, then flash your handset with latest image, or turn off ssh: `set_usb_debug.sh --mtp-sdb` and plug it in, then follow the quickstart instructions repeated below.
+Multi-language locale environment
+---------------------------------
+
+Locales for English and Arabic must be installed to pass some test cases:
+
+$ sudo locale-gen en
+$ sudo locale-gen ar
+$ sudo update-locale
+
+
Quickstart
----------
"testVisual":
{
"visualType":"IMAGE",
- "url":"0001.png"
+ "url":"0001.png",
+ "atlasing":true
},
"testVisual2":
{
"foregroundVisual":
{
"visualType":"IMAGE",
- "url":"theSameImage.png"
+ "url":"theSameImage.png",
+ "atlasing":true
},
"labelVisual":
{
"testVisual":
{
"visualType":"IMAGE",
- "url":"0002.png"
+ "url":"0002.png",
+ "atlasing":true
},
"testVisual2":
{
"foregroundVisual":
{
"visualType":"IMAGE",
- "url":"theSameImage.png"
+ "url":"theSameImage.png",
+ "atlasing":true
},
"labelVisual":
{
"testVisual":
{
"visualType":"IMAGE",
- "url":"0001.png"
+ "url":"0001.png",
+ "atlasing":true
},
"testVisual2":
{
"focusVisual":
{
"visualType":"IMAGE",
- "url": "focus.png"
+ "url": "focus.png",
+ "atlasing":true
}
},
"entryTransition":
#include <dali-toolkit-test-suite-utils.h>
#include <toolkit-event-thread-callback.h>
#include <dali-toolkit/devel-api/image-loader/image-atlas.h>
+#include <dali-toolkit/devel-api/visuals/image-visual-properties-devel.h>
+
#include <dali-toolkit/public-api/controls/image-view/image-view.h>
+#include <dali-toolkit/dali-toolkit.h>
using namespace Dali;
using namespace Dali::Toolkit;
callStack.Reset();
callStack.Enable(true);
- ImageView imageView1 = ImageView::New( gImage_34_RGBA, ImageDimensions(34, 34) );
- ImageView imageView2 = ImageView::New( gImage_50_RGBA, ImageDimensions(50, 50) );
+ Property::Map imageMap1;
+
+ imageMap1[ ImageVisual::Property::URL ] = gImage_34_RGBA;
+ imageMap1[ ImageVisual::Property::DESIRED_HEIGHT ] = 34;
+ imageMap1[ ImageVisual::Property::DESIRED_WIDTH ] = 34;
+ imageMap1[ DevelImageVisual::Property::ATLASING] = true;
+
+ Property::Map imageMap2;
+
+ imageMap2[ ImageVisual::Property::URL ] = gImage_50_RGBA;
+ imageMap2[ ImageVisual::Property::DESIRED_HEIGHT ] = 50;
+ imageMap2[ ImageVisual::Property::DESIRED_WIDTH ] = 50;
+ imageMap2[ DevelImageVisual::Property::ATLASING ] = true;
+
+ ImageView imageView1 = ImageView::New();
+ imageView1.SetProperty( ImageView::Property::IMAGE, imageMap1 );
+
+ ImageView imageView2 = ImageView::New();
+ imageView2.SetProperty( ImageView::Property::IMAGE, imageMap2 );
// ImageView doesn't do size negotiation properly: it only listens to OnSizeSet:
imageView1.SetSize( 100, 100 );
Stage::GetCurrent().Remove( imageView2 );
application.SendNotification();
application.Render(RENDER_FRAME_INTERVAL);
- ImageView imageView3 = ImageView::New( gImage_128_RGB, ImageDimensions(100, 100) );
+
+ Property::Map imageMap3;
+ imageMap3[ ImageVisual::Property::URL ] = gImage_128_RGB;
+ imageMap3[ ImageVisual::Property::DESIRED_HEIGHT ] = 100;
+ imageMap3[ ImageVisual::Property::DESIRED_WIDTH ] = 100;
+ imageMap3[ DevelImageVisual::Property::ATLASING ] = true;
+
+ ImageView imageView3 = ImageView::New();
+ imageView3.SetProperty( ImageView::Property::IMAGE, imageMap3 );
+
application.GetPlatform().SetClosestImageSize( Vector2(100, 100) );
Stage::GetCurrent().Add( imageView3 );
#include <dali-toolkit/dali-toolkit.h>
#include <dali/devel-api/scripting/scripting.h>
+#include <dali-toolkit/devel-api/visuals/image-visual-properties-devel.h>
#include <dali/public-api/rendering/renderer.h>
#include <test-native-image.h>
callStack.Reset();
callStack.Enable(true);
- ImageView imageView = ImageView::New( gImage_34_RGBA, ImageDimensions( 34, 34 ) );
+ Property::Map imageMap;
+
+ imageMap[ ImageVisual::Property::URL ] = gImage_34_RGBA;
+ imageMap[ ImageVisual::Property::DESIRED_HEIGHT ] = 34;
+ imageMap[ ImageVisual::Property::DESIRED_WIDTH ] = 34;
+ imageMap[ DevelImageVisual::Property::ATLASING] = true;
+
+ ImageView imageView = ImageView::New();
+ imageView.SetProperty( ImageView::Property::IMAGE, imageMap );
// By default, Aysnc loading is used
// loading is not started if the actor is offStage
asyncLoadingMap[ "desiredHeight" ] = 34;
asyncLoadingMap[ "desiredWidth" ] = 34;
asyncLoadingMap[ "synchronousLoading" ] = false;
+ asyncLoadingMap[ "atlasing" ] = true;
ImageView imageView = ImageView::New();
imageView.SetProperty( ImageView::Property::IMAGE, asyncLoadingMap );
Property::Map syncLoadingMap;
syncLoadingMap[ ImageVisual::Property::SYNCHRONOUS_LOADING ] = true;
+ syncLoadingMap[ DevelImageVisual::Property::ATLASING ] = true;
// Sync loading, no atlasing for big size image
{
syncLoadingMap[ ImageVisual::Property::URL ] = gImage_600_RGB;
imageView.SetProperty( ImageView::Property::IMAGE, syncLoadingMap );
+
// BitmapLoader is used, and the loading is started immediately even the actor is not on stage.
BitmapLoader loader = BitmapLoader::GetLatestCreated();
DALI_TEST_CHECK( loader );
syncLoadingMap[ "desiredHeight" ] = 34;
syncLoadingMap[ "desiredWidth" ] = 34;
syncLoadingMap[ "synchronousLoading" ] = true;
+ syncLoadingMap[ "atlasing" ] = true;
imageView.SetProperty( ImageView::Property::IMAGE, syncLoadingMap );
// loading is started even if the actor is offStage
{
const char* DEFAULT_LOCALE_DIR = "/tmp/locale/";
-const std::string DEFAULT_EN_LOCALE_DIR = "/tmp/locale/en/LC_MESSAGES/";
+static std::string gLocaleLang;
+static std::string gLocaleLanguage;
}
void dali_textselectionpopupmirroringltr_startup(void)
{
- // Cheat! Copy the .mo file
- std::ifstream src( std::string( DEFAULT_EN_LOCALE_DIR + "dali-toolkit.mo.en" ).c_str(), std::ifstream::binary );
- std::ofstream dst( std::string( DEFAULT_EN_LOCALE_DIR + "dali-toolkit.mo" ).c_str(), std::ofstream::binary );
- dst << src.rdbuf();
+ // Keep the current locale environment.
+ char* langPtr = getenv( "LANG" );
+ gLocaleLang = std::string( langPtr );
+
+ char* languagePtr = getenv( "LANGUAGE" );
+ gLocaleLanguage = std::string( languagePtr );
+
+ // Set the locale environment to Arabic.
+ setenv( "LANG", "en_GB.UTF-8", 1 );
+ setenv( "LANGUAGE", "en_GB:en", 1 );
test_return_value = TET_UNDEF;
}
void dali_textselectionpopupmirroringltr_cleanup(void)
{
+ // Restore the locale environment.
+ setenv( "LANG", gLocaleLang.c_str(), 1 );
+ setenv( "LANGUAGE", gLocaleLanguage.c_str(), 1 );
+
test_return_value = TET_PASS;
}
{
const char* DEFAULT_LOCALE_DIR = "/tmp/locale/";
-const std::string DEFAULT_EN_LOCALE_DIR = "/tmp/locale/en/LC_MESSAGES/";
+static std::string gLocaleLang;
+static std::string gLocaleLanguage;
}
void dali_textselectionpopupmirroringrtl_startup(void)
{
- // Cheat! Copy the .mo file
- std::ifstream src( std::string( DEFAULT_EN_LOCALE_DIR + "dali-toolkit.mo.ar" ).c_str(), std::ifstream::binary );
- std::ofstream dst( std::string( DEFAULT_EN_LOCALE_DIR + "dali-toolkit.mo" ).c_str(), std::ofstream::binary );
- dst << src.rdbuf();
+ // Keep the current locale environment.
+ char* langPtr = getenv( "LANG" );
+ gLocaleLang = std::string( langPtr );
+
+ char* languagePtr = getenv( "LANGUAGE" );
+ gLocaleLanguage = std::string( languagePtr );
+
+ // Set the locale environment to Arabic.
+ setenv( "LANG", "ar_AE.UTF-8", 1 );
+ setenv( "LANGUAGE", "ar_AE:ar", 1 );
test_return_value = TET_UNDEF;
}
void dali_textselectionpopupmirroringrtl_cleanup(void)
{
+ // Restore the locale environment.
+ setenv( "LANG", gLocaleLang.c_str(), 1 );
+ setenv( "LANGUAGE", gLocaleLanguage.c_str(), 1 );
+
test_return_value = TET_PASS;
}
ToolkitTestApplication application;
- setlocale( LC_ALL, "en_GB.UTF-8" );
+ setlocale( LC_ALL, "ar_AE.UTF-8" );
textdomain("dali-toolkit");
bindtextdomain("dali-toolkit", DEFAULT_LOCALE_DIR );
propertyMap.Insert( ImageVisual::Property::PIXEL_AREA, pixelArea );
propertyMap.Insert( ImageVisual::Property::WRAP_MODE_U, WrapMode::MIRRORED_REPEAT );
propertyMap.Insert( ImageVisual::Property::WRAP_MODE_V, WrapMode::REPEAT );
+ propertyMap.Insert( DevelImageVisual::Property::ATLASING, true );
Visual::Base visual = factory.CreateVisual( propertyMap );
DALI_TEST_CHECK( visual );
* @note For N-Patch images only.
*/
BORDER = WRAP_MODE_V + 1,
+
+ /**
+ * @brief Whether to use the texture atlas
+ * @details Name "atlasing", type Property::BOOLEAN, true to enable texture atlas
+ *
+ * @note Optional. By default atlasing is off.
+ */
+
+ ATLASING = WRAP_MODE_V + 2,
};
} //namespace Property
// INTERNAL HEADERS
#include <dali-toolkit/public-api/visuals/image-visual-properties.h>
+#include <dali-toolkit/devel-api/visuals/image-visual-properties-devel.h>
#include <dali-toolkit/devel-api/visuals/visual-properties-devel.h>
#include <dali-toolkit/internal/visuals/visual-string-constants.h>
#include <dali-toolkit/internal/visuals/visual-factory-impl.h>
const char * const IMAGE_DESIRED_WIDTH( "desiredWidth" );
const char * const IMAGE_DESIRED_HEIGHT( "desiredHeight" );
const char * const SYNCHRONOUS_LOADING( "synchronousLoading" );
+const char * const IMAGE_ATLASING("atlasing");
// fitting modes
DALI_ENUM_TO_STRING_TABLE_BEGIN( FITTING_MODE )
const char* VERTEX_SHADER = DALI_COMPOSE_SHADER(
attribute mediump vec2 aPosition;\n
- uniform mediump mat4 uMvpMatrix;\n
+ uniform mediump mat4 uModelMatrix;\n
+ uniform mediump mat4 uViewMatrix;\n
+ uniform mediump mat4 uProjection;\n
uniform mediump vec3 uSize;\n
uniform mediump vec4 pixelArea;
varying mediump vec2 vTexCoord;\n
void main()\n
{\n
- mediump vec4 vertexPosition = uMvpMatrix * ComputeVertexPosition();\n
+ mediump vec4 vertexPosition = uViewMatrix * uModelMatrix * ComputeVertexPosition();\n
+ vertexPosition.xy = floor ( vertexPosition.xy );\n // Pixel alignment
+ vertexPosition = uProjection * vertexPosition;\n
vTexCoord = pixelArea.xy+pixelArea.zw*(aPosition + vec2(0.5) );\n
gl_Position = vertexPosition;\n
}\n
mFittingMode( fittingMode ),
mSamplingMode( samplingMode ),
mWrapModeU( WrapMode::DEFAULT ),
- mWrapModeV( WrapMode::DEFAULT )
+ mWrapModeV( WrapMode::DEFAULT ),
+ mAttemptAtlasing( false )
{
}
mFittingMode( FittingMode::DEFAULT ),
mSamplingMode( SamplingMode::DEFAULT ),
mWrapModeU( WrapMode::DEFAULT ),
- mWrapModeV( WrapMode::DEFAULT )
+ mWrapModeV( WrapMode::DEFAULT ),
+ mAttemptAtlasing( false )
{
}
{
DoSetProperty( Toolkit::ImageVisual::Property::SYNCHRONOUS_LOADING, keyValue.second );
}
+ else if ( keyValue.first == IMAGE_ATLASING )
+ {
+ DoSetProperty( Toolkit::DevelImageVisual::Property::ATLASING, keyValue.second );
+ }
}
}
- if( mImpl->mFlags & Impl::IS_SYNCHRONOUS_RESOURCE_LOADING && mImageUrl.IsValid() )
+ if( ( mImpl->mFlags & Impl::IS_SYNCHRONOUS_RESOURCE_LOADING ) && mImageUrl.IsValid() )
{
// if sync loading is required, the loading should start
// immediately when new image url is set or the actor is off stage
mWrapModeV = Dali::WrapMode::Type( wrapMode );
break;
}
+
+ case Toolkit::DevelImageVisual::Property::ATLASING:
+ {
+ bool atlasing = false;
+ mAttemptAtlasing = value.Get( atlasing );
+ }
}
}
Vector4 atlasRect;
// texture set has to be created first as we need to know if atlasing succeeded or not
// when selecting the shader
- TextureSet textures = CreateTextureSet( atlasRect, IsSynchronousResourceLoading(), true );
+ TextureSet textures = CreateTextureSet( atlasRect, IsSynchronousResourceLoading(), mAttemptAtlasing );
CreateRenderer( textures );
if( mImpl->mFlags & Impl::IS_ATLASING_APPLIED ) // the texture is packed inside atlas
map.Insert( Toolkit::ImageVisual::Property::PIXEL_AREA, mPixelArea );
map.Insert( Toolkit::ImageVisual::Property::WRAP_MODE_U, mWrapModeU );
map.Insert( Toolkit::ImageVisual::Property::WRAP_MODE_V, mWrapModeV );
+
+ map.Insert( Toolkit::DevelImageVisual::Property::ATLASING, mAttemptAtlasing );
}
void ImageVisual::DoCreateInstancePropertyMap( Property::Map& map ) const
Dali::WrapMode::Type mWrapModeU:3;
Dali::WrapMode::Type mWrapModeV:3;
+ bool mAttemptAtlasing:1; // If true will attempt atlasing, otherwise create unique texture
+
};
} // namespace Internal
const unsigned int TOOLKIT_MAJOR_VERSION = 1;
const unsigned int TOOLKIT_MINOR_VERSION = 2;
-const unsigned int TOOLKIT_MICRO_VERSION = 31;
+const unsigned int TOOLKIT_MICRO_VERSION = 32;
const char * const TOOLKIT_BUILD_DATE = __DATE__ " " __TIME__;
#ifdef DEBUG_ENABLED
Name: dali-toolkit
Summary: The OpenGLES Canvas Core Library Toolkit
-Version: 1.2.31
+Version: 1.2.32
Release: 1
Group: System/Libraries
License: Apache-2.0 and BSD-2-Clause and MIT