-//
-// 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>
{
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()
{
}
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;
}
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.
Initialize(pixelFormat, width, height, bufferSize);
- mData = new Dali::Integration::PixelBuffer[bufferSize];
+ mData = reinterpret_cast< Dali::Integration::PixelBuffer* >( malloc( bufferSize ) );
return mData;
}