From: Adeel Kazmi Date: Tue, 15 Nov 2016 11:44:21 +0000 (+0000) Subject: Fix various SVACE errors X-Git-Tag: dali_1.2.15~1 X-Git-Url: http://review.tizen.org/git/?a=commitdiff_plain;h=de75852545a1ee1c42b867f70837bc0ade8c912e;p=platform%2Fcore%2Fuifw%2Fdali-core.git Fix various SVACE errors Change-Id: If88b8fe34844e35e43ac94a9650a8e5817f14729 --- diff --git a/automated-tests/src/dali/dali-test-suite-utils/test-gl-sync-abstraction.h b/automated-tests/src/dali/dali-test-suite-utils/test-gl-sync-abstraction.h index 278bcd7..8ce96a4 100644 --- a/automated-tests/src/dali/dali-test-suite-utils/test-gl-sync-abstraction.h +++ b/automated-tests/src/dali/dali-test-suite-utils/test-gl-sync-abstraction.h @@ -2,7 +2,7 @@ #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. @@ -108,6 +108,10 @@ public: // TEST FUNCTIONS int GetNumberOfSyncObjects(); private: + + TestGlSyncAbstraction( const TestGlSyncAbstraction& ); ///< Undefined + TestGlSyncAbstraction& operator=( const TestGlSyncAbstraction& ); ///< Undefined + typedef std::vector SyncContainer; typedef SyncContainer::iterator SyncIter; SyncContainer mSyncObjects; ///< The sync objects diff --git a/automated-tests/src/dali/utc-Dali-Texture.cpp b/automated-tests/src/dali/utc-Dali-Texture.cpp index 93965de..8620381 100644 --- a/automated-tests/src/dali/utc-Dali-Texture.cpp +++ b/automated-tests/src/dali/utc-Dali-Texture.cpp @@ -1,5 +1,5 @@ /* - * 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. @@ -466,6 +466,51 @@ int UtcDaliTextureUpload05(void) 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( 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; diff --git a/dali/internal/event/animation/key-frames-impl.h b/dali/internal/event/animation/key-frames-impl.h index c593b0b..433d2bc 100644 --- a/dali/internal/event/animation/key-frames-impl.h +++ b/dali/internal/event/animation/key-frames-impl.h @@ -2,7 +2,7 @@ #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. @@ -172,7 +172,7 @@ protected: KeyFrameBaseSpec& operator=( const KeyFrameBaseSpec& keyFrames ) { - if( *this != keyFrames ) + if( this != &keyFrames ) { mPVs.clear(); mPVs = keyFrames.mPVs; diff --git a/dali/internal/event/animation/property-input-accessor.h b/dali/internal/event/animation/property-input-accessor.h index 9c203a1..aca460b 100644 --- a/dali/internal/event/animation/property-input-accessor.h +++ b/dali/internal/event/animation/property-input-accessor.h @@ -2,7 +2,7 @@ #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. @@ -64,8 +64,11 @@ public: */ PropertyInputAccessor& operator=(const PropertyInputAccessor& accessor) { - mInput = accessor.mInput; - mComponentIndex = accessor.mComponentIndex; + if( this != &accessor ) + { + mInput = accessor.mInput; + mComponentIndex = accessor.mComponentIndex; + } return *this; } diff --git a/dali/internal/event/animation/property-input-indexer.h b/dali/internal/event/animation/property-input-indexer.h index c19bf14..94a03e6 100644 --- a/dali/internal/event/animation/property-input-indexer.h +++ b/dali/internal/event/animation/property-input-indexer.h @@ -2,7 +2,7 @@ #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. @@ -61,8 +61,11 @@ public: */ PropertyInputIndexer& operator=( const PropertyInputIndexer& other ) { - mBufferIndex = other.mBufferIndex; - mInput = other.mInput; + if( this != &other ) + { + mBufferIndex = other.mBufferIndex; + mInput = other.mInput; + } return *this; } diff --git a/dali/internal/render/renderers/render-texture.cpp b/dali/internal/render/renderers/render-texture.cpp index 8ca2647..36df6f5 100644 --- a/dali/internal/render/renderers/render-texture.cpp +++ b/dali/internal/render/renderers/render-texture.cpp @@ -730,7 +730,7 @@ void NewTexture::Upload( Context& context, PixelDataPtr pixelData, const Interna 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