Commit dc9c159245d90eed96186fee0058f184e89413b9

Authored by Richard Huang
2 parents 7d758faf 6ebd2b44

[dali_2.2.11] Merge branch 'devel/master'

Change-Id: I3fadb7ad5dc4209a94ce4cb1b5369158835f4384
examples/direct-rendering/direct-rendering-example.cpp
1 /* 1 /*
2 - * Copyright (c) 2022 Samsung Electronics Co., Ltd. 2 + * Copyright (c) 2023 Samsung Electronics Co., Ltd.
3 * 3 *
4 * Licensed under the Apache License, Version 2.0 (the "License"); 4 * Licensed under the Apache License, Version 2.0 (the "License");
5 * you may not use this file except in compliance with the License. 5 * you may not use this file except in compliance with the License.
@@ -46,32 +46,32 @@ const uint32_t DR_THREAD_ENABLED = GetEnvInt("DR_THREAD_ENABLED", 0); @@ -46,32 +46,32 @@ const uint32_t DR_THREAD_ENABLED = GetEnvInt("DR_THREAD_ENABLED", 0);
46 */ 46 */
47 const Toolkit::GlView::BackendMode BACKEND_MODE = 47 const Toolkit::GlView::BackendMode BACKEND_MODE =
48 Toolkit::GlView::BackendMode(GetEnvInt("EGL_ENABLED", 0)); 48 Toolkit::GlView::BackendMode(GetEnvInt("EGL_ENABLED", 0));
49 -} 49 +} // namespace
50 50
51 /** 51 /**
52 * RenderView encapsulates single GLView callback and its parameters. 52 * RenderView encapsulates single GLView callback and its parameters.
53 */ 53 */
54 struct RenderView 54 struct RenderView
55 { 55 {
56 - explicit RenderView( const Dali::Window& window ) 56 + explicit RenderView(const Dali::Window& window)
57 { 57 {
58 mWindow = window; 58 mWindow = window;
59 } 59 }
60 60
61 - int Create(const Vector2& pos, Toolkit::GlView::BackendMode mode ) 61 + int Create(const Vector2& pos, Toolkit::GlView::BackendMode mode)
62 { 62 {
63 auto w = mWindow.GetSize().GetWidth(); 63 auto w = mWindow.GetSize().GetWidth();
64 auto h = mWindow.GetSize().GetHeight(); 64 auto h = mWindow.GetSize().GetHeight();
65 65
66 NativeRenderer::CreateInfo info{}; 66 NativeRenderer::CreateInfo info{};
67 info.clearColor = {0, 0, 0, 0}; 67 info.clearColor = {0, 0, 0, 0};
68 - info.name = "DR";  
69 - info.offscreen = (mode == Toolkit::GlView::BackendMode::EGL_IMAGE_OFFSCREEN_RENDERING || DR_THREAD_ENABLED);  
70 - info.viewportX = 0;  
71 - info.viewportY = 0;  
72 - info.width = w;  
73 - info.height = h;  
74 - info.threaded = (mode != Toolkit::GlView::BackendMode::EGL_IMAGE_OFFSCREEN_RENDERING) && (DR_THREAD_ENABLED); 68 + info.name = "DR";
  69 + info.offscreen = (mode == Toolkit::GlView::BackendMode::EGL_IMAGE_OFFSCREEN_RENDERING || DR_THREAD_ENABLED);
  70 + info.viewportX = 0;
  71 + info.viewportY = 0;
  72 + info.width = w;
  73 + info.height = h;
  74 + info.threaded = (mode != Toolkit::GlView::BackendMode::EGL_IMAGE_OFFSCREEN_RENDERING) && (DR_THREAD_ENABLED);
75 75
76 // Enable threaded rendering 76 // Enable threaded rendering
77 if(info.threaded && mode == Dali::Toolkit::GlView::BackendMode::DIRECT_RENDERING) 77 if(info.threaded && mode == Dali::Toolkit::GlView::BackendMode::DIRECT_RENDERING)
@@ -103,9 +103,8 @@ struct RenderView @@ -103,9 +103,8 @@ struct RenderView
103 return 0; 103 return 0;
104 } 104 }
105 105
106 -  
107 - Dali::Window mWindow;  
108 - Toolkit::GlView mGlView; 106 + Dali::Window mWindow;
  107 + Toolkit::GlView mGlView;
109 std::unique_ptr<NativeRenderer> mRenderer{}; 108 std::unique_ptr<NativeRenderer> mRenderer{};
110 109
111 CallbackBase* mGlInitCallback{}; 110 CallbackBase* mGlInitCallback{};
@@ -119,9 +118,8 @@ struct RenderView @@ -119,9 +118,8 @@ struct RenderView
119 class DirectRenderingExampleController : public ConnectionTracker 118 class DirectRenderingExampleController : public ConnectionTracker
120 { 119 {
121 public: 120 public:
122 -  
123 explicit DirectRenderingExampleController(Application& application) 121 explicit DirectRenderingExampleController(Application& application)
124 - : mApplication(application) 122 + : mApplication(application)
125 { 123 {
126 // Connect to the Application's Init signal 124 // Connect to the Application's Init signal
127 mApplication.InitSignal().Connect(this, &DirectRenderingExampleController::Create); 125 mApplication.InitSignal().Connect(this, &DirectRenderingExampleController::Create);
@@ -135,8 +133,11 @@ public: @@ -135,8 +133,11 @@ public:
135 Dali::Window window = application.GetWindow(); 133 Dali::Window window = application.GetWindow();
136 window.SetBackgroundColor(Color::WHITE); 134 window.SetBackgroundColor(Color::WHITE);
137 135
  136 + window.KeyEventSignal().Connect(this, &DirectRenderingExampleController::OnKeyEvent);
  137 + window.GetRootLayer().TouchedSignal().Connect(this, &DirectRenderingExampleController::OnTouch);
  138 +
138 mDRView = std::make_unique<RenderView>(window); 139 mDRView = std::make_unique<RenderView>(window);
139 - mDRView->Create( Vector2::ZERO, BACKEND_MODE ); 140 + mDRView->Create(Vector2::ZERO, BACKEND_MODE);
140 } 141 }
141 142
142 bool OnTouch(Actor actor, const TouchEvent& touch) 143 bool OnTouch(Actor actor, const TouchEvent& touch)
@@ -158,13 +159,13 @@ public: @@ -158,13 +159,13 @@ public:
158 } 159 }
159 160
160 private: 161 private:
161 - Application& mApplication; 162 + Application& mApplication;
162 std::unique_ptr<RenderView> mDRView; 163 std::unique_ptr<RenderView> mDRView;
163 }; 164 };
164 165
165 int DALI_EXPORT_API main(int argc, char** argv) 166 int DALI_EXPORT_API main(int argc, char** argv)
166 { 167 {
167 - Application application = Application::New(&argc, &argv); 168 + Application application = Application::New(&argc, &argv);
168 DirectRenderingExampleController test(application); 169 DirectRenderingExampleController test(application);
169 application.MainLoop(); 170 application.MainLoop();
170 return 0; 171 return 0;
examples/perf-view-creation/perf-view-creation-example.cpp
@@ -451,7 +451,7 @@ public: @@ -451,7 +451,7 @@ public:
451 mCreatingControlList.pop_front(); 451 mCreatingControlList.pop_front();
452 452
453 // Dereference timer safety 453 // Dereference timer safety
454 - if(mTimerList.empty()) 454 + if(!mTimerList.empty())
455 { 455 {
456 mTimerList.pop_front(); 456 mTimerList.pop_front();
457 } 457 }
examples/scene3d-model/scene3d-model-example.cpp
@@ -25,6 +25,7 @@ @@ -25,6 +25,7 @@
25 #include <cstring> 25 #include <cstring>
26 26
27 #include <dali-scene3d/public-api/controls/model/model.h> 27 #include <dali-scene3d/public-api/controls/model/model.h>
  28 +#include <dali-scene3d/public-api/loader/environment-map-loader.h>
28 29
29 using namespace Dali; 30 using namespace Dali;
30 using namespace Dali::Toolkit; 31 using namespace Dali::Toolkit;
@@ -376,15 +377,9 @@ public: @@ -376,15 +377,9 @@ public:
376 mSkyboxGeometry.AddVertexBuffer(vertexBuffer); 377 mSkyboxGeometry.AddVertexBuffer(vertexBuffer);
377 mSkyboxGeometry.SetType(Geometry::TRIANGLES); 378 mSkyboxGeometry.SetType(Geometry::TRIANGLES);
378 379
379 - // Diffuse Cube Map  
380 - Devel::PixelBuffer diffusePixelBuffer = LoadImageFromFile(uri_cube_diffuse_texture);  
381 - int32_t diffuseFaceSize = diffusePixelBuffer.GetWidth() / 4;  
382 - Texture texture = Texture::New(TextureType::TEXTURE_CUBE, diffusePixelBuffer.GetPixelFormat(), diffuseFaceSize, diffuseFaceSize);  
383 - for(int32_t i = 0; i < 6; ++i)  
384 - {  
385 - UploadTextureFace(texture, diffusePixelBuffer, i);  
386 - }  
387 - texture.GenerateMipmaps(); 380 + Dali::Scene3D::Loader::EnvironmentMapData environmentMapData;
  381 + Dali::Scene3D::Loader::LoadEnvironmentMap(uri_cube_diffuse_texture, environmentMapData);
  382 + Texture texture = environmentMapData.GetTexture();
388 383
389 mSkyboxTextures = TextureSet::New(); 384 mSkyboxTextures = TextureSet::New();
390 mSkyboxTextures.SetTexture(0, texture); 385 mSkyboxTextures.SetTexture(0, texture);
packaging/com.samsung.dali-demo.spec
@@ -2,7 +2,7 @@ @@ -2,7 +2,7 @@
2 2
3 Name: com.samsung.dali-demo 3 Name: com.samsung.dali-demo
4 Summary: The OpenGLES Canvas Core Demo 4 Summary: The OpenGLES Canvas Core Demo
5 -Version: 2.2.10 5 +Version: 2.2.11
6 Release: 1 6 Release: 1
7 Group: System/Libraries 7 Group: System/Libraries
8 License: Apache-2.0 8 License: Apache-2.0