[dali_2.3.21] Merge branch 'devel/master'
[platform/core/uifw/dali-toolkit.git] / automated-tests / src / dali-toolkit / utc-Dali-GlViewDirectRendering.cpp
1 /*
2  * Copyright (c) 2024 Samsung Electronics Co., Ltd.
3  *
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
7  *
8  * http://www.apache.org/licenses/LICENSE-2.0
9  *
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.
15  *
16  */
17
18 #include <unistd.h>
19 #include <thread>
20
21 #include <dali-toolkit-test-suite-utils.h>
22
23 #include <dali-toolkit/dali-toolkit.h>
24 #include <dali-toolkit/public-api/controls/gl-view/gl-view.h>
25 #include <dali/devel-api/adaptor-framework/window-devel.h>
26 #include <dali/public-api/signals/render-callback.h>
27
28 using namespace Dali;
29 using namespace Dali::Toolkit;
30
31 // Positive test case for a method
32 int UtcDaliGlViewDirectRenderingNew(void)
33 {
34   ToolkitTestApplication application;
35   tet_infoline(" UtcDaliGlViewDirectRenderingNew");
36   GlView view = GlView::New(GlView::BackendMode::DIRECT_RENDERING, GlView::ColorFormat::RGBA8888);
37   DALI_TEST_CHECK(view);
38
39   auto mode1 = view.GetBackendMode();
40
41   DALI_TEST_EQUALS(mode1, GlView::BackendMode::DIRECT_RENDERING, TEST_LOCATION);
42
43   GlView view2 = GlView::New(GlView::BackendMode::EGL_IMAGE_OFFSCREEN_RENDERING, GlView::ColorFormat::RGBA8888);
44   DALI_TEST_CHECK(view2);
45
46   auto mode2 = view2.GetBackendMode();
47   DALI_TEST_EQUALS(mode2, GlView::BackendMode::EGL_IMAGE_OFFSCREEN_RENDERING, TEST_LOCATION);
48
49   END_TEST;
50 }
51
52 int UtcDaliGlViewDirectRenderingNewN(void)
53 {
54   ToolkitTestApplication application;
55   tet_infoline(" UtcDaliGlViewDirectRenderingNewN");
56   // Invalid backend mode
57   GlView view = GlView::New(GlView::BackendMode(11111), GlView::ColorFormat::RGBA8888);
58   DALI_TEST_CHECK(!view);
59
60   END_TEST;
61 }
62
63 // Positive test case for a method
64 int UtcDaliGlViewDirectRenderingDownCast(void)
65 {
66   ToolkitTestApplication application;
67   tet_infoline(" UtcDaliGlViewDirectRenderingDownCast");
68
69   GlView     view = GlView::New(GlView::BackendMode::DIRECT_RENDERING, GlView::ColorFormat::RGB888);
70   BaseHandle handle(view);
71
72   Toolkit::GlView view2 = Toolkit::GlView::DownCast(handle);
73   DALI_TEST_CHECK(view);
74   DALI_TEST_CHECK(view2);
75   DALI_TEST_CHECK(view == view2);
76   END_TEST;
77 }
78
79 int UtcDaliGlViewDirectRenderingCopyAndAssignment(void)
80 {
81   ToolkitTestApplication application;
82   tet_infoline("UtcDaliGlViewDirectRenderingCopyAndAssignment");
83
84   GlView view = Toolkit::GlView::New(GlView::BackendMode::DIRECT_RENDERING, GlView::ColorFormat::RGB888);
85   DALI_TEST_CHECK(view);
86
87   GlView copy(view);
88   DALI_TEST_CHECK(view == copy);
89
90   GlView assign;
91   DALI_TEST_CHECK(!assign);
92
93   assign = copy;
94   DALI_TEST_CHECK(assign == view);
95
96   END_TEST;
97 }
98
99 int UtcDaliGlViewDirectRenderingMoveAssignment(void)
100 {
101   ToolkitTestApplication application;
102   tet_infoline("UtcDaliGlViewDirectRenderingMoveAssignment");
103
104   GlView view = Toolkit::GlView::New(GlView::BackendMode::DIRECT_RENDERING, GlView::ColorFormat::RGB888);
105   DALI_TEST_EQUALS(1, view.GetBaseObject().ReferenceCount(), TEST_LOCATION);
106
107   GlView moved;
108   moved = std::move(view);
109   DALI_TEST_CHECK(moved);
110   DALI_TEST_EQUALS(1, moved.GetBaseObject().ReferenceCount(), TEST_LOCATION);
111   DALI_TEST_CHECK(!view);
112
113   END_TEST;
114 }
115
116 int UtcDaliGlViewDirectRenderingSetGraphicsConfigGles20N(void)
117 {
118   ToolkitTestApplication application;
119   tet_infoline("UtcDaliGlViewDirectRenderingSetGraphicsConfigGles20");
120   GlView view;
121   try
122   {
123     view.SetGraphicsConfig(true, true, 0, GlView::GraphicsApiVersion::GLES_VERSION_2_0);
124     DALI_TEST_CHECK(false);
125   }
126   catch(...)
127   {
128     DALI_TEST_CHECK(true);
129   }
130   END_TEST;
131 }
132
133 int UtcDaliGlViewDirectRenderingSetGraphicsConfigGles30(void)
134 {
135   ToolkitTestApplication application;
136   tet_infoline("UtcDaliGlViewDirectRenderingSetGraphicsConfigGles30");
137   GlView view = Toolkit::GlView::New(GlView::BackendMode::DIRECT_RENDERING, GlView::ColorFormat::RGB888);
138
139   try
140   {
141     view.SetGraphicsConfig(true, true, 0, GlView::GraphicsApiVersion::GLES_VERSION_3_0);
142     DALI_TEST_CHECK(true);
143   }
144   catch(...)
145   {
146     DALI_TEST_CHECK(false);
147   }
148   END_TEST;
149 }
150
151 int UtcDaliGlViewDirectRenderingRenderingMode(void)
152 {
153   ToolkitTestApplication application;
154   tet_infoline("UtcDaliGlViewDirectRenderingRenderingMode");
155   GlView view = Toolkit::GlView::New(GlView::BackendMode::DIRECT_RENDERING, GlView::ColorFormat::RGB888);
156
157   view.SetRenderingMode(GlView::RenderingMode::ON_DEMAND);
158
159   GlView::RenderingMode mode = view.GetRenderingMode();
160
161   DALI_TEST_EQUALS(GlView::RenderingMode::ON_DEMAND, mode, TEST_LOCATION);
162
163   END_TEST;
164 }
165
166 int UtcDaliGlViewDirectRenderingOnSizeSet(void)
167 {
168   ToolkitTestApplication application;
169   tet_infoline("UtcDaliGlViewDirectRenderingOnSizeSet");
170   GlView view = Toolkit::GlView::New(GlView::BackendMode::DIRECT_RENDERING, GlView::ColorFormat::RGB888);
171
172   application.GetScene().Add(view);
173
174   application.SendNotification();
175   application.Render();
176
177   Vector3 size(200.0f, 300.0f, 0.0f);
178   view.SetProperty(Actor::Property::SIZE, size);
179
180   application.SendNotification();
181   application.Render();
182
183   DALI_TEST_EQUALS(view.GetCurrentProperty<Vector3>(Actor::Property::SIZE), size, TEST_LOCATION);
184
185   END_TEST;
186 }
187
188 namespace DirectRenderingCode
189 {
190 // Internal callback function
191 void glInit(Dali::RenderCallbackInput& input)
192 {
193 }
194
195 int glRenderFrame(Dali::RenderCallbackInput& input)
196 {
197   static unsigned int retFlag = 0;
198   return retFlag++;
199 }
200
201 int gBoundTextureCount = 0;
202
203 int glRenderFrameWithTextures(Dali::RenderCallbackInput& input)
204 {
205   gBoundTextureCount = input.textureBindings.size();
206   return 1;
207 }
208
209 void glTerminate(Dali::RenderCallbackInput& input)
210 {
211 }
212
213 // Internal callback function
214 void glInitMT(Dali::RenderCallbackInput& input)
215 {
216 }
217
218 int gDRFramesRendered = 0;
219
220 int glRenderFrameMT(Dali::RenderCallbackInput& input)
221 {
222   gDRFramesRendered++;
223   return 1;
224 }
225
226 void glTerminateMT(Dali::RenderCallbackInput& input)
227 {
228 }
229
230 void resizeCB(Vector2 size)
231 {
232 }
233
234 } // namespace DirectRenderingCode
235
236 int UtcDaliGlViewDirectRenderingRegisterGlCallbacksN(void)
237 {
238   ToolkitTestApplication application;
239   tet_infoline("UtcDaliGlViewDirectRenderingRegisterGlCallbacksN");
240   GlView view;
241
242   try
243   {
244     view.RegisterGlCallbacks(Dali::MakeCallback(DirectRenderingCode::glInit), Dali::MakeCallback(DirectRenderingCode::glRenderFrame), Dali::MakeCallback(DirectRenderingCode::glTerminate));
245     DALI_TEST_CHECK(false);
246   }
247   catch(...)
248   {
249     DALI_TEST_CHECK(true);
250   }
251   END_TEST;
252 }
253
254 int UtcDaliGlViewDirectRenderingSetResizeCallbackN(void)
255 {
256   ToolkitTestApplication application;
257   tet_infoline("UtcDaliGlViewDirectRenderingSetResizeCallback");
258   GlView view;
259
260   try
261   {
262     view.SetResizeCallback(Dali::MakeCallback(DirectRenderingCode::resizeCB));
263     DALI_TEST_CHECK(false);
264   }
265   catch(...)
266   {
267     DALI_TEST_CHECK(true);
268   }
269   END_TEST;
270 }
271
272 int UtcDaliGlViewDirectRenderingRenderOnce(void)
273 {
274   ToolkitTestApplication application;
275   tet_infoline("UtcDaliGlViewDirectRenderingRenderOnce");
276   GlView view = Toolkit::GlView::New(GlView::BackendMode::DIRECT_RENDERING, GlView::ColorFormat::RGB888);
277
278   try
279   {
280     view.RenderOnce();
281     DALI_TEST_CHECK(true);
282   }
283   catch(...)
284   {
285     DALI_TEST_CHECK(false);
286   }
287   END_TEST;
288 }
289
290 int UtcDaliGlViewDirectRenderingWindowVisibilityChanged(void)
291 {
292   ToolkitTestApplication application;
293   tet_infoline("UtcDaliGlViewDirectRenderingWindowVisibilityChanged");
294   GlView view = Toolkit::GlView::New(GlView::BackendMode::DIRECT_RENDERING, GlView::ColorFormat::RGB888);
295   application.GetScene().Add(view);
296   view.SetRenderingMode(GlView::RenderingMode::CONTINUOUS);
297   view.SetGraphicsConfig(true, true, 0, GlView::GraphicsApiVersion::GLES_VERSION_2_0);
298   view.RegisterGlCallbacks(Dali::MakeCallback(DirectRenderingCode::glInit), Dali::MakeCallback(DirectRenderingCode::glRenderFrame), Dali::MakeCallback(DirectRenderingCode::glTerminate));
299   view.SetResizeCallback(Dali::MakeCallback(DirectRenderingCode::resizeCB));
300
301   application.SendNotification();
302   application.Render();
303
304   Window window = DevelWindow::Get(view);
305   window.Hide();
306   application.SendNotification();
307   application.Render();
308
309   DALI_TEST_CHECK(true);
310   END_TEST;
311 }
312
313 int UtcDaliGlViewDirectRenderingOnScene(void)
314 {
315   ToolkitTestApplication application;
316
317   GlView view = Toolkit::GlView::New(GlView::BackendMode::DIRECT_RENDERING, GlView::ColorFormat::RGB888);
318
319   //Onscene
320   application.GetScene().Add(view);
321   view.SetRenderingMode(GlView::RenderingMode::CONTINUOUS);
322   view.SetGraphicsConfig(true, true, 0, GlView::GraphicsApiVersion::GLES_VERSION_2_0);
323   view.RegisterGlCallbacks(Dali::MakeCallback(DirectRenderingCode::glInit), Dali::MakeCallback(DirectRenderingCode::glRenderFrame), Dali::MakeCallback(DirectRenderingCode::glTerminate));
324
325   application.SendNotification();
326   application.Render();
327
328   //Offscene
329   application.GetScene().Remove(view);
330
331   application.SendNotification();
332   application.Render();
333
334   DALI_TEST_CHECK(true);
335   END_TEST;
336 }
337
338 int UtcDaliGlViewDirectRenderingControlVisibilityChanged(void)
339 {
340   ToolkitTestApplication application;
341
342   GlView view = Toolkit::GlView::New(GlView::BackendMode::DIRECT_RENDERING, GlView::ColorFormat::RGB888);
343   application.GetScene().Add(view);
344
345   application.SendNotification();
346   application.Render();
347
348   view.SetProperty(Actor::Property::VISIBLE, false);
349   application.SendNotification();
350   application.Render();
351   DALI_TEST_CHECK(view.GetCurrentProperty<bool>(Actor::Property::VISIBLE) == false);
352
353   view.SetProperty(Actor::Property::VISIBLE, true);
354   application.SendNotification();
355   application.Render();
356   DALI_TEST_CHECK(view.GetCurrentProperty<bool>(Actor::Property::VISIBLE) == true);
357
358   END_TEST;
359 }
360
361 int UtcDaliGlViewDirectRenderingResize(void)
362 {
363   ToolkitTestApplication application;
364   tet_infoline("UtcDaliGlViewDirectRenderingResize");
365   GlView view = Toolkit::GlView::New(GlView::BackendMode::DIRECT_RENDERING, GlView::ColorFormat::RGB888);
366
367   application.GetScene().Add(view);
368   view.SetGraphicsConfig(true, true, 0, GlView::GraphicsApiVersion::GLES_VERSION_2_0);
369   view.RegisterGlCallbacks(Dali::MakeCallback(DirectRenderingCode::glInit), Dali::MakeCallback(DirectRenderingCode::glRenderFrame), Dali::MakeCallback(DirectRenderingCode::glTerminate));
370   view.SetResizeCallback(Dali::MakeCallback(DirectRenderingCode::resizeCB));
371   view.SetProperty(Actor::Property::ANCHOR_POINT, AnchorPoint::TOP_LEFT);
372   view.SetProperty(Actor::Property::SIZE, Vector2(360.0f, 360.0f));
373
374   application.SendNotification();
375   application.Render();
376
377   //To GlViewRenderThread can recognize Resize signal the main thread have to sleep.
378   std::this_thread::sleep_for(std::chrono::milliseconds(100));
379
380   application.SendNotification();
381   application.Render();
382
383   DALI_TEST_CHECK(true);
384   END_TEST;
385 }
386
387 int UtcDaliGlViewDirectRenderingDirectResize(void)
388 {
389   ToolkitTestApplication application;
390   tet_infoline("UtcDaliGlViewDirectRenderingResize");
391   GlView view = Toolkit::GlView::New(GlView::BackendMode::UNSAFE_DIRECT_RENDERING, GlView::ColorFormat::RGB888);
392
393   application.GetScene().Add(view);
394   view.SetGraphicsConfig(true, true, 0, GlView::GraphicsApiVersion::GLES_VERSION_2_0);
395   view.RegisterGlCallbacks(Dali::MakeCallback(DirectRenderingCode::glInit), Dali::MakeCallback(DirectRenderingCode::glRenderFrame), Dali::MakeCallback(DirectRenderingCode::glTerminate));
396   view.SetResizeCallback(Dali::MakeCallback(DirectRenderingCode::resizeCB));
397   view.SetProperty(Actor::Property::ANCHOR_POINT, AnchorPoint::TOP_LEFT);
398   view.SetProperty(Actor::Property::SIZE, Vector2(360.0f, 360.0f));
399
400   application.SendNotification();
401   application.Render();
402
403   //To GlViewRenderThread can recognize Resize signal the main thread have to sleep.
404   std::this_thread::sleep_for(std::chrono::milliseconds(100));
405
406   application.SendNotification();
407   application.Render();
408
409   DALI_TEST_CHECK(true);
410   END_TEST;
411 }
412
413 int UtcDaliGlViewDirectRenderingTerminateCallback(void)
414 {
415   ToolkitTestApplication application;
416   tet_infoline("UtcDaliGlViewDirectRenderingTerminateCallback");
417   GlView view = Toolkit::GlView::New(GlView::BackendMode::DIRECT_RENDERING, GlView::ColorFormat::RGB888);
418
419   application.GetScene().Add(view);
420   view.SetGraphicsConfig(true, true, 0, GlView::GraphicsApiVersion::GLES_VERSION_2_0);
421   view.RegisterGlCallbacks(Dali::MakeCallback(DirectRenderingCode::glInit), Dali::MakeCallback(DirectRenderingCode::glRenderFrame), Dali::MakeCallback(DirectRenderingCode::glTerminate));
422   view.SetResizeCallback(Dali::MakeCallback(DirectRenderingCode::resizeCB));
423   view.SetProperty(Actor::Property::ANCHOR_POINT, AnchorPoint::TOP_LEFT);
424   view.SetProperty(Actor::Property::SIZE, Vector2(360.0f, 360.0f));
425
426   application.SendNotification();
427   application.Render();
428
429   //To GlViewRenderThread can recognize Resize signal the main thread have to sleep.
430   std::this_thread::sleep_for(std::chrono::milliseconds(100));
431
432   application.SendNotification();
433   application.Render();
434
435   DALI_TEST_CHECK(true);
436   END_TEST;
437 }
438
439 int UtcDaliGlViewDirectRenderingTextureBinding(void)
440 {
441   ToolkitTestApplication application;
442
443   GlView view = Toolkit::GlView::New(GlView::BackendMode::DIRECT_RENDERING, GlView::ColorFormat::RGB888);
444
445   view.SetRenderingMode(GlView::RenderingMode::CONTINUOUS);
446   view.SetGraphicsConfig(true, true, 0, GlView::GraphicsApiVersion::GLES_VERSION_2_0);
447   view.RegisterGlCallbacks(Dali::MakeCallback(DirectRenderingCode::glInit), Dali::MakeCallback(DirectRenderingCode::glRenderFrameWithTextures), Dali::MakeCallback(DirectRenderingCode::glTerminate));
448   view.SetProperty(Actor::Property::ANCHOR_POINT, AnchorPoint::TOP_LEFT);
449   view.SetProperty(Actor::Property::SIZE, Vector2(360.0f, 360.0f));
450
451   // Set size on the actor (half the window size to show that glClear() and scissor test work together)
452   view.SetProperty(Actor::Property::SIZE, Size(100, 100));
453   view.SetProperty(Actor::Property::POSITION, Vector2(0, 0));
454
455   application.GetScene().Add(view);
456
457   // Prepare texture 1
458   Texture   texture1   = Texture::New(Dali::TextureType::TEXTURE_2D, Pixel::Format::RGBA8888, 512, 512);
459   auto*     data1      = reinterpret_cast<uint8_t*>(malloc(512 * 512 * 4));
460   PixelData pixelData1 = PixelData::New(data1, 512 * 512 * 4, 512, 512, Pixel::Format::RGBA8888, PixelData::ReleaseFunction::FREE);
461   texture1.Upload(pixelData1);
462
463   // Prepare texture 2
464   Texture   texture2   = Texture::New(Dali::TextureType::TEXTURE_2D, Pixel::Format::RGBA8888, 512, 512);
465   auto*     data2      = reinterpret_cast<uint8_t*>(malloc(512 * 512 * 4));
466   PixelData pixelData2 = PixelData::New(data2, 512 * 512 * 4, 512, 512, Pixel::Format::RGBA8888, PixelData::ReleaseFunction::FREE);
467   texture2.Upload(pixelData2);
468
469   std::vector<Texture> texturesToBind;
470   texturesToBind.push_back(texture1);
471   texturesToBind.push_back(texture2);
472
473   view.BindTextureResources(texturesToBind);
474
475   DirectRenderingCode::gBoundTextureCount = 0;
476
477   application.SendNotification();
478   application.Render();
479
480   DALI_TEST_EQUALS(DirectRenderingCode::gBoundTextureCount, texturesToBind.size(), TEST_LOCATION);
481
482   END_TEST;
483 }
484
485 // Positive test case for a method
486 int UtcDaliGlViewDirectRenderingThreadedNew(void)
487 {
488   ToolkitTestApplication application;
489   tet_infoline(" UtcDaliGlViewDirectRenderingThreadedNew");
490   GlView view = GlView::New(GlView::BackendMode::DIRECT_RENDERING_THREADED, GlView::ColorFormat::RGBA8888);
491   DALI_TEST_CHECK(view);
492
493   auto mode1 = view.GetBackendMode();
494
495   DALI_TEST_EQUALS(mode1, GlView::BackendMode::DIRECT_RENDERING_THREADED, TEST_LOCATION);
496
497   END_TEST;
498 }
499
500 int UtcDaliGlViewDirectRenderingThreadedOnScene(void)
501 {
502   ToolkitTestApplication application;
503
504   GlView view = Toolkit::GlView::New(GlView::BackendMode::DIRECT_RENDERING_THREADED, GlView::ColorFormat::RGB888);
505
506   //Onscene
507   application.GetScene().Add(view);
508   view.SetRenderingMode(GlView::RenderingMode::CONTINUOUS);
509   view.SetGraphicsConfig(true, true, 0, GlView::GraphicsApiVersion::GLES_VERSION_3_0);
510   view.RegisterGlCallbacks(Dali::MakeCallback(DirectRenderingCode::glInitMT), Dali::MakeCallback(DirectRenderingCode::glRenderFrameMT), Dali::MakeCallback(DirectRenderingCode::glTerminateMT));
511   view.SetProperty(Actor::Property::ANCHOR_POINT, AnchorPoint::TOP_LEFT);
512   view.SetProperty(Actor::Property::PARENT_ORIGIN, ParentOrigin::TOP_LEFT);
513
514   // Set size on the actor (half the window size to show that glClear() and scissor test work together)
515   view.SetProperty(Actor::Property::SIZE, Size(100, 100));
516   view.SetProperty(Actor::Property::POSITION, Vector2(0, 0));
517
518   while(DirectRenderingCode::gDRFramesRendered < 1)
519   {
520     application.SendNotification();
521     application.Render();
522   }
523   DALI_TEST_CHECK(true);
524   END_TEST;
525 }
526
527 extern "C" bool gDirectRenderingFailCreateShader;
528 extern "C" bool gDirectRenderingFailCreateProgram;
529
530 int UtcDaliGlViewDirectRenderingThreadedOnScene1(void)
531 {
532   ToolkitTestApplication application;
533
534   GlView view = Toolkit::GlView::New(GlView::BackendMode::DIRECT_RENDERING_THREADED, GlView::ColorFormat::RGB888);
535
536   // This test will fail instantiating shaders
537   gDirectRenderingFailCreateShader = true;
538
539   //Onscene
540   application.GetScene().Add(view);
541   view.SetRenderingMode(GlView::RenderingMode::CONTINUOUS);
542   view.SetGraphicsConfig(true, true, 0, GlView::GraphicsApiVersion::GLES_VERSION_3_0);
543   view.RegisterGlCallbacks(Dali::MakeCallback(DirectRenderingCode::glInitMT), Dali::MakeCallback(DirectRenderingCode::glRenderFrameMT), Dali::MakeCallback(DirectRenderingCode::glTerminateMT));
544   view.SetProperty(Actor::Property::ANCHOR_POINT, AnchorPoint::TOP_LEFT);
545   view.SetProperty(Actor::Property::PARENT_ORIGIN, ParentOrigin::TOP_LEFT);
546
547   // Set size on the actor (half the window size to show that glClear() and scissor test work together)
548   view.SetProperty(Actor::Property::SIZE, Size(100, 100));
549   view.SetProperty(Actor::Property::POSITION, Vector2(0, 0));
550
551   while(DirectRenderingCode::gDRFramesRendered < 1)
552   {
553     application.SendNotification();
554     application.Render();
555   }
556   DALI_TEST_CHECK(true);
557   END_TEST;
558 }
559
560 int UtcDaliGlViewDirectRenderingThreadedOnScene2(void)
561 {
562   ToolkitTestApplication application;
563
564   GlView view = Toolkit::GlView::New(GlView::BackendMode::DIRECT_RENDERING_THREADED, GlView::ColorFormat::RGB888);
565
566   // This test will fail instantiating shaders
567   gDirectRenderingFailCreateProgram = true;
568
569   //Onscene
570   application.GetScene().Add(view);
571   view.SetRenderingMode(GlView::RenderingMode::CONTINUOUS);
572   view.SetGraphicsConfig(true, true, 0, GlView::GraphicsApiVersion::GLES_VERSION_3_0);
573   view.RegisterGlCallbacks(Dali::MakeCallback(DirectRenderingCode::glInitMT), Dali::MakeCallback(DirectRenderingCode::glRenderFrameMT), Dali::MakeCallback(DirectRenderingCode::glTerminateMT));
574   view.SetProperty(Actor::Property::ANCHOR_POINT, AnchorPoint::TOP_LEFT);
575   view.SetProperty(Actor::Property::PARENT_ORIGIN, ParentOrigin::TOP_LEFT);
576
577   // Set size on the actor (half the window size to show that glClear() and scissor test work together)
578   view.SetProperty(Actor::Property::SIZE, Size(100, 100));
579   view.SetProperty(Actor::Property::POSITION, Vector2(0, 0));
580
581   while(DirectRenderingCode::gDRFramesRendered < 1)
582   {
583     application.SendNotification();
584     application.Render();
585   }
586   DALI_TEST_CHECK(true);
587   END_TEST;
588 }