all: $(TARGETS)
%: %.cpp
- $(CC) -o $@ $< $(CXXFLAGS) $(LDFLAGS)
+ $(CC) -o $@ $< ../../dali-test-suite-utils/test-application.cpp $(CXXFLAGS) $(LDFLAGS)
clean:
@rm -f $(notdir $(TARGETS))
--- /dev/null
+#define tet_infoline printf
+#define tet_printf printf
+#include "test-application.h"
+
+bool BlendEnabled(const TraceCallStack& callStack)
+{
+ std::stringstream out;
+ out << GL_BLEND;
+ bool blendEnabled = callStack.FindMethodAndParams("Enable", out.str());
+ return blendEnabled;
+}
+
+bool BlendDisabled(const TraceCallStack& callStack)
+{
+ std::stringstream out;
+ out << GL_BLEND;
+ bool blendEnabled = callStack.FindMethodAndParams("Disable", out.str());
+ return blendEnabled;
+}
+
+
static constexpr float DEFAULT_HORIZONTAL_DPI = 220.0f;
static constexpr float DEFAULT_VERTICAL_DPI = 217.0f;
#else
- static const float DEFAULT_HORIZONTAL_DPI = 220.0f;
- static const float DEFAULT_VERTICAL_DPI = 217.0f;
+ static const float DEFAULT_HORIZONTAL_DPI = 220.0f;
+ static const float DEFAULT_VERTICAL_DPI = 217.0f;
#endif
static const unsigned int DEFAULT_RENDER_INTERVAL = 1;
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 << "]";
};
template <>
-int TestGlAbstraction::ProgramUniformValue<int>::GetZero() const
+inline int TestGlAbstraction::ProgramUniformValue<int>::GetZero() const
{
return 0;
}
template <>
-float TestGlAbstraction::ProgramUniformValue<float>::GetZero() const
+inline float TestGlAbstraction::ProgramUniformValue<float>::GetZero() const
{
return 0.0f;
}
template <>
-Vector2 TestGlAbstraction::ProgramUniformValue<Vector2>::GetZero() const
+inline Vector2 TestGlAbstraction::ProgramUniformValue<Vector2>::GetZero() const
{
return Vector2::ZERO;
}
template <>
-Vector3 TestGlAbstraction::ProgramUniformValue<Vector3>::GetZero() const
+inline Vector3 TestGlAbstraction::ProgramUniformValue<Vector3>::GetZero() const
{
return Vector3::ZERO;
}
template <>
-Vector4 TestGlAbstraction::ProgramUniformValue<Vector4>::GetZero() const
+inline Vector4 TestGlAbstraction::ProgramUniformValue<Vector4>::GetZero() const
{
return Vector4::ZERO;
}
template <>
-Matrix TestGlAbstraction::ProgramUniformValue<Matrix>::GetZero() const
+inline Matrix TestGlAbstraction::ProgramUniformValue<Matrix>::GetZero() const
{
return Matrix();
}
template <>
-Matrix3 TestGlAbstraction::ProgramUniformValue<Matrix3>::GetZero() const
+inline Matrix3 TestGlAbstraction::ProgramUniformValue<Matrix3>::GetZero() const
{
return Matrix3( Matrix() );
}
} // namespace Dali
-bool BlendEnabled(const TraceCallStack& callStack)
-{
- std::stringstream out;
- out << GL_BLEND;
- bool blendEnabled = callStack.FindMethodAndParams("Enable", out.str());
- return blendEnabled;
-}
-
-bool BlendDisabled(const TraceCallStack& callStack)
-{
- std::stringstream out;
- out << GL_BLEND;
- bool blendEnabled = callStack.FindMethodAndParams("Disable", out.str());
- return blendEnabled;
-}
-
+extern bool BlendEnabled(const TraceCallStack& callStack);
+extern bool BlendDisabled(const TraceCallStack& callStack);
-#endif // __TEST_GL_ES_H__
+#endif // header
{
bitmapData = Integration::Bitmap::New(Integration::Bitmap::BITMAP_2D_PACKED_PIXELS, true);
bitmapData->GetPackedPixelsProfile()->ReserveBuffer(Pixel::A8, 64, 64);
- PixelBuffer* pixelBuffer = bitmapData->GetBuffer();
+ Integration::PixelBuffer* pixelBuffer = bitmapData->GetBuffer();
memset( pixelBuffer, it->character, 64*64 );
}
bitmapData = Integration::Bitmap::New(Integration::Bitmap::BITMAP_2D_PACKED_PIXELS, true);
bitmapData->GetPackedPixelsProfile()->ReserveBuffer(Pixel::A8, 64, 64);
- PixelBuffer* pixelBuffer = bitmapData->GetBuffer();
+ Integration::PixelBuffer* pixelBuffer = bitmapData->GetBuffer();
memset( pixelBuffer, it->character, 64*64 );
set->AddCharacter(bitmapData, character);
}
all: $(TARGETS)
%: %.cpp
- $(CC) -o $@ $< $(CXXFLAGS) $(LDFLAGS)
+ $(CC) -o $@ $< ../../dali-test-suite-utils/test-application.cpp $(CXXFLAGS) $(LDFLAGS)
+
clean:
@rm -f $(notdir $(TARGETS))
[enable_debug=$enableval],
[enable_debug=no])
+AC_ARG_ENABLE([emscripten],
+ [AC_HELP_STRING([--enable-emscripten],
+ [Emscripten builds])],
+ [enable_emscripten=$enableval],
+ [enable_emscripten=no])
+
if test "x$enable_debug" = "xyes"; then
DALI_CFLAGS="$DALI_CFLAGS -DDEBUG_ENABLED -DDEBUG_BACKTRACE"
fi
DALI_CFLAGS="$DALI_CFLAGS -fvisibility=hidden -DHIDE_DALI_INTERNALS"
fi
+if test "x$enable_emscripten" = "xyes"; then
+ DALI_CFLAGS="$DALI_CFLAGS -DEMSCRIPTEN -std=c++11"
+fi
+
AC_ARG_ENABLE([performance-monitor],
[AC_HELP_STRING([--enable-performance-monitor],
[Enables the performance monitor output])],
Performance Monitor: $enable_performance_monitor
Data Dir (Read/Write): $dataReadWriteDir
Data Dir (Read Only): $dataReadOnlyDir
+ Emscripten: $enable_emscripten
"
noinst_PROGRAMS = linker.test
-linker_test_SOURCES = linker-test.cpp
+linker_test_SOURCES = linker-test.cpp ../../../automated-tests/dali-test-suite-utils/test-application.cpp
linker_test_CXXFLAGS = \
-Werror -Wall -Wfloat-equal \
// C++0x not supported
#endif
+#ifdef EMSCRIPTEN
+
+#ifndef __clang__
+# error not clang?
+#endif
+
+// clang cpp11 check is per feature
+#if !__has_feature(cxx_constexpr)
+# error constexpr needed for compile-time-math. Use --std=c11
+#endif
+
+#define _CPP11
+
+#endif
+
namespace Dali
{
class PanGestureDetector;
}
-class PanGesture;
+struct PanGesture;
/**
* This class looks for panning (or dragging) gestures. The user will be pressing one or more fingers on
class PinchGestureDetector;
}
-class PinchGesture;
+struct PinchGesture;
/**
* This class looks for pinching gestures involving two touches. It tries to detect when the user moves two
class TapGestureDetector;
}
-class TapGesture;
+struct TapGesture;
/**
* This class emits a signal when a tap gesture occurs that meets the requirements set by the
enum { value = 0 };
};
+
/**
* Compile time template to calculate the machine epsilon for a given floating point number
* Note! value needs to be compile time constant
struct Vector2;
struct Vector4;
-struct Quaternion;
+class Quaternion;
/**
* 3d Vector
memcpy( mBuffer[index], src, size );
// unset WRITING bit, set UPDATED bit
- BufferState checkState = __sync_val_compare_and_swap( &mState, (currentState | WRITING), (index | UPDATED) );
+ BufferState checkState = __sync_val_compare_and_swap( &mState,
+ static_cast<BufferState>(currentState | WRITING),
+ static_cast<BufferState>(index | UPDATED) );
DALI_ASSERT_DEBUG( checkState & WRITING );
(void)checkState; // Avoid unused variable warning
{
// Try to swap buffers.
// This will set mState to 1 if readbuffer 0 was updated, 0 if readbuffer 1 was updated and fail if WRITING is set
- if( __sync_bool_compare_and_swap( &mState, currentWriteBuf | UPDATED, !currentWriteBuf ) )
+ if( __sync_bool_compare_and_swap( &mState,
+ static_cast<BufferState>(currentWriteBuf | UPDATED),
+ static_cast<BufferState>(!currentWriteBuf) ) )
{
// swap successful
return mBuffer[currentWriteBuf];
#include <string.h>
#include <sstream>
#include <iomanip>
-#include <boost/thread/tss.hpp>
+
+#ifndef EMSCRIPTEN
+# include <boost/thread/tss.hpp>
+#endif
// INTERNAL INCLUDES
#include <dali/public-api/common/constants.h>
unsigned int logOptions;
};
+#ifndef EMSCRIPTEN // single threaded
boost::thread_specific_ptr<ThreadLocalLogging> threadLocal;
+#else
+std::auto_ptr<ThreadLocalLogging> threadLocal;
+#endif
/* Forward declarations */
std::string FormatToString(const char *format, ...);
{
return;
}
-
va_list arg;
va_start(arg, format);
std::string message = ArgListToString(format, arg);
struct Vector2;
struct Vector3;
struct Vector4;
-struct Matrix3;
-struct Matrix;
-struct Quaternion;
+class Matrix3;
+class Matrix;
+class Quaternion;
namespace Integration
{
namespace Integration
{
-class DynamicsBodySettings;
+struct DynamicsBodySettings;
class DynamicsShape;
class DynamicsWorld;
namespace Dali
{
-class Vector3;
+struct Vector3;
namespace Integration
{
namespace Integration
{
-class DynamicsCollisionData;
+struct DynamicsCollisionData;
class DynamicsBody;
class DynamicsJoint;
class DynamicsWorld;
-class DynamicsWorldSettings;
+struct DynamicsWorldSettings;
typedef std::map<void*, DynamicsCollisionData> CollisionDataContainer;
DynamicsWorld* InitializeDynamics( DynamicsWorldSettings* settings );
mLayerList(NULL),
mClippingBox(0,0,0,0),
mSortFunction(Dali::Layer::ZValue),
- mRenderOffscreen(false),
mIsClipping(false),
mDepthTestDisabled(false)
{
ClippingBox mClippingBox; ///< The clipping box, in window coordinates
Dali::Layer::SortFunctionType mSortFunction; ///< Used to sort semi-transparent geometry
- bool mRenderOffscreen:1; ///< true when rendering to a FBO
bool mIsClipping:1; ///< True when clipping is enabled
bool mDepthTestDisabled:1; ///< Whether depth test is disabled.
- static bool mFirstInstance ;
+ static bool mFirstInstance;
static DefaultPropertyLookup* mDefaultLayerPropertyLookup; ///< Default properties
};
namespace Internal
{
-class Source;
+struct Source;
typedef std::vector<Source> SourceContainer;
typedef SourceContainer::iterator SourceIter;
--- /dev/null
+//
+// Copyright (c) 2014 Samsung Electronics Co., Ltd.
+//
+// Licensed under the Flora License, Version 1.0 (the License);
+// you may not use this file except in compliance with the License.
+// You may obtain a copy of the License at
+//
+// http://floralicense.org/license/
+//
+// Unless required by applicable law or agreed to in writing, software
+// distributed under the License is distributed on an AS IS BASIS,
+// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
+// See the License for the specific language governing permissions and
+// limitations under the License.
+//
+
+//
+// gcc and clang minimal demangling
+// Both follow Itanium C++ ABI
+//
+// We only decode namespaces and class typeid names for simplicity as its all we need.
+//
+// From http://mentorembedded.github.io/cxx-abi/abi.html#mangling-structure
+//
+// <nested-name> ::= N [<CV-qualifiers>] <prefix> <unqualified-name> E
+// ::= N [<CV-qualifiers>] <template-prefix> <template-args> E
+//
+// <prefix> ::= <prefix> <unqualified-name>
+// ::= <template-prefix> <template-args>
+// ::= <template-param>
+// ::= <decltype>
+// ::= # empty
+// ::= <substitution>
+// ::= <prefix> <data-member-prefix>
+//
+// <template-prefix> ::= <prefix> <template unqualified-name>
+// ::= <template-param>
+// ::= <substitution>
+// <unqualified-name> ::= <operator-name>
+// ::= <ctor-dtor-name>
+// ::= <source-name>
+// ::= <unnamed-type-name>
+//
+// <source-name> ::= <positive length number> <identifier>
+// <number> ::= [n] <non-negative decimal integer>
+// <identifier> ::= <unqualified source code identifier>
+//
+// So for example
+//
+// Dali::Internal::Actor would be
+//
+// N4Dali8Internal5ActorE
+//
+
+// CLASS HEADER
+#include <dali/internal/event/common/demangler.h>
+
+namespace
+{
+
+// true if character represent a digit
+inline bool IsDigit(char c)
+{
+ return (c >= '0' && c <= '9');
+}
+
+// Gets the number of characters (number is in string)
+// start The start position to look for a number
+// result The number as an integer
+// returns the number of characters used to define the number ie '12' is 2
+size_t GetNumberOfCharacters(const std::string& s, const size_t& start, int& result)
+{
+ size_t size = s.size();
+
+ size_t i = start;
+
+ int number = 0;
+
+ for( ; i < size; ++i )
+ {
+ char c = s.at(i);
+ if( !IsDigit( c ) )
+ {
+ break;
+ }
+ else
+ {
+ number = 10 * number + (c - '0');
+ }
+ }
+
+ if( i - start )
+ {
+ result = number;
+ }
+
+ return i - start;
+}
+
+} // anon namespace
+
+
+namespace Dali
+{
+
+namespace Internal
+{
+
+#if defined(__clang__) || defined(__GNUC__)
+
+// Demangle class name mangled according to the Itanium C++ ABI
+// Returns demangled names ie "N4Dali8Internal5ActorE" is ["Dali","Internal","Actor"]
+std::vector<std::string> DemangleNestedNames(const char *typeIdName)
+{
+ std::vector<std::string> ret;
+
+ const std::string mangledName(typeIdName);
+
+
+ size_t size = mangledName.size();
+
+ if( size >= 2 )
+ {
+ int number = 0;
+ size_t start = 0;
+
+ // If the class isnt nested in a namespace then it just starts with the
+ // number of characters
+ if(mangledName[0] == 'N' && mangledName[size-1] == 'E')
+ {
+ start = 1;
+ }
+
+ while( size_t chars = GetNumberOfCharacters(mangledName, start, number) )
+ {
+ ret.push_back( mangledName.substr( start + chars, number ) );
+
+ start += chars + number;
+ }
+ }
+
+ return ret;
+}
+
+#else
+# error Unsupported Compiler
+#endif
+
+
+const std::string DemangleClassName(const char *typeIdName)
+{
+ std::string name;
+ std::vector<std::string> names = DemangleNestedNames(typeIdName);
+
+ if( names.size() )
+ {
+ name = names[ names.size() - 1 ];
+ }
+
+ return name;
+}
+
+} // namespace Internal
+
+} // namespace Dali
--- /dev/null
+#ifndef __DALI_DEMANGLER_H__
+#define __DALI_DEMANGLER_H__
+
+//
+// Copyright (c) 2014 Samsung Electronics Co., Ltd.
+//
+// Licensed under the Flora License, Version 1.0 (the License);
+// you may not use this file except in compliance with the License.
+// You may obtain a copy of the License at
+//
+// http://floralicense.org/license/
+//
+// Unless required by applicable law or agreed to in writing, software
+// distributed under the License is distributed on an AS IS BASIS,
+// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
+// See the License for the specific language governing permissions and
+// limitations under the License.
+//
+
+// INTERNAL INCLUDES
+#include <vector>
+#include <string>
+
+namespace Dali
+{
+
+namespace Internal
+{
+
+/**
+ * Demangle a nested typeid name into its component parts.
+ * A nested type name is one containing namespaces and class names only.
+ * eg DemangleNestedNames(typeid(Dali::Actor).name());
+ * @param[in] typeIdName The type id name string to demangle.
+ * @returns the demangled list of names ie ["Dali","Actor"] or an empty list
+ */
+std::vector<std::string> DemangleNestedNames(const char *typeIdName);
+
+/**
+ * Demangle a nested typeid name to its class name.
+ * @param[in] typeIdName The type id name string to demangle.
+ * @returns the class name ie "Actor" or an empty string
+ */
+const std::string DemangleClassName(const char *typeIdName);
+
+}
+
+}
+
+
+#endif // header
#include <dali/internal/event/common/notification-manager.h>
// EXTERNAL INCLUDES
+#ifdef __clang__
+#pragma clang diagnostic push
+#pragma clang diagnostic ignored "-Wall"
+
#include <boost/thread/mutex.hpp>
+#pragma clang diagnostic pop
+#else
+
+#include <boost/thread/mutex.hpp>
+
+#endif // __clang__
+
// INTERNAL INCLUDES
#include <dali/public-api/common/dali-common.h>
#include <dali/internal/event/common/property-notification-impl.h>
// EXTERNAL INCLUDES
#include <boost/thread/tss.hpp>
+#include <memory>
// INTERNAL INCLUDES
#include <dali/internal/common/core-impl.h>
namespace
{
-boost::thread_specific_ptr<ThreadLocalStorage> threadLocal;
+#ifdef EMSCRIPTEN
+ std::auto_ptr<ThreadLocalStorage> threadLocal;
+#else
+ boost::thread_specific_ptr<ThreadLocalStorage> threadLocal;
+#endif
}
ThreadLocalStorage::ThreadLocalStorage(Core* core)
#include <dali/internal/event/common/type-registry-impl.h>
// EXTERNAL INCLUDES
-#include <execinfo.h>
-#include <cxxabi.h>
#include <string.h>
#include <sstream>
#include <dali/public-api/object/type-registry.h>
#include <dali/public-api/object/base-handle.h>
#include <dali/internal/event/actors/custom-actor-internal.h>
+#include <dali/internal/event/common/demangler.h>
#include <dali/integration-api/debug.h>
Debug::Filter* gLogFilter = Debug::Filter::New(Debug::NoLogging, false, "LOG_TYPE_REGISTRY");
#endif
-std::vector<std::string> SplitString(const std::string &s, char delim, std::vector<std::string> &elems)
-{
- std::stringstream ss(s);
- std::string item;
- while(std::getline(ss, item, delim))
- {
- elems.push_back(item);
- }
- return elems;
-}
-
-const int Demangle(const char* symbol, std::vector<std::string> &resolved)
-{
- int status = -4;
-
- char* res = abi::__cxa_demangle(symbol, NULL, NULL, &status);
-
- const char* const demangled_name = (status==0)?res:symbol;
-
- std::string sDemangled(demangled_name);
-
- free(res);
-
- SplitString(sDemangled, ':', resolved);
-
- return resolved.size();
-}
-
-const std::string DemangleShortName(const char *symbol)
-{
- std::vector<std::string> resolved;
-
- Demangle(symbol, resolved);
-
- if(resolved.size() > 0)
- {
- return resolved[ resolved.size() - 1 ];
- }
- else
- {
- return std::string(symbol);
- }
-
-}
-
} // namespace anon
namespace Dali
{
Dali::TypeInfo ret;
- std::string typeName = DemangleShortName(registerType.name());
+ std::string typeName = DemangleClassName(registerType.name());
RegistryMap::iterator iter = mRegistryLut.find(typeName);
}
bool TypeRegistry::Register( const std::type_info& theTypeInfo, const std::type_info& baseTypeInfo,
- Dali::TypeInfo::CreateFunction createInstance, bool callCreateOnInit )
+ Dali::TypeInfo::CreateFunction createInstance, bool callCreateOnInit )
{
- std::string uniqueTypeName = DemangleShortName(theTypeInfo.name());
+ std::string uniqueTypeName = DemangleClassName(theTypeInfo.name());
return Register( uniqueTypeName, baseTypeInfo, createInstance, callCreateOnInit );
}
{
bool ret = false;
- std::string baseTypeName = DemangleShortName(baseTypeInfo.name());
+ std::string baseTypeName = DemangleClassName(baseTypeInfo.name());
RegistryMap::iterator iter = mRegistryLut.find(uniqueTypeName);
std::string TypeRegistry::RegistrationName( const std::type_info& registerType )
{
- return DemangleShortName( registerType.name() );
+ return DemangleClassName( registerType.name() );
}
void TypeRegistry::RegisterSignal( TypeRegistration& typeRegistration, const std::string& name, Dali::TypeInfo::SignalConnectorFunctionV2 func )
} // unnamed namespace
-EventProcessor::EventProcessor(Stage& stage, NotificationManager& notificationManager, GestureEventProcessor& gestureEventProcessor)
-: mNotificationManager(notificationManager),
- mTouchEventProcessor(stage),
+EventProcessor::EventProcessor(Stage& stage, NotificationManager& /* notificationManager */, GestureEventProcessor& gestureEventProcessor)
+: mTouchEventProcessor(stage),
mGestureEventProcessor(gestureEventProcessor),
mKeyEventProcessor(stage),
mMouseWheelEventProcessor(stage),
private:
- NotificationManager& mNotificationManager; ///< Processes notification events.
TouchEventProcessor mTouchEventProcessor; ///< Processes touch events.
GestureEventProcessor& mGestureEventProcessor; ///< Processes gesture events.
KeyEventProcessor mKeyEventProcessor; ///< Processes key events.
namespace Integration
{
-class GestureEvent;
+struct GestureEvent;
}
namespace Internal
/**
* Get the property index from the vertex index and the vertex property enumeration
*/
+ using ProxyObject::GetPropertyIndex;
Property::Index GetPropertyIndex( unsigned int vertex, Property::Index property ) const;
/**
namespace Internal
{
class Material;
-class MaterialProperties;
+struct MaterialProperties;
class ModelData;
namespace Serialize
ResourceTicketPtr ModelFactory::Load( const std::string& filename )
{
ResourceTicketPtr ticket;
- ResourceTypePath typePath(ModelResourceType(), filename);
+ ModelResourceType modelResourceType; // construct first as no copy ctor (needed to bind ref to object)
+ ResourceTypePath typePath(modelResourceType, filename);
// Search for a matching resource
ResourceTypePathIdIter iter = mResourceTypePathIdMap.end();
// Request a new model resource, if necessary
if ( !ticket )
{
- ticket = mResourceClient.RequestResource(ModelResourceType(), filename);
+ ModelResourceType modelResourceType; // construct first as no copy ctor (needed to bind ref to object)
+ ticket = mResourceClient.RequestResource(modelResourceType, filename);
mResourceTypePathIdMap.insert( ResourceTypePathIdPair( typePath, ticket->GetId() ) );
}
}
else
{
+#ifndef EMSCRIPTEN
fprintf(stderr, "%s: Model not loaded yet\n", __PRETTY_FUNCTION__);
+#else
+ // printf to stderr doesnt always show in browser console window
+ printf("%s: Model not loaded yet\n", __PRETTY_FUNCTION__);
+#endif
}
}
const ResourceId newId = ++(mImpl->mNextId);
Dali::ImageAttributes imageAttributes = Dali::ImageAttributes::New(bitmap->GetImageWidth(), bitmap->GetImageHeight(), bitmap->GetPixelFormat());
- ResourceTypePath typePath(BitmapResourceType(imageAttributes), "");
-
+ BitmapResourceType bitmapResourceType(imageAttributes); // construct first as no copy ctor (needed to bind ref to object)
+ ResourceTypePath typePath(bitmapResourceType, "");
newTicket = new ImageTicket(*this, newId, typePath);
newTicket->mAttributes = imageAttributes;
newTicket->LoadingSucceeded();
ImageTicketPtr newTicket;
const ResourceId newId = ++(mImpl->mNextId);
-
- ResourceTypePath typePath(NativeImageResourceType(), "");
+ NativeImageResourceType nativeImageResourceType; // construct first as no copy ctor (needed to bind ref to object)
+ ResourceTypePath typePath(nativeImageResourceType, "");
newTicket = new ImageTicket(*this, newId, typePath);
newTicket->mAttributes = ImageAttributes::New(resourceData.GetWidth(),
resourceData.GetHeight(),
const ResourceId newId = ++(mImpl->mNextId);
Dali::ImageAttributes imageAttributes = Dali::ImageAttributes::New(width, height, pixelFormat );
- ResourceTypePath typePath(RenderTargetResourceType(imageAttributes), "");
+ RenderTargetResourceType renderTargetResourceType(imageAttributes) ; // construct first as no copy ctor (needed to bind ref to object)
+ ResourceTypePath typePath(renderTargetResourceType, "");
newTicket = new ImageTicket(*this, newId, typePath);
newTicket->mAttributes = imageAttributes;
newTicket->LoadingSucceeded();
const ResourceId newId = ++(mImpl->mNextId);
Dali::ImageAttributes imageAttributes = Dali::ImageAttributes::New(nativeImage.GetWidth(), nativeImage.GetHeight(), nativeImage.GetPixelFormat() );
- ResourceTypePath typePath(RenderTargetResourceType(imageAttributes), "");
+ RenderTargetResourceType renderTargetResourceType(imageAttributes); // construct first as no copy ctor (needed to bind ref to object)
+ ResourceTypePath typePath(renderTargetResourceType, "");
newTicket = new ImageTicket(*this, newId, typePath);
newTicket->mAttributes = imageAttributes;
newTicket->LoadingSucceeded();
const ResourceId newId = ++(mImpl->mNextId);
Dali::ImageAttributes imageAttributes = Dali::ImageAttributes::New( width, height, pixelformat);
- ResourceTypePath typePath(BitmapResourceType(imageAttributes), "");
+ BitmapResourceType bitmapResourceType(imageAttributes); // construct first as no copy ctor (needed to bind ref to object)
+ ResourceTypePath typePath(bitmapResourceType, "");
newTicket = new ImageTicket(*this, newId, typePath);
mImpl->mTickets.insert(TicketPair(newId, newTicket.Get()));
{
ResourceTicketPtr newTicket;
const ResourceId newId = ++(mImpl->mNextId);
- ResourceTypePath typePath(MeshResourceType(), "");
+ MeshResourceType meshResourceType; // construct first as no copy ctor (needed to bind ref to object)
+ ResourceTypePath typePath(meshResourceType, "");
newTicket = new ResourceTicket(*this, newId, typePath);
mImpl->mTickets.insert(TicketPair(newId, newTicket.Get()));
// Forward declarations.
-class TextFormat;
+struct TextFormat;
class ResourceClient;
class FontFactory;
TextArray utfCodes = GetUniqueCharacters( text );
// ensure all the metrics are loaded for the characters
- LoadMetricsSynchronously( utfCodes ) ;
+ LoadMetricsSynchronously( utfCodes );
// Measure text
// Calculate the natural size of text for the font
TextArray utfCodes;
utfCodes.push_back( character.GetImplementation().GetCharacter() );
- LoadMetricsSynchronously( utfCodes ) ;
+ LoadMetricsSynchronously( utfCodes );
const GlyphMetric* glyph;
mFontId(fontId),
mFontCount( 0 ),
mMetricsLoaded( false ),
- mPlatform( ThreadLocalStorage::Get().GetPlatformAbstraction() ),
- mResourceClient( resourceClient )
+ mPlatform( ThreadLocalStorage::Get().GetPlatformAbstraction() )
{
}
unsigned int mFontCount; ///< How many font objects are using this font, used to know when it should be deleted from font factory
bool mMetricsLoaded; ///< Whether the metrics cache has been loaded
Integration::PlatformAbstraction& mPlatform; ///< platform abstraction
- ResourceClient& mResourceClient; ///< resource client
};
} // namespace Internal
$(internal_src_dir)/event/animation/animation-playlist.cpp \
$(internal_src_dir)/event/animation/constraint-impl.cpp \
$(internal_src_dir)/event/animation/key-frames-impl.cpp \
+ $(internal_src_dir)/event/common/demangler.cpp \
$(internal_src_dir)/event/common/notification-manager.cpp \
$(internal_src_dir)/event/common/object-registry-impl.cpp \
$(internal_src_dir)/event/common/projection.cpp \
namespace SceneGraph
{
class RenderInstruction;
-class RenderList;
+struct RenderList;
class RenderItem;
}
{
DynamicsDebugRenderer::DynamicsDebugRenderer(const Shader& debugShader)
-: mBufferName(0),
- mShader(const_cast<Shader&>(debugShader)),
+: mShader(const_cast<Shader&>(debugShader)),
mContext(NULL),
mBufferIndex(0),
mViewMatrix(Matrix::IDENTITY),
void UpdateBuffer( const Integration::DynamicsDebugVertexContainer& vertices );
private:
-
- int mBufferName;
Shader& mShader;
Context* mContext;
BufferIndex mBufferIndex;
LOG_GL("BindBuffer GL_ELEMENT_ARRAY_BUFFER 0\n");
mGlAbstraction.BindBuffer(GL_ELEMENT_ARRAY_BUFFER, mBoundElementArrayBufferId);
+#ifndef EMSCRIPTEN // not in WebGL
mBoundTransformFeedbackBufferId = 0;
LOG_GL("BindBuffer GL_TRANSFORM_FEEDBACK_BUFFER 0\n");
mGlAbstraction.BindBuffer(GL_TRANSFORM_FEEDBACK_BUFFER, mBoundTransformFeedbackBufferId);
+#endif
mActiveTextureUnit = UNINITIALIZED_TEXTURE_UNIT;
{
class RenderDataProvider;
-class BoneTransforms;
+struct BoneTransforms;
class LightController;
class RenderMaterial;
class Mesh;
{
mTexture = mTextureCache->GetTexture( mTextureId );
- if( ( mTexture == NULL ) )
+ if( mTexture == NULL )
{
// texture atlas hasn't been created yet
return false;
// CLASS HEADER
#include <dali/internal/update/common/scene-graph-buffers.h>
-using namespace std;
-
namespace Dali
{
{
class DynamicsBody;
-class DynamicsBodySettings;
+struct DynamicsBodySettings;
} // namespace Integration
}
}
+ virtual void Update( BufferIndex /*updateBufferIndex*/, const Node& /*owningNode*/, int /*nodeDirtyFlags*/ )
+ {
+ if (mUpdateRequired)
+ {
+ mUpdateRequired = false;
+ }
+ }
+
protected:
/**
// Undefined
LightAttachment& operator=(const LightAttachment& rhs);
- void Update()
- {
- if (mUpdateRequired)
- {
- mUpdateRequired = false;
- }
- }
-
private:
Internal::LightPtr mLight;
bool mUpdateRequired; ///< This is set to true if the projection matrix requires an update
#include <dali/internal/update/queue/update-message-queue.h>
// EXTERNAL INCLUDES
+#ifdef __clang__
+#pragma clang diagnostic push
+#pragma clang diagnostic ignored "-Wall"
#include <boost/thread/mutex.hpp>
+#pragma clang diagnostic pop
+#else
+#include <boost/thread/mutex.hpp>
+#endif // ifdef __clang
// INTERNAL INCLUDES
#include <dali/public-api/common/vector-wrapper.h>
{
typedef HistoryPairType<Vector2> HistoryPair;
typedef std::set<HistoryPair> HistoryContainer;
- typedef typename HistoryContainer::iterator HistoryContainerIter;
+ typedef HistoryContainer::iterator HistoryContainerIter;
public:
#include <string>
#include <cstdio>
#include <execinfo.h>
-#include <cxxabi.h>
+
+#ifndef EMSCRIPTEN // cxxabi not supported
+# include <cxxabi.h>
+#endif
+
#include <cstring>
// INTERNAL INCLUDES
namespace Dali
{
+#ifndef EMSCRIPTEN
+
std::string Demangle(const char* symbol)
{
std::string result;
return result;
}
+#endif // EMSCRIPTEN
+
+#ifndef EMSCRIPTEN
+
DALI_EXPORT_API DaliException::DaliException(const char *location, const char* condition)
: mLocation(location), mCondition(condition)
{
free(symbols);
}
+#else
+
+DALI_EXPORT_API DaliException::DaliException(const char *location, const char* condition)
+: mLocation(location), mCondition(condition)
+{
+ printf("Exception: \n%s\n thrown at %s\nSee dlog for backtrace\n", mCondition.c_str(), mLocation.c_str());
+}
+
+#endif // EMSCRIPTEN
+
DALI_EXPORT_API void DaliAssertMessage(const char* condition, const char* file, int line)
{
DALI_LOG_ERROR_NOFN( "Assertion (%s) failed in: %s:%d\n", condition, file, line );
namespace
{
-Vector3 CalculateNormal(const Vector3& v0, const Vector3& v1, const Vector3& v2)
-{
- // Calculate normal...
- const Vector3 e0 = v1 - v0;
- const Vector3 e1 = v2 - v1;
- Vector3 normal = e0.Cross(e1);
- normal.Normalize();
- return normal;
-}
-
} // namespace
Mesh::Mesh()
class Matrix;
-struct Bone;
+class Bone;
typedef std::vector< Bone > BoneContainer;
typedef BoneContainer::iterator BoneIter;
typedef BoneContainer::const_iterator BoneConstIter;