2 * Copyright (c) 2024 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.
18 #include <dali-toolkit-test-suite-utils.h>
19 #include <dali-toolkit/dali-toolkit.h>
23 #include <dali-scene3d/public-api/controls/model/model.h>
24 #include <dali-scene3d/public-api/controls/scene-view/scene-view.h>
25 #include <toolkit-event-thread-callback.h>
28 using namespace Dali::Toolkit;
30 void scene_view_startup(void)
32 test_return_value = TET_UNDEF;
35 void scene_view_cleanup(void)
37 test_return_value = TET_PASS;
43 * For the AnimatedCube.gltf and its Assets
44 * Donated by Norbert Nopper for glTF testing.
45 * Take from https://github.com/KhronosGroup/glTF-Sample-Models/tree/master/2.0/AnimatedCube
47 const char* TEST_GLTF_FILE_NAME = TEST_RESOURCE_DIR "/AnimatedCube.gltf";
50 * For the diffuse and specular cube map texture.
51 * These textures are based off version of Wave engine sample
52 * Take from https://github.com/WaveEngine/Samples
54 * Copyright (c) 2024 Wave Coorporation
56 * Permission is hereby granted, free of charge, to any person obtaining a copy
57 * of this software and associated documentation files (the "Software"), to
58 * deal in the Software without restriction, including without limitation the
59 * rights to use, copy, modify, merge, publish, distribute, sublicense, and/or
60 * sell copies of the Software, and to permit persons to whom the Software is
61 * furnished to do so, subject to the following conditions:
63 * The above copyright notice and this permission notice shall be included in
64 * all copies or substantial portions of the Software.
66 * THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
67 * IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
68 * FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
69 * AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
70 * LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,
71 * OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN
74 const char* TEST_EQUIRECTANGULAR_TEXTURE = TEST_RESOURCE_DIR "/application-icon-20.png";
75 const char* TEST_DIFFUSE_TEXTURE = TEST_RESOURCE_DIR "/forest_irradiance.ktx";
76 const char* TEST_SPECULAR_TEXTURE = TEST_RESOURCE_DIR "/forest_radiance.ktx";
77 const char* TEST_DIFFUSE_TEXTURE2 = TEST_RESOURCE_DIR "//forest_irradiance.ktx";
78 const char* TEST_SPECULAR_TEXTURE2 = TEST_RESOURCE_DIR "//forest_radiance.ktx";
80 Dali::Texture GetDiffuseTexture(Dali::Scene3D::Model model)
82 Dali::Texture texture;
84 Actor meshActor = model.FindChildByName("AnimatedCube");
87 Renderer renderer = meshActor.GetRendererAt(0u);
90 TextureSet textureSet = renderer.GetTextures();
91 if(textureSet.GetTextureCount() == 10u)
93 texture = textureSet.GetTexture(8u);
101 Dali::Texture GetSpecularTexture(Dali::Scene3D::Model model)
103 Dali::Texture texture;
105 Actor meshActor = model.FindChildByName("AnimatedCube");
108 Renderer renderer = meshActor.GetRendererAt(0u);
111 TextureSet textureSet = renderer.GetTextures();
112 if(textureSet.GetTextureCount() == 10u)
114 texture = textureSet.GetTexture(9u);
123 static bool gOnRelayoutCallBackCalled = false;
124 void OnRelayoutCallback(Actor actor)
126 gOnRelayoutCallBackCalled = true;
129 static bool gResourceReadyCalled = false;
130 void OnResourceReady(Control control)
132 gResourceReadyCalled = true;
136 // Negative test case for a method
137 int UtcDaliSceneViewUninitialized(void)
139 ToolkitTestApplication application;
140 tet_infoline("UtcDaliSceneViewUninitialized");
142 Scene3D::SceneView view;
146 // New() must be called to create a Model or it wont be valid.
147 Actor a = Actor::New();
149 DALI_TEST_CHECK(false);
151 catch(Dali::DaliException& e)
153 // Tests that a negative test of an assertion succeeds
154 DALI_TEST_PRINT_ASSERT(e);
155 DALI_TEST_CHECK(!view);
160 // Positive test case for a method
161 int UtcDaliSceneViewNew(void)
163 ToolkitTestApplication application;
164 tet_infoline("UtcDaliSceneViewNew");
166 Scene3D::SceneView view = Scene3D::SceneView::New();
167 DALI_TEST_CHECK(view);
171 // Positive test case for a method
172 int UtcDaliSceneViewDownCast(void)
174 ToolkitTestApplication application;
175 tet_infoline("UtcDaliSceneViewDownCast");
177 Scene3D::SceneView view = Scene3D::SceneView::New();
178 BaseHandle handle(view);
180 Scene3D::SceneView sceneView = Scene3D::SceneView::DownCast(handle);
181 DALI_TEST_CHECK(view);
182 DALI_TEST_CHECK(sceneView);
183 DALI_TEST_CHECK(sceneView == view);
187 int UtcDaliSceneViewTypeRegistry(void)
189 ToolkitTestApplication application;
190 tet_infoline("UtcDaliSceneViewTypeRegistry");
192 TypeRegistry typeRegistry = TypeRegistry::Get();
193 DALI_TEST_CHECK(typeRegistry);
195 TypeInfo typeInfo = typeRegistry.GetTypeInfo("SceneView");
196 DALI_TEST_CHECK(typeInfo);
198 BaseHandle handle = typeInfo.CreateInstance();
199 DALI_TEST_CHECK(handle);
201 Scene3D::SceneView model = Scene3D::SceneView::DownCast(handle);
202 DALI_TEST_CHECK(model);
207 // Positive test case for a method
208 int UtcDaliSceneViewAddRemove(void)
210 ToolkitTestApplication application;
211 tet_infoline("UtcDaliSceneViewAddRemove");
213 Scene3D::SceneView view = Scene3D::SceneView::New();
214 DALI_TEST_CHECK(view);
215 DALI_TEST_EQUALS(1u, view.GetChildCount(), TEST_LOCATION);
217 Actor actor = Actor::New();
219 view.SetProperty(Actor::Property::PARENT_ORIGIN, ParentOrigin::CENTER);
220 view.SetProperty(Actor::Property::SIZE, application.GetScene().GetSize());
223 DALI_TEST_EQUALS(1u, view.GetChildCount(), TEST_LOCATION);
224 Actor layer = view.GetChildAt(0u);
226 DALI_TEST_EQUALS(2u, layer.GetChildCount(), TEST_LOCATION);
227 DALI_TEST_EQUALS(actor, layer.GetChildAt(1u), TEST_LOCATION); // index 0u is default camera
230 DALI_TEST_EQUALS(1u, layer.GetChildCount(), TEST_LOCATION);
234 int UtcDaliSceneViewCopyAndAssignment(void)
236 ToolkitTestApplication application;
238 Scene3D::SceneView view = Scene3D::SceneView::New();
239 DALI_TEST_CHECK(view);
241 Scene3D::SceneView copy(view);
242 DALI_TEST_CHECK(view == copy);
244 Scene3D::SceneView assign;
245 DALI_TEST_CHECK(!assign);
248 DALI_TEST_CHECK(assign == view);
253 int UtcDaliSceneViewMoveConstructor(void)
255 ToolkitTestApplication application;
257 Scene3D::SceneView view = Scene3D::SceneView::New();
258 DALI_TEST_EQUALS(1, view.GetBaseObject().ReferenceCount(), TEST_LOCATION);
259 view.SetProperty(Actor::Property::SENSITIVE, false);
260 DALI_TEST_CHECK(false == view.GetProperty<bool>(Actor::Property::SENSITIVE));
262 Scene3D::SceneView moved = std::move(view);
263 DALI_TEST_CHECK(moved);
264 DALI_TEST_EQUALS(1, moved.GetBaseObject().ReferenceCount(), TEST_LOCATION);
265 DALI_TEST_CHECK(false == moved.GetProperty<bool>(Actor::Property::SENSITIVE));
266 DALI_TEST_CHECK(!view);
271 int UtcDaliSceneViewMoveAssignment(void)
273 ToolkitTestApplication application;
275 Scene3D::SceneView view = Scene3D::SceneView::New();
276 DALI_TEST_EQUALS(1, view.GetBaseObject().ReferenceCount(), TEST_LOCATION);
277 view.SetProperty(Actor::Property::SENSITIVE, false);
278 DALI_TEST_CHECK(false == view.GetProperty<bool>(Actor::Property::SENSITIVE));
280 Scene3D::SceneView moved;
281 moved = std::move(view);
282 DALI_TEST_CHECK(moved);
283 DALI_TEST_EQUALS(1, moved.GetBaseObject().ReferenceCount(), TEST_LOCATION);
284 DALI_TEST_CHECK(false == moved.GetProperty<bool>(Actor::Property::SENSITIVE));
285 DALI_TEST_CHECK(!view);
290 int UtcDaliSceneViewOnScene01(void)
292 ToolkitTestApplication application;
294 Scene3D::SceneView view = Scene3D::SceneView::New();
296 DALI_TEST_EQUALS(1u, view.GetChildCount(), TEST_LOCATION);
297 Actor layer = view.GetChildAt(0u);
299 DALI_TEST_EQUALS(1u, layer.GetChildCount(), TEST_LOCATION);
301 application.GetScene().Add(view);
303 application.SendNotification();
304 application.Render();
306 // CameraActor is added on layer when on scene
307 DALI_TEST_EQUALS(1u, layer.GetChildCount(), TEST_LOCATION);
312 int UtcDaliSceneViewOnScene02(void)
314 ToolkitTestApplication application;
316 uint32_t baseRenderTaskCount = application.GetScene().GetRenderTaskList().GetTaskCount();
318 Scene3D::SceneView view = Scene3D::SceneView::New();
320 uint32_t renderTaskCount = application.GetScene().GetRenderTaskList().GetTaskCount();
321 DALI_TEST_EQUALS(baseRenderTaskCount, renderTaskCount, TEST_LOCATION);
323 application.GetScene().Add(view);
325 application.SendNotification();
326 application.Render();
328 renderTaskCount = application.GetScene().GetRenderTaskList().GetTaskCount();
329 DALI_TEST_EQUALS(baseRenderTaskCount + 2u, renderTaskCount, TEST_LOCATION);
331 RenderTask renderTask = application.GetScene().GetRenderTaskList().GetTask(baseRenderTaskCount + 1u);
332 CameraActor camera = renderTask.GetCameraActor();
334 CameraActor defaultCamera = renderTask.GetCameraActor();
335 DALI_TEST_CHECK(defaultCamera);
336 DALI_TEST_EQUALS(camera, defaultCamera, TEST_LOCATION);
337 DALI_TEST_EQUALS(defaultCamera, view.GetSelectedCamera(), TEST_LOCATION);
342 int UtcDaliSceneViewUserCamera(void)
344 ToolkitTestApplication application;
346 Scene3D::SceneView view = Scene3D::SceneView::New();
347 view.SetProperty(Dali::Actor::Property::SIZE, Vector2(100, 100));
349 application.GetScene().Add(view);
351 application.SendNotification();
352 application.Render();
354 CameraActor defaultCamera = view.GetSelectedCamera();
355 CameraActor camera = Dali::CameraActor::New();
356 camera.SetProperty(Dali::Actor::Property::NAME, "camera");
357 view.AddCamera(camera);
358 view.SelectCamera("camera");
360 DALI_TEST_NOT_EQUALS(defaultCamera, view.GetSelectedCamera(), 0.0f, TEST_LOCATION);
361 DALI_TEST_EQUALS(camera, view.GetSelectedCamera(), TEST_LOCATION);
363 camera.SetProperty(Dali::Actor::Property::PARENT_ORIGIN, ParentOrigin::CENTER);
364 camera.SetProperty(Dali::Actor::Property::ANCHOR_POINT, AnchorPoint::CENTER);
365 camera.SetFieldOfView(0.5f);
366 camera.SetNearClippingPlane(1.0f);
367 camera.SetFarClippingPlane(5000.0f);
368 camera.SetProperty(Dali::Actor::Property::POSITION, Vector3(20, 30, 40));
370 float fov = camera[Dali::CameraActor::Property::FIELD_OF_VIEW];
371 float nearPlain = camera[Dali::CameraActor::Property::NEAR_PLANE_DISTANCE];
372 float farPlain = camera[Dali::CameraActor::Property::FAR_PLANE_DISTANCE];
373 Vector3 cameraPosition = camera[Dali::Actor::Property::POSITION];
375 view.SetProperty(Dali::Actor::Property::SIZE, Vector2(400, 300));
377 DALI_TEST_EQUALS(fov, camera.GetProperty<float>(Dali::CameraActor::Property::FIELD_OF_VIEW), TEST_LOCATION);
378 DALI_TEST_EQUALS(nearPlain, camera.GetProperty<float>(Dali::CameraActor::Property::NEAR_PLANE_DISTANCE), TEST_LOCATION);
379 DALI_TEST_EQUALS(farPlain, camera.GetProperty<float>(Dali::CameraActor::Property::FAR_PLANE_DISTANCE), TEST_LOCATION);
380 DALI_TEST_EQUALS(cameraPosition, camera.GetProperty<Vector3>(Dali::Actor::Property::POSITION), TEST_LOCATION);
385 int UtcDaliSceneViewAddRemoveCamera(void)
387 ToolkitTestApplication application;
389 Scene3D::SceneView view = Scene3D::SceneView::New();
390 view.SetProperty(Dali::Actor::Property::SIZE, Vector2(100, 100));
392 application.GetScene().Add(view);
394 application.SendNotification();
395 application.Render();
397 CameraActor camera0 = view.GetSelectedCamera();
398 camera0.SetProperty(Dali::Actor::Property::NAME, "camera0");
399 CameraActor camera1 = Dali::CameraActor::New();
400 camera1.SetProperty(Dali::Actor::Property::NAME, "camera1");
402 DALI_TEST_EQUALS(1u, view.GetCameraCount(), TEST_LOCATION);
403 view.AddCamera(camera1);
404 DALI_TEST_EQUALS(2u, view.GetCameraCount(), TEST_LOCATION);
406 DALI_TEST_EQUALS(camera0, view.GetCamera(0), TEST_LOCATION);
407 DALI_TEST_EQUALS(camera0, view.GetCamera("camera0"), TEST_LOCATION);
408 DALI_TEST_EQUALS(camera1, view.GetCamera(1), TEST_LOCATION);
409 DALI_TEST_EQUALS(camera1, view.GetCamera("camera1"), TEST_LOCATION);
411 DALI_TEST_EQUALS(camera0, view.GetSelectedCamera(), TEST_LOCATION);
412 view.SelectCamera(1); // 0 -> 1
413 DALI_TEST_EQUALS(camera1, view.GetSelectedCamera(), TEST_LOCATION);
414 view.SelectCamera("camera0"); // 1 -> 0
415 DALI_TEST_EQUALS(camera0, view.GetSelectedCamera(), TEST_LOCATION);
416 view.SelectCamera("camera1"); // 0 -> 1
417 DALI_TEST_EQUALS(camera1, view.GetSelectedCamera(), TEST_LOCATION);
418 view.SelectCamera(0); // 1 -> 0
419 DALI_TEST_EQUALS(camera0, view.GetSelectedCamera(), TEST_LOCATION);
421 view.SelectCamera(1); // 0 -> 1
422 DALI_TEST_EQUALS(camera1, view.GetSelectedCamera(), TEST_LOCATION);
423 DALI_TEST_EQUALS(2u, view.GetCameraCount(), TEST_LOCATION);
424 view.RemoveCamera(camera1); // 1 -> 0
425 DALI_TEST_EQUALS(camera0, view.GetSelectedCamera(), TEST_LOCATION);
426 DALI_TEST_EQUALS(1u, view.GetCameraCount(), TEST_LOCATION);
428 CameraActor defaultCamera = view.GetSelectedCamera();
429 DALI_TEST_CHECK(defaultCamera);
430 DALI_TEST_EQUALS(camera0, defaultCamera, TEST_LOCATION);
431 DALI_TEST_NOT_EQUALS(camera1, defaultCamera, 0.0f, TEST_LOCATION);
435 int UtcDaliSceneViewImageBasedLight01(void)
437 ToolkitTestApplication application;
439 Scene3D::SceneView view = Scene3D::SceneView::New();
440 view.ResourceReadySignal().Connect(OnResourceReady);
441 view.SetProperty(Dali::Actor::Property::SIZE, Vector2(100, 100));
443 application.GetScene().Add(view);
445 application.SendNotification();
446 application.Render();
448 Scene3D::Model modelView1 = Scene3D::Model::New(TEST_GLTF_FILE_NAME);
449 Scene3D::Model modelView2 = Scene3D::Model::New(TEST_GLTF_FILE_NAME);
450 Scene3D::Model modelView3 = Scene3D::Model::New(TEST_GLTF_FILE_NAME);
451 view.Add(modelView1);
452 view.Add(modelView2);
454 application.SendNotification();
455 application.Render();
456 DALI_TEST_EQUALS(Test::WaitForEventThreadTrigger(2), true, TEST_LOCATION);
457 application.SendNotification();
458 application.Render();
460 DALI_TEST_EQUALS(GetDiffuseTexture(modelView1), GetDiffuseTexture(modelView2), TEST_LOCATION);
461 DALI_TEST_EQUALS(GetSpecularTexture(modelView1), GetSpecularTexture(modelView2), TEST_LOCATION);
462 DALI_TEST_NOT_EQUALS(GetDiffuseTexture(modelView1), GetDiffuseTexture(modelView3), 0.0f, TEST_LOCATION);
463 DALI_TEST_NOT_EQUALS(GetSpecularTexture(modelView1), GetSpecularTexture(modelView3), 0.0f, TEST_LOCATION);
465 gResourceReadyCalled = false;
466 DALI_TEST_EQUALS(gResourceReadyCalled, false, TEST_LOCATION);
467 view.SetImageBasedLightSource(TEST_DIFFUSE_TEXTURE, TEST_SPECULAR_TEXTURE);
469 application.SendNotification();
470 application.Render();
472 DALI_TEST_EQUALS(Test::WaitForEventThreadTrigger(2), true, TEST_LOCATION);
473 application.SendNotification();
474 application.Render();
476 DALI_TEST_EQUALS(gResourceReadyCalled, true, TEST_LOCATION);
478 DALI_TEST_EQUALS(GetDiffuseTexture(modelView1), GetDiffuseTexture(modelView2), TEST_LOCATION);
479 DALI_TEST_EQUALS(GetSpecularTexture(modelView1), GetSpecularTexture(modelView2), TEST_LOCATION);
480 DALI_TEST_NOT_EQUALS(GetDiffuseTexture(modelView1), GetDiffuseTexture(modelView3), 0.0f, TEST_LOCATION);
481 DALI_TEST_NOT_EQUALS(GetSpecularTexture(modelView1), GetSpecularTexture(modelView3), 0.0f, TEST_LOCATION);
483 view.Add(modelView3);
484 application.SendNotification();
485 application.Render();
486 DALI_TEST_EQUALS(Test::WaitForEventThreadTrigger(1), true, TEST_LOCATION);
487 application.SendNotification();
488 application.Render();
490 DALI_TEST_EQUALS(GetDiffuseTexture(modelView1), GetDiffuseTexture(modelView3), TEST_LOCATION);
491 DALI_TEST_EQUALS(GetSpecularTexture(modelView1), GetSpecularTexture(modelView3), TEST_LOCATION);
493 view.Remove(modelView1);
495 gResourceReadyCalled = false;
496 DALI_TEST_EQUALS(gResourceReadyCalled, false, TEST_LOCATION);
497 view.SetImageBasedLightSource(TEST_DIFFUSE_TEXTURE2, TEST_SPECULAR_TEXTURE2);
499 application.SendNotification();
500 application.Render();
502 DALI_TEST_EQUALS(Test::WaitForEventThreadTrigger(2), true, TEST_LOCATION);
503 application.SendNotification();
504 application.Render();
506 DALI_TEST_EQUALS(gResourceReadyCalled, true, TEST_LOCATION);
508 DALI_TEST_NOT_EQUALS(GetDiffuseTexture(modelView1), GetDiffuseTexture(modelView2), 0.0f, TEST_LOCATION);
509 DALI_TEST_NOT_EQUALS(GetSpecularTexture(modelView1), GetSpecularTexture(modelView2), 0.0f, TEST_LOCATION);
510 DALI_TEST_NOT_EQUALS(GetDiffuseTexture(modelView1), GetDiffuseTexture(modelView3), 0.0f, TEST_LOCATION);
511 DALI_TEST_NOT_EQUALS(GetSpecularTexture(modelView1), GetSpecularTexture(modelView3), 0.0f, TEST_LOCATION);
512 DALI_TEST_EQUALS(GetDiffuseTexture(modelView2), GetDiffuseTexture(modelView3), TEST_LOCATION);
513 DALI_TEST_EQUALS(GetSpecularTexture(modelView2), GetSpecularTexture(modelView3), TEST_LOCATION);
518 int UtcDaliSceneViewImageBasedLight02(void)
520 ToolkitTestApplication application;
522 Scene3D::SceneView view = Scene3D::SceneView::New();
523 view.ResourceReadySignal().Connect(OnResourceReady);
524 view.SetProperty(Dali::Actor::Property::SIZE, Vector2(100, 100));
526 application.GetScene().Add(view);
528 application.SendNotification();
529 application.Render();
531 Scene3D::Model modelView1 = Scene3D::Model::New(TEST_GLTF_FILE_NAME);
532 modelView1.ResourceReadySignal().Connect(OnResourceReady);
533 view.Add(modelView1);
534 application.SendNotification();
535 application.Render();
536 DALI_TEST_EQUALS(Test::WaitForEventThreadTrigger(1), true, TEST_LOCATION);
537 application.SendNotification();
538 application.Render();
540 gResourceReadyCalled = false;
541 DALI_TEST_EQUALS(gResourceReadyCalled, false, TEST_LOCATION);
542 view.SetImageBasedLightSource(TEST_DIFFUSE_TEXTURE, TEST_SPECULAR_TEXTURE);
544 application.SendNotification();
545 application.Render();
547 DALI_TEST_EQUALS(Test::WaitForEventThreadTrigger(2), true, TEST_LOCATION);
548 application.SendNotification();
549 application.Render();
551 DALI_TEST_EQUALS(gResourceReadyCalled, true, TEST_LOCATION);
553 Dali::Texture diffuseTexture = GetDiffuseTexture(modelView1);
554 Dali::Texture specularTexture = GetSpecularTexture(modelView1);
556 gResourceReadyCalled = false;
557 DALI_TEST_EQUALS(gResourceReadyCalled, false, TEST_LOCATION);
558 modelView1.SetImageBasedLightSource(TEST_DIFFUSE_TEXTURE2, TEST_SPECULAR_TEXTURE2);
560 application.SendNotification();
561 application.Render();
563 DALI_TEST_EQUALS(Test::WaitForEventThreadTrigger(2), true, TEST_LOCATION);
564 application.SendNotification();
565 application.Render();
567 DALI_TEST_EQUALS(gResourceReadyCalled, true, TEST_LOCATION);
569 DALI_TEST_NOT_EQUALS(GetDiffuseTexture(modelView1), diffuseTexture, 0.0f, TEST_LOCATION);
570 DALI_TEST_NOT_EQUALS(GetSpecularTexture(modelView1), specularTexture, 0.0f, TEST_LOCATION);
571 diffuseTexture = GetDiffuseTexture(modelView1);
572 specularTexture = GetSpecularTexture(modelView1);
574 // reset SceneView IBL
575 view.SetImageBasedLightSource("", "");
576 DALI_TEST_EQUALS(GetDiffuseTexture(modelView1), diffuseTexture, TEST_LOCATION);
577 DALI_TEST_EQUALS(GetSpecularTexture(modelView1), specularTexture, TEST_LOCATION);
579 modelView1.SetImageBasedLightSource("", "");
580 DALI_TEST_NOT_EQUALS(GetDiffuseTexture(modelView1), diffuseTexture, 0.0f, TEST_LOCATION);
581 DALI_TEST_NOT_EQUALS(GetSpecularTexture(modelView1), specularTexture, 0.0f, TEST_LOCATION);
586 int UtcDaliSceneViewImageBasedLight03(void)
588 ToolkitTestApplication application;
590 Scene3D::SceneView view = Scene3D::SceneView::New();
591 view.SetProperty(Dali::Actor::Property::SIZE, Vector2(100, 100));
592 view.ResourceReadySignal().Connect(OnResourceReady);
593 application.GetScene().Add(view);
595 application.SendNotification();
596 application.Render();
598 Scene3D::Model modelView1 = Scene3D::Model::New(TEST_GLTF_FILE_NAME);
599 view.Add(modelView1);
600 modelView1.SetImageBasedLightSource(TEST_SPECULAR_TEXTURE, TEST_DIFFUSE_TEXTURE);
602 application.SendNotification();
603 application.Render();
604 DALI_TEST_EQUALS(Test::WaitForEventThreadTrigger(3), true, TEST_LOCATION);
605 application.SendNotification();
606 application.Render();
608 Dali::Texture diffuseTexture = GetDiffuseTexture(modelView1);
609 Dali::Texture specularTexture = GetSpecularTexture(modelView1);
611 gResourceReadyCalled = false;
612 DALI_TEST_EQUALS(gResourceReadyCalled, false, TEST_LOCATION);
613 view.SetImageBasedLightSource(TEST_DIFFUSE_TEXTURE2, TEST_SPECULAR_TEXTURE2);
615 application.SendNotification();
616 application.Render();
617 DALI_TEST_EQUALS(Test::WaitForEventThreadTrigger(2), true, TEST_LOCATION);
618 application.SendNotification();
619 application.Render();
621 DALI_TEST_EQUALS(gResourceReadyCalled, true, TEST_LOCATION);
623 DALI_TEST_EQUALS(GetDiffuseTexture(modelView1), diffuseTexture, TEST_LOCATION);
624 DALI_TEST_EQUALS(GetSpecularTexture(modelView1), specularTexture, TEST_LOCATION);
626 modelView1.SetImageBasedLightSource("", "");
627 DALI_TEST_NOT_EQUALS(GetDiffuseTexture(modelView1), diffuseTexture, 0.0f, TEST_LOCATION);
628 DALI_TEST_NOT_EQUALS(GetSpecularTexture(modelView1), specularTexture, 0.0f, TEST_LOCATION);
629 diffuseTexture = GetDiffuseTexture(modelView1);
630 specularTexture = GetSpecularTexture(modelView1);
632 // reset SceneView IBL
633 view.SetImageBasedLightSource("", "");
634 DALI_TEST_NOT_EQUALS(GetDiffuseTexture(modelView1), diffuseTexture, 0.0f, TEST_LOCATION);
635 DALI_TEST_NOT_EQUALS(GetSpecularTexture(modelView1), specularTexture, 0.0f, TEST_LOCATION);
640 int UtcDaliSceneViewImageBasedFactor(void)
642 ToolkitTestApplication application;
644 Scene3D::SceneView view = Scene3D::SceneView::New();
645 view.SetProperty(Dali::Actor::Property::SIZE, Vector2(100, 100));
647 application.GetScene().Add(view);
649 application.SendNotification();
650 application.Render();
652 Scene3D::Model modelView1 = Scene3D::Model::New(TEST_GLTF_FILE_NAME);
653 view.Add(modelView1);
655 DALI_TEST_EQUALS(view.GetImageBasedLightScaleFactor(), 1.0f, TEST_LOCATION);
656 DALI_TEST_EQUALS(modelView1.GetImageBasedLightScaleFactor(), 1.0f, TEST_LOCATION);
658 view.SetImageBasedLightScaleFactor(0.5f);
659 DALI_TEST_EQUALS(view.GetImageBasedLightScaleFactor(), 0.5f, TEST_LOCATION);
660 DALI_TEST_EQUALS(modelView1.GetImageBasedLightScaleFactor(), 1.0f, TEST_LOCATION);
664 int UtcDaliSceneViewUseFramebuffer01(void)
666 ToolkitTestApplication application;
668 Scene3D::SceneView view = Scene3D::SceneView::New();
669 view.SetProperty(Dali::Actor::Property::SIZE, Vector2(100, 100));
671 application.GetScene().Add(view);
673 application.SendNotification();
674 application.Render();
676 bool useFramebuffer = view.IsUsingFramebuffer();
677 view.UseFramebuffer(true);
678 DALI_TEST_NOT_EQUALS(useFramebuffer, view.IsUsingFramebuffer(), 0.0f, TEST_LOCATION);
683 int UtcDaliSceneViewUseFramebuffer02(void)
685 ToolkitTestApplication application;
687 uint32_t baseRenderTaskCount = application.GetScene().GetRenderTaskList().GetTaskCount();
689 Scene3D::SceneView view = Scene3D::SceneView::New();
690 view.SetProperty(Dali::Actor::Property::SIZE, Vector2(100, 100));
692 application.GetScene().Add(view);
694 application.SendNotification();
695 application.Render();
697 RenderTask renderTask = application.GetScene().GetRenderTaskList().GetTask(baseRenderTaskCount + 1u);
698 DALI_TEST_CHECK(!renderTask.GetFrameBuffer());
700 view.UseFramebuffer(true);
701 DALI_TEST_CHECK(renderTask.GetFrameBuffer());
703 view.UseFramebuffer(false);
704 DALI_TEST_CHECK(!renderTask.GetFrameBuffer());
706 view.UseFramebuffer(true);
707 DALI_TEST_CHECK(renderTask.GetFrameBuffer());
712 int UtcDaliSceneViewFramebufferMultiSamplingLevel(void)
714 ToolkitTestApplication application;
716 Scene3D::SceneView view = Scene3D::SceneView::New();
717 view.SetProperty(Dali::Actor::Property::SIZE, Vector2(100, 100));
719 application.GetScene().Add(view);
721 application.SendNotification();
722 application.Render();
724 uint8_t expectValue = 0u; // Default MultiSamplingLevel is 0.
725 uint8_t multiSamplingLevel = view.GetFramebufferMultiSamplingLevel();
726 DALI_TEST_EQUALS(multiSamplingLevel, expectValue, TEST_LOCATION);
728 expectValue = 4u; // Change value.
729 view.UseFramebuffer(true);
730 view.SetFramebufferMultiSamplingLevel(expectValue);
732 multiSamplingLevel = view.GetFramebufferMultiSamplingLevel();
733 DALI_TEST_EQUALS(multiSamplingLevel, expectValue, TEST_LOCATION);
735 // Note : we don't check multi sampling level is applied to framebuffer, or not.
736 view.UseFramebuffer(false);
737 expectValue = 2u; // Change value.
738 view.SetFramebufferMultiSamplingLevel(expectValue);
740 application.SendNotification();
741 application.Render();
743 multiSamplingLevel = view.GetFramebufferMultiSamplingLevel();
744 DALI_TEST_EQUALS(multiSamplingLevel, expectValue, TEST_LOCATION);
749 int UtcDaliSceneViewResourceReady(void)
751 ToolkitTestApplication application;
753 gOnRelayoutCallBackCalled = false;
754 gResourceReadyCalled = false;
755 Scene3D::SceneView view = Scene3D::SceneView::New();
756 view.SetProperty(Actor::Property::SIZE, Vector2(100.0f, 100.0f));
757 view.OnRelayoutSignal().Connect(OnRelayoutCallback);
758 view.ResourceReadySignal().Connect(OnResourceReady);
759 // SceneView::IsResourceReady() returns true by default.
760 DALI_TEST_EQUALS(view.IsResourceReady(), true, TEST_LOCATION);
763 DALI_TEST_CHECK(!gOnRelayoutCallBackCalled);
764 DALI_TEST_CHECK(!gResourceReadyCalled);
766 application.GetScene().Add(view);
768 application.SendNotification();
769 application.Render();
771 DALI_TEST_EQUALS(gOnRelayoutCallBackCalled, true, TEST_LOCATION);
772 DALI_TEST_EQUALS(view.IsResourceReady(), true, TEST_LOCATION);
773 DALI_TEST_EQUALS(gResourceReadyCalled, false, TEST_LOCATION);
775 gOnRelayoutCallBackCalled = false;
776 gResourceReadyCalled = false;
778 view.SetImageBasedLightSource(TEST_DIFFUSE_TEXTURE, TEST_SPECULAR_TEXTURE);
780 application.SendNotification();
781 application.Render();
782 DALI_TEST_EQUALS(Test::WaitForEventThreadTrigger(2), true, TEST_LOCATION);
783 application.SendNotification();
784 application.Render();
786 DALI_TEST_EQUALS(gOnRelayoutCallBackCalled, false, TEST_LOCATION);
787 DALI_TEST_EQUALS(gResourceReadyCalled, true, TEST_LOCATION);
792 int UtcDaliSceneViewSetSkybox(void)
794 ToolkitTestApplication application;
796 gResourceReadyCalled = false;
797 Scene3D::SceneView view = Scene3D::SceneView::New();
798 view.SetProperty(Actor::Property::SIZE, Vector2(100.0f, 100.0f));
799 view.ResourceReadySignal().Connect(OnResourceReady);
800 application.GetScene().Add(view);
802 application.SendNotification();
803 application.Render();
805 uint32_t childCount = view.GetChildAt(0u).GetChildCount();
806 view.SetSkybox(TEST_SPECULAR_TEXTURE);
808 gResourceReadyCalled = false;
809 DALI_TEST_EQUALS(gResourceReadyCalled, false, TEST_LOCATION);
811 application.SendNotification();
812 application.Render();
813 DALI_TEST_EQUALS(Test::WaitForEventThreadTrigger(1), true, TEST_LOCATION);
814 application.SendNotification();
815 application.Render();
817 DALI_TEST_EQUALS(gResourceReadyCalled, true, TEST_LOCATION);
819 DALI_TEST_EQUALS(view.GetChildAt(0u).GetChildCount(), childCount + 1, TEST_LOCATION);
827 int UtcDaliSceneViewSetSkyboxEquirectangular(void)
829 ToolkitTestApplication application;
831 gResourceReadyCalled = false;
832 Scene3D::SceneView view = Scene3D::SceneView::New();
833 view.SetProperty(Actor::Property::SIZE, Vector2(100.0f, 100.0f));
834 view.ResourceReadySignal().Connect(OnResourceReady);
835 application.GetScene().Add(view);
837 application.SendNotification();
838 application.Render();
840 uint32_t childCount = view.GetChildAt(0u).GetChildCount();
841 view.SetSkyboxEnvironmentMapType(Scene3D::EnvironmentMapType::EQUIRECTANGULAR);
842 view.SetSkybox(TEST_EQUIRECTANGULAR_TEXTURE);
844 gResourceReadyCalled = false;
845 DALI_TEST_EQUALS(gResourceReadyCalled, false, TEST_LOCATION);
847 application.SendNotification();
848 application.Render();
849 DALI_TEST_EQUALS(Test::WaitForEventThreadTrigger(1), true, TEST_LOCATION);
850 application.SendNotification();
851 application.Render();
853 DALI_TEST_EQUALS(gResourceReadyCalled, true, TEST_LOCATION);
855 DALI_TEST_EQUALS(view.GetChildAt(0u).GetChildCount(), childCount + 1, TEST_LOCATION);
863 int UtcDaliSceneViewSetSkyboxEmpty(void)
865 ToolkitTestApplication application;
867 gResourceReadyCalled = false;
868 Scene3D::SceneView view = Scene3D::SceneView::New();
869 view.SetProperty(Actor::Property::SIZE, Vector2(100.0f, 100.0f));
870 view.ResourceReadySignal().Connect(OnResourceReady);
871 application.GetScene().Add(view);
873 application.SendNotification();
874 application.Render();
876 uint32_t childCount = view.GetChildAt(0u).GetChildCount();
878 DALI_TEST_EQUALS(view.GetChildAt(0u).GetChildCount(), childCount, TEST_LOCATION);
886 int UtcDaliSceneViewSetSkyboxEmpty2(void)
888 ToolkitTestApplication application;
890 gResourceReadyCalled = false;
891 Scene3D::SceneView view = Scene3D::SceneView::New();
892 view.SetProperty(Actor::Property::SIZE, Vector2(100.0f, 100.0f));
893 view.ResourceReadySignal().Connect(OnResourceReady);
894 application.GetScene().Add(view);
896 application.SendNotification();
897 application.Render();
899 view.SetSkybox(TEST_EQUIRECTANGULAR_TEXTURE);
901 application.SendNotification();
902 application.Render();
903 DALI_TEST_EQUALS(Test::WaitForEventThreadTrigger(1), true, TEST_LOCATION);
904 application.SendNotification();
905 application.Render();
907 uint32_t childCount = view.GetChildAt(0u).GetChildCount();
910 DALI_TEST_EQUALS(view.GetChildAt(0u).GetChildCount(), childCount - 1, TEST_LOCATION);
918 int UtcDaliSceneViewSetSkyboxEquirectangularEmpty(void)
920 ToolkitTestApplication application;
922 gResourceReadyCalled = false;
923 Scene3D::SceneView view = Scene3D::SceneView::New();
924 view.SetProperty(Actor::Property::SIZE, Vector2(100.0f, 100.0f));
925 view.ResourceReadySignal().Connect(OnResourceReady);
926 application.GetScene().Add(view);
928 application.SendNotification();
929 application.Render();
931 uint32_t childCount = view.GetChildAt(0u).GetChildCount();
933 DALI_TEST_EQUALS(view.GetChildAt(0u).GetChildCount(), childCount, TEST_LOCATION);
941 int UtcDaliSceneViewSetSkyboxIntensity(void)
943 ToolkitTestApplication application;
945 Scene3D::SceneView view = Scene3D::SceneView::New();
946 view.SetProperty(Actor::Property::SIZE, Vector2(100.0f, 100.0f));
948 float intensity = 0.5f;
949 DALI_TEST_EQUALS(view.GetSkyboxIntensity(), 1.0f, TEST_LOCATION);
951 view.SetSkyboxIntensity(intensity);
952 DALI_TEST_EQUALS(view.GetSkyboxIntensity(), intensity, TEST_LOCATION);
957 int UtcDaliSceneViewSetSkyboxOrientation(void)
959 ToolkitTestApplication application;
961 Scene3D::SceneView view = Scene3D::SceneView::New();
962 view.SetProperty(Actor::Property::SIZE, Vector2(100.0f, 100.0f));
964 Dali::Quaternion orientation = Dali::Quaternion(Radian(0.5f), Vector3::YAXIS);
965 view.SetSkyboxOrientation(orientation);
966 DALI_TEST_EQUALS(view.GetSkyboxOrientation(), orientation, TEST_LOCATION);
971 int UtcDaliSceneViewSetImageBasedLightAndSkybox(void)
973 ToolkitTestApplication application;
975 Scene3D::SceneView view = Scene3D::SceneView::New();
976 view.ResourceReadySignal().Connect(OnResourceReady);
977 view.SetProperty(Dali::Actor::Property::SIZE, Vector2(100, 100));
978 view.SetImageBasedLightSource(TEST_DIFFUSE_TEXTURE, TEST_SPECULAR_TEXTURE);
979 view.SetSkybox(TEST_SPECULAR_TEXTURE);
980 application.GetScene().Add(view);
982 // Check SceneView needs 3 trigger to load both of image based light and skybox.
983 gResourceReadyCalled = false;
984 DALI_TEST_EQUALS(gResourceReadyCalled, false, TEST_LOCATION);
985 application.SendNotification();
986 application.Render();
987 DALI_TEST_EQUALS(Test::WaitForEventThreadTrigger(3), true, TEST_LOCATION);
988 application.SendNotification();
989 application.Render();
990 DALI_TEST_EQUALS(gResourceReadyCalled, true, TEST_LOCATION);
995 int UtcDaliSceneViewCreateAndRemoveRenderTask(void)
997 ToolkitTestApplication application;
998 RenderTaskList taskList = application.GetScene().GetRenderTaskList();
1000 uint32_t baseRenderTaskCount = taskList.GetTaskCount();
1002 Scene3D::SceneView view = Scene3D::SceneView::New();
1003 view.SetProperty(Actor::Property::SIZE, Vector2(100.0f, 100.0f));
1005 DALI_TEST_EQUALS(baseRenderTaskCount, application.GetScene().GetRenderTaskList().GetTaskCount(), TEST_LOCATION);
1007 application.GetScene().Add(view);
1009 DALI_TEST_EQUALS(baseRenderTaskCount + 2, application.GetScene().GetRenderTaskList().GetTaskCount(), TEST_LOCATION);
1013 DALI_TEST_EQUALS(baseRenderTaskCount, application.GetScene().GetRenderTaskList().GetTaskCount(), TEST_LOCATION);
1018 int UtcDaliSceneViewColorMode(void)
1020 ToolkitTestApplication application;
1022 Scene3D::SceneView view = Scene3D::SceneView::New();
1023 application.GetScene().Add(view);
1025 DALI_TEST_EQUALS(view.GetChildAt(0u).GetProperty<int>(Dali::Actor::Property::COLOR_MODE), static_cast<int>(ColorMode::USE_OWN_MULTIPLY_PARENT_ALPHA), TEST_LOCATION);
1027 view.UseFramebuffer(true);
1029 DALI_TEST_EQUALS(view.GetChildAt(0u).GetProperty<int>(Dali::Actor::Property::COLOR_MODE), static_cast<int>(ColorMode::USE_OWN_COLOR), TEST_LOCATION);
1031 view.UseFramebuffer(false);
1033 DALI_TEST_EQUALS(view.GetChildAt(0u).GetProperty<int>(Dali::Actor::Property::COLOR_MODE), static_cast<int>(ColorMode::USE_OWN_MULTIPLY_PARENT_ALPHA), TEST_LOCATION);
1038 int UtcDaliSceneViewSetResolution(void)
1040 ToolkitTestApplication application;
1042 Scene3D::SceneView view = Scene3D::SceneView::New();
1043 application.GetScene().Add(view);
1044 view.SetProperty(Dali::Actor::Property::SIZE, Vector2(100, 100));
1046 DALI_TEST_EQUALS(view.GetResolutionWidth(), 100u, TEST_LOCATION);
1047 DALI_TEST_EQUALS(view.GetResolutionHeight(), 100u, TEST_LOCATION);
1049 view.SetResolution(200u, 200u);
1051 DALI_TEST_EQUALS(view.GetResolutionWidth(), 100u, TEST_LOCATION);
1052 DALI_TEST_EQUALS(view.GetResolutionHeight(), 100u, TEST_LOCATION);
1054 view.UseFramebuffer(true);
1056 DALI_TEST_EQUALS(view.GetResolutionWidth(), 200u, TEST_LOCATION);
1057 DALI_TEST_EQUALS(view.GetResolutionHeight(), 200u, TEST_LOCATION);
1059 view.SetResolution(300u, 0u);
1061 DALI_TEST_EQUALS(view.GetResolutionWidth(), 100u, TEST_LOCATION);
1062 DALI_TEST_EQUALS(view.GetResolutionHeight(), 100u, TEST_LOCATION);
1064 view.SetResolution(300u, 400u);
1066 DALI_TEST_EQUALS(view.GetResolutionWidth(), 300u, TEST_LOCATION);
1067 DALI_TEST_EQUALS(view.GetResolutionHeight(), 400u, TEST_LOCATION);
1069 view.ResetResolution();
1071 DALI_TEST_EQUALS(view.GetResolutionWidth(), 100u, TEST_LOCATION);
1072 DALI_TEST_EQUALS(view.GetResolutionHeight(), 100u, TEST_LOCATION);
1074 view.SetProperty(Dali::Actor::Property::SIZE, Vector2(400, 400));
1076 DALI_TEST_EQUALS(view.GetResolutionWidth(), 400u, TEST_LOCATION);
1077 DALI_TEST_EQUALS(view.GetResolutionHeight(), 400u, TEST_LOCATION);
1082 int UtcDaliSceneViewSetResolution02(void)
1084 tet_infoline("Test whether framebuffer created well base on inputed resolution");
1085 ToolkitTestApplication application;
1086 RenderTaskList renderTaskList = application.GetScene().GetRenderTaskList();
1088 uint32_t baseRenderTaskCount = renderTaskList.GetTaskCount();
1090 Scene3D::SceneView view = Scene3D::SceneView::New();
1091 application.GetScene().Add(view);
1092 view.SetProperty(Dali::Actor::Property::SIZE, Vector2(100, 100));
1094 DALI_TEST_EQUALS(view.GetResolutionWidth(), 100u, TEST_LOCATION);
1095 DALI_TEST_EQUALS(view.GetResolutionHeight(), 100u, TEST_LOCATION);
1097 uint32_t expectWidth = 83u;
1098 uint32_t expectHeight = 207u;
1100 view.SetResolution(expectWidth, expectHeight);
1102 DALI_TEST_EQUALS(view.GetResolutionWidth(), 100u, TEST_LOCATION);
1103 DALI_TEST_EQUALS(view.GetResolutionHeight(), 100u, TEST_LOCATION);
1105 tet_printf("Test Framebuffer result target created well\n");
1106 view.UseFramebuffer(true);
1108 RenderTask renderTask = renderTaskList.GetTask(baseRenderTaskCount + 1u);
1109 DALI_TEST_CHECK(renderTask);
1111 FrameBuffer frameBuffer = renderTask.GetFrameBuffer();
1112 DALI_TEST_CHECK(frameBuffer);
1114 DALI_TEST_EQUALS(view.GetResolutionWidth(), expectWidth, TEST_LOCATION);
1115 DALI_TEST_EQUALS(view.GetResolutionHeight(), expectHeight, TEST_LOCATION);
1117 Texture renderTargetTexture = frameBuffer.GetColorTexture();
1118 DALI_TEST_CHECK(renderTargetTexture);
1119 DALI_TEST_EQUALS(renderTargetTexture.GetWidth(), expectWidth, TEST_LOCATION);
1120 DALI_TEST_EQUALS(renderTargetTexture.GetHeight(), expectHeight, TEST_LOCATION);
1122 tet_printf("Test Framebuffer result target created well after create new FBO, by set multisampling level\n");
1123 view.SetFramebufferMultiSamplingLevel(2u);
1125 renderTask = renderTaskList.GetTask(baseRenderTaskCount + 1u);
1126 DALI_TEST_CHECK(renderTask);
1128 frameBuffer = renderTask.GetFrameBuffer();
1129 DALI_TEST_CHECK(frameBuffer);
1131 DALI_TEST_EQUALS(view.GetResolutionWidth(), expectWidth, TEST_LOCATION);
1132 DALI_TEST_EQUALS(view.GetResolutionHeight(), expectHeight, TEST_LOCATION);
1134 renderTargetTexture = frameBuffer.GetColorTexture();
1135 DALI_TEST_CHECK(renderTargetTexture);
1137 DALI_TEST_EQUALS(renderTargetTexture.GetWidth(), expectWidth, TEST_LOCATION);
1138 DALI_TEST_EQUALS(renderTargetTexture.GetHeight(), expectHeight, TEST_LOCATION);
1140 tet_printf("Test Framebuffer result target created well after change resolution\n");
1142 expectHeight = 103u;
1143 view.SetResolution(expectWidth, expectHeight);
1145 renderTask = renderTaskList.GetTask(baseRenderTaskCount + 1u);
1146 DALI_TEST_CHECK(renderTask);
1148 frameBuffer = renderTask.GetFrameBuffer();
1149 DALI_TEST_CHECK(frameBuffer);
1151 DALI_TEST_EQUALS(view.GetResolutionWidth(), expectWidth, TEST_LOCATION);
1152 DALI_TEST_EQUALS(view.GetResolutionHeight(), expectHeight, TEST_LOCATION);
1154 renderTargetTexture = frameBuffer.GetColorTexture();
1155 DALI_TEST_CHECK(renderTargetTexture);
1157 DALI_TEST_EQUALS(renderTargetTexture.GetWidth(), expectWidth, TEST_LOCATION);
1158 DALI_TEST_EQUALS(renderTargetTexture.GetHeight(), expectHeight, TEST_LOCATION);
1165 const char* TEST_MASK_IMAGE_FILE_NAME = TEST_RESOURCE_DIR "/mask.png";
1167 static constexpr std::string_view Y_FLIP_MASK_TEXTURE = "uYFlipMaskTexture";
1170 int UtcDaliSceneViewMasking(void)
1172 ToolkitTestApplication application;
1174 Scene3D::SceneView view = Scene3D::SceneView::New();
1175 application.GetScene().Add(view);
1177 DALI_TEST_EQUALS(view.GetProperty<std::string>(Dali::Scene3D::SceneView::Property::ALPHA_MASK_URL), "", TEST_LOCATION);
1178 DALI_TEST_EQUALS(view.GetProperty<bool>(Dali::Scene3D::SceneView::Property::CROP_TO_MASK), true, TEST_LOCATION);
1179 DALI_TEST_EQUALS(view.GetProperty<float>(Dali::Scene3D::SceneView::Property::MASK_CONTENT_SCALE), 1.0f, TEST_LOCATION);
1181 auto yFlipMaskTextureIndex = view.GetPropertyIndex(Y_FLIP_MASK_TEXTURE.data());
1182 DALI_TEST_EQUALS(yFlipMaskTextureIndex, Property::INVALID_INDEX, TEST_LOCATION);
1184 view.UseFramebuffer(true);
1185 view.SetProperty(Dali::Scene3D::SceneView::Property::ALPHA_MASK_URL, TEST_MASK_IMAGE_FILE_NAME);
1186 view.SetProperty(Dali::Scene3D::SceneView::Property::CROP_TO_MASK, false);
1187 view.SetProperty(Dali::Scene3D::SceneView::Property::MASK_CONTENT_SCALE, 0.5f);
1189 DALI_TEST_EQUALS(view.GetProperty<std::string>(Dali::Scene3D::SceneView::Property::ALPHA_MASK_URL), TEST_MASK_IMAGE_FILE_NAME, TEST_LOCATION);
1190 DALI_TEST_EQUALS(view.GetProperty<bool>(Dali::Scene3D::SceneView::Property::CROP_TO_MASK), false, TEST_LOCATION);
1191 DALI_TEST_EQUALS(view.GetProperty<float>(Dali::Scene3D::SceneView::Property::MASK_CONTENT_SCALE), 0.5f, TEST_LOCATION);
1193 yFlipMaskTextureIndex = view.GetPropertyIndex(std::string(Y_FLIP_MASK_TEXTURE));
1194 DALI_TEST_EQUALS(view.GetProperty<float>(yFlipMaskTextureIndex), 1.0f, TEST_LOCATION);