// EXTERNAL INCLUDES
#include <sstream>
#include <string>
+#include <cstring>
#include <map>
#include <cstdio>
#include <cstring> // for strcmp
inline void DeleteTextures(GLsizei n, const GLuint* textures)
{
std::stringstream out;
- out << n << ", " << textures << " = [" ;
+ out << n << ", " << textures << " = [";
for(GLsizei i=0; i<n; i++)
{
- out << textures[i] << ", " ;
+ out << textures[i] << ", ";
mDeletedTextureIds.push_back(textures[i]);
}
out << "]";
if test "x$enable_emscripten" = "xyes"; then
DALI_CFLAGS="$DALI_CFLAGS -DEMSCRIPTEN -std=c++11"
- # Automatically turn off backtrace support
+ # Automatically turn off backtrace support and mutex locks
enable_backtrace="no"
enable_lock_backtrace="no"
fi
#else
+#if defined(__clang__)
+
+#undef _LIBCPP_INLINE_VISIBILITY
+#define _LIBCPP_INLINE_VISIBILITY
+#undef _LIBCPP_EXTERN_TEMPLATE
+#define _LIBCPP_EXTERN_TEMPLATE(...)
+
+#include <map>
+
+#undef _LIBCPP_INLINE_VISIBILITY
+#define _LIBCPP_INLINE_VISIBILITY __attribute__ ((__visibility__("hidden"), __always_inline__))
+#undef _LIBCPP_EXTERN_TEMPLATE
+#define _LIBCPP_EXTERN_TEMPLATE(...) extern template __VA_ARGS__;
+
+#else
+
// ensure that default visibility is used with any class that is used as an exception type
# include <memory>
# include <new>
# undef _GLIBCXX_VISIBILITY_ATTR
# define _GLIBCXX_VISIBILITY_ATTR(V) __attribute__ ((__visibility__ (#V))) // restore `_GLIBCXX_VISIBILITY_ATTR`
+#endif //ifdef __clang__
+
#endif //ifndef HIDE_DALI_INTERNALS
#else
+#if defined(__clang__)
+
+#undef _LIBCPP_INLINE_VISIBILITY
+#define _LIBCPP_INLINE_VISIBILITY
+#undef _LIBCPP_EXTERN_TEMPLATE
+#define _LIBCPP_EXTERN_TEMPLATE(...)
+
+#include <set>
+
+#undef _LIBCPP_INLINE_VISIBILITY
+#define _LIBCPP_INLINE_VISIBILITY __attribute__ ((__visibility__("hidden"), __always_inline__))
+#undef _LIBCPP_EXTERN_TEMPLATE
+#define _LIBCPP_EXTERN_TEMPLATE(...) extern template __VA_ARGS__;
+
+#else
+
+
// ensure that default visibility is used with any class that is used as an exception type
# include <memory>
# include <new>
# include <stdexcept>
+
# include <bits/c++config.h>
# include <bits/stl_tree.h>
# undef _GLIBCXX_VISIBILITY_ATTR
# undef _GLIBCXX_VISIBILITY_ATTR
# define _GLIBCXX_VISIBILITY_ATTR(V) __attribute__ ((__visibility__ (#V))) // restore `_GLIBCXX_VISIBILITY_ATTR`
+#endif //ifdef __clang__
+
#endif //ifndef HIDE_DALI_INTERNALS
#endif /* __DALI_SET_H__ */
// EXTERNAL INCLUDES
#include <algorithm>
+#include <cmath> // abs<float>
// INTERNAL INCLUDES
#include <dali/integration-api/events/touch-event-integ.h>
break;
}
- if ( ( abs( point.screen.x - iter->point.screen.x ) < mMinMotionDistance.x ) &&
- ( abs( point.screen.y - iter->point.screen.y ) < mMinMotionDistance.y ) )
+ if ( ( std::abs( point.screen.x - iter->point.screen.x ) < mMinMotionDistance.x ) &&
+ ( std::abs( point.screen.y - iter->point.screen.y ) < mMinMotionDistance.y ) )
{
// Not enough positional change from last event so ignore
ignore = true;
break;
}
- if ( ( abs( point.screen.x - iter->point.screen.x ) < mMinMotionDistance.x ) &&
- ( abs( point.screen.y - iter->point.screen.y ) < mMinMotionDistance.y ) )
+ if ( ( std::abs( point.screen.x - iter->point.screen.x ) < mMinMotionDistance.x ) &&
+ ( std::abs( point.screen.y - iter->point.screen.y ) < mMinMotionDistance.y ) )
{
// Not enough positional change from last event so ignore
ignore = true;
DALI_ASSERT_ALWAYS( false && "Property type enumeration out of bounds" ); // should not come here
break;
}
- }
+ } // entry.GetType
}
Property::Value Actor::GetDefaultProperty( Property::Index index ) const
/**
* @brief Functor operator for float properties
*
- * @param[in,out] position Current value of the property
- * @param[in] inputs Contains the input property used as the parameter for the path
+ * @param[out] value Current value of the property
+ * @param[in] inputs Contains the input property used as the parameter for the path
*
* @return The value of the linear map at the given parameter.
*/
max = min+1;
}
- tLocal =(t - min*step) / step;
+ tLocal = (t - min*step) / step;
}
else
{
namespace
{
+#if defined(EMSCRIPTEN)
+ThreadLocalStorage* threadLocal = NULL;
+#else
__thread ThreadLocalStorage* threadLocal = NULL;
+#endif
}
ThreadLocalStorage::ThreadLocalStorage(Core* core)
if(pCustom)
{
- type = GetTypeInfo( typeid( pCustom->GetImplementation() ) );
+ const Dali::CustomActorImpl& custom = pCustom->GetImplementation();
+ type = GetTypeInfo( typeid( custom ) );
}
else
{
// do not load image resource again if there is a similar resource loaded:
// see explanation in image.h of what is deemed compatible
return (requested.GetScalingMode() == actual.GetScalingMode()) &&
- (
- (requested.GetFilterMode() == actual.GetFilterMode()) ||
- (requested.GetFilterMode() == SamplingMode::DONT_CARE)
- ) &&
- (fabsf(requested.GetWidth() - actual.GetWidth()) <= actual.GetWidth() * mMaxScale) &&
- (fabsf(requested.GetHeight() - actual.GetHeight()) <= actual.GetHeight() * mMaxScale);
+ (
+ (requested.GetFilterMode() == actual.GetFilterMode()) ||
+ (requested.GetFilterMode() == SamplingMode::DONT_CARE)
+ ) &&
+ (fabsf(static_cast<float>(requested.GetWidth()) - static_cast<float>(actual.GetWidth())) <= actual.GetWidth() * mMaxScale) &&
+ (fabsf(static_cast<float>(requested.GetHeight()) - static_cast<float>(actual.GetHeight())) <= actual.GetHeight() * mMaxScale);
}
Request* ImageFactory::InsertNewRequest( ResourceId resourceId, const std::string& filename, std::size_t urlHash, const ImageAttributes* attr )
{
namespace Internal
{
-class BlendingOptions;
+struct BlendingOptions;
namespace SceneGraph
{
// CLASS HEADER
#include <dali/internal/render/gl-resources/bitmap-texture.h>
+// EXTERNAL INCLUDES
+#include <cstring>
+
// INTERNAL INCLUDES
#include <dali/public-api/common/dali-vector.h>
#include <dali/integration-api/debug.h>
namespace Internal
{
-CompressedBitmapTexture::CompressedBitmapTexture(Internal::BitmapCompressed* const bitmap, Context& context, ResourcePolicy::Discardable discardPolicy)
+CompressedBitmapTexture::CompressedBitmapTexture(Internal::BitmapCompressed* const bitmap, Context& context, ResourcePolicy::Discardable /*discardPolicy*/)
: Texture(context,
bitmap->GetImageWidth(),
bitmap->GetImageHeight(),
bitmap->GetImageWidth(),
bitmap->GetImageHeight()),
mBitmap(bitmap),
- mDiscardPolicy(discardPolicy),
mPixelFormat( bitmap->GetPixelFormat() )
{
DALI_LOG_TRACE_METHOD(Debug::Filter::gImage);
private:
Internal::BitmapCompressedPtr mBitmap; ///< The Bitmap the Texture was created from (may be NULL)
- ResourcePolicy::Discardable mDiscardPolicy;
Pixel::Format mPixelFormat;
// Changes scope, should be at end of class
#include <dali/public-api/object/property.h>
#include <dali/public-api/object/property-input.h>
#include <dali/public-api/object/property-types.h>
+#include <dali/public-api/math/math-utils.h> // Clamp
namespace Dali
{
mBlendPolicy( OPAQUE ),
mResourcesReady( false ),
mFinishedResourceAcquisition( false ),
- mTexturesRequireBlending( false ),
mMaterialChanged( true )
{
// Observe own property-owner's uniform map
BlendPolicy mBlendPolicy; ///< The blend policy as determined by PrepareRender
bool mResourcesReady; ///< if the material is ready to be rendered
bool mFinishedResourceAcquisition; ///< if resource loading is completed
- bool mTexturesRequireBlending; ///< if material textures require blending
bool mMaterialChanged; ///< if the material has changed since the last frame
};
// INTERNAL INCLUDES
#include <dali/integration-api/debug.h>
-namespace
-{
-const int MAX_NUM_STACK_FRAMES = 25;
-}
-
namespace Dali
{
#if defined(BACKTRACE_ENABLED)
+namespace
+{
+const int MAX_NUM_STACK_FRAMES = 25;
+}
+
std::string Demangle(const char* symbol)
{
std::string result;
SizeType* metadata = reinterpret_cast< SizeType* >( mData );
// TODO would be nice to memset to a bitpattern to catch illegal use of container after release
// but that would require knowledge of the itemsize
- free( metadata - 2u );
+ delete [] ( metadata - 2u );
mData = 0u;
}
}
if( capacity > oldCapacity )
{
const SizeType wholeAllocation = sizeof(SizeType) * 2u + capacity * elementSize;
- void* wholeData = (void*)malloc( wholeAllocation );
+ void* wholeData = (void*) new unsigned char[ wholeAllocation ];
DALI_ASSERT_ALWAYS( wholeData && "VectorBase::Reserve - Memory allocation failed" );
#if defined( DEBUG_ENABLED )
* @brief Resize the vector. Does not change capacity.
*
* @param count to resize to.
+ */
+ void Resize( SizeType count )
+ {
+ ItemType item = ItemType();
+ Resize(count, item);
+ }
+
+ /**
+ * @brief Resize the vector. Does not change capacity.
+ *
+ * @param count to resize to.
* @param item to insert to the new indices.
*/
- void Resize( SizeType count, ItemType item = ItemType() )
+ void Resize( SizeType count, const ItemType& item )
{
const SizeType oldCount = VectorBase::Count();
if( count <= oldCount )
#include <new>
#include <stdexcept>
+#if defined(__clang__)
+
+#undef _LIBCPP_INLINE_VISIBILITY
+#define _LIBCPP_INLINE_VISIBILITY
+#undef _LIBCPP_EXTERN_TEMPLATE
+#define _LIBCPP_EXTERN_TEMPLATE(...)
+
+#include <vector>
+
+#undef _LIBCPP_INLINE_VISIBILITY
+#define _LIBCPP_INLINE_VISIBILITY __attribute__ ((__visibility__("hidden"), __always_inline__))
+#undef _LIBCPP_EXTERN_TEMPLATE
+#define _LIBCPP_EXTERN_TEMPLATE(...) extern template __VA_ARGS__;
+
+#else
+
#include <bits/c++config.h>
#undef _GLIBCXX_VISIBILITY_ATTR
#define _GLIBCXX_VISIBILITY_ATTR(V) __attribute__ ((__visibility__ ("hidden")))
#undef _GLIBCXX_VISIBILITY_ATTR
#define _GLIBCXX_VISIBILITY_ATTR(V) __attribute__ ((__visibility__ (#V))) // restore `_GLIBCXX_VISIBILITY_ATTR`
+#endif //ifdef __clang__
+
#endif //ifndef HIDE_DALI_INTERNALS
#endif /* __VECTOR_WRAPPER__H__ */
const unsigned int CORE_MICRO_VERSION = 13;
const char * const CORE_BUILD_DATE = __DATE__ " " __TIME__;
+#ifndef EMSCRIPTEN
+
#ifdef DEBUG_ENABLED
namespace
{
} // unnamed namespace
#endif
+#endif // EMSCRIPTEN
+
} // namespace Dali