EGL Cleanup 58/307958/7
authorDavid Steele <david.steele@samsung.com>
Wed, 13 Mar 2024 09:36:59 +0000 (09:36 +0000)
committerDavid Steele <david.steele@samsung.com>
Mon, 8 Jul 2024 10:07:25 +0000 (11:07 +0100)
Removes unused egl headers
Expand EGL interface to be more useful.
 (With an eye to creating an equivalent Vulkan interface)
Minor fixup for GLES interface vs abstraction

Change-Id: I42bbef2d94c62b3be58a0d06e648b837ec27659a

18 files changed:
build/tizen/module-list.cmake
dali/integration-api/adaptor-framework/egl-interface.h
dali/integration-api/adaptor-framework/scene-holder-impl.cpp
dali/internal/adaptor/common/adaptor-impl.cpp
dali/internal/adaptor/common/adaptor-internal-services.h
dali/internal/adaptor/common/combined-update-render-controller.cpp
dali/internal/graphics/gles-impl/gles-context.cpp
dali/internal/graphics/gles/egl-graphics.cpp
dali/internal/graphics/gles/egl-graphics.h
dali/internal/graphics/gles/egl-implementation.cpp
dali/internal/graphics/gles/egl-implementation.h
dali/internal/imaging/android/native-image-source-queue-impl-android.cpp
dali/internal/imaging/android/native-image-source-queue-impl-android.h
dali/internal/imaging/macos/native-image-source-impl-mac.cpp
dali/internal/imaging/macos/native-image-source-impl-mac.h
dali/internal/system/common/capture-impl.cpp
dali/internal/window-system/common/window-impl.cpp
dali/internal/window-system/common/window-render-surface.cpp

index c345546858a26ff6dbe6c885e39b3b6644e426e7..465c4ab29a754148ae2df04c4d1569b740446a4e 100644 (file)
@@ -64,92 +64,6 @@ include( ${ADAPTOR_ROOT}/dali/internal/trace/file.list )
 SET( adaptor_thread_dir ${ADAPTOR_ROOT}/dali/internal/thread )
 include( ${ADAPTOR_ROOT}/dali/internal/thread/file.list )
 
-SET( adaptor_vector_animation_dir ${ADAPTOR_ROOT}/dali/internal/vector-animation )
-include( ${ADAPTOR_ROOT}/dali/internal/vector-animation/file.list )
-
-SET( adaptor_vector_image_dir ${ADAPTOR_ROOT}/dali/internal/vector-image )
-include( ${ADAPTOR_ROOT}/dali/internal/vector-image/file.list )
-
-SET( adaptor_canvas_renderer_dir ${ADAPTOR_ROOT}/dali/internal/canvas-renderer )
-include( ${ADAPTOR_ROOT}/dali/internal/canvas-renderer/file.list )
-
-SET( adaptor_public_api_dir ${ADAPTOR_ROOT}/dali/public-api )
-include( ${ADAPTOR_ROOT}/dali/public-api/file.list )
-
-SET( adaptor_dali_header_dir ${ADAPTOR_ROOT}/dali )
-include( ${ADAPTOR_ROOT}/dali/file.list )
-
-SET( adaptor_devel_api_dir ${ADAPTOR_ROOT}/dali/devel-api )
-include( ${ADAPTOR_ROOT}/dali/devel-api/file.list )
-
-SET( adaptor_integration_api_dir ${ADAPTOR_ROOT}/dali/integration-api )
-include( ${ADAPTOR_ROOT}/dali/integration-api/file.list )
-
-SET( adaptor_thirdparty_dir ${ADAPTOR_ROOT}/third-party )
-include( ${ADAPTOR_ROOT}/third-party/file.list )
-SET( adaptor_accessibility_dir ${ADAPTOR_ROOT}/dali/internal/accessibility )
-include( ${ADAPTOR_ROOT}/dali/internal/accessibility/file.list )
-
-SET( adaptor_adaptor_dir ${ADAPTOR_ROOT}/dali/internal/adaptor )
-include( ${ADAPTOR_ROOT}/dali/internal/adaptor/file.list )
-
-SET( adaptor_clipboard_dir ${ADAPTOR_ROOT}/dali/internal/clipboard )
-include( ${ADAPTOR_ROOT}/dali/internal/clipboard/file.list )
-
-SET( adaptor_drag_and_drop_dir ${ADAPTOR_ROOT}/dali/internal/drag-and-drop )
-include( ${ADAPTOR_ROOT}/dali/internal/drag-and-drop/file.list )
-
-SET( adaptor_framework_dir ${ADAPTOR_ROOT}/dali/internal/adaptor-framework )
-include( ${ADAPTOR_ROOT}/dali/internal/adaptor-framework/file.list )
-
-SET( adaptor_graphics_dir ${ADAPTOR_ROOT}/dali/internal/graphics )
-include( ${ADAPTOR_ROOT}/dali/internal/graphics/file.list )
-
-SET( adaptor_haptics_dir ${ADAPTOR_ROOT}/dali/internal/haptics )
-include( ${ADAPTOR_ROOT}/dali/internal/haptics/file.list )
-
-SET( adaptor_imaging_dir ${ADAPTOR_ROOT}/dali/internal/imaging )
-include( ${ADAPTOR_ROOT}/dali/internal/imaging/file.list )
-
-SET( adaptor_input_dir ${ADAPTOR_ROOT}/dali/internal/input )
-include( ${ADAPTOR_ROOT}/dali/internal/input/file.list )
-
-SET( adaptor_legacy_dir ${ADAPTOR_ROOT}/dali/internal/legacy )
-include( ${ADAPTOR_ROOT}/dali/internal/legacy/file.list )
-
-SET( adaptor_network_dir ${ADAPTOR_ROOT}/dali/internal/network )
-include( ${ADAPTOR_ROOT}/dali/internal/network/file.list )
-
-SET( adaptor_sensor_dir ${ADAPTOR_ROOT}/dali/internal/sensor )
-include( ${ADAPTOR_ROOT}/dali/internal/sensor/file.list )
-
-SET( adaptor_styling_dir ${ADAPTOR_ROOT}/dali/internal/styling )
-include( ${ADAPTOR_ROOT}/dali/internal/styling/file.list )
-
-SET( adaptor_system_dir ${ADAPTOR_ROOT}/dali/internal/system )
-include( ${ADAPTOR_ROOT}/dali/internal/system/file.list )
-
-SET( adaptor_text_dir ${ADAPTOR_ROOT}/dali/internal/text )
-include( ${ADAPTOR_ROOT}/dali/internal/text/file.list )
-
-SET( adaptor_video_dir ${ADAPTOR_ROOT}/dali/internal/video )
-include( ${ADAPTOR_ROOT}/dali/internal/video/file.list )
-
-SET( adaptor_camera_dir ${ADAPTOR_ROOT}/dali/internal/camera )
-include( ${ADAPTOR_ROOT}/dali/internal/camera/file.list )
-
-SET( adaptor_web_engine_dir ${ADAPTOR_ROOT}/dali/internal/web-engine )
-include( ${ADAPTOR_ROOT}/dali/internal/web-engine/file.list )
-
-SET( adaptor_window_system_dir ${ADAPTOR_ROOT}/dali/internal/window-system )
-include( ${ADAPTOR_ROOT}/dali/internal/window-system/file.list )
-
-SET( adaptor_trace_dir ${ADAPTOR_ROOT}/dali/internal/trace )
-include( ${ADAPTOR_ROOT}/dali/internal/trace/file.list )
-
-SET( adaptor_thread_dir ${ADAPTOR_ROOT}/dali/internal/thread )
-include( ${ADAPTOR_ROOT}/dali/internal/thread/file.list )
-
 SET( adaptor_addons_dir ${ADAPTOR_ROOT}/dali/internal/addons )
 include( ${ADAPTOR_ROOT}/dali/internal/addons/file.list )
 
@@ -176,4 +90,3 @@ include( ${ADAPTOR_ROOT}/dali/integration-api/file.list )
 
 SET( adaptor_thirdparty_dir ${ADAPTOR_ROOT}/third-party )
 include( ${ADAPTOR_ROOT}/third-party/file.list )
-
index 5c33c6fab6dfff520e775265b60d9731aad76889..2a83449969b00b34bad415ecef0e18879431ef1c 100644 (file)
@@ -2,7 +2,7 @@
 #define DALI_INTEGRATION_EGL_INTERFACE_H
 
 /*
- * Copyright (c) 2020 Samsung Electronics Co., Ltd.
+ * Copyright (c) 2024 Samsung Electronics Co., Ltd.
  *
  * Licensed under the Apache License, Version 2.0 (the "License");
  * you may not use this file except in compliance with the License.
@@ -20,6 +20,8 @@
 
 // INTERNAL INCLUDES
 #include <dali/internal/graphics/common/egl-include.h>
+#include <dali/public-api/common/vector-wrapper.h>
+#include <dali/public-api/math/rect.h>
 
 namespace Dali
 {
@@ -35,12 +37,44 @@ enum ColorDepth
 class EglInterface
 {
 public:
+  /**
+   * Choose config of egl
+   * @param isWindowType whether the config for window or pixmap
+   * @param colorDepth Bit per pixel value (ex. 32 or 24)
+   * @return true if the eglChooseConfig is succeed.
+   */
+  virtual bool ChooseConfig(bool isWindowType, ColorDepth depth) = 0;
+
   /**
     * Create the OpenGL context.
     * @return true if successful
     */
   virtual bool CreateContext() = 0;
 
+  /**
+    * Create the OpenGL context for the window.
+    * @return true if successful
+   */
+  virtual bool CreateWindowContext(EGLContext& mEglContext) = 0;
+
+  /**
+    * Create an OpenGL surface using a window
+    * @param window The window to create the surface on
+    * @param colorDepth Bit per pixel value (ex. 32 or 24)
+    * @return Handle to an on-screen EGL window surface (the requester has an ownership of this egl surface)
+   */
+  virtual EGLSurface CreateSurfaceWindow(EGLNativeWindowType window, ColorDepth depth) = 0;
+
+  /**
+    * Destroy the OpenGL context.
+   */
+  virtual void DestroyContext(EGLContext& eglContext) = 0;
+
+  /**
+    * Destroy the OpenGL surface.
+   */
+  virtual void DestroySurface(EGLSurface& eglSurface) = 0;
+
   /**
    * Make the OpenGL context current
    */
@@ -51,11 +85,40 @@ public:
    */
   virtual void TerminateGles() = 0;
 
+  /**
+   * Replaces the render surface
+   * @param[in] window, the window to create the new surface on
+   * @return true if the context was lost due to a change in display
+   *         between old surface and new surface
+   */
+  virtual bool ReplaceSurfaceWindow(EGLNativeWindowType window, EGLSurface& eglSurface, EGLContext& eglContext) = 0;
+
+  /**
+   * @brief Returns whether the partial update is required.
+   * @return true if the partial update is required.
+   */
+  virtual bool IsPartialUpdateRequired() const = 0;
+
+  /**
+   * Gets current back buffer age
+   */
+  virtual int GetBufferAge(EGLSurface& eglSurface) const = 0;
+
+  /**
+   * Performs an OpenGL set damage command with damaged rects
+   */
+  virtual void SetDamageRegion(EGLSurface& eglSurface, std::vector<Rect<int>>& damagedRects) = 0;
+
   /**
    * Performs an OpenGL swap buffers command
    */
   virtual void SwapBuffers(EGLSurface& eglSurface) = 0;
 
+  /**
+   * Performs an OpenGL swap buffers command
+   */
+  virtual void SwapBuffers(EGLSurface& eglSurface, const std::vector<Rect<int>>& damagedRects) = 0;
+
   /**
    * Performs an OpenGL copy buffers command
    */
index d5e1cf17c9d14dd77cade69d424fdf34bb25d5c5..c2d98f4d1201d78edeb8ad436350c5ff92045cb4 100644 (file)
@@ -33,7 +33,6 @@
 // INTERNAL INCLUDES
 #include <dali/internal/adaptor/common/adaptor-impl.h>
 #include <dali/internal/adaptor/common/lifecycle-observer.h>
-#include <dali/internal/graphics/gles/egl-graphics.h>
 #include <dali/internal/input/common/key-impl.h>
 #include <dali/internal/input/common/physical-keyboard-impl.h>
 #include <dali/internal/system/common/time-service.h>
index 1d73ef7e03965cac847e763659e37ea8f3aeafc6..36bcec2dfdbbe4ed662557f2707117238a84c353 100644 (file)
 #include <dali/internal/system/common/thread-controller.h>
 #include <dali/public-api/dali-adaptor-common.h>
 
-#include <dali/internal/graphics/gles/egl-graphics-factory.h>
 #include <dali/internal/graphics/gles/egl-graphics.h>
 
 #include <dali/devel-api/text-abstraction/font-client.h>
 
 #include <dali/internal/accessibility/common/tts-player-impl.h>
-#include <dali/internal/graphics/common/egl-image-extensions.h>
-#include <dali/internal/graphics/gles/egl-sync-implementation.h>
 #include <dali/internal/graphics/gles/gl-implementation.h>
 #include <dali/internal/graphics/gles/gl-proxy-implementation.h>
 #include <dali/internal/system/common/callback-manager.h>
index af75f62ed744efc27fb945f913d0fdbcdc9a1c89..23b0bdfbac75f5e0b66b7537e19434ecdfe99891 100644 (file)
@@ -2,7 +2,7 @@
 #define DALI_INTERNAL_ADAPTOR_INTERNAL_SERVICES_H
 
 /*
- * Copyright (c) 2023 Samsung Electronics Co., Ltd.
+ * Copyright (c) 2024 Samsung Electronics Co., Ltd.
  *
  * Licensed under the Apache License, Version 2.0 (the "License");
  * you may not use this file except in compliance with the License.
@@ -27,7 +27,6 @@
 #include <dali/integration-api/adaptor-framework/render-surface-interface.h>
 #include <dali/integration-api/adaptor-framework/trigger-event-interface.h>
 #include <dali/internal/graphics/common/graphics-interface.h>
-#include <dali/internal/graphics/gles/egl-factory-interface.h>
 #include <dali/internal/network/common/socket-factory-interface.h>
 #include <dali/internal/network/common/trace-interface.h>
 #include <dali/internal/system/common/performance-interface.h>
index 93c7a0eb1d64be6a2315b72d846903b626e7aa69..b3d865772e4361d97c5190f9c8475a7a41ab2abd 100644 (file)
@@ -30,7 +30,6 @@
 #include <dali/internal/adaptor/common/adaptor-internal-services.h>
 #include <dali/internal/adaptor/common/combined-update-render-controller-debug.h>
 #include <dali/internal/graphics/common/graphics-interface.h>
-#include <dali/internal/graphics/gles/egl-graphics.h>
 #include <dali/internal/system/common/environment-options.h>
 #include <dali/internal/system/common/texture-upload-manager-impl.h>
 #include <dali/internal/system/common/time-service.h>
index b7e829be976f354a036d5e0424884285270030e5..382c78f0c1480f1a8697a7998df26adfc225f7bc 100644 (file)
@@ -31,8 +31,8 @@
 #include "gles-graphics-render-target.h"
 #include "gles-texture-dependency-checker.h"
 
-#include <EGL/egl.h>
-#include <EGL/eglext.h>
+#include <dali/internal/graphics/common/egl-include.h>
+
 #include <map>
 #include <unordered_map>
 
@@ -1320,12 +1320,12 @@ void Context::ResetGLESState()
   mImpl->mCurrentUBOBindings.clear();
   mImpl->mCurrentTextureBindings.clear();
   mImpl->mCurrentVertexBufferBindings.clear();
-  mImpl->mCurrentRenderTarget = nullptr;
-  mImpl->mCurrentRenderPass = nullptr;
-  mImpl->mVertexBuffersChanged = true;
+  mImpl->mCurrentRenderTarget       = nullptr;
+  mImpl->mCurrentRenderPass         = nullptr;
+  mImpl->mVertexBuffersChanged      = true;
   mImpl->mCurrentIndexBufferBinding = {};
-  mImpl->mCurrentSamplerBindings = {};
-  mImpl->mProgramVAOCurrentState = 0;
+  mImpl->mCurrentSamplerBindings    = {};
+  mImpl->mProgramVAOCurrentState    = 0;
 
   ClearState();
   mImpl->InitializeGlState();
index 0d46a0c8b8510815adf9c597cc4628c306357a97..4f746521307bc8a889fc3d6355cbf703dc32d96e 100644 (file)
@@ -194,11 +194,6 @@ void EglGraphics::Destroy()
   mGraphicsController.Destroy();
 }
 
-GlImplementation& EglGraphics::GetGlesInterface()
-{
-  return *mGLES;
-}
-
 Integration::GlAbstraction& EglGraphics::GetGlAbstraction() const
 {
   DALI_ASSERT_DEBUG(mGLES && "GLImplementation not created");
index 753629fee1f7abd773248319a1cdac91002a73bd..e1a73b1b524827e47563db605e2e3507f981e4f9 100644 (file)
@@ -114,11 +114,6 @@ public:
    */
   EglInterface& GetEglInterface() const;
 
-  /**
-   * @copydoc Dali::Integration::GlAbstraction& GetGlesInterface()
-   */
-  GlImplementation& GetGlesInterface();
-
   /**
    * Gets the implementation of GlSyncAbstraction for EGL.
    * @return The implementation of GlSyncAbstraction for EGL.
index 644933a6f9a6095518cd3e3c6d625cca9c90d771..889c736e5f505621d48acdc32fd607e111f6cd0e 100644 (file)
@@ -519,11 +519,11 @@ void EglImplementation::SwapBuffers(EGLSurface& eglSurface)
   }
 }
 
-EGLint EglImplementation::GetBufferAge(EGLSurface& eglSurface) const
+int EglImplementation::GetBufferAge(EGLSurface& eglSurface) const
 {
   START_DURATION_CHECK();
 
-  EGLint age = 0;
+  int age = 0;
   eglQuerySurface(mEglDisplay, eglSurface, EGL_BUFFER_AGE_EXT, &age);
   if(age < 0)
   {
index bee38dc9f7db51975ac439ae5abdd7b6c8fad34b..57fdb16a72c6c5ca95a2499b1e087f954289028b 100644 (file)
@@ -2,7 +2,7 @@
 #define DALI_INTERNAL_EGL_IMPLEMENTATION_H
 
 /*
- * Copyright (c) 2023 Samsung Electronics Co., Ltd.
+ * Copyright (c) 2024 Samsung Electronics Co., Ltd.
  *
  * Licensed under the Apache License, Version 2.0 (the "License");
  * you may not use this file except in compliance with the License.
  */
 
 // EXTERNAL INCLUDES
-#include <dali/public-api/common/list-wrapper.h>
-#include <dali/public-api/common/vector-wrapper.h>
-
 #include <dali/integration-api/core-enumerations.h>
 #include <dali/internal/graphics/common/egl-include.h>
 #include <dali/public-api/common/dali-vector.h>
-#include <dali/public-api/common/vector-wrapper.h>
-#include <dali/public-api/math/rect.h>
 
 // INTERNAL INCLUDES
 #include <dali/integration-api/adaptor-framework/egl-interface.h>
@@ -80,17 +75,17 @@ public:
     * Create the OpenGL context for the window.
     * @return true if successful
     */
-  bool CreateWindowContext(EGLContext& mEglContext);
+  bool CreateWindowContext(EGLContext& mEglContext) override;
 
   /**
     * Destroy the OpenGL context.
     */
-  void DestroyContext(EGLContext& eglContext);
+  void DestroyContext(EGLContext& eglContext) override;
 
   /**
     * Destroy the OpenGL surface.
     */
-  void DestroySurface(EGLSurface& eglSurface);
+  void DestroySurface(EGLSurface& eglSurface) override;
 
   /**
    * Make the OpenGL context current
@@ -122,24 +117,24 @@ public:
   bool IsGlesInitialized() const;
 
   /**
-   * Performs an OpenGL swap buffers command
+   * Gets current back buffer age
    */
-  void SwapBuffers(EGLSurface& eglSurface) override;
+  int GetBufferAge(EGLSurface& eglSurface) const override;
 
   /**
-   * Gets current back buffer age
+   * @copydoc EglInterface::SetDamageRegion
    */
-  EGLint GetBufferAge(EGLSurface& eglSurface) const;
+  void SetDamageRegion(EGLSurface& eglSurface, std::vector<Rect<int>>& damagedRects) override;
 
   /**
-   * Performs an OpenGL set damage command with damaged rects
+   * @copydoc EglInterface::SwapBuffers
    */
-  void SetDamageRegion(EGLSurface& eglSurface, std::vector<Rect<int>>& damagedRects);
+  void SwapBuffers(EGLSurface& eglSurface) override;
 
   /**
-   * Performs an OpenGL swap buffers command with damaged rects
+   * @copydoc EglInterface::SwapBuffers
    */
-  virtual void SwapBuffers(EGLSurface& eglSurface, const std::vector<Rect<int>>& damagedRects);
+  void SwapBuffers(EGLSurface& eglSurface, const std::vector<Rect<int>>& damagedRects) override;
 
   /**
    * Performs an OpenGL copy buffers command
@@ -152,20 +147,14 @@ public:
   void WaitGL() override;
 
   /**
-   * Choose config of egl
-   * @param isWindowType whether the config for window or pixmap
-   * @param colorDepth Bit per pixel value (ex. 32 or 24)
-   * @return true if the eglChooseConfig is succeed.
-  */
-  bool ChooseConfig(bool isWindowType, ColorDepth depth);
+   * @copydoc EglInterface::ChooseConfig
+   */
+  bool ChooseConfig(bool isWindowType, ColorDepth depth) override;
 
   /**
-    * Create an OpenGL surface using a window
-    * @param window The window to create the surface on
-    * @param colorDepth Bit per pixel value (ex. 32 or 24)
-    * @return Handle to an on-screen EGL window surface (the requester has an ownership of this egl surface)
-    */
-  EGLSurface CreateSurfaceWindow(EGLNativeWindowType window, ColorDepth depth);
+   * @copydoc EglInterface::CreateSurfaceWindow
+   */
+  EGLSurface CreateSurfaceWindow(EGLNativeWindowType window, ColorDepth depth) override;
 
   /**
    * Create the OpenGL surface using a pixmap
@@ -176,12 +165,9 @@ public:
   EGLSurface CreateSurfacePixmap(EGLNativePixmapType pixmap, ColorDepth depth);
 
   /**
-   * Replaces the render surface
-   * @param[in] window, the window to create the new surface on
-   * @return true if the context was lost due to a change in display
-   *         between old surface and new surface
+   * @copydoc EglInterface::ReplaceSurfaceWindow
    */
-  bool ReplaceSurfaceWindow(EGLNativeWindowType window, EGLSurface& eglSurface, EGLContext& eglContext);
+  bool ReplaceSurfaceWindow(EGLNativeWindowType window, EGLSurface& eglSurface, EGLContext& eglContext) override;
 
   /**
    * Replaces the render surface
@@ -235,7 +221,7 @@ public:
    * @brief Returns whether the partial update is required.
    * @return true if the partial update is required.
    */
-  bool IsPartialUpdateRequired() const;
+  bool IsPartialUpdateRequired() const override;
 
 private:
   Vector<EGLint> mContextAttribs;
index c9f32850e3eb46cb4b9c1d13d18878e8c22afcd2..dbccf4240efbe908e23fbb044767f2f2a3fe31b0 100644 (file)
@@ -1,5 +1,5 @@
 /*
- * Copyright (c) 2023 Samsung Electronics Co., Ltd.
+ * Copyright (c) 2024 Samsung Electronics Co., Ltd.
  *
  * Licensed under the Apache License, Version 2.0 (the "License");
  * you may not use this file except in compliance with the License.
@@ -24,8 +24,6 @@
 
 // INTERNAL INCLUDES
 #include <dali/internal/adaptor/common/adaptor-impl.h>
-#include <dali/internal/graphics/common/egl-image-extensions.h>
-#include <dali/internal/graphics/gles/egl-graphics.h>
 
 namespace Dali
 {
index 0ecbe51489ff1188bb51e30ee3392e14a7dcc161..d609b15c6d8752df82f648ca51d57d98a2e3e686 100644 (file)
@@ -2,7 +2,7 @@
 #define DALI_INTERNAL_NATIVE_IMAGE_SOURCE_QUEUE_IMPL_ANDROID_H
 
 /*
- * Copyright (c) 2023 Samsung Electronics Co., Ltd.
+ * Copyright (c) 2024 Samsung Electronics Co., Ltd.
  *
  * Licensed under the Apache License, Version 2.0 (the "License");
  * you may not use this file except in compliance with the License.
@@ -29,9 +29,6 @@ namespace Internal
 {
 namespace Adaptor
 {
-class EglGraphics;
-class EglImageExtensions;
-
 /**
  * Dali internal NativeImageSourceQueue.
  */
index ffb8dee9e1f663e9d8a2cc36b229645c839d9f90..d386b2dc7b7db26d78f5b94f8fffd6fe030572bc 100644 (file)
 // EXTERNAL INCLUDES
 #include <dali/devel-api/common/stage.h>
 #include <dali/integration-api/debug.h>
+#include <dali/integration-api/gl-defines.h>
 
 // INTERNAL INCLUDES
 #include <dali/integration-api/adaptor-framework/render-surface-interface.h>
 #include <dali/internal/adaptor/common/adaptor-impl.h>
-#include <dali/internal/graphics/common/egl-image-extensions.h>
-#include <dali/internal/graphics/gles/egl-graphics.h>
 
 namespace Dali::Internal::Adaptor
 {
index 864e3f9bcbf8c5a635659dd44d885923b9c0a66d..576f56d5e0b1004c83227910781dcbc858260aa6 100644 (file)
@@ -1,7 +1,7 @@
 #pragma once
 
 /*
- * Copyright (c) 2023 Samsung Electronics Co., Ltd.
+ * Copyright (c) 2024 Samsung Electronics Co., Ltd.
  *
  * Licensed under the Apache License, Version 2.0 (the "License");
  * you may not use this file except in compliance with the License.
@@ -26,8 +26,6 @@
 
 namespace Dali::Internal::Adaptor
 {
-class EglImageExtensions;
-
 /**
  * Dali internal NativeImageSource.
  */
index 1c7263f9efa3c4a6699d6c1a728aaf6220c33245..a86e13233da490ff7ad5952eb430d313de761349 100644 (file)
@@ -31,7 +31,6 @@
 #include <dali/devel-api/adaptor-framework/window-devel.h>
 #include <dali/integration-api/adaptor-framework/adaptor.h>
 #include <dali/internal/adaptor/common/adaptor-impl.h>
-#include <dali/internal/graphics/gles/egl-graphics.h>
 
 namespace Dali
 {
index 9c3d9a2af9abd2641b1435b897e32d57431487d5..55f37515474479e7c14d1d17fd1580b4b83da4ce 100644 (file)
@@ -34,7 +34,6 @@
 #include <dali/devel-api/adaptor-framework/accessibility-bridge.h>
 #include <dali/devel-api/atspi-interfaces/accessible.h>
 #include <dali/integration-api/adaptor-framework/render-surface-interface.h>
-#include <dali/internal/graphics/gles/egl-graphics.h>
 #include <dali/internal/window-system/common/event-handler.h>
 #include <dali/internal/window-system/common/orientation-impl.h>
 #include <dali/internal/window-system/common/render-surface-factory.h>
index 0d6dbdb3c4a1b9ebeb5017e95c13483f9ebfd03e..a8c8910d6b4c84a63175bda49d5dbd74be07c754 100644 (file)
@@ -1,5 +1,5 @@
 /*
- * Copyright (c) 2023 Samsung Electronics Co., Ltd.
+ * Copyright (c) 2024 Samsung Electronics Co., Ltd.
  *
  * Licensed under the Apache License, Version 2.0 (the "License");
  * you may not use this file except in compliance with the License.
@@ -317,10 +317,12 @@ void WindowRenderSurface::InitializeGraphics()
     auto eglGraphics = static_cast<EglGraphics*>(mGraphics);
     mEGL             = &eglGraphics->GetEglInterface();
 
-    // Create the OpenGL context for this window
-    Internal::Adaptor::EglImplementation& eglImpl = static_cast<Internal::Adaptor::EglImplementation&>(*mEGL);
-    eglImpl.ChooseConfig(true, mColorDepth);
-    eglImpl.CreateWindowContext(mEGLContext);
+    if(mEGL)
+    {
+      // Create the OpenGL context for this window
+      mEGL->ChooseConfig(true, mColorDepth);
+      mEGL->CreateWindowContext(mEGLContext);
+    }
 
     // Create the OpenGL surface
     CreateSurface();
@@ -351,10 +353,10 @@ void WindowRenderSurface::CreateSurface()
     InitializeImeSurface();
   }
 
-  auto eglGraphics = static_cast<EglGraphics*>(mGraphics);
-
-  Internal::Adaptor::EglImplementation& eglImpl = eglGraphics->GetEglImplementation();
-  mEGLSurface                                   = eglImpl.CreateSurfaceWindow(window, mColorDepth);
+  if(mEGL)
+  {
+    mEGLSurface = mEGL->CreateSurfaceWindow(window, mColorDepth);
+  }
 
   DALI_LOG_RELEASE_INFO("WindowRenderSurface::CreateSurface: WinId (%d), EGLSurface (%p), w = %d h = %d angle = %d screen rotation = %d\n",
                         mWindowBase->GetNativeWindowId(),
@@ -369,18 +371,15 @@ void WindowRenderSurface::DestroySurface()
 {
   DALI_LOG_TRACE_METHOD(gWindowRenderSurfaceLogFilter);
 
-  auto eglGraphics = static_cast<EglGraphics*>(mGraphics);
-  if(eglGraphics)
+  if(mEGL)
   {
     DALI_LOG_RELEASE_INFO("WindowRenderSurface::DestroySurface: WinId (%d)\n", mWindowBase->GetNativeWindowId());
 
-    Internal::Adaptor::EglImplementation& eglImpl = eglGraphics->GetEglImplementation();
-
-    eglImpl.DestroySurface(mEGLSurface);
+    mEGL->DestroySurface(mEGLSurface);
     mEGLSurface = nullptr;
 
     // Destroy context also
-    eglImpl.DestroyContext(mEGLContext);
+    mEGL->DestroyContext(mEGLContext);
     mEGLContext = nullptr;
 
     mWindowBase->DestroyEglWindow();
@@ -409,10 +408,11 @@ bool WindowRenderSurface::ReplaceGraphicsSurface()
   // Create the EGL window
   EGLNativeWindowType window = mWindowBase->CreateEglWindow(width, height);
 
-  auto eglGraphics = static_cast<EglGraphics*>(mGraphics);
-
-  Internal::Adaptor::EglImplementation& eglImpl = eglGraphics->GetEglImplementation();
-  return eglImpl.ReplaceSurfaceWindow(window, mEGLSurface, mEGLContext);
+  if(mEGL)
+  {
+    return mEGL->ReplaceSurfaceWindow(window, mEGLSurface, mEGLContext);
+  }
+  return false;
 }
 
 void WindowRenderSurface::UpdatePositionSize(Dali::PositionSize positionSize)
@@ -615,9 +615,6 @@ bool WindowRenderSurface::PreRender(bool resizingSurface, const std::vector<Rect
     }
   }
 
-  // This is now done when the render pass for the render surface begins
-  //  MakeContextCurrent();
-
   return true;
 }
 
@@ -627,8 +624,8 @@ void WindowRenderSurface::PostRender()
   auto eglGraphics = static_cast<EglGraphics*>(mGraphics);
   if(eglGraphics)
   {
-    GlImplementation& mGLES = eglGraphics->GetGlesInterface();
-    mGLES.PostRender();
+    auto& gl = eglGraphics->GetGlAbstraction();
+    gl.PostRender();
 
     bool needWindowRotationCompleted = false;
 
@@ -728,7 +725,6 @@ void WindowRenderSurface::InitializeImeSurface()
     {
       mPostRenderTrigger = std::unique_ptr<TriggerEventInterface>(TriggerEventFactory::CreateTriggerEvent(MakeCallback(this, &WindowRenderSurface::ProcessPostRender),
                                                                                                           TriggerEventInterface::KEEP_ALIVE_AFTER_TRIGGER));
-
     }
   }
 }
@@ -820,8 +816,7 @@ void WindowRenderSurface::OnFileDescriptorEventDispatched(FileDescriptorMonitor:
 
 void WindowRenderSurface::SetBufferDamagedRects(const std::vector<Rect<int>>& damagedRects, Rect<int>& clippingRect)
 {
-  auto eglGraphics = static_cast<EglGraphics*>(mGraphics);
-  if(eglGraphics)
+  if(mEGL)
   {
     // If scene is not exist, just use stored mPositionSize.
     Rect<int> surfaceRect(0, 0, mPositionSize.width, mPositionSize.height);
@@ -839,8 +834,7 @@ void WindowRenderSurface::SetBufferDamagedRects(const std::vector<Rect<int>>& da
       orientation = std::min(totalAngle / 90, 3);
     }
 
-    Internal::Adaptor::EglImplementation& eglImpl = eglGraphics->GetEglImplementation();
-    if(!eglImpl.IsPartialUpdateRequired() || mFullSwapNextFrame)
+    if(!mEGL->IsPartialUpdateRequired() || mFullSwapNextFrame)
     {
       InsertRects(mBufferDamagedRects, surfaceRect);
       clippingRect = surfaceRect;
@@ -858,7 +852,7 @@ void WindowRenderSurface::SetBufferDamagedRects(const std::vector<Rect<int>>& da
 
     mGraphics->ActivateSurfaceContext(this);
 
-    EGLint bufferAge = eglImpl.GetBufferAge(mEGLSurface);
+    EGLint bufferAge = mEGL->GetBufferAge(mEGLSurface);
 
     // Buffer age 0 means the back buffer in invalid and requires full swap
     if(bufferAge == 0)
@@ -913,22 +907,19 @@ void WindowRenderSurface::SetBufferDamagedRects(const std::vector<Rect<int>>& da
         damagedRegion.push_back(clippingRect);
       }
 
-      eglImpl.SetDamageRegion(mEGLSurface, damagedRegion);
+      mEGL->SetDamageRegion(mEGLSurface, damagedRegion);
     }
   }
 }
 
 void WindowRenderSurface::SwapBuffers(const std::vector<Rect<int>>& damagedRects)
 {
-  auto eglGraphics = static_cast<EglGraphics*>(mGraphics);
-  if(eglGraphics)
+  if(mEGL)
   {
-    Internal::Adaptor::EglImplementation& eglImpl = eglGraphics->GetEglImplementation();
-
-    if(!eglImpl.IsPartialUpdateRequired() || mFullSwapNextFrame)
+    if(!mEGL->IsPartialUpdateRequired() || mFullSwapNextFrame)
     {
       mFullSwapNextFrame = false;
-      eglImpl.SwapBuffers(mEGLSurface);
+      mEGL->SwapBuffers(mEGLSurface);
       return;
     }
 
@@ -945,11 +936,11 @@ void WindowRenderSurface::SwapBuffers(const std::vector<Rect<int>>& damagedRects
     {
       // In normal cases, WindowRenderSurface::SwapBuffers() will not be called if mergedRects.size() is 0.
       // For exceptional cases, swap full area.
-      eglImpl.SwapBuffers(mEGLSurface);
+      mEGL->SwapBuffers(mEGLSurface);
     }
     else
     {
-      eglImpl.SwapBuffers(mEGLSurface, damagedRects);
+      mEGL->SwapBuffers(mEGLSurface, damagedRects);
     }
   }
 }
@@ -958,7 +949,7 @@ void WindowRenderSurface::SetFrontBufferRendering(bool enable)
 {
   if(mIsFrontBufferRendering != enable)
   {
-    mIsFrontBufferRendering = enable;
+    mIsFrontBufferRendering        = enable;
     mIsFrontBufferRenderingChanged = !mIsFrontBufferRenderingChanged;
   }
 }