[3.0] Remove/move experimental features
[platform/core/uifw/dali-core.git] / automated-tests / src / dali / utc-Dali-FrameBufferImage.cpp
index 31c4939..af150dc 100644 (file)
@@ -1,5 +1,5 @@
 /*
- * 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.
@@ -37,9 +37,6 @@ void utc_dali_framebuffer_cleanup(void)
   test_return_value = TET_PASS;
 }
 
-static const float ROTATION_EPSILON = 0.0001f;
-
-
 int UtcDaliFrameBufferImageNew01(void)
 {
   TestApplication application;
@@ -52,7 +49,7 @@ int UtcDaliFrameBufferImageNew01(void)
 
   // 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();
@@ -65,12 +62,6 @@ int UtcDaliFrameBufferImageNew01(void)
   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);
@@ -109,20 +100,10 @@ int UtcDaliFrameBufferImageNew03(void)
 
   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;
 }
@@ -138,7 +119,7 @@ int UtcDaliFrameBufferImageAttachments01(void)
 
   // 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();
@@ -146,9 +127,9 @@ int UtcDaliFrameBufferImageAttachments01(void)
   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;
 }
@@ -164,7 +145,7 @@ int UtcDaliFrameBufferImageAttachments02(void)
 
   // 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();
@@ -172,9 +153,9 @@ int UtcDaliFrameBufferImageAttachments02(void)
   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;
 }
@@ -190,7 +171,7 @@ int UtcDaliFrameBufferImageAttachments03(void)
 
   // 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();
@@ -198,9 +179,9 @@ int UtcDaliFrameBufferImageAttachments03(void)
   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;
 }
@@ -216,7 +197,7 @@ int UtcDaliFrameBufferImageAttachments04(void)
 
   // 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();
@@ -224,9 +205,9 @@ int UtcDaliFrameBufferImageAttachments04(void)
   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;
 }