/*
- * Copyright (c) 2014 Samsung Electronics Co., Ltd.
+ * Copyright (c) 2016 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.
static const unsigned int sEncodedBufferImageDataPNGLength = sizeof( sEncodedBufferImageDataPNG );
+void PrepareDecodeBuffer( TestApplication& application, unsigned int width, unsigned int height, Pixel::Format pixelFormat )
+{
+ TestPlatformAbstraction& platform = application.GetPlatform();
+ Integration::Bitmap* bitmap = Integration::Bitmap::New( Integration::Bitmap::BITMAP_2D_PACKED_PIXELS, ResourcePolicy::OWNED_RETAIN );
+ bitmap->GetPackedPixelsProfile()->ReserveBuffer( pixelFormat, width, height, width, height );
+ Integration::BitmapPtr bitmapPtr(bitmap);
+ platform.SetDecodedBitmap( bitmapPtr );
+}
+
} // anonymous namespace
EncodedBufferImage image1;
DALI_TEST_CHECK( !image1 );
- image1 = EncodedBufferImage::New( sEncodedBufferImageDataPNG, sEncodedBufferImageDataPNGLength, ImageDimensions(), FittingMode::DEFAULT, SamplingMode::DEFAULT, Image::NEVER );
+ image1 = EncodedBufferImage::New( sEncodedBufferImageDataPNG, sEncodedBufferImageDataPNGLength, ImageDimensions(), FittingMode::DEFAULT, SamplingMode::DEFAULT );
EncodedBufferImage image2( image1 );
DALI_TEST_EQUALS( image1, image2, TEST_LOCATION );
EncodedBufferImage image1;
DALI_TEST_CHECK( !image1 );
- image1 = EncodedBufferImage::New( sEncodedBufferImageDataPNG, sEncodedBufferImageDataPNGLength, ImageDimensions(), FittingMode::DEFAULT, SamplingMode::DEFAULT, Image::NEVER );
+ image1 = EncodedBufferImage::New( sEncodedBufferImageDataPNG, sEncodedBufferImageDataPNGLength, ImageDimensions(), FittingMode::DEFAULT, SamplingMode::DEFAULT );
EncodedBufferImage image2;
image2 = image1;
{
TestApplication application;
- Image image1 = EncodedBufferImage::New( sEncodedBufferImageDataPNG, sEncodedBufferImageDataPNGLength, ImageDimensions(), FittingMode::DEFAULT, SamplingMode::DEFAULT, Image::NEVER );
+ Image image1 = EncodedBufferImage::New( sEncodedBufferImageDataPNG, sEncodedBufferImageDataPNGLength, ImageDimensions(), FittingMode::DEFAULT, SamplingMode::DEFAULT );
EncodedBufferImage image2 = DownCast< EncodedBufferImage >(image1);
DALI_TEST_EQUALS( image1, image2, TEST_LOCATION );
DALI_TEST_CHECK( !image );
// Trigger image decode to initialise the handle
- image = EncodedBufferImage::New( sEncodedBufferImageDataPNG, sEncodedBufferImageDataPNGLength, ImageDimensions(), FittingMode::DEFAULT, SamplingMode::DEFAULT, Image::NEVER );
+ image = EncodedBufferImage::New( sEncodedBufferImageDataPNG, sEncodedBufferImageDataPNGLength, ImageDimensions(), FittingMode::DEFAULT, SamplingMode::DEFAULT );
DALI_TEST_CHECK( image );
- // Change the release policy to Unused:
- Image image2;
-
- DALI_TEST_CHECK( !image2 );
-
- // Trigger image decode to initialise the handle
- image2 = EncodedBufferImage::New( sEncodedBufferImageDataPNG, sEncodedBufferImageDataPNGLength, ImageDimensions(), FittingMode::DEFAULT, SamplingMode::DEFAULT, Image::UNUSED );
-
- DALI_TEST_CHECK( image2 );
END_TEST;
}
DALI_TEST_CHECK( !image );
// Trigger image decode to initialise the handle
+ PrepareDecodeBuffer( application, 720u, 1280u, Pixel::RGBA8888 );
image = EncodedBufferImage::New( sEncodedBufferImageDataPNG, sEncodedBufferImageDataPNGLength, ImageDimensions(), FittingMode::DEFAULT, SamplingMode::DEFAULT );
DALI_TEST_CHECK( image );