Revert "[4.0] Change raw pointer to unique_ptr" 15/154815/1
authortaeyoon0.lee <taeyoon0.lee@samsung.com>
Wed, 11 Oct 2017 09:05:09 +0000 (18:05 +0900)
committertaeyoon0.lee <taeyoon0.lee@samsung.com>
Wed, 11 Oct 2017 09:05:23 +0000 (18:05 +0900)
This reverts commit 0b5699811bac5ff1b3c92a2245d4ec594cade5e6.

Change-Id: Iede97efc88a7935f0fd182137cecb070b71966e9

dali-toolkit/internal/visuals/image/image-visual.cpp
dali-toolkit/internal/visuals/image/image-visual.h
dali-toolkit/internal/visuals/texture-manager-impl.h

index 5dbd3cd0c244a3d081640f0cf1ec7b96c5f32c67..8961b4b7f152c3aa1e18463379b5272633f9ac81 100644 (file)
@@ -261,7 +261,7 @@ ImageVisual::ImageVisual( VisualFactoryCache& factoryCache,
   mPixelArea( FULL_TEXTURE_RECT ),
   mPlacementActor(),
   mImageUrl( imageUrl ),
-  mMaskingData( ),
+  mMaskingData( NULL ),
   mDesiredSize( size ),
   mTextureId( TextureManager::INVALID_TEXTURE_ID ),
   mFittingMode( fittingMode ),
@@ -279,7 +279,7 @@ ImageVisual::ImageVisual( VisualFactoryCache& factoryCache, const Image& image )
   mPixelArea( FULL_TEXTURE_RECT ),
   mPlacementActor(),
   mImageUrl(),
-  mMaskingData( ),
+  mMaskingData( NULL ),
   mDesiredSize(),
   mTextureId( TextureManager::INVALID_TEXTURE_ID ),
   mFittingMode( FittingMode::DEFAULT ),
@@ -304,6 +304,7 @@ ImageVisual::~ImageVisual()
       textureManager.Remove( mMaskingData->mAlphaMaskId );
     }
   }
+  delete mMaskingData;
 }
 
 void ImageVisual::DoSetProperties( const Property::Map& propertyMap )
@@ -508,9 +509,9 @@ void ImageVisual::DoSetProperty( Property::Index index, const Property::Value& v
 
 void ImageVisual::AllocateMaskData()
 {
-  if( !mMaskingData )
+  if( mMaskingData == NULL )
   {
-    mMaskingData.reset(new TextureManager::MaskingData());
+    mMaskingData = new TextureManager::MaskingData();
   }
 }
 
index a95753c8c7f3f39566545548201cafffe4f64cc4..bee6067d68f739e99051b66706ec23e50e378c2a 100644 (file)
@@ -19,8 +19,6 @@
  */
 
 // EXTERNAL INCLUDES
-#include <memory>
-
 #include <dali/public-api/common/intrusive-ptr.h>
 #include <dali/public-api/images/image.h>
 #include <dali/public-api/images/image-operations.h>
@@ -321,7 +319,7 @@ private:
   Vector4 mPixelArea;
   WeakHandle<Actor> mPlacementActor;
   VisualUrl mImageUrl;
-  TextureManager::MaskingDataPointer mMaskingData;
+  TextureManager::MaskingData* mMaskingData;
 
   Dali::ImageDimensions mDesiredSize;
   TextureManager::TextureId mTextureId;
index 7a243fd528e27caad1b6931a4458f4b4d93e48b0..868afdc199e4b23af192912fdfde08c307434d07 100644 (file)
@@ -21,7 +21,6 @@
 #include <deque>
 #include <functional>
 #include <string>
-#include <memory>
 #include <dali/public-api/common/dali-vector.h>
 #include <dali/public-api/object/ref-object.h>
 #include <dali/public-api/rendering/texture-set.h>
@@ -116,7 +115,6 @@ public:
     float mContentScaleFactor;
     bool mCropToMask;
   };
-  using MaskingDataPointer = std::unique_ptr<MaskingData>;
 
   /**
    * Constructor.
@@ -133,7 +131,7 @@ public:
 
   TextureSet LoadTexture(VisualUrl& url, Dali::ImageDimensions desiredSize,
                          Dali::FittingMode::Type fittingMode, Dali::SamplingMode::Type samplingMode,
-                         const MaskingDataPointer& maskInfo, bool synchronousLoading,
+                         MaskingData* maskInfo, bool synchronousLoading,
                          TextureManager::TextureId& textureId, Vector4& textureRect,
                          bool& atlasingStatus, bool& loadingStatus, Dali::WrapMode::Type wrapModeU,
                          Dali::WrapMode::Type wrapModeV, TextureUploadObserver* textureObserver,