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 4 * Licensed under the Apache License, Version 2.0 (the "License");
5 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 46 */
47 47 const Toolkit::GlView::BackendMode BACKEND_MODE =
48 48 Toolkit::GlView::BackendMode(GetEnvInt("EGL_ENABLED", 0));
49   -}
  49 +} // namespace
50 50  
51 51 /**
52 52 * RenderView encapsulates single GLView callback and its parameters.
53 53 */
54 54 struct RenderView
55 55 {
56   - explicit RenderView( const Dali::Window& window )
  56 + explicit RenderView(const Dali::Window& window)
57 57 {
58 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 63 auto w = mWindow.GetSize().GetWidth();
64 64 auto h = mWindow.GetSize().GetHeight();
65 65  
66 66 NativeRenderer::CreateInfo info{};
67 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 76 // Enable threaded rendering
77 77 if(info.threaded && mode == Dali::Toolkit::GlView::BackendMode::DIRECT_RENDERING)
... ... @@ -103,9 +103,8 @@ struct RenderView
103 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 108 std::unique_ptr<NativeRenderer> mRenderer{};
110 109  
111 110 CallbackBase* mGlInitCallback{};
... ... @@ -119,9 +118,8 @@ struct RenderView
119 118 class DirectRenderingExampleController : public ConnectionTracker
120 119 {
121 120 public:
122   -
123 121 explicit DirectRenderingExampleController(Application& application)
124   - : mApplication(application)
  122 + : mApplication(application)
125 123 {
126 124 // Connect to the Application's Init signal
127 125 mApplication.InitSignal().Connect(this, &DirectRenderingExampleController::Create);
... ... @@ -135,8 +133,11 @@ public:
135 133 Dali::Window window = application.GetWindow();
136 134 window.SetBackgroundColor(Color::WHITE);
137 135  
  136 + window.KeyEventSignal().Connect(this, &DirectRenderingExampleController::OnKeyEvent);
  137 + window.GetRootLayer().TouchedSignal().Connect(this, &DirectRenderingExampleController::OnTouch);
  138 +
138 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 143 bool OnTouch(Actor actor, const TouchEvent& touch)
... ... @@ -158,13 +159,13 @@ public:
158 159 }
159 160  
160 161 private:
161   - Application& mApplication;
  162 + Application& mApplication;
162 163 std::unique_ptr<RenderView> mDRView;
163 164 };
164 165  
165 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 169 DirectRenderingExampleController test(application);
169 170 application.MainLoop();
170 171 return 0;
... ...
examples/perf-view-creation/perf-view-creation-example.cpp
... ... @@ -451,7 +451,7 @@ public:
451 451 mCreatingControlList.pop_front();
452 452  
453 453 // Dereference timer safety
454   - if(mTimerList.empty())
  454 + if(!mTimerList.empty())
455 455 {
456 456 mTimerList.pop_front();
457 457 }
... ...
examples/scene3d-model/scene3d-model-example.cpp
... ... @@ -25,6 +25,7 @@
25 25 #include <cstring>
26 26  
27 27 #include <dali-scene3d/public-api/controls/model/model.h>
  28 +#include <dali-scene3d/public-api/loader/environment-map-loader.h>
28 29  
29 30 using namespace Dali;
30 31 using namespace Dali::Toolkit;
... ... @@ -376,15 +377,9 @@ public:
376 377 mSkyboxGeometry.AddVertexBuffer(vertexBuffer);
377 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 384 mSkyboxTextures = TextureSet::New();
390 385 mSkyboxTextures.SetTexture(0, texture);
... ...
packaging/com.samsung.dali-demo.spec
... ... @@ -2,7 +2,7 @@
2 2  
3 3 Name: com.samsung.dali-demo
4 4 Summary: The OpenGLES Canvas Core Demo
5   -Version: 2.2.10
  5 +Version: 2.2.11
6 6 Release: 1
7 7 Group: System/Libraries
8 8 License: Apache-2.0
... ...