Revert "[Tizen] Restore Uploaded signal for BufferImage and ResourceImage"
[platform/core/uifw/dali-core.git] / dali / internal / event / images / bitmap-compressed.cpp
index ef05919..3e057b1 100644 (file)
@@ -1,25 +1,25 @@
-//
-// 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.
-//
+/*
+ * Copyright (c) 2018 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/internal/event/images/bitmap-compressed.h>
 
-// INTERNAL INCLUDES
-#include <dali/internal/common/core-impl.h>
-#include <dali/integration-api/debug.h>
+// EXTERNAL INCLUDES
+#include <cstdlib>
 
 // INTERNAL INCLUDES
 #include <dali/internal/common/core-impl.h>
@@ -32,8 +32,11 @@ namespace Internal
 {
 using namespace Dali::Pixel;
 
-BitmapCompressed::BitmapCompressed( const bool bitmapOwnsBuffer ) : Bitmap(bitmapOwnsBuffer), mBufferSize(0)
-{}
+BitmapCompressed::BitmapCompressed( const ResourcePolicy::Discardable discardable )
+: Bitmap( discardable ),
+  mBufferSize(0)
+{
+}
 
 BitmapCompressed::~BitmapCompressed()
 {
@@ -41,9 +44,9 @@ BitmapCompressed::~BitmapCompressed()
 }
 
 void BitmapCompressed::Initialize( Pixel::Format pixelFormat,
-                          const unsigned int width,
-                          const unsigned int height,
-                          const size_t bufferSize )
+                                   const uint32_t width,
+                                   const uint32_t height,
+                                   const uint32_t bufferSize )
 {
   Dali::Integration::Bitmap::Initialize( pixelFormat, width, height );
   mBufferSize  = bufferSize;
@@ -51,9 +54,9 @@ void BitmapCompressed::Initialize( Pixel::Format pixelFormat,
 }
 
 Dali::Integration::PixelBuffer* BitmapCompressed::ReserveBufferOfSize( Pixel::Format pixelFormat,
-                                    const unsigned int  width,
-                                    const unsigned int  height,
-                                    const size_t        bufferSize )
+                                                                       const uint32_t  width,
+                                                                       const uint32_t  height,
+                                                                       const uint32_t  bufferSize )
 {
   // Sanity check that a not-outrageous amount of data is being passed in (indicating a client error):
   DALI_ASSERT_DEBUG(bufferSize < (1U << 27U) && "That is far too much compressed data."); // 128MB of compressed data == unreasonable.
@@ -62,7 +65,7 @@ Dali::Integration::PixelBuffer* BitmapCompressed::ReserveBufferOfSize( Pixel::Fo
 
   Initialize(pixelFormat, width, height, bufferSize);
 
-  mData = new Dali::Integration::PixelBuffer[bufferSize];
+  mData = reinterpret_cast< Dali::Integration::PixelBuffer* >( malloc( bufferSize ) );
 
   return mData;
 }