2 * Copyright (c) 2014 Samsung Electronics Co., Ltd.
4 * Licensed under the Apache License, Version 2.0 (the "License");
5 * you may not use this file except in compliance with the License.
6 * You may obtain a copy of the License at
8 * http://www.apache.org/licenses/LICENSE-2.0
10 * Unless required by applicable law or agreed to in writing, software
11 * distributed under the License is distributed on an "AS IS" BASIS,
12 * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
13 * See the License for the specific language governing permissions and
14 * limitations under the License.
22 #include <dali/public-api/dali-core.h>
23 #include <dali-test-suite-utils.h>
28 void utc_dali_framebuffer_startup(void)
30 test_return_value = TET_UNDEF;
33 void utc_dali_framebuffer_cleanup(void)
35 test_return_value = TET_PASS;
38 static const float ROTATION_EPSILON = 0.0001f;
41 int UtcDaliFrameBufferImageNew01(void)
43 TestApplication application;
45 tet_infoline("UtcDaliFrameBufferImageNew01 - FrameBufferImage::New(unsigned int, unsigned int, Pixel::Format)");
47 // invoke default handle constructor
48 FrameBufferImage image;
49 Vector2 stageSize = Stage::GetCurrent().GetSize();
52 image = FrameBufferImage::New(); // create framebuffer with the same dimensions as the stage
53 ImageActor actor=ImageActor::New(image);
54 Stage::GetCurrent().Add(actor);
56 application.SendNotification();
59 application.SendNotification();
61 DALI_TEST_CHECK( image );
62 DALI_TEST_EQUALS((float)image.GetWidth(), stageSize.width, TEST_LOCATION);
63 DALI_TEST_EQUALS((float)image.GetHeight(), stageSize.height, TEST_LOCATION);
65 image = FrameBufferImage::New(16, 16); // create framebuffer with dimensions of 16x16
66 actor.SetImage(image);
68 application.SendNotification();
71 application.SendNotification();
73 DALI_TEST_CHECK( image );
74 DALI_TEST_EQUALS(image.GetWidth(), 16u, TEST_LOCATION);
75 DALI_TEST_EQUALS(image.GetHeight(), 16u, TEST_LOCATION);
79 int UtcDaliFrameBufferImageDownCast(void)
81 TestApplication application;
82 tet_infoline("Testing Dali::FrameBufferImage::DownCast()");
84 FrameBufferImage image = FrameBufferImage::New();
86 BaseHandle object(image);
88 FrameBufferImage image2 = FrameBufferImage::DownCast(object);
89 DALI_TEST_CHECK(image2);
91 FrameBufferImage image3 = DownCast< FrameBufferImage >(object);
92 DALI_TEST_CHECK(image3);
94 BaseHandle unInitializedObject;
95 FrameBufferImage image4 = FrameBufferImage::DownCast(unInitializedObject);
96 DALI_TEST_CHECK(!image4);
98 FrameBufferImage image5 = DownCast< FrameBufferImage >(unInitializedObject);
99 DALI_TEST_CHECK(!image5);
101 Image image6 = FrameBufferImage::New();
102 FrameBufferImage image7 = FrameBufferImage::DownCast(image6);
103 DALI_TEST_CHECK(image7);