/*
- * 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.
test_return_value = TET_PASS;
}
-static const float ROTATION_EPSILON = 0.0001f;
-
-
int UtcDaliFrameBufferImageNew01(void)
{
TestApplication application;
// initialise handle
image = FrameBufferImage::New(); // create framebuffer with the same dimensions as the stage
- ImageActor actor=ImageActor::New(image);
+ Actor actor = CreateRenderableActor( image );
Stage::GetCurrent().Add(actor);
application.SendNotification();
DALI_TEST_EQUALS((float)image.GetHeight(), stageSize.height, TEST_LOCATION);
image = FrameBufferImage::New(16, 16); // create framebuffer with dimensions of 16x16
- actor.SetImage(image);
-
- application.SendNotification();
- application.Render();
- application.Render();
- application.SendNotification();
DALI_TEST_CHECK( image );
DALI_TEST_EQUALS(image.GetWidth(), 16u, TEST_LOCATION);
DALI_TEST_CHECK( !image );
- // initialise handle with UNUSED release policy
- image = FrameBufferImage::New(*(nativeImage.Get()), Image::UNUSED);
-
- DALI_TEST_CHECK( image );
- DALI_TEST_EQUALS( image.GetReleasePolicy(), Image::UNUSED, TEST_LOCATION );
-
- // initialise handle with NEVER release policy
- image.Reset();
- DALI_TEST_CHECK( !image );
-
- image = FrameBufferImage::New(*(nativeImage.Get()), Image::NEVER);
+ // initialise handle
+ image = FrameBufferImage::New(*(nativeImage.Get()));
DALI_TEST_CHECK( image );
- DALI_TEST_EQUALS( image.GetReleasePolicy(), Image::NEVER, TEST_LOCATION );
END_TEST;
}
// initialise handle
image = FrameBufferImage::New(64, 64, Pixel::RGBA8888, RenderBuffer::COLOR); // create framebuffer with Color buffer
- ImageActor actor=ImageActor::New(image);
+ Actor actor = CreateRenderableActor(image);
Stage::GetCurrent().Add(actor);
application.SendNotification();
application.Render();
application.SendNotification();
- DALI_TEST_EQUALS(application.GetGlAbstraction().CheckFramebufferColorAttachment(), true, TEST_LOCATION);
- DALI_TEST_EQUALS(application.GetGlAbstraction().CheckFramebufferDepthAttachment(), false, TEST_LOCATION);
- DALI_TEST_EQUALS(application.GetGlAbstraction().CheckFramebufferStencilAttachment(), false, TEST_LOCATION);
+ 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;
}
// initialise handle
image = FrameBufferImage::New(64, 64, Pixel::RGBA8888, RenderBuffer::COLOR_DEPTH); // create framebuffer with Color and Depth buffer
- ImageActor actor=ImageActor::New(image);
+ Actor actor = CreateRenderableActor(image);
Stage::GetCurrent().Add(actor);
application.SendNotification();
application.Render();
application.SendNotification();
- DALI_TEST_EQUALS(application.GetGlAbstraction().CheckFramebufferColorAttachment(), true, TEST_LOCATION);
- DALI_TEST_EQUALS(application.GetGlAbstraction().CheckFramebufferDepthAttachment(), true, TEST_LOCATION);
- DALI_TEST_EQUALS(application.GetGlAbstraction().CheckFramebufferStencilAttachment(), false, TEST_LOCATION);
+ 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;
}
// initialise handle
image = FrameBufferImage::New(64, 64, Pixel::RGBA8888, RenderBuffer::COLOR_STENCIL); // create framebuffer with Color and Stencil
- ImageActor actor=ImageActor::New(image);
+ Actor actor = CreateRenderableActor(image);
Stage::GetCurrent().Add(actor);
application.SendNotification();
application.Render();
application.SendNotification();
- DALI_TEST_EQUALS(application.GetGlAbstraction().CheckFramebufferColorAttachment(), true, TEST_LOCATION);
- DALI_TEST_EQUALS(application.GetGlAbstraction().CheckFramebufferDepthAttachment(), false, TEST_LOCATION);
- DALI_TEST_EQUALS(application.GetGlAbstraction().CheckFramebufferStencilAttachment(), true, TEST_LOCATION);
+ 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;
}
// 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);
+ Actor actor = CreateRenderableActor(image);
Stage::GetCurrent().Add(actor);
application.SendNotification();
application.Render();
application.SendNotification();
- DALI_TEST_EQUALS(application.GetGlAbstraction().CheckFramebufferColorAttachment(), true, TEST_LOCATION);
- DALI_TEST_EQUALS(application.GetGlAbstraction().CheckFramebufferDepthAttachment(), true, TEST_LOCATION);
- DALI_TEST_EQUALS(application.GetGlAbstraction().CheckFramebufferStencilAttachment(), true, TEST_LOCATION);
+ 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;
}