Fix various SVACE errors 07/98007/3
authorAdeel Kazmi <adeel.kazmi@samsung.com>
Tue, 15 Nov 2016 11:44:21 +0000 (11:44 +0000)
committerAdeel Kazmi <adeel.kazmi@samsung.com>
Wed, 16 Nov 2016 15:10:38 +0000 (15:10 +0000)
Change-Id: If88b8fe34844e35e43ac94a9650a8e5817f14729

automated-tests/src/dali/dali-test-suite-utils/test-gl-sync-abstraction.h
automated-tests/src/dali/utc-Dali-Texture.cpp
dali/internal/event/animation/key-frames-impl.h
dali/internal/event/animation/property-input-accessor.h
dali/internal/event/animation/property-input-indexer.h
dali/internal/render/renderers/render-texture.cpp
dali/internal/update/common/discard-queue.cpp
dali/internal/update/manager/geometry-batcher.cpp
dali/internal/update/manager/geometry-batcher.h
dali/internal/update/manager/update-manager.cpp
dali/public-api/object/property-value.cpp

index 278bcd7..8ce96a4 100644 (file)
@@ -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<TestSyncObject*>   SyncContainer;
   typedef SyncContainer::iterator SyncIter;
   SyncContainer mSyncObjects;  ///< The sync objects
index 93965de..8620381 100644 (file)
@@ -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<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;
index c593b0b..433d2bc 100644 (file)
@@ -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<V>& operator=( const KeyFrameBaseSpec<V>& keyFrames )
   {
-    if( *this != keyFrames )
+    if( this != &keyFrames )
     {
       mPVs.clear();
       mPVs = keyFrames.mPVs;
index 9c203a1..aca460b 100644 (file)
@@ -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;
   }
 
index c19bf14..94a03e6 100644 (file)
@@ -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;
   }
index 8ca2647..36df6f5 100644 (file)
@@ -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<dataSize; i++ )
     {
index e89c964..d1e4eed 100644 (file)
@@ -38,7 +38,12 @@ namespace SceneGraph
 {
 
 DiscardQueue::DiscardQueue( RenderQueue& renderQueue )
-: mRenderQueue( renderQueue )
+: mRenderQueue( renderQueue ),
+  mNodeQueue(),
+  mShaderQueue(),
+  mRendererQueue(),
+  mCameraQueue(),
+  mGeometryBatcher( NULL )
 {
 }
 
index 58a9dbb..2409c95 100644 (file)
@@ -189,9 +189,12 @@ struct BatchParent
 
 struct Impl
 {
-  Impl() :
+  Impl()
+  : batchParents(),
+    updateManager( NULL ),
     currentFrame( 0 )
-  {}
+  {
+  }
 
   int GetBatchKeyIndex( size_t batchParentIndex, const BatchKey& key )
   {
index c19e034..069ac85 100644 (file)
@@ -121,6 +121,9 @@ public:
 
 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
index 28a309f..dbe3c0e 100644 (file)
@@ -273,6 +273,11 @@ struct UpdateManager::Impl
 
   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,
index fd4058e..d2d3e66 100644 (file)
@@ -222,6 +222,11 @@ public: // Data
     Property::Array* arrayValue;
     Property::Map* mapValue;
   };
+
+private:
+
+  Impl( const Impl& ); ///< Undefined
+  Impl& operator=( const Impl& ); ///< Undefined
 };
 
 Property::Value::Value()