// INTERNAL INCLUDES
#include <dali/integration-api/debug.h>
+#include <dali/integration-api/platform-abstraction.h>
+#include <dali/internal/event/common/thread-local-storage.h>
#include <dali/internal/event/images/bitmap-packed-pixel.h>
#include <dali/internal/event/images/bitmap-compressed.h>
#include <dali/internal/event/images/bitmap-external.h>
}
}
-Bitmap* Bitmap::New(const Profile profile = BITMAP_2D_PACKED_PIXELS, const bool managePixelBuffer = true)
+Bitmap* Bitmap::New( const Profile profile = BITMAP_2D_PACKED_PIXELS,
+ ResourcePolicy::Discardable discardable = ResourcePolicy::DISCARD )
{
DALI_ASSERT_DEBUG(profile == BITMAP_2D_PACKED_PIXELS || profile == BITMAP_COMPRESSED);
* scanlines past the bottom of the image in the buffer if requested.*/
case BITMAP_2D_PACKED_PIXELS:
{
- Bitmap * const bitmap = new Dali::Internal::BitmapPackedPixel(managePixelBuffer);
+ Bitmap * const bitmap = new Dali::Internal::BitmapPackedPixel( discardable );
return bitmap;
}
/** The data for the bitmap is buffered in an opaque form.*/
case BITMAP_COMPRESSED:
{
- return new Dali::Internal::BitmapCompressed(managePixelBuffer);
+ return new Dali::Internal::BitmapCompressed( discardable );
}
}
return 0;
}
-Bitmap::Bitmap( bool discardable, Dali::Integration::PixelBuffer* pixBuf)
+
+Bitmap::Bitmap( ResourcePolicy::Discardable discardable, Dali::Integration::PixelBuffer* pixBuf)
: mImageWidth(0),
mImageHeight(0),
mPixelFormat(Pixel::RGBA8888),
void Bitmap::DiscardBuffer()
{
- if ( mDiscardable )
+ if( mDiscardable == ResourcePolicy::DISCARD )
{
DeletePixelBuffer();
}
Bitmap::~Bitmap()
{
DALI_LOG_TRACE_METHOD(Debug::Filter::gImage);
- DeletePixelBuffer();
+ if( mDiscardable == ResourcePolicy::DISCARD )
+ {
+ DeletePixelBuffer();
+ }
}
/**
} //namespace Integration
} //namespace Dali
-