unsigned int width(64);
unsigned int height(64);
- FrameBuffer frameBuffer = FrameBuffer::New( width, height, FrameBuffer::COLOR );
+ FrameBuffer frameBuffer = FrameBuffer::New( width, height, FrameBuffer::Attachment::NONE );
DALI_TEST_CHECK( frameBuffer );
unsigned int width(64);
unsigned int height(64);
- FrameBuffer frameBuffer = FrameBuffer::New( width, height, FrameBuffer::COLOR_DEPTH );
+ FrameBuffer frameBuffer = FrameBuffer::New( width, height, FrameBuffer::Attachment::DEPTH );
DALI_TEST_CHECK( frameBuffer );
unsigned int width(64);
unsigned int height(64);
- FrameBuffer frameBuffer = FrameBuffer::New( width, height, FrameBuffer::COLOR_STENCIL );
+ FrameBuffer frameBuffer = FrameBuffer::New( width, height, FrameBuffer::Attachment::STENCIL );
DALI_TEST_CHECK( frameBuffer );
unsigned int width(64);
unsigned int height(64);
- FrameBuffer frameBuffer = FrameBuffer::New( width, height, FrameBuffer::COLOR_DEPTH_STENCIL );
+ FrameBuffer frameBuffer = FrameBuffer::New( width, height, FrameBuffer::Attachment::DEPTH_STENCIL );
DALI_TEST_CHECK( frameBuffer );
END_TEST;
}
+int UtcDaliFrameBufferNew06(void)
+{
+ TestApplication application;
+
+ unsigned int width(64);
+ unsigned int height(64);
+ FrameBuffer frameBuffer = FrameBuffer::New( width, height, FrameBuffer::Attachment::DEPTH | FrameBuffer::Attachment::STENCIL );
+
+ DALI_TEST_CHECK( frameBuffer );
+
+ application.SendNotification();
+ application.Render();
+
+ DALI_TEST_EQUALS(application.GetGlAbstraction().CheckFramebufferColorAttachment(), (GLenum)GL_FALSE, 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 UtcDaliFrameBufferNewWithColor01(void)
+{
+ TestApplication application;
+ uint32_t width = 64;
+ uint32_t height = 64;
+ FrameBuffer frameBuffer = FrameBuffer::New( width, height );
+ application.SendNotification();
+ application.Render();
+ 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);
+ // check that texture is not empty handle
+ DALI_TEST_CHECK( frameBuffer.GetColorTexture() );
+ END_TEST;
+}
+
+int UtcDaliFrameBufferNewWithColor02(void)
+{
+ TestApplication application;
+ uint32_t width = 64;
+ uint32_t height = 64;
+ FrameBuffer frameBuffer = FrameBuffer::New( width, height, FrameBuffer::Attachment::COLOR );
+ application.SendNotification();
+ application.Render();
+ 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);
+ // check that texture is not empty handle
+ DALI_TEST_CHECK( frameBuffer.GetColorTexture() );
+ END_TEST;
+}
+
+int UtcDaliFrameBufferNewWithColor03(void)
+{
+ TestApplication application;
+ uint32_t width = 64;
+ uint32_t height = 64;
+ FrameBuffer frameBuffer = FrameBuffer::New( width, height, FrameBuffer::Attachment::COLOR_DEPTH );
+ application.SendNotification();
+ application.Render();
+ 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);
+ // check that texture is not empty handle
+ DALI_TEST_CHECK( frameBuffer.GetColorTexture() );
+ END_TEST;
+}
+
+int UtcDaliFrameBufferNewWithColor04(void)
+{
+ TestApplication application;
+ uint32_t width = 64;
+ uint32_t height = 64;
+ FrameBuffer frameBuffer = FrameBuffer::New( width, height, FrameBuffer::Attachment::COLOR_STENCIL );
+ application.SendNotification();
+ application.Render();
+ 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);
+ // check that texture is not empty handle
+ DALI_TEST_CHECK( frameBuffer.GetColorTexture() );
+ END_TEST;
+}
+
+int UtcDaliFrameBufferNewWithColor05(void)
+{
+ TestApplication application;
+ uint32_t width = 64;
+ uint32_t height = 64;
+ FrameBuffer frameBuffer = FrameBuffer::New( width, height, FrameBuffer::Attachment::COLOR_DEPTH_STENCIL );
+ application.SendNotification();
+ application.Render();
+ 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);
+ // check that texture is not empty handle
+ DALI_TEST_CHECK( frameBuffer.GetColorTexture() );
+ END_TEST;
+}
+
int UtcDaliFrameBufferCopyConstructor(void)
{
TestApplication application;
unsigned int width(64);
unsigned int height(64);
- FrameBuffer frameBuffer = FrameBuffer::New( width, height, FrameBuffer::COLOR );
+ FrameBuffer frameBuffer = FrameBuffer::New( width, height, FrameBuffer::Attachment::NONE );
FrameBuffer frameBufferCopy( frameBuffer );
unsigned int width(64);
unsigned int height(64);
- FrameBuffer frameBuffer = FrameBuffer::New( width, height, FrameBuffer::COLOR );
+ FrameBuffer frameBuffer = FrameBuffer::New( width, height, FrameBuffer::Attachment::NONE );
FrameBuffer frameBuffer2;
DALI_TEST_CHECK( !frameBuffer2 );
TestApplication application;
unsigned int width(64);
unsigned int height(64);
- FrameBuffer frameBuffer = FrameBuffer::New( width, height, FrameBuffer::COLOR );
+ FrameBuffer frameBuffer = FrameBuffer::New( width, height, FrameBuffer::Attachment::NONE );
BaseHandle handle(frameBuffer);
FrameBuffer frameBuffer2 = FrameBuffer::DownCast(handle);
unsigned int width(64);
unsigned int height(64);
- FrameBuffer frameBuffer = FrameBuffer::New( width, height, FrameBuffer::COLOR_DEPTH_STENCIL );
+ FrameBuffer frameBuffer = FrameBuffer::New( width, height, FrameBuffer::Attachment::DEPTH_STENCIL );
Texture texture = Texture::New( TextureType::TEXTURE_2D, Pixel::RGBA8888, width, height );
frameBuffer.AttachColorTexture( texture );
unsigned int width(64);
unsigned int height(64);
- FrameBuffer frameBuffer = FrameBuffer::New( width, height, FrameBuffer::COLOR );
+ FrameBuffer frameBuffer = FrameBuffer::New( width, height, FrameBuffer::Attachment::NONE );
Texture texture = Texture::New( TextureType::TEXTURE_2D, Pixel::RGBA8888, width, height );
texture.GenerateMipmaps();
unsigned int width(64);
unsigned int height(64);
- FrameBuffer frameBuffer = FrameBuffer::New( width, height, FrameBuffer::COLOR );
+ FrameBuffer frameBuffer = FrameBuffer::New( width, height, FrameBuffer::Attachment::NONE );
Texture texture = Texture::New( TextureType::TEXTURE_CUBE, Pixel::RGBA8888, width, height );
texture.GenerateMipmaps();
END_TEST;
}
+int UtcDaliFrameBufferAttachColorTexture04(void)
+{
+ TestApplication application;
+
+ unsigned int width(64);
+ unsigned int height(64);
+ FrameBuffer frameBuffer = FrameBuffer::New( width, height, FrameBuffer::Attachment::DEPTH | FrameBuffer::Attachment::STENCIL );
+ Texture texture = Texture::New( TextureType::TEXTURE_2D, Pixel::RGBA8888, width, height );
+ frameBuffer.AttachColorTexture( texture );
+
+ application.SendNotification();
+ application.Render();
+
+ 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 UtcDaliFrameBufferGetColorTexture01(void)
{
TestApplication application;
unsigned int width(64);
unsigned int height(64);
- FrameBuffer frameBuffer = FrameBuffer::New( width, height, FrameBuffer::COLOR );
+ FrameBuffer frameBuffer = FrameBuffer::New( width, height, FrameBuffer::Attachment::NONE );
Texture texture = Texture::New( TextureType::TEXTURE_2D, Pixel::RGBA8888, width, height );
frameBuffer.AttachColorTexture( texture );
unsigned int width(64);
unsigned int height(64);
- FrameBuffer frameBuffer = FrameBuffer::New( width, height, FrameBuffer::COLOR );
+ FrameBuffer frameBuffer = FrameBuffer::New( width, height, FrameBuffer::Attachment::NONE );
Texture texture = Texture::New( TextureType::TEXTURE_2D, Pixel::RGBA8888, width, height );
frameBuffer.AttachColorTexture( texture, 0u, 1u );
END_TEST;
}
+int UtcDaliFramebufferContextLoss(void)
+{
+ tet_infoline("UtcDaliFramebufferContextLoss\n");
+ TestApplication application; // Default config: DALI_DISCARDS_ALL_DATA
+
+ //Create the texture
+ unsigned int width(64);
+ unsigned int height(64);
+ Texture texture = Texture::New( TextureType::TEXTURE_2D, Pixel::RGBA8888, width, height );
+ DALI_TEST_CHECK( texture );
+ FrameBuffer frameBuffer = FrameBuffer::New( width, height, FrameBuffer::Attachment::NONE );
+ DALI_TEST_CHECK( frameBuffer );
+ frameBuffer.AttachColorTexture( texture, 0u, 1u );
+
+ Geometry geometry = CreateQuadGeometry();
+ Shader shader = CreateShader();
+ Renderer renderer = Renderer::New(geometry, shader);
+
+ application.SendNotification();
+ application.Render(16);
+
+ // Lose & regain context (in render 'thread')
+ application.ResetContext();
+ DALI_TEST_CHECK( frameBuffer );
+
+ END_TEST;
+}