inline void GetShaderSource(GLuint shader, GLsizei bufsize, GLsizei* length, char* source)
{
const std::string shaderSource = mShaderSources[shader];
- if( static_cast<int>(shaderSource.length()) < bufsize )
+ const int shaderSourceLength = static_cast<int>(shaderSource.length());
+ if( shaderSourceLength < bufsize )
{
- strcpy(source, shaderSource.c_str());
- *length = shaderSource.length();
+ strncpy( source, shaderSource.c_str(), shaderSourceLength );
+ *length = shaderSourceLength;
}
else
{
#define __TEST_GL_SYNC_ABSTRACTION_H__
/*
- * Copyright (c) 2014 Samsung Electronics Co., Ltd.
+ * Copyright (c) 2016 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.
int GetNumberOfSyncObjects();
private:
+
+ TestGlSyncAbstraction( const TestGlSyncAbstraction& ); ///< Undefined
+ TestGlSyncAbstraction& operator=( const TestGlSyncAbstraction& ); ///< Undefined
+
typedef std::vector<TestSyncObject*> SyncContainer;
typedef SyncContainer::iterator SyncIter;
SyncContainer mSyncObjects; ///< The sync objects
/*
- * Copyright (c) 2015 Samsung Electronics Co., Ltd.
+ * Copyright (c) 2016 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.
END_TEST;
}
+int UtcDaliTextureUpload06(void)
+{
+ TestApplication application;
+
+ //Create the texture
+ unsigned int width(64);
+ unsigned int height(64);
+ tet_infoline( "Creating a Texure with an alpha channel" );
+ Texture texture = Texture::New( TextureType::TEXTURE_2D, Pixel::RGBA8888, width, height );
+
+ application.GetGlAbstraction().EnableTextureCallTrace(true);
+
+ application.SendNotification();
+ application.Render();
+
+ TraceCallStack& callStack = application.GetGlAbstraction().GetTextureTrace();
+
+ tet_infoline( "TexImage2D should be called with a null pointer to reserve storage for the texture in the gpu" );
+ {
+ std::stringstream out;
+ out << GL_TEXTURE_2D <<", "<< 0u << ", " << width <<", "<< height;
+ DALI_TEST_CHECK( callStack.FindMethodAndParams("TexImage2D", out.str().c_str() ) );
+ }
+
+ tet_infoline( "Upload data to the texture" );
+ callStack.Reset();
+
+ tet_infoline( "Creating a RGB pixel buffer and adding that to the texture to ensure it is handled correctly" );
+ unsigned int bufferSize( width * height * 3 );
+ unsigned char* buffer= reinterpret_cast<unsigned char*>( malloc( bufferSize ) );
+ PixelData pixelData = PixelData::New( buffer, bufferSize, width, height, Pixel::RGB888, PixelData::FREE );
+ texture.Upload( pixelData );
+ application.SendNotification();
+ application.Render();
+
+ tet_infoline( "TexImage2D should be called to upload the data" );
+ {
+ std::stringstream out;
+ out << GL_TEXTURE_2D <<", "<< 0u << ", " << width <<", "<< height;
+ DALI_TEST_CHECK( callStack.FindMethodAndParams("TexImage2D", out.str().c_str() ) );
+ }
+
+ END_TEST;
+}
+
int UtcDaliTextureUploadSmallerThanSize(void)
{
TestApplication application;
END_TEST;
}
-int UtcDaliTextureSetGetTextureCount(void)
+int UtcDaliTextureGetTextureCount0(void)
{
TestApplication application;
END_TEST;
}
+
+int UtcDaliTextureGetTextureCount1(void)
+{
+ TestApplication application;
+
+ TextureSet textureSet = CreateTextureSet();
+ DALI_TEST_EQUALS( textureSet.GetTextureCount(), 0u, TEST_LOCATION );
+
+ Texture texture = Texture::New( TextureType::TEXTURE_2D, Pixel::RGBA8888, 64, 64 );
+ textureSet.SetTexture( 0u, texture );
+ DALI_TEST_EQUALS( textureSet.GetTextureCount(), 1u, TEST_LOCATION );
+
+ textureSet.SetTexture( 1u, texture );
+ DALI_TEST_EQUALS( textureSet.GetTextureCount(), 2u, TEST_LOCATION );
+
+ textureSet.SetSampler( 2u, Sampler::New() );
+ DALI_TEST_EQUALS( textureSet.GetTextureCount(), 3u, TEST_LOCATION );
+
+ END_TEST;
+}
#define __DALI_ANIMATION_DATA_H__
/*
- * Copyright (c) 2015 Samsung Electronics Co., Ltd.
+ * Copyright (c) 2016 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.
/**
* @brief Adds one AnimationDataElement to the list to describe one animation.
* @param[in] animationDataElement A pre-populated struct to add
+ * @note This class takes ownership of animationDataElement
*/
void Add( AnimationDataElement* animationDataElement );
/*
- * Copyright (c) 2015 Samsung Electronics Co., Ltd.
+ * Copyright (c) 2016 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.
{
++rightmost;
}
- dest[i] = SQUARE( i - parabolas[rightmost] ) + source[parabolas[rightmost]];
+ dest[i] = SQUARE( static_cast< int >( i ) - parabolas[rightmost] ) + source[parabolas[rightmost]];
}
}
platform_abstraction_src_files = \
$(platform_abstraction_src_dir)/bitmap.cpp \
$(platform_abstraction_src_dir)/core.cpp \
- $(platform_abstraction_src_dir)/image-data.cpp \
$(platform_abstraction_src_dir)/debug.cpp \
$(platform_abstraction_src_dir)/profiling.cpp \
$(platform_abstraction_src_dir)/input-options.cpp \
$(platform_abstraction_src_dir)/input-options.h \
$(platform_abstraction_src_dir)/bitmap.h \
$(platform_abstraction_src_dir)/resource-policies.h \
- $(platform_abstraction_src_dir)/image-data.h \
$(platform_abstraction_src_dir)/resource-types.h \
$(platform_abstraction_src_dir)/resource-request.h \
$(platform_abstraction_src_dir)/resource-cache.h \
+++ /dev/null
-/*
- * Copyright (c) 2014 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.
- * You may obtain a copy of the License at
- *
- * http://www.apache.org/licenses/LICENSE-2.0
- *
- * 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.
- *
- */
-
-// CLASS HEADER
-#include <dali/integration-api/image-data.h>
-
-// INTERNAL INCLUDES
-
-// EXTERNAL INCLUDES
-
-namespace Dali
-{
-
-namespace Integration
-{
-
-ImageData::ImageData( const size_t numBytes, const unsigned imageWidth, const unsigned imageHeight, const Pixel::Format pixelFormat ) :
- mData( new uint8_t[numBytes] ),
- dataSize( numBytes ),
- imageWidth( imageWidth ),
- imageHeight( imageHeight ),
- pixelFormat( pixelFormat ),
- mAlphaChannelUsed( ALPHA_USAGE_UNDETERMINED )
-{
- DALI_ASSERT_DEBUG( numBytes > 0U && imageWidth > 0U && imageHeight > 0U );
-}
-
-ImageData::ImageData( uint8_t * const imageBuffer, const size_t numBytes, const unsigned imageWidth, const unsigned imageHeight, const Pixel::Format pixelFormat ) :
- mData( imageBuffer ),
- dataSize( numBytes ),
- imageWidth( imageWidth ),
- imageHeight( imageHeight ),
- pixelFormat( pixelFormat ),
- mAlphaChannelUsed( ALPHA_USAGE_UNDETERMINED )
-{
- DALI_ASSERT_DEBUG( imageBuffer != 0 && numBytes > 0U && imageWidth > 0U && imageHeight > 0U );
-}
-
-ImageData::~ImageData()
-{
- delete[] mData;
-}
-
-ImageDataPtr ImageData::New( const BufferSize numBytes, unsigned imageWidth, unsigned imageHeight, Pixel::Format pixelFormat )
-{
- DALI_ASSERT_DEBUG( numBytes.bufferSize > 0 && "Zero allocations are pointless if also harmless." );
- DALI_ASSERT_DEBUG( imageWidth > 0 && imageHeight > 0 && "Zero dimensioned images are pointless if also harmless." );
- return ImageDataPtr( new ImageData( numBytes, imageWidth, imageHeight, pixelFormat ) );
-}
-
-ImageDataPtr ImageData::New( uint8_t * const imageBuffer, const BufferSize numBytes, unsigned imageWidth, unsigned imageHeight, Pixel::Format pixelFormat )
-{
- DALI_ASSERT_DEBUG( numBytes.bufferSize > 0 && "Zero-length buffers are pointless if also harmless." );
- DALI_ASSERT_DEBUG( imageWidth > 0 && imageHeight > 0 && "Zero dimensioned images are pointless if also harmless." );
- return ImageDataPtr( new ImageData( imageBuffer, numBytes, imageWidth, imageHeight, pixelFormat ) );
-}
-
-ImageDataPtr NewBitmapImageData( unsigned imageWidth, unsigned imageHeight, Pixel::Format pixelFormat )
-{
- DALI_ASSERT_DEBUG( pixelFormat <= Pixel::BGRA8888 && "Pixel format must be an addressable one." );
- const size_t numBytes = imageWidth * imageHeight * Pixel::GetBytesPerPixel( pixelFormat );
-
- return ImageData::New( BufferSize(numBytes), imageWidth, imageHeight, pixelFormat );
-}
-
-} //namespace Integration
-
-} //namespace Dali
-
+++ /dev/null
-#ifndef __DALI_INTEGRATION_IMAGE_DATA_H__
-#define __DALI_INTEGRATION_IMAGE_DATA_H__
-
-/*
- * Copyright (c) 2014 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.
- * You may obtain a copy of the License at
- *
- * http://www.apache.org/licenses/LICENSE-2.0
- *
- * 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 <dali/integration-api/debug.h> // For DALI_LOG_OBJECT_STRING_DECLARATION
-#include <dali/public-api/object/ref-object.h>
-#include <dali/public-api/common/intrusive-ptr.h>
-#include <dali/public-api/images/pixel.h>
-
-// EXTERNAL INCLUDES
-#include <stdint.h>
-
-namespace Dali
-{
-
-namespace Integration
-{
-
-class ImageData;
-typedef IntrusivePtr<ImageData> ImageDataPtr;
-
-typedef uint8_t PixelBuffer;
-
-/**
- * Used to avoid accidentally mixing the order of parameters where some are uint
- * dimensions and one is a buffer size.
- **/
-class BufferSize
-{
-public:
- explicit BufferSize(size_t size) : bufferSize( size )
- { }
- operator size_t() const { return bufferSize; }
- const size_t bufferSize;
-};
-
-/**
- * @brief A simple container for image data.
- *
- * Just a pointer to a buffer and some minimal metadata. It always owns the
- * buffer of image data that it points to until it is destroyed or the buffer
- * is released with ReleaseImageBuffer().
- *
- * The width and height stored are the logical image values. Compressed formats
- * such as ETC group pixels into blocks (ETC = 4*4) and these logical width and
- * height may indicate, for example for ETC, that 1 to 3 pixels in the rightmost
- * column of blocks or bottom row are ignored for rendering.
- * For simple uncompressed images, the buffer is exactly width * height *
- * bytes-per-pixel in size with no spare bytes at right or bottom edge.
- */
-class DALI_IMPORT_API ImageData : public Dali::RefObject
-{
-public:
- /**
- * @brief Three values for the information about the alpha values in the
- * pixels.
- *
- * Alpha in pixels with the channel can be undetermined, it can be all-ones,
- * or it can have at least one pixel that is translucent with an alpha < 1.0.
- **/
- enum AlphaUsage
- {
- /** Alpha not yet been tested.*/
- ALPHA_USAGE_UNDETERMINED,
- /** Alpha == 1.0 in every pixel.*/
- ALPHA_USAGE_ALL_OPAQUE,
- /** Alpha < 1.0 in at least one pixel.*/
- ALPHA_USAGE_SOME_TRANSLUCENT
- };
-
-private:
-
- /**
- * Construct an instance and allocate a buffer owned by it.
- * @param[in] numBytes The number of bytes to allocate to hold the image data.
- * @param[in] imageWidth The width in pixels of the image.
- * @param[in] imageHeight The height in pixels of the image.
- * @param[in] pixelFormat The format of the image data in the buffer.
- */
- ImageData( const size_t numBytes, const unsigned imageWidth, const unsigned imageHeight, const Pixel::Format pixelFormat );
-
- /**
- * Construct an instance and have it take ownership of the buffer passed in.
- * @param[in] imageBuffer A buffer of pixel data that should have been allocated using <code>new uint8_t[]</code>.
- * @param[in] numBytes The number of bytes in the buffer pointed to by imageBuffer.
- * @param[in] imageWidth The width in pixels of the image.
- * @param[in] imageHeight The height in pixels of the image.
- * @param[in] pixelFormat The format of the image data in the buffer.
- */
- ImageData( uint8_t * const imageBuffer, const size_t numBytes, const unsigned imageWidth, const unsigned imageHeight, const Pixel::Format pixelFormat );
-
- ~ImageData();
-
-public:
-
- /** Allocate and initialize a fresh ImageData object pointing at a new buffer,
- * returning a smart pointer owning it.
- * @note Clients can alternatively use the helper function NewBitmapImageData() to
- * calculate the buffer size from other parameters if the image data represents
- * a bitmap (a 2d grid of addressable pixels).
- * @param[in] numBytes The number of bytes to allocate to hold the image data.
- * @param[in] imageWidth The width in pixels of the image.
- * @param[in] imageHeight The height in pixels of the image.
- * @param[in] pixelFormat The format of the image data in the buffer.
- **/
- static ImageDataPtr New( const BufferSize numBytes, unsigned imageWidth, unsigned imageHeight, Pixel::Format pixelFormat );
-
- /** Allocate and initialise a fresh ImageData object, taking ownership of the
- * buffer passed in.
- * @param[in] imageBuffer A block of memory allocated with
- * <code>new uint8_t[]</code>. <em>This is owned by the new ImageData instance
- * on successful return and should be forgotten by the caller</em>.
- * @param[in] numBytes The number of bytes in the buffer pointed to by imageBuffer.
- * @param[in] imageWidth The width in pixels of the image.
- * @param[in] imageHeight The height in pixels of the image.
- * @param[in] pixelFormat The format of the image data in the buffer.
- **/
- static ImageDataPtr New( uint8_t * const imageBuffer, const BufferSize numBytes, unsigned imageWidth, unsigned imageHeight, Pixel::Format pixelFormat );
-
- /** Access the buffer of image data. */
- const uint8_t * GetBuffer() const { return mData; }
-
- /** Access the buffer of image data. */
- uint8_t * GetBuffer() { return mData; }
-
- /**
- * Pass ownership of the buffer of pixel-level data that this instance
- * currently owns to the caller, and forget about the buffer here as a
- * side effect.
- * @returns A pointer to the underlying buffer of pixel-level image data.
- * The caller takes ownership of the buffer and is responsible for calling
- * delete[] on it eventually.
- **/
- uint8_t * ReleaseImageBuffer() { uint8_t * const data = mData; mData = 0; return data; }
-
- /**
- * @brief Get whether the alpha channel in the pixels is used.
- */
- AlphaUsage GetAlphaUsage() const { return mAlphaChannelUsed; }
-
- /**
- * @brief Set whether the alpha channel in the pixels is used.
- */
- void SetAlphaUsed( const bool alphaUsed ) { mAlphaChannelUsed = alphaUsed ? ALPHA_USAGE_SOME_TRANSLUCENT : ALPHA_USAGE_ALL_OPAQUE; }
-
-private:
-
- ImageData(const ImageData& other); ///< defined private to prevent use
- ImageData& operator = (const ImageData& other); ///< defined private to prevent use
-
- /** Pointer to the buffer of image data. */
- uint8_t* mData;
-
-public:
- const size_t dataSize; ///< Number of bytes in buffer pointed at by mData
- const uint16_t imageWidth; ///< Image logical width in pixels
- const uint16_t imageHeight; ///< Image logical height in pixels
- const Pixel::Format pixelFormat; ///< Pixel format
-
-private:
- AlphaUsage mAlphaChannelUsed;
-
- // Changes scope, should be at end of class
- DALI_LOG_OBJECT_STRING_DECLARATION;
-};
-
-/**
- * A convenience function for creating the common case of an uncompressed image
- * having width * height pixels in the buffer.
- * @param[in] imageWidth The width in pixels of the image.
- * @param[in] imageHeight The height in pixels of the image.
- * @param[in] pixelFormat The format of the image data in the buffer.
- */
-DALI_IMPORT_API ImageDataPtr NewBitmapImageData( unsigned imageWidth, unsigned imageHeight, Pixel::Format pixelFormat );
-
-} // namespace Integration
-
-} // namespace Dali
-
-#endif // __DALI_INTEGRATION_IMAGE_DATA_H__
{
EnsureRelayoutData();
+ DALI_ASSERT_DEBUG( mRelayoutData && "mRelayoutData not created" );
+
mRelayoutData->relayoutEnabled = relayoutEnabled;
}
}
bool Actor::DoConnectSignal( BaseObject* object, ConnectionTrackerInterface* tracker, const std::string& signalName, FunctorDelegate* functor )
{
bool connected( true );
- Actor* actor = dynamic_cast< Actor* >( object );
+ Actor* actor = static_cast< Actor* >( object ); // TypeRegistry guarantees that this is the correct type.
if( 0 == signalName.compare( SIGNAL_TOUCHED ) )
{
/*
- * Copyright (c) 2014 Samsung Electronics Co., Ltd.
+ * Copyright (c) 2016 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.
bool Animation::DoConnectSignal( BaseObject* object, ConnectionTrackerInterface* tracker, const std::string& signalName, FunctorDelegate* functor )
{
bool connected( true );
- Animation* animation = dynamic_cast<Animation*>(object);
+ Animation* animation = static_cast< Animation* >(object); // TypeRegistry guarantees that this is the correct type.
if( 0 == signalName.compare( SIGNAL_FINISHED ) )
{
#define __DALI_INTERNAL_KEY_FRAMES_H__
/*
- * Copyright (c) 2014 Samsung Electronics Co., Ltd.
+ * Copyright (c) 2016 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.
KeyFrameBaseSpec<V>& operator=( const KeyFrameBaseSpec<V>& keyFrames )
{
- if( *this != keyFrames )
+ if( this != &keyFrames )
{
mPVs.clear();
mPVs = keyFrames.mPVs;
#define __DALI_PROPERTY_INPUT_ACCESSOR_H__
/*
- * Copyright (c) 2015 Samsung Electronics Co., Ltd.
+ * Copyright (c) 2016 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.
*/
PropertyInputAccessor& operator=(const PropertyInputAccessor& accessor)
{
- mInput = accessor.mInput;
- mComponentIndex = accessor.mComponentIndex;
+ if( this != &accessor )
+ {
+ mInput = accessor.mInput;
+ mComponentIndex = accessor.mComponentIndex;
+ }
return *this;
}
#define __DALI_PROPERTY_INPUT_INDEXER_H__
/*
- * Copyright (c) 2014 Samsung Electronics Co., Ltd.
+ * Copyright (c) 2016 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.
*/
PropertyInputIndexer& operator=( const PropertyInputIndexer& other )
{
- mBufferIndex = other.mBufferIndex;
- mInput = other.mInput;
+ if( this != &other )
+ {
+ mBufferIndex = other.mBufferIndex;
+ mInput = other.mInput;
+ }
return *this;
}
/*
- * Copyright (c) 2014 Samsung Electronics Co., Ltd.
+ * Copyright (c) 2016 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.
bool ObjectRegistry::DoConnectSignal( BaseObject* object, ConnectionTrackerInterface* tracker, const std::string& signalName, FunctorDelegate* functor )
{
bool connected( true );
- ObjectRegistry* objectRegistry = dynamic_cast<ObjectRegistry*>( object );
+ ObjectRegistry* objectRegistry = static_cast< ObjectRegistry* >( object ); // TypeRegistry guarantees that this is the correct type.
if( 0 == strcmp( signalName.c_str(), SIGNAL_OBJECT_CREATED ) )
{
bool Stage::DoConnectSignal( BaseObject* object, ConnectionTrackerInterface* tracker, const std::string& signalName, FunctorDelegate* functor )
{
bool connected( true );
- Stage* stage = dynamic_cast<Stage*>(object);
+ Stage* stage = static_cast< Stage* >(object); // TypeRegistry guarantees that this is the correct type.
if( 0 == strcmp( signalName.c_str(), SIGNAL_KEY_EVENT ) )
{
/*
- * Copyright (c) 2014 Samsung Electronics Co., Ltd.
+ * Copyright (c) 2016 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.
bool LongPressGestureDetector::DoConnectSignal( BaseObject* object, ConnectionTrackerInterface* tracker, const std::string& signalName, FunctorDelegate* functor )
{
bool connected( true );
- LongPressGestureDetector* gesture = dynamic_cast<LongPressGestureDetector*>(object);
+ LongPressGestureDetector* gesture = static_cast< LongPressGestureDetector* >(object); // TypeRegistry guarantees that this is the correct type.
if ( 0 == strcmp( signalName.c_str(), SIGNAL_LONG_PRESS_DETECTED ) )
{
/*
- * Copyright (c) 2014 Samsung Electronics Co., Ltd.
+ * Copyright (c) 2016 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.
bool PanGestureDetector::DoConnectSignal( BaseObject* object, ConnectionTrackerInterface* tracker, const std::string& signalName, FunctorDelegate* functor )
{
bool connected( true );
- PanGestureDetector* gesture = dynamic_cast<PanGestureDetector*>(object);
+ PanGestureDetector* gesture = static_cast< PanGestureDetector* >(object); // TypeRegistry guarantees that this is the correct type.
if ( 0 == strcmp( signalName.c_str(), SIGNAL_PAN_DETECTED ) )
{
/*
- * Copyright (c) 2014 Samsung Electronics Co., Ltd.
+ * Copyright (c) 2016 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.
bool PinchGestureDetector::DoConnectSignal( BaseObject* object, ConnectionTrackerInterface* tracker, const std::string& signalName, FunctorDelegate* functor )
{
bool connected( true );
- PinchGestureDetector* gesture = dynamic_cast<PinchGestureDetector*>(object);
+ PinchGestureDetector* gesture = static_cast< PinchGestureDetector* >(object); // TypeRegistry guarantees that this is the correct type.
if ( 0 == strcmp( signalName.c_str(), SIGNAL_PINCH_DETECTED ) )
{
/*
- * Copyright (c) 2014 Samsung Electronics Co., Ltd.
+ * Copyright (c) 2016 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.
bool TapGestureDetector::DoConnectSignal( BaseObject* object, ConnectionTrackerInterface* tracker, const std::string& signalName, FunctorDelegate* functor )
{
bool connected( true );
- TapGestureDetector* gesture = dynamic_cast<TapGestureDetector*>(object);
+ TapGestureDetector* gesture = static_cast< TapGestureDetector* >(object); // TypeRegistry guarantees that this is the correct type.
if ( 0 == strcmp( signalName.c_str(), SIGNAL_TAP_DETECTED ) )
{
// unsigned int GetBufferSize() const
virtual size_t GetBufferSize() const
{
- return mBufferWidth*mBytesPerPixel*mBufferHeight;
+ return static_cast< size_t >( mBufferWidth ) * mBytesPerPixel * mBufferHeight; // need to cast to size_t to avoid possibility of overflow
}
/**
* @return The buffer stride (in bytes).
*/
virtual unsigned int GetBufferStride() const;
- //{
- // return mBufferWidth*mBytesPerPixel;
- //}
/**
* Get the pixel format
bool RenderTask::DoConnectSignal( BaseObject* object, ConnectionTrackerInterface* tracker, const std::string& signalName, FunctorDelegate* functor )
{
bool connected( true );
- RenderTask* renderTask = dynamic_cast<RenderTask*>(object);
+ RenderTask* renderTask = static_cast< RenderTask* >(object); // TypeRegistry guarantees that this is the correct type.
if ( 0 == strcmp( signalName.c_str(), SIGNAL_FINISHED ) )
{
size_t TextureSet::GetTextureCount() const
{
- return mImages.size();
+ return mSamplers.size();
}
const SceneGraph::TextureSet* TextureSet::GetTextureSetSceneObject() const
#define __DALI_INTERNAL_RESOURCE_CLIENT_H__
/*
- * Copyright (c) 2014 Samsung Electronics Co., Ltd.
+ * Copyright (c) 2016 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 UpdateImageTicket( ResourceId id, const ImageAttributes& imageAttributes ); ///!< Issue #AHC01
private:
+
+ ResourceClient( const ResourceClient& ); ///< Undefined
+ ResourceClient& operator=( const ResourceClient& ); ///< Undefined
+
ResourceManager& mResourceManager; ///< The resource manager
EventThreadServices& mEventThreadServices; ///< Interface to send messages through
{
mRenderDataProvider = dataProvider;
mUpdateAttributesLocation = true;
+
+ //Check that the number of textures match the number of samplers in the shader
+ size_t textureCount = dataProvider->GetTextures().size() + dataProvider->GetNewTextures().size();
+ Program* program = dataProvider->GetShader().GetProgram();
+ if( program && program->GetActiveSamplerCount() != textureCount )
+ {
+ DALI_LOG_ERROR("The number of active samplers in the shader(%lu) does not match the number of textures in the TextureSet(%lu)\n",
+ program->GetActiveSamplerCount(),
+ textureCount );
+ }
}
void Renderer::SetGeometry( Render::Geometry* geometry )
if( pixelDataFormat == GL_RGB && mInternalFormat == GL_RGBA )
{
//Convert manually from RGB to RGBA if GLES < 3 ( GLES 3 can do the conversion automatically when uploading )
- size_t dataSize = params.width * params.height;
+ size_t dataSize = static_cast< size_t >( params.width ) * params.height;
tempBuffer = new unsigned char[dataSize*4u];
for( size_t i(0u); i<dataSize; i++ )
{
{
// program not found so create it
program = new Program( cache, shaderData, modifiesGeometry );
-
- // we want to lazy load programs so dont do a Load yet, it gets done in Use()
+ program->Load();
cache.AddProgram( shaderHash, program );
}
void Program::Use()
{
- if ( !mLinked )
- {
- Load();
- }
-
if ( mLinked )
{
if ( this != mCache.GetCurrentProgram() )
#define __DALI_INTERNAL_PROGRAM_H__
/*
- * Copyright (c) 2014 Samsung Electronics Co., Ltd.
+ * Copyright (c) 2016 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.
private:
- // default constructor, not defined
- Program();
- // assignment operator, not defined
- Program& operator=( const Program& );
+ Program(); ///< default constructor, not defined
+ Program( const Program& ); ///< copy constructor, not defined
+ Program& operator=( const Program& ); ///< assignment operator, not defined
/**
* Load the shader, from a precompiled binary if available, else from source code
{
DiscardQueue::DiscardQueue( RenderQueue& renderQueue )
-: mRenderQueue( renderQueue )
+: mRenderQueue( renderQueue ),
+ mNodeQueue(),
+ mShaderQueue(),
+ mRendererQueue(),
+ mCameraQueue(),
+ mGeometryBatcher( NULL )
{
}
/*
- * Copyright (c) 2014 Samsung Electronics Co., Ltd.
+ * Copyright (c) 2016 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.
mConditionType(condition),
mArguments(arguments),
mValid(false),
- mNotifyMode( Dali::PropertyNotification::Disabled )
+ mNotifyMode( Dali::PropertyNotification::Disabled ),
+ mConditionFunction(NULL)
{
SetNotifyMode(notifyMode);
#define __DALI_INTERNAL_SCENE_GRAPH_PAN_GESTURE_H__
/*
- * Copyright (c) 2014 Samsung Electronics Co., Ltd.
+ * Copyright (c) 2016 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.
*/
Info& operator=( const Info& rhs )
{
- velocity = rhs.velocity;
- displacement = rhs.displacement;
- position = rhs.position;
+ if( this != &rhs )
+ {
+ velocity = rhs.velocity;
+ displacement = rhs.displacement;
+ position = rhs.position;
+ }
return *this;
}
*/
PanInfo& operator=( const PanInfo& rhs )
{
- time = rhs.time;
- state = rhs.state;
- local = rhs.local;
- screen = rhs.screen;
+ if( this != &rhs )
+ {
+ time = rhs.time;
+ state = rhs.state;
+ local = rhs.local;
+ screen = rhs.screen;
+ }
return *this;
}
struct Impl
{
- Impl() :
+ Impl()
+ : batchParents(),
+ updateManager( NULL ),
currentFrame( 0 )
- {}
+ {
+ }
int GetBatchKeyIndex( size_t batchParentIndex, const BatchKey& key )
{
private:
+ GeometryBatcher( const GeometryBatcher& ); ///< Undefined
+ GeometryBatcher& operator=( const GeometryBatcher& ); ///< Undefined
+
/**
* @brief Clones vertex format of source geometry and stores generated data in the batchInfo object
* @param[in] sourceGeometry Geometry of the very first batched item
GestureContainer gestures; ///< A container of owned gesture detectors
bool renderTaskWaiting; ///< A REFRESH_ONCE render task is waiting to be rendered
+
+private:
+
+ Impl( const Impl& ); ///< Undefined
+ Impl& operator=( const Impl& ); ///< Undefined
};
UpdateManager::UpdateManager( NotificationManager& notificationManager,
if( mTextureSet )
{
size_t textureCount = mTextureSet->GetTextureCount();
- size_t newTextureCount = mTextureSet->GetNewTextureCount();
-
- Program* program = mShader->GetProgram();
- if( program && program->GetActiveSamplerCount() != textureCount + newTextureCount )
- {
- DALI_LOG_ERROR("The number of active samplers in the shader(%lu) does not match the number of textures in the TextureSet(%lu)\n",
- program->GetActiveSamplerCount(),
- textureCount + newTextureCount );
- }
-
dataProvider->mTextures.resize( textureCount );
dataProvider->mSamplers.resize( textureCount );
for( unsigned int i(0); i<textureCount; ++i )
dataProvider->mSamplers[i] = mTextureSet->GetTextureSampler(i);
}
- dataProvider->mNewTextures.resize( newTextureCount );
- dataProvider->mSamplers.resize( newTextureCount );
- for( unsigned int i(0); i<newTextureCount; ++i )
+ textureCount = mTextureSet->GetNewTextureCount();
+ dataProvider->mNewTextures.resize( textureCount );
+ dataProvider->mSamplers.resize( textureCount );
+ for( unsigned int i(0); i<textureCount; ++i )
{
dataProvider->mNewTextures[i] = mTextureSet->GetNewTexture(i);
dataProvider->mSamplers[i] = mTextureSet->GetTextureSampler(i);
const unsigned int CORE_MAJOR_VERSION = 1;
const unsigned int CORE_MINOR_VERSION = 2;
-const unsigned int CORE_MICRO_VERSION = 14;
+const unsigned int CORE_MICRO_VERSION = 15;
const char * const CORE_BUILD_DATE = __DATE__ " " __TIME__;
#ifndef EMSCRIPTEN
/*
- * Copyright (c) 2015 Samsung Electronics Co., Ltd.
+ * Copyright (c) 2016 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.
Gesture& Gesture::operator=( const Gesture& rhs )
{
- type = rhs.type;
- state = rhs.state;
- time = rhs.time;
+ if( this != &rhs )
+ {
+ type = rhs.type;
+ state = rhs.state;
+ time = rhs.time;
+ }
return *this;
}
/*
- * Copyright (c) 2015 Samsung Electronics Co., Ltd.
+ * Copyright (c) 2016 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.
LongPressGesture& LongPressGesture::operator=( const LongPressGesture& rhs )
{
- Gesture::operator=(rhs);
- numberOfTouches = rhs.numberOfTouches;
- screenPoint = rhs.screenPoint;
- localPoint = rhs.localPoint;
+ if( this != &rhs )
+ {
+ Gesture::operator=(rhs);
+ numberOfTouches = rhs.numberOfTouches;
+ screenPoint = rhs.screenPoint;
+ localPoint = rhs.localPoint;
+ }
return *this;
}
/*
- * Copyright (c) 2015 Samsung Electronics Co., Ltd.
+ * Copyright (c) 2016 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.
PanGesture& PanGesture::operator=( const PanGesture& rhs )
{
- Gesture::operator=(rhs);
- velocity = rhs.velocity;
- displacement = rhs.displacement;
- position = rhs.position;
- screenVelocity = rhs.screenVelocity;
- screenDisplacement = rhs.screenDisplacement;
- screenPosition = rhs.screenPosition;
- numberOfTouches = rhs.numberOfTouches;
+ if( this != &rhs )
+ {
+ Gesture::operator=(rhs);
+ velocity = rhs.velocity;
+ displacement = rhs.displacement;
+ position = rhs.position;
+ screenVelocity = rhs.screenVelocity;
+ screenDisplacement = rhs.screenDisplacement;
+ screenPosition = rhs.screenPosition;
+ numberOfTouches = rhs.numberOfTouches;
+ }
return *this;
}
/*
- * Copyright (c) 2015 Samsung Electronics Co., Ltd.
+ * Copyright (c) 2016 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.
PinchGesture& PinchGesture::operator=( const PinchGesture& rhs )
{
- Gesture::operator=(rhs);
- scale = rhs.scale;
- speed = rhs.speed;
- screenCenterPoint = rhs.screenCenterPoint;
- localCenterPoint = rhs.localCenterPoint;
+ if( this != &rhs )
+ {
+ Gesture::operator=(rhs);
+ scale = rhs.scale;
+ speed = rhs.speed;
+ screenCenterPoint = rhs.screenCenterPoint;
+ localCenterPoint = rhs.localCenterPoint;
+ }
return *this;
}
/*
- * Copyright (c) 2015 Samsung Electronics Co., Ltd.
+ * Copyright (c) 2016 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.
TapGesture& TapGesture::operator=( const TapGesture& rhs )
{
- Gesture::operator=(rhs);
- numberOfTaps = rhs.numberOfTaps;
- numberOfTouches = rhs.numberOfTouches;
- screenPoint = rhs.screenPoint;
- localPoint = rhs.localPoint;
+ if( this != &rhs )
+ {
+ Gesture::operator=(rhs);
+ numberOfTaps = rhs.numberOfTaps;
+ numberOfTouches = rhs.numberOfTouches;
+ screenPoint = rhs.screenPoint;
+ localPoint = rhs.localPoint;
+ }
return *this;
}
Property::Array* arrayValue;
Property::Map* mapValue;
};
+
+private:
+
+ Impl( const Impl& ); ///< Undefined
+ Impl& operator=( const Impl& ); ///< Undefined
};
Property::Value::Value()
}
Property::Value::Value( Type type )
+: mImpl( NULL )
{
switch (type)
{
Name: dali
Summary: The OpenGLES Canvas Core Library
-Version: 1.2.14
+Version: 1.2.15
Release: 1
Group: System/Libraries
License: Apache-2.0 and BSD-2-Clause and MIT