- // Respect the desired release policy
- mResourcePolicy = releasePol == Dali::Image::UNUSED ? ResourcePolicy::OWNED_DISCARD : ResourcePolicy::OWNED_RETAIN;
+BufferImage::BufferImage(PixelBuffer* pixBuf,
+ unsigned int width,
+ unsigned int height,
+ Pixel::Format pixelformat,
+ unsigned int stride)
+: Image(),
+ mInternalBuffer( NULL ),
+ mExternalBuffer( pixBuf ),
+ mBufferSize( 0 ),
+ mByteStride( 0 ),
+ mBytesPerPixel( 0 ),
+ mBufferWidth( 0 ),
+ mPixelFormat( pixelformat ),
+ mResourcePolicy( ResourcePolicy::OWNED_DISCARD )
+{
+ SetupBuffer( width, height, pixelformat, stride ? stride: width );
+}
+
+BufferImage::~BufferImage()
+{
+ delete[] mInternalBuffer;