build
build.log
tct*core.h
+results_xml.*
END_TEST;
}
+// Set a size that is too large on an Image with a shader that requires grid
+int UtcDaliImageActorSetSize01(void)
+{
+ TestApplication application;
+
+ BitmapImage img = BitmapImage::New( 1,1 );
+ ImageActor actor = ImageActor::New( img );
+
+ ShaderEffect effect = ShaderEffect::New( " ", " ", " ", " ", ShaderEffect::HINT_GRID );
+ actor.SetShaderEffect( effect );
+
+ const float INVALID_SIZE = float(1u<<31);
+ Vector3 vector( INVALID_SIZE, INVALID_SIZE, INVALID_SIZE );
+
+ DALI_TEST_CHECK(vector != actor.GetCurrentSize());
+
+ actor.SetSize(vector);
+ Stage::GetCurrent().Add(actor);
+
+ // flush the queue and render once
+ application.SendNotification();
+ application.Render();
+
+ DALI_TEST_EQUALS(vector, actor.GetCurrentSize(), TEST_LOCATION );
+ END_TEST;
+}
+
int UtcDaliImageActorGetCurrentSize01(void)
{
TestApplication application;
// EXTERNAL INCLUDES
#include <string>
+#include <sstream>
#include <list>
// INTERNAL INCLUDES
std::string mDebugString;
/**
+ * Print all the actor tree names
+ **/
+#define DALI_LOG_ACTOR_TREE( node ) { \
+ std::stringstream branch; \
+ Node* tempNode = node; \
+ while( tempNode ) { \
+ branch << "<" << tempNode->mDebugString << ">::"; \
+ tempNode = tempNode->GetParent(); \
+ } \
+ DALI_LOG_ERROR_NOFN("Actor tree: %s\n", branch.str().c_str()); \
+}
+
+/**
* Allows one object to set another object's debug string
*/
#define DALI_LOG_SET_OBJECT_STRING(object, string) (object->mDebugString = string)
#else // DEBUG_ENABLED
#define DALI_LOG_OBJECT_STRING_DECLARATION
+#define DALI_LOG_ACTOR_TREE(node)
#define DALI_LOG_SET_OBJECT_STRING(object, string)
#define DALI_LOG_FMT_OBJECT_STRING(object, fmt, args...)
#define DALI_LOG_GET_OBJECT_STRING(object)
ShaderChanged( updateBufferIndex );
}
+bool RenderableAttachment::ResolveVisibility( BufferIndex updateBufferIndex )
+{
+ mHasSizeAndColorFlag = false;
+ const Vector4& color = mParent->GetWorldColor( updateBufferIndex );
+ if( color.a > FULLY_TRANSPARENT ) // not fully transparent
+ {
+ const float MAX_NODE_SIZE = float(1u<<30);
+ const Vector3& size = mParent->GetSize( updateBufferIndex );
+ if( ( size.width > Math::MACHINE_EPSILON_1000 ) && // width is greater than a very small number
+ ( size.height > Math::MACHINE_EPSILON_1000 ) && // height is greater than a very small number
+ ( size.width < MAX_NODE_SIZE ) && // width is smaller than the maximum allowed size
+ ( size.height < MAX_NODE_SIZE ) ) // height is smaller than the maximum allowed size
+ {
+ mHasSizeAndColorFlag = true;
+ }
+ else
+ {
+ DALI_LOG_ERROR("Actor size should be bigger than 0 but not bigger than %f.\n", MAX_NODE_SIZE );
+ DALI_LOG_ACTOR_TREE( mParent );
+ }
+ }
+ return mHasSizeAndColorFlag;
+}
+
void RenderableAttachment::DoGetScaleForSize( const Vector3& nodeSize, Vector3& scaling )
{
scaling = Vector3::ONE;
* @param[in] updateBufferIndex The current update buffer index.
* @return visible tells if this renderer can be potentially seen
*/
- virtual bool ResolveVisibility( BufferIndex updateBufferIndex )
- {
- mHasSizeAndColorFlag = false;
- const Vector4& color = mParent->GetWorldColor( updateBufferIndex );
- if( color.a > FULLY_TRANSPARENT ) // not fully transparent
- {
- const Vector3& size = mParent->GetSize( updateBufferIndex );
- if( ( size.width > Math::MACHINE_EPSILON_1000 )&& // width is greater than a very small number
- ( size.height > Math::MACHINE_EPSILON_1000 ) ) // height is greater than a very small number
- {
- mHasSizeAndColorFlag = true;
- }
- }
- return mHasSizeAndColorFlag;
- }
+ virtual bool ResolveVisibility( BufferIndex updateBufferIndex );
/**
* if this renderable actor has visible size and color