#include <dali/public-api/dali-core.h>
#include <dali-test-suite-utils.h>
#include <test-native-image.h>
+#include <dali/integration-api/gl-abstraction.h>
using std::max;
using namespace Dali;
test_return_value = TET_PASS;
}
-static const float ROTATION_EPSILON = 0.0001f;
-
-
int UtcDaliFrameBufferImageNew01(void)
{
TestApplication application;
image = FrameBufferImage::New(*(nativeImage.Get()), Image::UNUSED);
DALI_TEST_CHECK( image );
- DALI_TEST_EQUALS( image.GetReleasePolicy(), Image::UNUSED, TEST_LOCATION );
+
+ //ReleasePolicy is always never for framebuffer images
+ DALI_TEST_EQUALS( image.GetReleasePolicy(), Image::NEVER, TEST_LOCATION );
// initialise handle with NEVER release policy
image.Reset();
image = FrameBufferImage::New(*(nativeImage.Get()), Image::NEVER);
DALI_TEST_CHECK( image );
+
+ //ReleasePolicy is always never for framebuffer images
DALI_TEST_EQUALS( image.GetReleasePolicy(), Image::NEVER, TEST_LOCATION );
END_TEST;
}
+int UtcDaliFrameBufferImageAttachments01(void)
+{
+ TestApplication application;
+
+ tet_infoline("UtcDaliFrameBufferImageAttachments01 - FrameBufferImage::New(unsigned int, unsigned int, Pixel::Format, RenderBuffer::Format)");
+
+ // invoke default handle constructor
+ FrameBufferImage image;
+
+ // initialise handle
+ image = FrameBufferImage::New(64, 64, Pixel::RGBA8888, RenderBuffer::COLOR); // create framebuffer with Color buffer
+ ImageActor actor=ImageActor::New(image);
+ Stage::GetCurrent().Add(actor);
+
+ application.SendNotification();
+ application.Render();
+ application.Render();
+ application.SendNotification();
+
+ DALI_TEST_EQUALS(application.GetGlAbstraction().CheckFramebufferColorAttachment(), (GLenum)GL_TRUE, TEST_LOCATION);
+ DALI_TEST_EQUALS(application.GetGlAbstraction().CheckFramebufferDepthAttachment(), (GLenum)GL_FALSE, TEST_LOCATION);
+ DALI_TEST_EQUALS(application.GetGlAbstraction().CheckFramebufferStencilAttachment(), (GLenum)GL_FALSE, TEST_LOCATION);
+
+ END_TEST;
+}
+
+int UtcDaliFrameBufferImageAttachments02(void)
+{
+ TestApplication application;
+
+ tet_infoline("UtcDaliFrameBufferImageAttachments02 - FrameBufferImage::New(unsigned int, unsigned int, Pixel::Format, RenderBuffer::Format)");
+
+ // invoke default handle constructor
+ FrameBufferImage image;
+
+ // initialise handle
+ image = FrameBufferImage::New(64, 64, Pixel::RGBA8888, RenderBuffer::COLOR_DEPTH); // create framebuffer with Color and Depth buffer
+ ImageActor actor=ImageActor::New(image);
+ Stage::GetCurrent().Add(actor);
+
+ application.SendNotification();
+ application.Render();
+ application.Render();
+ application.SendNotification();
+
+ DALI_TEST_EQUALS(application.GetGlAbstraction().CheckFramebufferColorAttachment(), (GLenum)GL_TRUE, TEST_LOCATION);
+ DALI_TEST_EQUALS(application.GetGlAbstraction().CheckFramebufferDepthAttachment(), (GLenum)GL_TRUE, TEST_LOCATION);
+ DALI_TEST_EQUALS(application.GetGlAbstraction().CheckFramebufferStencilAttachment(), (GLenum)GL_FALSE, TEST_LOCATION);
+
+ END_TEST;
+}
+
+int UtcDaliFrameBufferImageAttachments03(void)
+{
+ TestApplication application;
+
+ tet_infoline("UtcDaliFrameBufferImageAttachments03 - FrameBufferImage::New(unsigned int, unsigned int, Pixel::Format, RenderBuffer::Format)");
+
+ // invoke default handle constructor
+ FrameBufferImage image;
+
+ // initialise handle
+ image = FrameBufferImage::New(64, 64, Pixel::RGBA8888, RenderBuffer::COLOR_STENCIL); // create framebuffer with Color and Stencil
+ ImageActor actor=ImageActor::New(image);
+ Stage::GetCurrent().Add(actor);
+
+ application.SendNotification();
+ application.Render();
+ application.Render();
+ application.SendNotification();
+
+ DALI_TEST_EQUALS(application.GetGlAbstraction().CheckFramebufferColorAttachment(), (GLenum)GL_TRUE, TEST_LOCATION);
+ DALI_TEST_EQUALS(application.GetGlAbstraction().CheckFramebufferDepthAttachment(), (GLenum)GL_FALSE, TEST_LOCATION);
+ DALI_TEST_EQUALS(application.GetGlAbstraction().CheckFramebufferStencilAttachment(), (GLenum)GL_TRUE, TEST_LOCATION);
+
+ END_TEST;
+}
+
+int UtcDaliFrameBufferImageAttachments04(void)
+{
+ TestApplication application;
+
+ tet_infoline("UtcDaliFrameBufferImageAttachments04 - FrameBufferImage::New(unsigned int, unsigned int, Pixel::Format, RenderBuffer::Format)");
+
+ // invoke default handle constructor
+ FrameBufferImage image;
+
+ // initialise handle
+ image = FrameBufferImage::New(64, 64, Pixel::RGBA8888, RenderBuffer::COLOR_DEPTH_STENCIL); // create framebuffer with Color, Depth and Stencil buffers
+ ImageActor actor=ImageActor::New(image);
+ Stage::GetCurrent().Add(actor);
+
+ application.SendNotification();
+ application.Render();
+ application.Render();
+ application.SendNotification();
+
+ DALI_TEST_EQUALS(application.GetGlAbstraction().CheckFramebufferColorAttachment(), (GLenum)GL_TRUE, TEST_LOCATION);
+ DALI_TEST_EQUALS(application.GetGlAbstraction().CheckFramebufferDepthAttachment(), (GLenum)GL_TRUE, TEST_LOCATION);
+ DALI_TEST_EQUALS(application.GetGlAbstraction().CheckFramebufferStencilAttachment(), (GLenum)GL_TRUE, TEST_LOCATION);
+
+ END_TEST;
+}
+
int UtcDaliFrameBufferImageDownCast(void)
{
TestApplication application;