Initial refactoring of graphics interface 14/251614/5
authorDavid Steele <david.steele@samsung.com>
Thu, 14 Jan 2021 19:14:11 +0000 (19:14 +0000)
committerDavid Steele <david.steele@samsung.com>
Mon, 18 Jan 2021 14:01:45 +0000 (14:01 +0000)
Core now takes a Graphics::Controller as a parameter
For now, this wraps references to old GlAbstraction, GlSyncAbstraction &
GlContextHelperAbstraction.

Changed up internal interfaces to use this graphics controller rather
than storing refs to GlAbstraction etc (except for Context)

Change-Id: Id1707dd4bddd8578d1227244757b309b0e33228b

17 files changed:
automated-tests/src/dali/dali-test-suite-utils/test-application.cpp
automated-tests/src/dali/dali-test-suite-utils/test-application.h
automated-tests/src/dali/dali-test-suite-utils/test-graphics-controller.h [new file with mode: 0644]
build/tizen/CMakeLists.txt
dali/graphics-api/file.list [new file with mode: 0644]
dali/graphics-api/graphics-controller.h [new file with mode: 0644]
dali/integration-api/core.cpp
dali/integration-api/core.h
dali/internal/common/core-impl.cpp
dali/internal/common/core-impl.h
dali/internal/render/common/render-manager.cpp [changed mode: 0755->0644]
dali/internal/render/common/render-manager.h
dali/internal/render/gl-resources/context.cpp
dali/internal/render/gl-resources/context.h
dali/internal/render/shaders/program-controller.cpp
dali/internal/render/shaders/program-controller.h
packaging/dali.spec

index 062276a..a2a1848 100644 (file)
@@ -1,5 +1,5 @@
 /*
- * Copyright (c) 2020 Samsung Electronics Co., Ltd.
+ * Copyright (c) 2021 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.
@@ -55,9 +55,7 @@ void TestApplication::CreateCore()
 
   mCore = Dali::Integration::Core::New(mRenderController,
                                        mPlatformAbstraction,
-                                       mGlAbstraction,
-                                       mGlSyncAbstraction,
-                                       mGlContextHelperAbstraction,
+                                       mGraphicsController,
                                        Integration::RenderToFrameBuffer::FALSE,
                                        Integration::DepthBufferAvailable::TRUE,
                                        Integration::StencilBufferAvailable::TRUE,
@@ -141,19 +139,24 @@ TestRenderController& TestApplication::GetRenderController()
   return mRenderController;
 }
 
+TestGraphicsController& TestApplication::GetGraphicsController()
+{
+  return mGraphicsController;
+}
+
 TestGlAbstraction& TestApplication::GetGlAbstraction()
 {
-  return mGlAbstraction;
+  return static_cast<TestGlAbstraction&>(mGraphicsController.GetGlAbstraction());
 }
 
 TestGlSyncAbstraction& TestApplication::GetGlSyncAbstraction()
 {
-  return mGlSyncAbstraction;
+  return static_cast<TestGlSyncAbstraction&>(mGraphicsController.GetGlSyncAbstraction());
 }
 
 TestGlContextHelperAbstraction& TestApplication::GetGlContextHelperAbstraction()
 {
-  return mGlContextHelperAbstraction;
+  return static_cast<TestGlContextHelperAbstraction&>(mGraphicsController.GetGlContextHelperAbstraction());
 }
 
 void TestApplication::ProcessEvent(const Integration::Event& event)
@@ -262,7 +265,7 @@ bool TestApplication::RenderOnly()
 void TestApplication::ResetContext()
 {
   mCore->ContextDestroyed();
-  mGlAbstraction.Initialize();
+  mGraphicsController.Initialize();
   mCore->ContextCreated();
 }
 
index 7362505..e7d8c76 100644 (file)
@@ -2,7 +2,7 @@
 #define DALI_TEST_APPLICATION_H
 
 /*
- * Copyright (c) 2020 Samsung Electronics Co., Ltd.
+ * Copyright (c) 2021 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.
 #include <dali/integration-api/resource-policies.h>
 #include <dali/integration-api/scene.h>
 #include <dali/integration-api/trace.h>
+
 #include <dali/public-api/common/dali-common.h>
 #include <test-platform-abstraction.h>
 
-#include "test-gl-abstraction.h"
-#include "test-gl-context-helper-abstraction.h"
-#include "test-gl-sync-abstraction.h"
+#include "test-graphics-controller.h"
 #include "test-render-controller.h"
 
 namespace Dali
@@ -58,27 +57,30 @@ public:
   void CreateScene();
   void InitializeCore();
   ~TestApplication() override;
-  static void                     LogMessage(Dali::Integration::Log::DebugPriority level, std::string& message);
-  static void                     LogContext(bool start, const char* tag);
-  Dali::Integration::Core&        GetCore();
-  TestPlatformAbstraction&        GetPlatform();
-  TestRenderController&           GetRenderController();
+  static void              LogMessage(Dali::Integration::Log::DebugPriority level, std::string& message);
+  static void              LogContext(bool start, const char* tag);
+  Dali::Integration::Core& GetCore();
+  TestPlatformAbstraction& GetPlatform();
+  TestRenderController&    GetRenderController();
+  TestGraphicsController&  GetGraphicsController();
+
   TestGlAbstraction&              GetGlAbstraction();
   TestGlSyncAbstraction&          GetGlSyncAbstraction();
   TestGlContextHelperAbstraction& GetGlContextHelperAbstraction();
-  void                            ProcessEvent(const Integration::Event& event);
-  void                            SendNotification();
-  bool                            Render(uint32_t intervalMilliseconds = DEFAULT_RENDER_INTERVAL, const char* location = NULL);
-  bool                            PreRenderWithPartialUpdate(uint32_t intervalMilliseconds, const char* location, std::vector<Rect<int>>& damagedRects);
-  bool                            RenderWithPartialUpdate(std::vector<Rect<int>>& damagedRects, Rect<int>& clippingRect);
-  uint32_t                        GetUpdateStatus();
-  bool                            UpdateOnly(uint32_t intervalMilliseconds = DEFAULT_RENDER_INTERVAL);
-  bool                            RenderOnly();
-  void                            ResetContext();
-  bool                            GetRenderNeedsUpdate();
-  bool                            GetRenderNeedsPostRender();
-  uint32_t                        Wait(uint32_t durationToWait);
-  static void                     EnableLogging(bool enabled)
+
+  void        ProcessEvent(const Integration::Event& event);
+  void        SendNotification();
+  bool        Render(uint32_t intervalMilliseconds = DEFAULT_RENDER_INTERVAL, const char* location = NULL);
+  bool        PreRenderWithPartialUpdate(uint32_t intervalMilliseconds, const char* location, std::vector<Rect<int>>& damagedRects);
+  bool        RenderWithPartialUpdate(std::vector<Rect<int>>& damagedRects, Rect<int>& clippingRect);
+  uint32_t    GetUpdateStatus();
+  bool        UpdateOnly(uint32_t intervalMilliseconds = DEFAULT_RENDER_INTERVAL);
+  bool        RenderOnly();
+  void        ResetContext();
+  bool        GetRenderNeedsUpdate();
+  bool        GetRenderNeedsPostRender();
+  uint32_t    Wait(uint32_t durationToWait);
+  static void EnableLogging(bool enabled)
   {
     mLoggingEnabled = enabled;
   }
@@ -92,11 +94,9 @@ private:
   void DoUpdate(uint32_t intervalMilliseconds, const char* location = NULL);
 
 protected:
-  TestPlatformAbstraction        mPlatformAbstraction;
-  TestRenderController           mRenderController;
-  TestGlAbstraction              mGlAbstraction;
-  TestGlSyncAbstraction          mGlSyncAbstraction;
-  TestGlContextHelperAbstraction mGlContextHelperAbstraction;
+  TestPlatformAbstraction mPlatformAbstraction;
+  TestRenderController    mRenderController;
+  TestGraphicsController  mGraphicsController;
 
   Integration::UpdateStatus mStatus;
   Integration::RenderStatus mRenderStatus;
diff --git a/automated-tests/src/dali/dali-test-suite-utils/test-graphics-controller.h b/automated-tests/src/dali/dali-test-suite-utils/test-graphics-controller.h
new file mode 100644 (file)
index 0000000..f5ab764
--- /dev/null
@@ -0,0 +1,61 @@
+#ifndef TEST_GRAPHICS_CONTROLLER_H
+#define TEST_GRAPHICS_CONTROLLER_H
+
+/*
+ * Copyright (c) 2021 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.
+ * You may obtain a copy of the License at
+ *
+ * http://www.apache.org/licenses/LICENSE-2.0
+ *
+ * Unless required by applicable law or agreed to in writing, software
+ * distributed under the License is distributed on an "AS IS" BASIS,
+ * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
+ * See the License for the specific language governing permissions and
+ * limitations under the License.
+ */
+
+#include <dali/graphics-api/graphics-controller.h>
+#include "test-gl-abstraction.h"
+#include "test-gl-context-helper-abstraction.h"
+#include "test-gl-sync-abstraction.h"
+
+namespace Dali
+{
+class TestGraphicsController : public Dali::Graphics::Controller
+{
+public:
+  TestGraphicsController()          = default;
+  virtual ~TestGraphicsController() = default;
+
+  void Initialize()
+  {
+    mGlAbstraction.Initialize();
+  }
+
+  Integration::GlAbstraction& GetGlAbstraction() override
+  {
+    return mGlAbstraction;
+  }
+
+  Integration::GlSyncAbstraction& GetGlSyncAbstraction() override
+  {
+    return mGlSyncAbstraction;
+  }
+
+  Integration::GlContextHelperAbstraction& GetGlContextHelperAbstraction() override
+  {
+    return mGlContextHelperAbstraction;
+  }
+
+private:
+  TestGlAbstraction              mGlAbstraction;
+  TestGlSyncAbstraction          mGlSyncAbstraction;
+  TestGlContextHelperAbstraction mGlContextHelperAbstraction;
+};
+
+} // namespace Dali
+
+#endif //TEST_GRAPHICS_CONTROLLER_H
index 301c614..511285f 100644 (file)
@@ -195,6 +195,7 @@ INCLUDE( ${ROOT_SRC_DIR}/dali/internal/file.list )
 INCLUDE( ${ROOT_SRC_DIR}/dali/integration-api/file.list )
 INCLUDE( ${ROOT_SRC_DIR}/dali/public-api/file.list )
 INCLUDE( ${ROOT_SRC_DIR}/dali/devel-api/file.list )
+INCLUDE( ${ROOT_SRC_DIR}/dali/graphics-api/file.list )
 IF( WIN32 )
   INCLUDE( ${ROOT_SRC_DIR}/dali/internal/file-windows.list )
 ELSEIF( UNIX )
@@ -288,6 +289,7 @@ ENDMACRO(INSTALL_HEADERS_WITH_DIRECTORY)
 # Install headers using lists defined by ADD_SUBDIRECTORY
 INSTALL_HEADERS_WITH_DIRECTORY(PUBLIC_API_HEADERS ${ROOT_SRC_DIR}/dali "dali")
 INSTALL_HEADERS_WITH_DIRECTORY(DEVEL_API_HEADERS ${ROOT_SRC_DIR}/dali "dali")
+INSTALL_HEADERS_WITH_DIRECTORY(GRAPHICS_API_HEADERS ${ROOT_SRC_DIR}/dali "dali")
 INSTALL_HEADERS_WITH_DIRECTORY(INTEGRATION_API_HEADERS ${ROOT_SRC_DIR}/dali "dali")
 INSTALL_HEADERS_WITH_DIRECTORY(PACKAGE_DOXY_HEADERS ${PACKAGE_DOXY_SRC_DIR} "dali/doc" )
 
diff --git a/dali/graphics-api/file.list b/dali/graphics-api/file.list
new file mode 100644 (file)
index 0000000..6f8fabc
--- /dev/null
@@ -0,0 +1,7 @@
+# Set the header directory
+
+SET( graphics_src_dir ${ROOT_SRC_DIR}/dali/graphics-api )
+
+SET( GRAPHICS_API_HEADERS ${GRAPHICS_API_HEADERS}
+   ${graphics_src_dir}/graphics-controller.h
+)
diff --git a/dali/graphics-api/graphics-controller.h b/dali/graphics-api/graphics-controller.h
new file mode 100644 (file)
index 0000000..fecbdb0
--- /dev/null
@@ -0,0 +1,66 @@
+#ifndef DALI_GRAPHICS_CONTROLLER_H
+#define DALI_GRAPHICS_CONTROLLER_H
+
+/*
+ * Copyright (c) 2021 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.
+ * You may obtain a copy of the License at
+ *
+ * http://www.apache.org/licenses/LICENSE-2.0
+ *
+ * Unless required by applicable law or agreed to in writing, software
+ * distributed under the License is distributed on an "AS IS" BASIS,
+ * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
+ * See the License for the specific language governing permissions and
+ * limitations under the License.
+ *
+ */
+
+// INTERNAL INCLUDES
+
+namespace Dali
+{
+namespace Integration
+{
+class GlAbstraction;
+class GlSyncAbstraction;
+class GlContextHelperAbstraction;
+} // namespace Integration
+
+namespace Graphics
+{
+/**
+ * @brief The main controller for creating graphics objects and submitting render commands.
+ */
+class Controller
+{
+public:
+  virtual ~Controller() = default;
+
+  // Temporary until graphics api is complete
+  virtual Integration::GlAbstraction&              GetGlAbstraction()              = 0;
+  virtual Integration::GlSyncAbstraction&          GetGlSyncAbstraction()          = 0;
+  virtual Integration::GlContextHelperAbstraction& GetGlContextHelperAbstraction() = 0;
+
+public:
+  // not copyable
+  Controller(const Controller&) = delete;
+  Controller& operator=(const Controller&) = delete;
+
+protected:
+  // derived types should not be moved direcly to prevent slicing
+  Controller(Controller&&) = default;
+  Controller& operator=(Controller&&) = default;
+
+  /**
+   * Objects of this type should not be directly instantiated.
+   */
+  Controller() = default;
+};
+
+} // namespace Graphics
+} // namespace Dali
+
+#endif // DALI_GRAPHICS_CONTROLLER_H
index 83cfedf..3942bea 100644 (file)
@@ -1,5 +1,5 @@
 /*
- * Copyright (c) 2020 Samsung Electronics Co., Ltd.
+ * Copyright (c) 2021 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,8 +20,6 @@
 
 // INTERNAL INCLUDES
 #include <dali/integration-api/events/event.h>
-#include <dali/integration-api/gl-context-helper-abstraction.h>
-#include <dali/integration-api/gl-sync-abstraction.h>
 #include <dali/integration-api/processor-interface.h>
 #include <dali/internal/common/core-impl.h>
 #include <dali/public-api/actors/layer.h>
@@ -32,22 +30,18 @@ namespace Dali
 {
 namespace Integration
 {
-Core* Core::New(RenderController&           renderController,
-                PlatformAbstraction&        platformAbstraction,
-                GlAbstraction&              glAbstraction,
-                GlSyncAbstraction&          glSyncAbstraction,
-                GlContextHelperAbstraction& glContextHelperAbstraction,
-                RenderToFrameBuffer         renderToFboEnabled,
-                DepthBufferAvailable        depthBufferAvailable,
-                StencilBufferAvailable      stencilBufferAvailable,
-                PartialUpdateAvailable      partialUpdateAvailable)
+Core* Core::New(RenderController&      renderController,
+                PlatformAbstraction&   platformAbstraction,
+                Graphics::Controller&  graphicsController,
+                RenderToFrameBuffer    renderToFboEnabled,
+                DepthBufferAvailable   depthBufferAvailable,
+                StencilBufferAvailable stencilBufferAvailable,
+                PartialUpdateAvailable partialUpdateAvailable)
 {
   Core* instance  = new Core;
   instance->mImpl = new Internal::Core(renderController,
                                        platformAbstraction,
-                                       glAbstraction,
-                                       glSyncAbstraction,
-                                       glContextHelperAbstraction,
+                                       graphicsController,
                                        renderToFboEnabled,
                                        depthBufferAvailable,
                                        stencilBufferAvailable,
index 97ebcef..686a1ec 100644 (file)
@@ -2,7 +2,7 @@
 #define DALI_INTEGRATION_CORE_H
 
 /*
- * Copyright (c) 2020 Samsung Electronics Co., Ltd.
+ * Copyright (c) 2021 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.
@@ -34,6 +34,11 @@ class Layer;
 class ObjectRegistry;
 class RenderTaskList;
 
+namespace Graphics
+{
+class Controller;
+}
+
 namespace Internal
 {
 class Core;
@@ -42,9 +47,6 @@ class Core;
 namespace Integration
 {
 class Core;
-class GlAbstraction;
-class GlSyncAbstraction;
-class GlContextHelperAbstraction;
 class PlatformAbstraction;
 class Processor;
 class RenderController;
@@ -228,24 +230,20 @@ public:
    * This object is used for integration with the native windowing system.
    * @param[in] renderController The interface to an object which controls rendering.
    * @param[in] platformAbstraction The interface providing platform specific services.
-   * @param[in] glAbstraction The interface providing OpenGL services.
-   * @param[in] glSyncAbstraction The interface providing OpenGL sync objects.
-   * @param[in] glContextHelperAbstraction The interface providing OpenGL context helper objects.
+   * @param[in] graphicsController The interface providing graphics services
    * @param[in] renderToFboEnabled Whether rendering into the Frame Buffer Object is enabled.
    * @param[in] depthBufferAvailable Whether the depth buffer is available
    * @param[in] stencilBufferAvailable Whether the stencil buffer is available
    * @param[in] partialUpdateAvailable Whether the partial update is available
    * @return A newly allocated Core.
    */
-  static Core* New(RenderController&           renderController,
-                   PlatformAbstraction&        platformAbstraction,
-                   GlAbstraction&              glAbstraction,
-                   GlSyncAbstraction&          glSyncAbstraction,
-                   GlContextHelperAbstraction& glContextHelperAbstraction,
-                   RenderToFrameBuffer         renderToFboEnabled,
-                   DepthBufferAvailable        depthBufferAvailable,
-                   StencilBufferAvailable      stencilBufferAvailable,
-                   PartialUpdateAvailable      partialUpdateAvailable);
+  static Core* New(RenderController&      renderController,
+                   PlatformAbstraction&   platformAbstraction,
+                   Graphics::Controller&  graphicsController,
+                   RenderToFrameBuffer    renderToFboEnabled,
+                   DepthBufferAvailable   depthBufferAvailable,
+                   StencilBufferAvailable stencilBufferAvailable,
+                   PartialUpdateAvailable partialUpdateAvailable);
 
   /**
    * Non-virtual destructor. Core is not intended as a base class.
index cffc170..9b5c071 100644 (file)
@@ -1,5 +1,5 @@
 /*
- * Copyright (c) 2020 Samsung Electronics Co., Ltd.
+ * Copyright (c) 2021 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.
 #include <dali/internal/common/core-impl.h>
 
 // INTERNAL INCLUDES
+#include <dali/graphics-api/graphics-controller.h>
 #include <dali/integration-api/core.h>
 #include <dali/integration-api/debug.h>
 #include <dali/integration-api/events/event.h>
-#include <dali/integration-api/gl-sync-abstraction.h>
 #include <dali/integration-api/gl-context-helper-abstraction.h>
+#include <dali/integration-api/gl-sync-abstraction.h>
 #include <dali/integration-api/platform-abstraction.h>
 #include <dali/integration-api/processor-interface.h>
 #include <dali/integration-api/render-controller.h>
 
 #include <dali/internal/event/actors/actor-impl.h>
 #include <dali/internal/event/animation/animation-playlist.h>
+#include <dali/internal/event/common/event-thread-services.h>
 #include <dali/internal/event/common/notification-manager.h>
 #include <dali/internal/event/common/property-notification-manager.h>
 #include <dali/internal/event/common/stage-impl.h>
 #include <dali/internal/event/common/thread-local-storage.h>
-#include <dali/internal/event/common/event-thread-services.h>
 #include <dali/internal/event/common/type-registry-impl.h>
 #include <dali/internal/event/effects/shader-factory.h>
 #include <dali/internal/event/events/event-processor.h>
 #include <dali/internal/event/size-negotiation/relayout-controller-impl.h>
 
 #include <dali/internal/update/common/discard-queue.h>
-#include <dali/internal/update/manager/update-manager.h>
 #include <dali/internal/update/manager/render-task-processor.h>
+#include <dali/internal/update/manager/update-manager.h>
 
 #include <dali/internal/render/common/performance-monitor.h>
 #include <dali/internal/render/common/render-manager.h>
 #include <dali/internal/render/gl-resources/context.h>
 
-using Dali::Internal::SceneGraph::UpdateManager;
-using Dali::Internal::SceneGraph::RenderManager;
 using Dali::Internal::SceneGraph::DiscardQueue;
+using Dali::Internal::SceneGraph::RenderManager;
 using Dali::Internal::SceneGraph::RenderQueue;
+using Dali::Internal::SceneGraph::UpdateManager;
 
 namespace
 {
@@ -63,43 +64,39 @@ const uint32_t MAXIMUM_UPDATE_COUNT = 2u;
 #if defined(DEBUG_ENABLED)
 Debug::Filter* gCoreFilter = Debug::Filter::New(Debug::Concise, false, "LOG_CORE");
 #endif
-}
+} // namespace
 
 namespace Dali
 {
-
 namespace Internal
 {
-
-using Integration::RenderController;
-using Integration::PlatformAbstraction;
-using Integration::GlSyncAbstraction;
+using Integration::Event;
 using Integration::GlAbstraction;
 using Integration::GlContextHelperAbstraction;
-using Integration::Event;
-using Integration::UpdateStatus;
+using Integration::GlSyncAbstraction;
+using Integration::PlatformAbstraction;
+using Integration::RenderController;
 using Integration::RenderStatus;
+using Integration::UpdateStatus;
 
-Core::Core( RenderController& renderController,
-            PlatformAbstraction& platform,
-            GlAbstraction& glAbstraction,
-            GlSyncAbstraction& glSyncAbstraction,
-            GlContextHelperAbstraction& glContextHelperAbstraction,
-            Integration::RenderToFrameBuffer renderToFboEnabled,
-            Integration::DepthBufferAvailable depthBufferAvailable,
-            Integration::StencilBufferAvailable stencilBufferAvailable,
-            Integration::PartialUpdateAvailable partialUpdateAvailable )
-: mRenderController( renderController ),
+Core::Core(RenderController&                   renderController,
+           PlatformAbstraction&                platform,
+           Graphics::Controller&               graphicsController,
+           Integration::RenderToFrameBuffer    renderToFboEnabled,
+           Integration::DepthBufferAvailable   depthBufferAvailable,
+           Integration::StencilBufferAvailable stencilBufferAvailable,
+           Integration::PartialUpdateAvailable partialUpdateAvailable)
+: mRenderController(renderController),
   mPlatform(platform),
-  mGlAbstraction(glAbstraction),
+  mGraphicsController(graphicsController),
   mProcessingEvent(false),
-  mForceNextUpdate( false )
+  mForceNextUpdate(false)
 {
   // Create the thread local storage
   CreateThreadLocalStorage();
 
   // This does nothing until Core is built with --enable-performance-monitor
-  PERFORMANCE_MONITOR_INIT( platform );
+  PERFORMANCE_MONITOR_INIT(platform);
 
   mNotificationManager = new NotificationManager();
 
@@ -109,34 +106,34 @@ Core::Core( RenderController& renderController,
 
   mRenderTaskProcessor = new SceneGraph::RenderTaskProcessor();
 
-  mRenderManager = RenderManager::New( glAbstraction, glSyncAbstraction, glContextHelperAbstraction, depthBufferAvailable, stencilBufferAvailable, partialUpdateAvailable );
+  mRenderManager = RenderManager::New(graphicsController, depthBufferAvailable, stencilBufferAvailable, partialUpdateAvailable);
 
   RenderQueue& renderQueue = mRenderManager->GetRenderQueue();
 
-  mDiscardQueue = new DiscardQueue( renderQueue );
+  mDiscardQueue = new DiscardQueue(renderQueue);
 
-  mUpdateManager = new UpdateManager( *mNotificationManager,
-                                      *mAnimationPlaylist,
-                                      *mPropertyNotificationManager,
-                                      *mDiscardQueue,
-                                       renderController,
-                                      *mRenderManager,
-                                       renderQueue,
-                                      *mRenderTaskProcessor );
+  mUpdateManager = new UpdateManager(*mNotificationManager,
+                                     *mAnimationPlaylist,
+                                     *mPropertyNotificationManager,
+                                     *mDiscardQueue,
+                                     renderController,
+                                     *mRenderManager,
+                                     renderQueue,
+                                     *mRenderTaskProcessor);
 
-  mRenderManager->SetShaderSaver( *mUpdateManager );
+  mRenderManager->SetShaderSaver(*mUpdateManager);
 
   mObjectRegistry = ObjectRegistry::New();
 
-  mStage = IntrusivePtr<Stage>( Stage::New( *mUpdateManager ) );
+  mStage = IntrusivePtr<Stage>(Stage::New(*mUpdateManager));
 
   // This must be called after stage is created but before stage initialization
-  mRelayoutController = IntrusivePtr< RelayoutController >( new RelayoutController( mRenderController ) );
+  mRelayoutController = IntrusivePtr<RelayoutController>(new RelayoutController(mRenderController));
 
-  mGestureEventProcessor = new GestureEventProcessor( *mUpdateManager, mRenderController );
+  mGestureEventProcessor = new GestureEventProcessor(*mUpdateManager, mRenderController);
 
   mShaderFactory = new ShaderFactory();
-  mUpdateManager->SetShaderSaver( *mShaderFactory );
+  mUpdateManager->SetShaderSaver(*mShaderFactory);
 
   GetImplementation(Dali::TypeRegistry::Get()).CallInitFunctions();
 }
@@ -151,7 +148,7 @@ Core::~Core()
   // allows core to be created / deleted many times in the same thread (how TET cases work).
   // Do this before mStage.Reset() so Stage::IsInstalled() returns false
   ThreadLocalStorage* tls = ThreadLocalStorage::GetInternal();
-  if( tls )
+  if(tls)
   {
     tls->Remove();
     tls->Unreference();
@@ -164,12 +161,11 @@ Core::~Core()
 
   // remove (last?) reference to stage
   mStage.Reset();
-
 }
 
 void Core::Initialize()
 {
-  mStage->Initialize( *mScenes[0] );
+  mStage->Initialize(*mScenes[0]);
 }
 
 Integration::ContextNotifierInterface* Core::GetContextNotifier()
@@ -194,7 +190,7 @@ void Core::ContextDestroyed()
   mRenderManager->ContextDestroyed();
 }
 
-void Core::Update( float elapsedSeconds, uint32_t lastVSyncTimeMilliseconds, uint32_t nextVSyncTimeMilliseconds, Integration::UpdateStatus& status, bool renderToFboEnabled, bool isRenderingToFbo )
+void Core::Update(float elapsedSeconds, uint32_t lastVSyncTimeMilliseconds, uint32_t nextVSyncTimeMilliseconds, Integration::UpdateStatus& status, bool renderToFboEnabled, bool isRenderingToFbo)
 {
   // set the time delta so adaptor can easily print FPS with a release build with 0 as
   // it is cached by frametime
@@ -202,11 +198,11 @@ void Core::Update( float elapsedSeconds, uint32_t lastVSyncTimeMilliseconds, uin
 
   // Render returns true when there are updates on the stage or one or more animations are completed.
   // Use the estimated time diff till we render as the elapsed time.
-  status.keepUpdating = mUpdateManager->Update( elapsedSeconds,
-                                                lastVSyncTimeMilliseconds,
-                                                nextVSyncTimeMilliseconds,
-                                                renderToFboEnabled,
-                                                isRenderingToFbo );
+  status.keepUpdating = mUpdateManager->Update(elapsedSeconds,
+                                               lastVSyncTimeMilliseconds,
+                                               nextVSyncTimeMilliseconds,
+                                               renderToFboEnabled,
+                                               isRenderingToFbo);
 
   // Check the Notification Manager message queue to set needsNotification
   status.needsNotification = mNotificationManager->MessagesToProcess();
@@ -218,29 +214,29 @@ void Core::Update( float elapsedSeconds, uint32_t lastVSyncTimeMilliseconds, uin
   // Any message to update will wake it up anyways
 }
 
-void Core::PreRender( RenderStatus& status, bool forceClear, bool uploadOnly )
+void Core::PreRender(RenderStatus& status, bool forceClear, bool uploadOnly)
 {
-  mRenderManager->PreRender( status, forceClear, uploadOnly );
+  mRenderManager->PreRender(status, forceClear, uploadOnly);
 }
 
-void Core::PreRender( Integration::Scene& scene, std::vector<Rect<int>>& damagedRects )
+void Core::PreRender(Integration::Scene& scene, std::vector<Rect<int>>& damagedRects)
 {
-  mRenderManager->PreRender( scene, damagedRects );
+  mRenderManager->PreRender(scene, damagedRects);
 }
 
-void Core::RenderScene( RenderStatus& status, Integration::Scene& scene, bool renderToFbo )
+void Core::RenderScene(RenderStatus& status, Integration::Scene& scene, bool renderToFbo)
 {
-  mRenderManager->RenderScene( status, scene, renderToFbo );
+  mRenderManager->RenderScene(status, scene, renderToFbo);
 }
 
-void Core::RenderScene( RenderStatus& status, Integration::Scene& scene, bool renderToFbo, Rect<int>& clippingRect )
+void Core::RenderScene(RenderStatus& status, Integration::Scene& scene, bool renderToFbo, Rect<int>& clippingRect)
 {
-  mRenderManager->RenderScene( status, scene, renderToFbo, clippingRect );
+  mRenderManager->RenderScene(status, scene, renderToFbo, clippingRect);
 }
 
-void Core::PostRender( bool uploadOnly )
+void Core::PostRender(bool uploadOnly)
 {
-  mRenderManager->PostRender( uploadOnly );
+  mRenderManager->PostRender(uploadOnly);
 }
 
 void Core::SceneCreated()
@@ -249,33 +245,33 @@ void Core::SceneCreated()
 
   mRelayoutController->OnApplicationSceneCreated();
 
-  for( const auto& scene : mScenes )
+  for(const auto& scene : mScenes)
   {
     Dali::Actor sceneRootLayer = scene->GetRootLayer();
-    mRelayoutController->RequestRelayoutTree( sceneRootLayer );
+    mRelayoutController->RequestRelayoutTree(sceneRootLayer);
   }
 }
 
-void Core::QueueEvent( const Integration::Event& event )
+void Core::QueueEvent(const Integration::Event& event)
 {
-  if (mScenes.size() != 0)
+  if(mScenes.size() != 0)
   {
-    mScenes.front()->QueueEvent( event );
+    mScenes.front()->QueueEvent(event);
   }
 }
 
 void Core::ProcessEvents()
 {
   // Guard against calls to ProcessEvents() during ProcessEvents()
-  if( mProcessingEvent )
+  if(mProcessingEvent)
   {
-    DALI_LOG_ERROR( "ProcessEvents should not be called from within ProcessEvents!\n" );
-    mRenderController.RequestProcessEventsOnIdle( false );
+    DALI_LOG_ERROR("ProcessEvents should not be called from within ProcessEvents!\n");
+    mRenderController.RequestProcessEventsOnIdle(false);
     return;
   }
 
   mProcessingEvent = true;
-  mRelayoutController->SetProcessingCoreEvents( true );
+  mRelayoutController->SetProcessingCoreEvents(true);
 
   // Signal that any messages received will be flushed soon
   mUpdateManager->EventProcessingStarted();
@@ -285,7 +281,7 @@ void Core::ProcessEvents()
   SceneContainer scenes = mScenes;
 
   // process events in all scenes
-  for( auto scene : scenes )
+  for(auto scene : scenes)
   {
     scene->ProcessEvents();
   }
@@ -293,7 +289,7 @@ void Core::ProcessEvents()
   mNotificationManager->ProcessMessages();
 
   // Emit signal here to inform listeners that event processing has finished.
-  for( auto scene : scenes )
+  for(auto scene : scenes)
   {
     scene->EmitEventProcessingFinishedSignal();
   }
@@ -305,7 +301,7 @@ void Core::ProcessEvents()
   mRelayoutController->Relayout();
 
   // Rebuild depth tree after event processing has finished
-  for( auto scene : scenes )
+  for(auto scene : scenes)
   {
     scene->RebuildDepthTree();
   }
@@ -318,13 +314,13 @@ void Core::ProcessEvents()
   // Check if the next update is forced.
   const bool forceUpdate = IsNextUpdateForced();
 
-  if( messagesToProcess || gestureNeedsUpdate || forceUpdate )
+  if(messagesToProcess || gestureNeedsUpdate || forceUpdate)
   {
     // tell the render controller to keep update thread running
-    mRenderController.RequestUpdate( forceUpdate );
+    mRenderController.RequestUpdate(forceUpdate);
   }
 
-  mRelayoutController->SetProcessingCoreEvents( false );
+  mRelayoutController->SetProcessingCoreEvents(false);
 
   // ProcessEvents() may now be called again
   mProcessingEvent = false;
@@ -335,28 +331,28 @@ uint32_t Core::GetMaximumUpdateCount() const
   return MAXIMUM_UPDATE_COUNT;
 }
 
-void Core::RegisterProcessor( Integration::Processor& processor )
+void Core::RegisterProcessor(Integration::Processor& processor)
 {
   mProcessors.PushBack(&processor);
 }
 
-void Core::UnregisterProcessor( Integration::Processor& processor )
+void Core::UnregisterProcessor(Integration::Processor& processor)
 {
-  auto iter = std::find( mProcessors.Begin(), mProcessors.End(), &processor );
-  if( iter != mProcessors.End() )
+  auto iter = std::find(mProcessors.Begin(), mProcessors.End(), &processor);
+  if(iter != mProcessors.End())
   {
-    mProcessors.Erase( iter );
+    mProcessors.Erase(iter);
   }
 }
 
 void Core::RunProcessors()
 {
   // Copy processor pointers to prevent changes to vector affecting loop iterator.
-  Dali::Vector<Integration::Processor*> processors( mProcessors );
+  Dali::Vector<Integration::Processor*> processors(mProcessors);
 
-  for( auto processor : processors )
+  for(auto processor : processors)
   {
-    if( processor )
+    if(processor)
     {
       processor->Process();
     }
@@ -425,20 +421,20 @@ AnimationPlaylist& Core::GetAnimationPlaylist() const
 
 Integration::GlAbstraction& Core::GetGlAbstraction() const
 {
-  return mGlAbstraction;
+  return mGraphicsController.GetGlAbstraction();
 }
 
-void Core::AddScene( Scene* scene )
+void Core::AddScene(Scene* scene)
 {
-  mScenes.push_back( scene );
+  mScenes.push_back(scene);
 }
 
-void Core::RemoveScene( Scene* scene )
+void Core::RemoveScene(Scene* scene)
 {
-  auto iter = std::find( mScenes.begin(), mScenes.end(), scene );
-  if( iter != mScenes.end() )
+  auto iter = std::find(mScenes.begin(), mScenes.end(), scene);
+  if(iter != mScenes.end())
   {
-    mScenes.erase( iter );
+    mScenes.erase(iter);
   }
 }
 
@@ -450,16 +446,16 @@ void Core::CreateThreadLocalStorage()
   tls->Reference();
 }
 
-void Core::RegisterObject( Dali::BaseObject* object )
+void Core::RegisterObject(Dali::BaseObject* object)
 {
   mObjectRegistry = &ThreadLocalStorage::Get().GetObjectRegistry();
-  mObjectRegistry->RegisterObject( object );
+  mObjectRegistry->RegisterObject(object);
 }
 
-void Core::UnregisterObject( Dali::BaseObject* object )
+void Core::UnregisterObject(Dali::BaseObject* object)
 {
   mObjectRegistry = &ThreadLocalStorage::Get().GetObjectRegistry();
-  mObjectRegistry->UnregisterObject( object );
+  mObjectRegistry->UnregisterObject(object);
 }
 
 Integration::RenderController& Core::GetRenderController()
@@ -467,9 +463,9 @@ Integration::RenderController& Core::GetRenderController()
   return mRenderController;
 }
 
-uint32_t* Core::ReserveMessageSlot( uint32_t size, bool updateScene )
+uint32_t* Core::ReserveMessageSlot(uint32_t size, bool updateScene)
 {
-  return mUpdateManager->ReserveMessageSlot( size, updateScene );
+  return mUpdateManager->ReserveMessageSlot(size, updateScene);
 }
 
 BufferIndex Core::GetEventBufferIndex() const
@@ -485,7 +481,7 @@ void Core::ForceNextUpdate()
 bool Core::IsNextUpdateForced()
 {
   bool nextUpdateForced = mForceNextUpdate;
-  mForceNextUpdate = false;
+  mForceNextUpdate      = false;
   return nextUpdateForced;
 }
 
index 478bfcd..deaa184 100644 (file)
@@ -2,7 +2,7 @@
 #define DALI_INTERNAL_CORE_H
 
 /*
- * Copyright (c) 2020 Samsung Electronics Co., Ltd.
+ * Copyright (c) 2021 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.
  */
 
 // INTERNAL INCLUDES
-#include <dali/public-api/common/dali-vector.h>
-#include <dali/public-api/object/ref-object.h>
+#include <dali/devel-api/common/owner-container.h>
 #include <dali/integration-api/context-notifier.h>
 #include <dali/integration-api/core-enumerations.h>
+#include <dali/integration-api/resource-policies.h>
 #include <dali/internal/common/owner-pointer.h>
-#include <dali/devel-api/common/owner-container.h>
 #include <dali/internal/event/animation/animation-playlist-declarations.h>
-#include <dali/internal/event/common/stage-def.h>
-#include <dali/integration-api/resource-policies.h>
-#include <dali/internal/event/common/scene-impl.h>
 #include <dali/internal/event/common/object-registry-impl.h>
+#include <dali/internal/event/common/scene-impl.h>
+#include <dali/internal/event/common/stage-def.h>
+#include <dali/public-api/common/dali-vector.h>
+#include <dali/public-api/object/ref-object.h>
 
 namespace Dali
 {
+namespace Graphics
+{
+class Controller;
+}
 
 namespace Integration
 {
 class Processor;
 class RenderController;
 class PlatformAbstraction;
-class GlAbstraction;
-class GlSyncAbstraction;
-class GlContextHelperAbstraction;
 class UpdateStatus;
 class RenderStatus;
 struct Event;
 struct TouchEvent;
-}
+} // namespace Integration
 
 namespace Internal
 {
-
 class NotificationManager;
 class AnimationPlaylist;
 class PropertyNotificationManager;
@@ -67,7 +67,7 @@ class UpdateManager;
 class RenderManager;
 class DiscardQueue;
 class RenderTaskProcessor;
-}
+} // namespace SceneGraph
 
 /**
  * Internal class for Dali::Integration::Core
@@ -75,19 +75,16 @@ class RenderTaskProcessor;
 class Core : public EventThreadServices
 {
 public:
-
   /**
    * Create and initialise a new Core instance
    */
-  Core( Integration::RenderController& renderController,
-        Integration::PlatformAbstraction& platform,
-        Integration::GlAbstraction& glAbstraction,
-        Integration::GlSyncAbstraction& glSyncAbstraction,
-        Integration::GlContextHelperAbstraction& glContextHelperAbstraction,
-        Integration::RenderToFrameBuffer renderToFboEnabled,
-        Integration::DepthBufferAvailable depthBufferAvailable,
-        Integration::StencilBufferAvailable stencilBufferAvailable,
-        Integration::PartialUpdateAvailable partialUpdateAvailable );
+  Core(Integration::RenderController&      renderController,
+       Integration::PlatformAbstraction&   platform,
+       Graphics::Controller&               graphicsController,
+       Integration::RenderToFrameBuffer    renderToFboEnabled,
+       Integration::DepthBufferAvailable   depthBufferAvailable,
+       Integration::StencilBufferAvailable stencilBufferAvailable,
+       Integration::PartialUpdateAvailable partialUpdateAvailable);
 
   /**
    * Destructor
@@ -127,32 +124,32 @@ public:
   /**
    * @copydoc Dali::Integration::Core::Update()
    */
-  void Update( float elapsedSeconds, uint32_t lastVSyncTimeMilliseconds, uint32_t nextVSyncTimeMilliseconds, Integration::UpdateStatus& status, bool renderToFboEnabled, bool isRenderingToFbo );
+  void Update(float elapsedSeconds, uint32_t lastVSyncTimeMilliseconds, uint32_t nextVSyncTimeMilliseconds, Integration::UpdateStatus& status, bool renderToFboEnabled, bool isRenderingToFbo);
 
   /**
    * @copydoc Dali::Integration::Core::PreRender()
    */
-  void PreRender( Integration::RenderStatus& status, bool forceClear, bool uploadOnly );
+  void PreRender(Integration::RenderStatus& status, bool forceClear, bool uploadOnly);
 
   /**
    * @copydoc Dali::Integration::Core::PreRender()
    */
-  void PreRender( Integration::Scene& scene, std::vector<Rect<int>>& damagedRects );
+  void PreRender(Integration::Scene& scene, std::vector<Rect<int>>& damagedRects);
 
   /**
    * @copydoc Dali::Integration::Core::RenderScene()
    */
-  void RenderScene( Integration::RenderStatus& status, Integration::Scene& scene, bool renderToFbo );
+  void RenderScene(Integration::RenderStatus& status, Integration::Scene& scene, bool renderToFbo);
 
   /**
    * @copydoc Dali::Integration::Core::RenderScene()
    */
-  void RenderScene( Integration::RenderStatus& status, Integration::Scene& scene, bool renderToFbo, Rect<int>& clippingRect );
+  void RenderScene(Integration::RenderStatus& status, Integration::Scene& scene, bool renderToFbo, Rect<int>& clippingRect);
 
   /**
    * @copydoc Dali::Integration::Core::Render()
    */
-  void PostRender( bool uploadOnly );
+  void PostRender(bool uploadOnly);
 
   /**
    * @copydoc Dali::Integration::Core::SceneCreated()
@@ -162,7 +159,7 @@ public:
   /**
    * @copydoc Dali::Integration::Core::QueueEvent(const Integration::Event&)
    */
-  void QueueEvent( const Integration::Event& event );
+  void QueueEvent(const Integration::Event& event);
 
   /**
    * @copydoc Dali::Integration::Core::ProcessEvents()
@@ -177,22 +174,22 @@ public:
   /**
    * @copydoc Dali::Integration::Core::RegisterProcessor
    */
-  void RegisterProcessor( Dali::Integration::Processor& processor );
+  void RegisterProcessor(Dali::Integration::Processor& processor);
 
   /**
    * @copydoc Dali::Integration::Core::UnregisterProcessor
    */
-  void UnregisterProcessor( Dali::Integration::Processor& processor );
+  void UnregisterProcessor(Dali::Integration::Processor& processor);
 
   /**
    * @copydoc Dali::Internal::ThreadLocalStorage::AddScene()
    */
-  void AddScene( Scene* scene );
+  void AddScene(Scene* scene);
 
   /**
    * @copydoc Dali::Internal::ThreadLocalStorage::RemoveScene()
    */
-  void RemoveScene( Scene* scene );
+  void RemoveScene(Scene* scene);
 
   /**
    * @brief Gets the Object registry.
@@ -201,16 +198,15 @@ public:
   ObjectRegistry& GetObjectRegistry() const;
 
 public: // Implementation of EventThreadServices
-
   /**
    * @copydoc EventThreadServices::RegisterObject
    */
-  void RegisterObject( BaseObject* object) override;
+  void RegisterObject(BaseObject* object) override;
 
   /**
    * @copydoc EventThreadServices::UnregisterObject
    */
-  void UnregisterObject( BaseObject* object) override;
+  void UnregisterObject(BaseObject* object) override;
 
   /**
    * @copydoc EventThreadServices::GetUpdateManager
@@ -225,7 +221,7 @@ public: // Implementation of EventThreadServices
   /**
    * @copydoc EventThreadServices::ReserveMessageSlot
    */
-  uint32_t* ReserveMessageSlot( uint32_t size, bool updateScene ) override;
+  uint32_t* ReserveMessageSlot(uint32_t size, bool updateScene) override;
 
   /**
    * @copydoc EventThreadServices::GetEventBufferIndex
@@ -243,7 +239,6 @@ public: // Implementation of EventThreadServices
   bool IsNextUpdateForced() override;
 
 private:
-
   /**
    * Run each registered processor
    */
@@ -319,12 +314,11 @@ private:
   Integration::GlAbstraction& GetGlAbstraction() const;
 
 private:
-
   /**
    * Undefined copy and assignment operators
    */
-  Core(const Core& core) = delete;  // No definition
-  Core& operator=(const Core& core) = delete;  // No definition
+  Core(const Core& core) = delete;            // No definition
+  Core& operator=(const Core& core) = delete; // No definition
 
   /**
    * Create Thread local storage
@@ -332,39 +326,35 @@ private:
   void CreateThreadLocalStorage();
 
 private:
-
-  Integration::RenderController&            mRenderController;            ///< Reference to Render controller to tell it to keep rendering
-  Integration::PlatformAbstraction&         mPlatform;                    ///< The interface providing platform specific services.
+  Integration::RenderController&    mRenderController; ///< Reference to Render controller to tell it to keep rendering
+  Integration::PlatformAbstraction& mPlatform;         ///< The interface providing platform specific services.
 
   IntrusivePtr<Stage>                       mStage;                       ///< The current stage
   AnimationPlaylistOwner                    mAnimationPlaylist;           ///< For 'Fire and forget' animation support
   OwnerPointer<PropertyNotificationManager> mPropertyNotificationManager; ///< For safe signal emmision of property changed notifications
-  IntrusivePtr< RelayoutController >        mRelayoutController;          ///< Size negotiation relayout controller
+  IntrusivePtr<RelayoutController>          mRelayoutController;          ///< Size negotiation relayout controller
 
-  OwnerPointer<SceneGraph::RenderTaskProcessor> mRenderTaskProcessor;         ///< Handles the processing of render tasks
-  OwnerPointer<SceneGraph::RenderManager>       mRenderManager;               ///< Render manager
-  OwnerPointer<SceneGraph::UpdateManager>       mUpdateManager;               ///< Update manager
-  OwnerPointer<SceneGraph::DiscardQueue>        mDiscardQueue;                ///< Used to cleanup nodes & resources when no longer in use.
-  OwnerPointer<ShaderFactory>                   mShaderFactory;               ///< Shader resource factory
-  OwnerPointer<NotificationManager>             mNotificationManager;         ///< Notification manager
-  OwnerPointer<GestureEventProcessor>           mGestureEventProcessor;       ///< The gesture event processor
-  Dali::Vector<Integration::Processor*>         mProcessors;                  ///< Registered processors (not owned)
+  OwnerPointer<SceneGraph::RenderTaskProcessor> mRenderTaskProcessor;   ///< Handles the processing of render tasks
+  OwnerPointer<SceneGraph::RenderManager>       mRenderManager;         ///< Render manager
+  OwnerPointer<SceneGraph::UpdateManager>       mUpdateManager;         ///< Update manager
+  OwnerPointer<SceneGraph::DiscardQueue>        mDiscardQueue;          ///< Used to cleanup nodes & resources when no longer in use.
+  OwnerPointer<ShaderFactory>                   mShaderFactory;         ///< Shader resource factory
+  OwnerPointer<NotificationManager>             mNotificationManager;   ///< Notification manager
+  OwnerPointer<GestureEventProcessor>           mGestureEventProcessor; ///< The gesture event processor
+  Dali::Vector<Integration::Processor*>         mProcessors;            ///< Registered processors (not owned)
 
   using SceneContainer = std::vector<ScenePtr>;
-  SceneContainer                                mScenes;                      ///< A container of scenes that bound to a surface for rendering, owned by Core
+  SceneContainer mScenes; ///< A container of scenes that bound to a surface for rendering, owned by Core
 
   // The object registry
-  ObjectRegistryPtr                             mObjectRegistry;
+  ObjectRegistryPtr mObjectRegistry;
 
-  // GlAbstraction for capabilities of GL
-  // Not to use this for bypass Context.
-  Integration::GlAbstraction&               mGlAbstraction;
+  Graphics::Controller& mGraphicsController;
 
-  bool                                      mProcessingEvent  : 1;        ///< True during ProcessEvents()
-  bool                                      mForceNextUpdate:1;           ///< True if the next rendering is really required.
+  bool mProcessingEvent : 1; ///< True during ProcessEvents()
+  bool mForceNextUpdate : 1; ///< True if the next rendering is really required.
 
   friend class ThreadLocalStorage;
-
 };
 
 } // namespace Internal
old mode 100755 (executable)
new mode 100644 (file)
index 54c31af..5e775ae
@@ -1,5 +1,5 @@
 /*
- * Copyright (c) 2020 Samsung Electronics Co., Ltd.
+ * Copyright (c) 2021 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.
 
 namespace Dali
 {
-
 namespace Internal
 {
-
 namespace SceneGraph
 {
-
 #if defined(DEBUG_ENABLED)
 namespace
 {
-Debug::Filter* gLogFilter = Debug::Filter::New(Debug::NoLogging, false, "LOG_RENDER_MANAGER" );
+Debug::Filter* gLogFilter = Debug::Filter::New(Debug::NoLogging, false, "LOG_RENDER_MANAGER");
 } // unnamed namespace
 #endif
 
@@ -53,84 +50,80 @@ Debug::Filter* gLogFilter = Debug::Filter::New(Debug::NoLogging, false, "LOG_REN
  */
 struct RenderManager::Impl
 {
-  Impl( Integration::GlAbstraction& glAbstraction,
-        Integration::GlSyncAbstraction& glSyncAbstraction,
-        Integration::GlContextHelperAbstraction& glContextHelperAbstraction,
-        Integration::DepthBufferAvailable depthBufferAvailableParam,
-        Integration::StencilBufferAvailable stencilBufferAvailableParam,
-        Integration::PartialUpdateAvailable partialUpdateAvailableParam )
-  : context( glAbstraction, &sceneContextContainer ),
-    currentContext( &context ),
-    glAbstraction( glAbstraction ),
-    glSyncAbstraction( glSyncAbstraction ),
-    glContextHelperAbstraction( glContextHelperAbstraction ),
+  Impl(Graphics::Controller&               graphicsController,
+       Integration::DepthBufferAvailable   depthBufferAvailableParam,
+       Integration::StencilBufferAvailable stencilBufferAvailableParam,
+       Integration::PartialUpdateAvailable partialUpdateAvailableParam)
+  : context(graphicsController.GetGlAbstraction(), &sceneContextContainer),
+    currentContext(&context),
+    graphicsController(graphicsController),
     renderQueue(),
     renderAlgorithms(),
-    frameCount( 0u ),
-    renderBufferIndex( SceneGraphBuffers::INITIAL_UPDATE_BUFFER_INDEX ),
+    frameCount(0u),
+    renderBufferIndex(SceneGraphBuffers::INITIAL_UPDATE_BUFFER_INDEX),
     defaultSurfaceRect(),
     rendererContainer(),
     samplerContainer(),
     textureContainer(),
     frameBufferContainer(),
-    lastFrameWasRendered( false ),
-    programController( glAbstraction ),
-    depthBufferAvailable( depthBufferAvailableParam ),
-    stencilBufferAvailable( stencilBufferAvailableParam ),
-    partialUpdateAvailable( partialUpdateAvailableParam ),
+    lastFrameWasRendered(false),
+    programController(graphicsController),
+    depthBufferAvailable(depthBufferAvailableParam),
+    stencilBufferAvailable(stencilBufferAvailableParam),
+    partialUpdateAvailable(partialUpdateAvailableParam),
     defaultSurfaceOrientation(0)
   {
-     // Create thread pool with just one thread ( there may be a need to create more threads in the future ).
-    threadPool = std::unique_ptr<Dali::ThreadPool>( new Dali::ThreadPool() );
-    threadPool->Initialize( 1u );
+    // Create thread pool with just one thread ( there may be a need to create more threads in the future ).
+    threadPool = std::unique_ptr<Dali::ThreadPool>(new Dali::ThreadPool());
+    threadPool->Initialize(1u);
   }
 
   ~Impl()
   {
-    threadPool.reset( nullptr ); // reset now to maintain correct destruction order
+    threadPool.reset(nullptr); // reset now to maintain correct destruction order
   }
 
-  void AddRenderTracker( Render::RenderTracker* renderTracker )
+  void AddRenderTracker(Render::RenderTracker* renderTracker)
   {
-    DALI_ASSERT_DEBUG( renderTracker != NULL );
-    mRenderTrackers.PushBack( renderTracker );
+    DALI_ASSERT_DEBUG(renderTracker != NULL);
+    mRenderTrackers.PushBack(renderTracker);
   }
 
-  void RemoveRenderTracker( Render::RenderTracker* renderTracker )
+  void RemoveRenderTracker(Render::RenderTracker* renderTracker)
   {
-    mRenderTrackers.EraseObject( renderTracker );
+    mRenderTrackers.EraseObject(renderTracker);
   }
 
   Context* CreateSceneContext()
   {
-    Context* context = new Context( glAbstraction );
-    sceneContextContainer.PushBack( context );
+    Context* context = new Context(graphicsController.GetGlAbstraction());
+    sceneContextContainer.PushBack(context);
     return context;
   }
 
-  void DestroySceneContext( Context* sceneContext )
+  void DestroySceneContext(Context* sceneContext)
   {
-    auto iter = std::find( sceneContextContainer.Begin(), sceneContextContainer.End(), sceneContext );
-    if( iter != sceneContextContainer.End() )
+    auto iter = std::find(sceneContextContainer.Begin(), sceneContextContainer.End(), sceneContext);
+    if(iter != sceneContextContainer.End())
     {
-      ( *iter )->GlContextDestroyed();
-      sceneContextContainer.Erase( iter );
+      (*iter)->GlContextDestroyed();
+      sceneContextContainer.Erase(iter);
     }
   }
 
-  Context* ReplaceSceneContext( Context* oldSceneContext )
+  Context* ReplaceSceneContext(Context* oldSceneContext)
   {
-    Context* newContext = new Context( glAbstraction );
+    Context* newContext = new Context(graphicsController.GetGlAbstraction());
 
     oldSceneContext->GlContextDestroyed();
 
-    std::replace( sceneContextContainer.begin(), sceneContextContainer.end(), oldSceneContext, newContext );
+    std::replace(sceneContextContainer.begin(), sceneContextContainer.end(), oldSceneContext, newContext);
     return newContext;
   }
 
   void UpdateTrackers()
   {
-    for( auto&& iter : mRenderTrackers )
+    for(auto&& iter : mRenderTrackers)
     {
       iter->PollSyncObject();
     }
@@ -138,62 +131,55 @@ struct RenderManager::Impl
 
   // the order is important for destruction,
   // programs are owned by context at the moment.
-  Context                                   context;                 ///< Holds the GL state of the share resource context
-  Context*                                  currentContext;          ///< Holds the GL state of the current context for rendering
-  OwnerContainer< Context* >                sceneContextContainer;   ///< List of owned contexts holding the GL state per scene
-  Integration::GlAbstraction&               glAbstraction;           ///< GL abstraction
-  Integration::GlSyncAbstraction&           glSyncAbstraction;       ///< GL sync abstraction
-  Integration::GlContextHelperAbstraction&  glContextHelperAbstraction; ///< GL context helper abstraction
-  RenderQueue                               renderQueue;             ///< A message queue for receiving messages from the update-thread.
-
-  std::vector< SceneGraph::Scene* >         sceneContainer;          ///< List of pointers to the scene graph objects of the scenes
+  Context                  context;               ///< Holds the GL state of the share resource context
+  Context*                 currentContext;        ///< Holds the GL state of the current context for rendering
+  OwnerContainer<Context*> sceneContextContainer; ///< List of owned contexts holding the GL state per scene
+  Graphics::Controller&    graphicsController;
+  RenderQueue              renderQueue; ///< A message queue for receiving messages from the update-thread.
 
-  Render::RenderAlgorithms                  renderAlgorithms;        ///< The RenderAlgorithms object is used to action the renders required by a RenderInstruction
+  std::vector<SceneGraph::Scene*> sceneContainer; ///< List of pointers to the scene graph objects of the scenes
 
-  uint32_t                                  frameCount;              ///< The current frame count
-  BufferIndex                               renderBufferIndex;       ///< The index of the buffer to read from; this is opposite of the "update" buffer
+  Render::RenderAlgorithms renderAlgorithms; ///< The RenderAlgorithms object is used to action the renders required by a RenderInstruction
 
-  Rect<int32_t>                             defaultSurfaceRect;      ///< Rectangle for the default surface we are rendering to
+  uint32_t    frameCount;        ///< The current frame count
+  BufferIndex renderBufferIndex; ///< The index of the buffer to read from; this is opposite of the "update" buffer
 
-  OwnerContainer< Render::Renderer* >       rendererContainer;       ///< List of owned renderers
-  OwnerContainer< Render::Sampler* >        samplerContainer;        ///< List of owned samplers
-  OwnerContainer< Render::Texture* >        textureContainer;        ///< List of owned textures
-  OwnerContainer< Render::FrameBuffer* >    frameBufferContainer;    ///< List of owned framebuffers
-  OwnerContainer< Render::VertexBuffer* >   vertexBufferContainer;   ///< List of owned vertex buffers
-  OwnerContainer< Render::Geometry* >       geometryContainer;       ///< List of owned Geometries
+  Rect<int32_t> defaultSurfaceRect; ///< Rectangle for the default surface we are rendering to
 
-  bool                                      lastFrameWasRendered;    ///< Keeps track of the last frame being rendered due to having render instructions
+  OwnerContainer<Render::Renderer*>     rendererContainer;     ///< List of owned renderers
+  OwnerContainer<Render::Sampler*>      samplerContainer;      ///< List of owned samplers
+  OwnerContainer<Render::Texture*>      textureContainer;      ///< List of owned textures
+  OwnerContainer<Render::FrameBuffer*>  frameBufferContainer;  ///< List of owned framebuffers
+  OwnerContainer<Render::VertexBuffer*> vertexBufferContainer; ///< List of owned vertex buffers
+  OwnerContainer<Render::Geometry*>     geometryContainer;     ///< List of owned Geometries
 
-  OwnerContainer< Render::RenderTracker* >  mRenderTrackers;         ///< List of render trackers
+  bool lastFrameWasRendered; ///< Keeps track of the last frame being rendered due to having render instructions
 
-  ProgramController                         programController;        ///< Owner of the GL programs
+  OwnerContainer<Render::RenderTracker*> mRenderTrackers; ///< List of render trackers
 
-  Integration::DepthBufferAvailable         depthBufferAvailable;     ///< Whether the depth buffer is available
-  Integration::StencilBufferAvailable       stencilBufferAvailable;   ///< Whether the stencil buffer is available
-  Integration::PartialUpdateAvailable       partialUpdateAvailable;   ///< Whether the partial update is available
+  ProgramController programController; ///< Owner of the GL programs
 
-  std::unique_ptr<Dali::ThreadPool>         threadPool;               ///< The thread pool
-  Vector<GLuint>                            boundTextures;            ///< The textures bound for rendering
-  Vector<GLuint>                            textureDependencyList;    ///< The dependency list of binded textures
+  Integration::DepthBufferAvailable   depthBufferAvailable;   ///< Whether the depth buffer is available
+  Integration::StencilBufferAvailable stencilBufferAvailable; ///< Whether the stencil buffer is available
+  Integration::PartialUpdateAvailable partialUpdateAvailable; ///< Whether the partial update is available
 
-  int                                       defaultSurfaceOrientation; ///< defaultSurfaceOrientation for the default surface we are rendering to
+  std::unique_ptr<Dali::ThreadPool> threadPool;            ///< The thread pool
+  Vector<GLuint>                    boundTextures;         ///< The textures bound for rendering
+  Vector<GLuint>                    textureDependencyList; ///< The dependency list of binded textures
 
+  int defaultSurfaceOrientation; ///< defaultSurfaceOrientation for the default surface we are rendering to
 };
 
-RenderManager* RenderManager::New( Integration::GlAbstraction& glAbstraction,
-                                   Integration::GlSyncAbstraction& glSyncAbstraction,
-                                   Integration::GlContextHelperAbstraction& glContextHelperAbstraction,
-                                   Integration::DepthBufferAvailable depthBufferAvailable,
-                                   Integration::StencilBufferAvailable stencilBufferAvailable,
-                                   Integration::PartialUpdateAvailable partialUpdateAvailable )
+RenderManager* RenderManager::New(Graphics::Controller&               graphicsController,
+                                  Integration::DepthBufferAvailable   depthBufferAvailable,
+                                  Integration::StencilBufferAvailable stencilBufferAvailable,
+                                  Integration::PartialUpdateAvailable partialUpdateAvailable)
 {
   RenderManager* manager = new RenderManager;
-  manager->mImpl = new Impl( glAbstraction,
-                             glSyncAbstraction,
-                             glContextHelperAbstraction,
-                             depthBufferAvailable,
-                             stencilBufferAvailable,
-                             partialUpdateAvailable );
+  manager->mImpl         = new Impl(graphicsController,
+                            depthBufferAvailable,
+                            stencilBufferAvailable,
+                            partialUpdateAvailable);
   return manager;
 }
 
@@ -227,33 +213,33 @@ void RenderManager::ContextDestroyed()
   mImpl->programController.GlContextDestroyed();
 
   //Inform textures
-  for( auto&& texture : mImpl->textureContainer )
+  for(auto&& texture : mImpl->textureContainer)
   {
     texture->GlContextDestroyed();
   }
 
   //Inform framebuffers
-  for( auto&& framebuffer : mImpl->frameBufferContainer )
+  for(auto&& framebuffer : mImpl->frameBufferContainer)
   {
     framebuffer->GlContextDestroyed();
   }
 
   // inform renderers
-  for( auto&& renderer : mImpl->rendererContainer )
+  for(auto&& renderer : mImpl->rendererContainer)
   {
     renderer->GlContextDestroyed();
   }
 
   // inform context
-  for( auto&& context : mImpl->sceneContextContainer )
+  for(auto&& context : mImpl->sceneContextContainer)
   {
     context->GlContextDestroyed();
   }
 }
 
-void RenderManager::SetShaderSaver( ShaderSaver& upstream )
+void RenderManager::SetShaderSaver(ShaderSaver& upstream)
 {
-  mImpl->programController.SetShaderSaver( upstream );
+  mImpl->programController.SetShaderSaver(upstream);
 }
 
 void RenderManager::SetDefaultSurfaceRect(const Rect<int32_t>& rect)
@@ -266,211 +252,211 @@ void RenderManager::SetDefaultSurfaceOrientation(int orientation)
   mImpl->defaultSurfaceOrientation = orientation;
 }
 
-void RenderManager::AddRenderer( OwnerPointer< Render::Renderer >& renderer )
+void RenderManager::AddRenderer(OwnerPointer<Render::Renderer>& renderer)
 {
   // Initialize the renderer as we are now in render thread
-  renderer->Initialize( mImpl->context );
+  renderer->Initialize(mImpl->context);
 
-  mImpl->rendererContainer.PushBack( renderer.Release() );
+  mImpl->rendererContainer.PushBack(renderer.Release());
 }
 
-void RenderManager::RemoveRenderer( Render::Renderer* renderer )
+void RenderManager::RemoveRenderer(Render::Renderer* renderer)
 {
-  mImpl->rendererContainer.EraseObject( renderer );
+  mImpl->rendererContainer.EraseObject(renderer);
 }
 
-void RenderManager::AddSampler( OwnerPointer< Render::Sampler >& sampler )
+void RenderManager::AddSampler(OwnerPointer<Render::Sampler>& sampler)
 {
-  mImpl->samplerContainer.PushBack( sampler.Release() );
+  mImpl->samplerContainer.PushBack(sampler.Release());
 }
 
-void RenderManager::RemoveSampler( Render::Sampler* sampler )
+void RenderManager::RemoveSampler(Render::Sampler* sampler)
 {
-  mImpl->samplerContainer.EraseObject( sampler );
+  mImpl->samplerContainer.EraseObject(sampler);
 }
 
-void RenderManager::AddTexture( OwnerPointer< Render::Texture >& texture )
+void RenderManager::AddTexture(OwnerPointer<Render::Texture>& texture)
 {
-  texture->Initialize( mImpl->context );
-  mImpl->textureContainer.PushBack( texture.Release() );
+  texture->Initialize(mImpl->context);
+  mImpl->textureContainer.PushBack(texture.Release());
 }
 
-void RenderManager::RemoveTexture( Render::Texture* texture )
+void RenderManager::RemoveTexture(Render::Texture* texture)
 {
-  DALI_ASSERT_DEBUG( NULL != texture );
+  DALI_ASSERT_DEBUG(NULL != texture);
 
   // Find the texture, use reference to pointer so we can do the erase safely
-  for ( auto&& iter : mImpl->textureContainer )
+  for(auto&& iter : mImpl->textureContainer)
   {
-    if ( iter == texture )
+    if(iter == texture)
     {
-      texture->Destroy( mImpl->context );
-      mImpl->textureContainer.Erase( &iter ); // Texture found; now destroy it
+      texture->Destroy(mImpl->context);
+      mImpl->textureContainer.Erase(&iter); // Texture found; now destroy it
       return;
     }
   }
 }
 
-void RenderManager::UploadTexture( Render::Texture* texture, PixelDataPtr pixelData, const Texture::UploadParams& params )
+void RenderManager::UploadTexture(Render::Texture* texture, PixelDataPtr pixelData, const Texture::UploadParams& params)
 {
-  texture->Upload( mImpl->context, pixelData, params );
+  texture->Upload(mImpl->context, pixelData, params);
 }
 
-void RenderManager::GenerateMipmaps( Render::Texture* texture )
+void RenderManager::GenerateMipmaps(Render::Texture* texture)
 {
-  texture->GenerateMipmaps( mImpl->context );
+  texture->GenerateMipmaps(mImpl->context);
 }
 
-void RenderManager::SetFilterMode( Render::Sampler* sampler, uint32_t minFilterMode, uint32_t magFilterMode )
+void RenderManager::SetFilterMode(Render::Sampler* sampler, uint32_t minFilterMode, uint32_t magFilterMode)
 {
-  sampler->mMinificationFilter = static_cast<Dali::FilterMode::Type>(minFilterMode);
-  sampler->mMagnificationFilter = static_cast<Dali::FilterMode::Type>(magFilterMode );
+  sampler->mMinificationFilter  = static_cast<Dali::FilterMode::Type>(minFilterMode);
+  sampler->mMagnificationFilter = static_cast<Dali::FilterMode::Type>(magFilterMode);
 }
 
-void RenderManager::SetWrapMode( Render::Sampler* sampler, uint32_t rWrapMode, uint32_t sWrapMode, uint32_t tWrapMode )
+void RenderManager::SetWrapMode(Render::Sampler* sampler, uint32_t rWrapMode, uint32_t sWrapMode, uint32_t tWrapMode)
 {
   sampler->mRWrapMode = static_cast<Dali::WrapMode::Type>(rWrapMode);
   sampler->mSWrapMode = static_cast<Dali::WrapMode::Type>(sWrapMode);
   sampler->mTWrapMode = static_cast<Dali::WrapMode::Type>(tWrapMode);
 }
 
-void RenderManager::AddFrameBuffer( OwnerPointer< Render::FrameBuffer >& frameBuffer )
+void RenderManager::AddFrameBuffer(OwnerPointer<Render::FrameBuffer>& frameBuffer)
 {
   Render::FrameBuffer* frameBufferPtr = frameBuffer.Release();
-  mImpl->frameBufferContainer.PushBack( frameBufferPtr );
-  frameBufferPtr->Initialize( mImpl->context );
+  mImpl->frameBufferContainer.PushBack(frameBufferPtr);
+  frameBufferPtr->Initialize(mImpl->context);
 }
 
-void RenderManager::RemoveFrameBuffer( Render::FrameBuffer* frameBuffer )
+void RenderManager::RemoveFrameBuffer(Render::FrameBuffer* frameBuffer)
 {
-  DALI_ASSERT_DEBUG( NULL != frameBuffer );
+  DALI_ASSERT_DEBUG(NULL != frameBuffer);
 
   // Find the sampler, use reference so we can safely do the erase
-  for ( auto&& iter : mImpl->frameBufferContainer )
+  for(auto&& iter : mImpl->frameBufferContainer)
   {
-    if ( iter == frameBuffer )
+    if(iter == frameBuffer)
     {
-      frameBuffer->Destroy( mImpl->context );
-      mImpl->frameBufferContainer.Erase( &iter ); // frameBuffer found; now destroy it
+      frameBuffer->Destroy(mImpl->context);
+      mImpl->frameBufferContainer.Erase(&iter); // frameBuffer found; now destroy it
 
       break;
     }
   }
 }
-void RenderManager::InitializeScene( SceneGraph::Scene* scene )
+void RenderManager::InitializeScene(SceneGraph::Scene* scene)
 {
-  scene->Initialize( *mImpl->CreateSceneContext() );
-  mImpl->sceneContainer.push_back( scene );
+  scene->Initialize(*mImpl->CreateSceneContext());
+  mImpl->sceneContainer.push_back(scene);
 }
 
-void RenderManager::UninitializeScene( SceneGraph::Scene* scene )
+void RenderManager::UninitializeScene(SceneGraph::Scene* scene)
 {
-  mImpl->DestroySceneContext( scene->GetContext() );
+  mImpl->DestroySceneContext(scene->GetContext());
 
-  auto iter = std::find( mImpl->sceneContainer.begin(), mImpl->sceneContainer.end(), scene );
-  if( iter != mImpl->sceneContainer.end() )
+  auto iter = std::find(mImpl->sceneContainer.begin(), mImpl->sceneContainer.end(), scene);
+  if(iter != mImpl->sceneContainer.end())
   {
-    mImpl->sceneContainer.erase( iter );
+    mImpl->sceneContainer.erase(iter);
   }
 }
 
-void RenderManager::SurfaceReplaced( SceneGraph::Scene* scene )
+void RenderManager::SurfaceReplaced(SceneGraph::Scene* scene)
 {
-  Context* newContext = mImpl->ReplaceSceneContext( scene->GetContext() );
-  scene->Initialize( *newContext );
+  Context* newContext = mImpl->ReplaceSceneContext(scene->GetContext());
+  scene->Initialize(*newContext);
 }
 
-void RenderManager::AttachColorTextureToFrameBuffer( Render::FrameBuffer* frameBuffer, Render::Texture* texture, uint32_t mipmapLevel, uint32_t layer )
+void RenderManager::AttachColorTextureToFrameBuffer(Render::FrameBuffer* frameBuffer, Render::Texture* texture, uint32_t mipmapLevel, uint32_t layer)
 {
-  frameBuffer->AttachColorTexture( mImpl->context, texture, mipmapLevel, layer );
+  frameBuffer->AttachColorTexture(mImpl->context, texture, mipmapLevel, layer);
 }
 
-void RenderManager::AttachDepthTextureToFrameBuffer( Render::FrameBuffer* frameBuffer, Render::Texture* texture, uint32_t mipmapLevel )
+void RenderManager::AttachDepthTextureToFrameBuffer(Render::FrameBuffer* frameBuffer, Render::Texture* texture, uint32_t mipmapLevel)
 {
-  frameBuffer->AttachDepthTexture( mImpl->context, texture, mipmapLevel );
+  frameBuffer->AttachDepthTexture(mImpl->context, texture, mipmapLevel);
 }
 
-void RenderManager::AttachDepthStencilTextureToFrameBuffer( Render::FrameBuffer* frameBuffer, Render::Texture* texture, uint32_t mipmapLevel )
+void RenderManager::AttachDepthStencilTextureToFrameBuffer(Render::FrameBuffer* frameBuffer, Render::Texture* texture, uint32_t mipmapLevel)
 {
-  frameBuffer->AttachDepthStencilTexture( mImpl->context, texture, mipmapLevel );
+  frameBuffer->AttachDepthStencilTexture(mImpl->context, texture, mipmapLevel);
 }
 
-void RenderManager::AddVertexBuffer( OwnerPointer< Render::VertexBuffer >& vertexBuffer )
+void RenderManager::AddVertexBuffer(OwnerPointer<Render::VertexBuffer>& vertexBuffer)
 {
-  mImpl->vertexBufferContainer.PushBack( vertexBuffer.Release() );
+  mImpl->vertexBufferContainer.PushBack(vertexBuffer.Release());
 }
 
-void RenderManager::RemoveVertexBuffer( Render::VertexBuffer* vertexBuffer )
+void RenderManager::RemoveVertexBuffer(Render::VertexBuffer* vertexBuffer)
 {
-  mImpl->vertexBufferContainer.EraseObject( vertexBuffer );
+  mImpl->vertexBufferContainer.EraseObject(vertexBuffer);
 }
 
-void RenderManager::SetVertexBufferFormat( Render::VertexBuffer* vertexBuffer, OwnerPointer< Render::VertexBuffer::Format>& format )
+void RenderManager::SetVertexBufferFormat(Render::VertexBuffer* vertexBuffer, OwnerPointer<Render::VertexBuffer::Format>& format)
 {
-  vertexBuffer->SetFormat( format.Release() );
+  vertexBuffer->SetFormat(format.Release());
 }
 
-void RenderManager::SetVertexBufferData( Render::VertexBuffer* vertexBuffer, OwnerPointer< Vector<uint8_t> >& data, uint32_t size )
+void RenderManager::SetVertexBufferData(Render::VertexBuffer* vertexBuffer, OwnerPointer<Vector<uint8_t>>& data, uint32_t size)
 {
-  vertexBuffer->SetData( data.Release(), size );
+  vertexBuffer->SetData(data.Release(), size);
 }
 
-void RenderManager::SetIndexBuffer( Render::Geometry* geometry, Dali::Vector<uint16_t>& indices )
+void RenderManager::SetIndexBuffer(Render::Geometry* geometry, Dali::Vector<uint16_t>& indices)
 {
-  geometry->SetIndexBuffer( indices );
+  geometry->SetIndexBuffer(indices);
 }
 
-void RenderManager::AddGeometry( OwnerPointer< Render::Geometry >& geometry )
+void RenderManager::AddGeometry(OwnerPointer<Render::Geometry>& geometry)
 {
-  mImpl->geometryContainer.PushBack( geometry.Release() );
+  mImpl->geometryContainer.PushBack(geometry.Release());
 }
 
-void RenderManager::RemoveGeometry( Render::Geometry* geometry )
+void RenderManager::RemoveGeometry(Render::Geometry* geometry)
 {
-  mImpl->geometryContainer.EraseObject( geometry );
+  mImpl->geometryContainer.EraseObject(geometry);
 }
 
-void RenderManager::AttachVertexBuffer( Render::Geometry* geometry, Render::VertexBuffer* vertexBuffer )
+void RenderManager::AttachVertexBuffer(Render::Geometry* geometry, Render::VertexBuffer* vertexBuffer)
 {
-  DALI_ASSERT_DEBUG( NULL != geometry );
+  DALI_ASSERT_DEBUG(NULL != geometry);
 
   // Find the geometry
-  for ( auto&& iter : mImpl->geometryContainer )
+  for(auto&& iter : mImpl->geometryContainer)
   {
-    if ( iter == geometry )
+    if(iter == geometry)
     {
-      iter->AddVertexBuffer( vertexBuffer );
+      iter->AddVertexBuffer(vertexBuffer);
       break;
     }
   }
 }
 
-void RenderManager::RemoveVertexBuffer( Render::Geometry* geometry, Render::VertexBuffer* vertexBuffer )
+void RenderManager::RemoveVertexBuffer(Render::Geometry* geometry, Render::VertexBuffer* vertexBuffer)
 {
-  DALI_ASSERT_DEBUG( NULL != geometry );
+  DALI_ASSERT_DEBUG(NULL != geometry);
 
   // Find the geometry
-  for ( auto&& iter : mImpl->geometryContainer )
+  for(auto&& iter : mImpl->geometryContainer)
   {
-    if ( iter == geometry )
+    if(iter == geometry)
     {
-      iter->RemoveVertexBuffer( vertexBuffer );
+      iter->RemoveVertexBuffer(vertexBuffer);
       break;
     }
   }
 }
 
-void RenderManager::SetGeometryType( Render::Geometry* geometry, uint32_t geometryType )
+void RenderManager::SetGeometryType(Render::Geometry* geometry, uint32_t geometryType)
 {
-  geometry->SetType( Render::Geometry::Type(geometryType) );
+  geometry->SetType(Render::Geometry::Type(geometryType));
 }
 
-void RenderManager::AddRenderTracker( Render::RenderTracker* renderTracker )
+void RenderManager::AddRenderTracker(Render::RenderTracker* renderTracker)
 {
   mImpl->AddRenderTracker(renderTracker);
 }
 
-void RenderManager::RemoveRenderTracker( Render::RenderTracker* renderTracker )
+void RenderManager::RemoveRenderTracker(Render::RenderTracker* renderTracker)
 {
   mImpl->RemoveRenderTracker(renderTracker);
 }
@@ -480,46 +466,42 @@ ProgramCache* RenderManager::GetProgramCache()
   return &(mImpl->programController);
 }
 
-void RenderManager::PreRender( Integration::RenderStatus& status, bool forceClear, bool uploadOnly )
+void RenderManager::PreRender(Integration::RenderStatus& status, bool forceClear, bool uploadOnly)
 {
-  DALI_PRINT_RENDER_START( mImpl->renderBufferIndex );
+  DALI_PRINT_RENDER_START(mImpl->renderBufferIndex);
 
   // Core::Render documents that GL context must be current before calling Render
-  DALI_ASSERT_DEBUG( mImpl->context.IsGlContextCreated() );
+  DALI_ASSERT_DEBUG(mImpl->context.IsGlContextCreated());
 
   // Increment the frame count at the beginning of each frame
   ++mImpl->frameCount;
 
   // Process messages queued during previous update
-  mImpl->renderQueue.ProcessMessages( mImpl->renderBufferIndex );
+  mImpl->renderQueue.ProcessMessages(mImpl->renderBufferIndex);
 
   uint32_t count = 0u;
-  for( uint32_t i = 0; i < mImpl->sceneContainer.size(); ++i )
+  for(uint32_t i = 0; i < mImpl->sceneContainer.size(); ++i)
   {
-    count += mImpl->sceneContainer[i]->GetRenderInstructions().Count( mImpl->renderBufferIndex );
+    count += mImpl->sceneContainer[i]->GetRenderInstructions().Count(mImpl->renderBufferIndex);
   }
 
   const bool haveInstructions = count > 0u;
 
-  DALI_LOG_INFO( gLogFilter, Debug::General,
-                 "Render: haveInstructions(%s) || mImpl->lastFrameWasRendered(%s) || forceClear(%s)\n",
-                 haveInstructions ? "true" : "false",
-                 mImpl->lastFrameWasRendered ? "true" : "false",
-                 forceClear ? "true" : "false" );
+  DALI_LOG_INFO(gLogFilter, Debug::General, "Render: haveInstructions(%s) || mImpl->lastFrameWasRendered(%s) || forceClear(%s)\n", haveInstructions ? "true" : "false", mImpl->lastFrameWasRendered ? "true" : "false", forceClear ? "true" : "false");
 
   // Only render if we have instructions to render, or the last frame was rendered (and therefore a clear is required).
-  if( haveInstructions || mImpl->lastFrameWasRendered || forceClear )
+  if(haveInstructions || mImpl->lastFrameWasRendered || forceClear)
   {
-    DALI_LOG_INFO( gLogFilter, Debug::General, "Render: Processing\n" );
+    DALI_LOG_INFO(gLogFilter, Debug::General, "Render: Processing\n");
 
     // Switch to the shared context
-    if ( mImpl->currentContext != &mImpl->context )
+    if(mImpl->currentContext != &mImpl->context)
     {
       mImpl->currentContext = &mImpl->context;
 
-      if ( mImpl->currentContext->IsSurfacelessContextSupported() )
+      if(mImpl->currentContext->IsSurfacelessContextSupported())
       {
-        mImpl->glContextHelperAbstraction.MakeSurfacelessContextCurrent();
+        mImpl->graphicsController.GetGlContextHelperAbstraction().MakeSurfacelessContextCurrent();
       }
 
       // Clear the current cached program when the context is switched
@@ -527,37 +509,37 @@ void RenderManager::PreRender( Integration::RenderStatus& status, bool forceClea
     }
 
     // Upload the geometries
-    for( uint32_t i = 0; i < mImpl->sceneContainer.size(); ++i )
+    for(uint32_t i = 0; i < mImpl->sceneContainer.size(); ++i)
     {
       RenderInstructionContainer& instructions = mImpl->sceneContainer[i]->GetRenderInstructions();
-      for ( uint32_t j = 0; j < instructions.Count( mImpl->renderBufferIndex ); ++j )
+      for(uint32_t j = 0; j < instructions.Count(mImpl->renderBufferIndex); ++j)
       {
-        RenderInstruction& instruction = instructions.At( mImpl->renderBufferIndex, j );
+        RenderInstruction& instruction = instructions.At(mImpl->renderBufferIndex, j);
 
-        const Matrix* viewMatrix       = instruction.GetViewMatrix( mImpl->renderBufferIndex );
-        const Matrix* projectionMatrix = instruction.GetProjectionMatrix( mImpl->renderBufferIndex );
+        const Matrix* viewMatrix       = instruction.GetViewMatrix(mImpl->renderBufferIndex);
+        const Matrix* projectionMatrix = instruction.GetProjectionMatrix(mImpl->renderBufferIndex);
 
-        DALI_ASSERT_DEBUG( viewMatrix );
-        DALI_ASSERT_DEBUG( projectionMatrix );
+        DALI_ASSERT_DEBUG(viewMatrix);
+        DALI_ASSERT_DEBUG(projectionMatrix);
 
-        if( viewMatrix && projectionMatrix )
+        if(viewMatrix && projectionMatrix)
         {
           const RenderListContainer::SizeType renderListCount = instruction.RenderListCount();
 
           // Iterate through each render list.
-          for( RenderListContainer::SizeType index = 0; index < renderListCount; ++index )
+          for(RenderListContainer::SizeType index = 0; index < renderListCount; ++index)
           {
-            const RenderList* renderList = instruction.GetRenderList( index );
+            const RenderList* renderList = instruction.GetRenderList(index);
 
-            if( renderList && !renderList->IsEmpty() )
+            if(renderList && !renderList->IsEmpty())
             {
               const std::size_t itemCount = renderList->Count();
-              for( uint32_t itemIndex = 0u; itemIndex < itemCount; ++itemIndex )
+              for(uint32_t itemIndex = 0u; itemIndex < itemCount; ++itemIndex)
               {
-                const RenderItem& item = renderList->GetItem( itemIndex );
-                if( DALI_LIKELY( item.mRenderer ) )
+                const RenderItem& item = renderList->GetItem(itemIndex);
+                if(DALI_LIKELY(item.mRenderer))
                 {
-                  item.mRenderer->Upload( *mImpl->currentContext );
+                  item.mRenderer->Upload(*mImpl->currentContext);
                 }
               }
             }
@@ -568,17 +550,17 @@ void RenderManager::PreRender( Integration::RenderStatus& status, bool forceClea
   }
 }
 
-void RenderManager::PreRender( Integration::Scene& scene, std::vector<Rect<int>>& damagedRects )
+void RenderManager::PreRender(Integration::Scene& scene, std::vector<Rect<int>>& damagedRects)
 {
-  if (mImpl->partialUpdateAvailable != Integration::PartialUpdateAvailable::TRUE)
+  if(mImpl->partialUpdateAvailable != Integration::PartialUpdateAvailable::TRUE)
   {
     return;
   }
 
-  Internal::Scene& sceneInternal = GetImplementation(scene);
-  SceneGraph::Scene* sceneObject = sceneInternal.GetSceneObject();
+  Internal::Scene&   sceneInternal = GetImplementation(scene);
+  SceneGraph::Scene* sceneObject   = sceneInternal.GetSceneObject();
 
-  if( sceneObject->IsRenderingSkipped() )
+  if(sceneObject->IsRenderingSkipped())
   {
     // We don't need to calculate dirty rects
     return;
@@ -600,7 +582,7 @@ void RenderManager::PreRender( Integration::Scene& scene, std::vector<Rect<int>>
 
     ~DamagedRectsCleaner()
     {
-      if (mCleanOnReturn)
+      if(mCleanOnReturn)
       {
         mDamagedRects.clear();
       }
@@ -608,10 +590,10 @@ void RenderManager::PreRender( Integration::Scene& scene, std::vector<Rect<int>>
 
   private:
     std::vector<Rect<int>>& mDamagedRects;
-    bool mCleanOnReturn;
+    bool                    mCleanOnReturn;
   };
 
-  Rect<int32_t> surfaceRect = Rect<int32_t>(0, 0, static_cast<int32_t>( scene.GetSize().width ), static_cast<int32_t>( scene.GetSize().height ));
+  Rect<int32_t> surfaceRect = Rect<int32_t>(0, 0, static_cast<int32_t>(scene.GetSize().width), static_cast<int32_t>(scene.GetSize().height));
 
   // Clean collected dirty/damaged rects on exit if 3d layer or 3d node or other conditions.
   DamagedRectsCleaner damagedRectCleaner(damagedRects);
@@ -619,41 +601,41 @@ void RenderManager::PreRender( Integration::Scene& scene, std::vector<Rect<int>>
   // Mark previous dirty rects in the sorted array. The array is already sorted by node and renderer, frame number.
   // so you don't need to sort: std::stable_sort(itemsDirtyRects.begin(), itemsDirtyRects.end());
   std::vector<DirtyRect>& itemsDirtyRects = sceneInternal.GetItemsDirtyRects();
-  for (DirtyRect& dirtyRect : itemsDirtyRects)
+  for(DirtyRect& dirtyRect : itemsDirtyRects)
   {
     dirtyRect.visited = false;
   }
 
-  uint32_t count = sceneObject->GetRenderInstructions().Count( mImpl->renderBufferIndex );
-  for (uint32_t i = 0; i < count; ++i)
+  uint32_t count = sceneObject->GetRenderInstructions().Count(mImpl->renderBufferIndex);
+  for(uint32_t i = 0; i < count; ++i)
   {
-    RenderInstruction& instruction = sceneObject->GetRenderInstructions().At( mImpl->renderBufferIndex, i );
+    RenderInstruction& instruction = sceneObject->GetRenderInstructions().At(mImpl->renderBufferIndex, i);
 
-    if (instruction.mFrameBuffer)
+    if(instruction.mFrameBuffer)
     {
       return; // TODO: reset, we don't deal with render tasks with framebuffers (for now)
     }
 
     const Camera* camera = instruction.GetCamera();
-    if (camera->mType == Camera::DEFAULT_TYPE && camera->mTargetPosition == Camera::DEFAULT_TARGET_POSITION)
+    if(camera->mType == Camera::DEFAULT_TYPE && camera->mTargetPosition == Camera::DEFAULT_TARGET_POSITION)
     {
       const Node* node = instruction.GetCamera()->GetNode();
-      if (node)
+      if(node)
       {
-        Vector3 position;
-        Vector3 scale;
+        Vector3    position;
+        Vector3    scale;
         Quaternion orientation;
         node->GetWorldMatrix(mImpl->renderBufferIndex).GetTransformComponents(position, orientation, scale);
 
         Vector3 orientationAxis;
-        Radian orientationAngle;
-        orientation.ToAxisAngle( orientationAxis, orientationAngle );
-
-        if (position.x > Math::MACHINE_EPSILON_10000 ||
-            position.y > Math::MACHINE_EPSILON_10000 ||
-            orientationAxis != Vector3(0.0f, 1.0f, 0.0f) ||
-            orientationAngle != ANGLE_180 ||
-            scale != Vector3(1.0f, 1.0f, 1.0f))
+        Radian  orientationAngle;
+        orientation.ToAxisAngle(orientationAxis, orientationAngle);
+
+        if(position.x > Math::MACHINE_EPSILON_10000 ||
+           position.y > Math::MACHINE_EPSILON_10000 ||
+           orientationAxis != Vector3(0.0f, 1.0f, 0.0f) ||
+           orientationAngle != ANGLE_180 ||
+           scale != Vector3(1.0f, 1.0f, 1.0f))
         {
           return;
         }
@@ -665,11 +647,11 @@ void RenderManager::PreRender( Integration::Scene& scene, std::vector<Rect<int>>
     }
 
     Rect<int32_t> viewportRect;
-    if (instruction.mIsViewportSet)
+    if(instruction.mIsViewportSet)
     {
       const int32_t y = (surfaceRect.height - instruction.mViewport.height) - instruction.mViewport.y;
-      viewportRect.Set(instruction.mViewport.x,  y, instruction.mViewport.width, instruction.mViewport.height);
-      if (viewportRect.IsEmpty() || !viewportRect.IsValid())
+      viewportRect.Set(instruction.mViewport.x, y, instruction.mViewport.width, instruction.mViewport.height);
+      if(viewportRect.IsEmpty() || !viewportRect.IsValid())
       {
         return; // just skip funny use cases for now, empty viewport means it is set somewhere else
       }
@@ -681,20 +663,20 @@ void RenderManager::PreRender( Integration::Scene& scene, std::vector<Rect<int>>
 
     const Matrix* viewMatrix       = instruction.GetViewMatrix(mImpl->renderBufferIndex);
     const Matrix* projectionMatrix = instruction.GetProjectionMatrix(mImpl->renderBufferIndex);
-    if (viewMatrix && projectionMatrix)
+    if(viewMatrix && projectionMatrix)
     {
       const RenderListContainer::SizeType count = instruction.RenderListCount();
-      for (RenderListContainer::SizeType index = 0u; index < count; ++index)
+      for(RenderListContainer::SizeType index = 0u; index < count; ++index)
       {
-        const RenderList* renderList = instruction.GetRenderList( index );
-        if (renderList && !renderList->IsEmpty())
+        const RenderList* renderList = instruction.GetRenderList(index);
+        if(renderList && !renderList->IsEmpty())
         {
           const std::size_t count = renderList->Count();
-          for (uint32_t index = 0u; index < count; ++index)
+          for(uint32_t index = 0u; index < count; ++index)
           {
-            RenderItem& item = renderList->GetItem( index );
+            RenderItem& item = renderList->GetItem(index);
             // If the item does 3D transformation, do early exit and clean the damaged rect array
-            if (item.mUpdateSize == Vector3::ZERO)
+            if(item.mUpdateSize == Vector3::ZERO)
             {
               return;
             }
@@ -702,47 +684,47 @@ void RenderManager::PreRender( Integration::Scene& scene, std::vector<Rect<int>>
             Rect<int> rect;
             DirtyRect dirtyRect(item.mNode, item.mRenderer, mImpl->frameCount, rect);
             // If the item refers to updated node or renderer.
-            if (item.mIsUpdated ||
-                (item.mNode &&
+            if(item.mIsUpdated ||
+               (item.mNode &&
                 (item.mNode->Updated() || (item.mRenderer && item.mRenderer->Updated(mImpl->renderBufferIndex, item.mNode)))))
             {
               item.mIsUpdated = false;
               item.mNode->SetUpdated(false);
 
               rect = item.CalculateViewportSpaceAABB(item.mUpdateSize, viewportRect.width, viewportRect.height);
-              if (rect.IsValid() && rect.Intersect(viewportRect) && !rect.IsEmpty())
+              if(rect.IsValid() && rect.Intersect(viewportRect) && !rect.IsEmpty())
               {
-                const int left = rect.x;
-                const int top = rect.y;
-                const int right = rect.x + rect.width;
+                const int left   = rect.x;
+                const int top    = rect.y;
+                const int right  = rect.x + rect.width;
                 const int bottom = rect.y + rect.height;
-                rect.x = (left / 16) * 16;
-                rect.y = (top / 16) * 16;
-                rect.width = ((right + 16) / 16) * 16 - rect.x;
-                rect.height = ((bottom + 16) / 16) * 16 - rect.y;
+                rect.x           = (left / 16) * 16;
+                rect.y           = (top / 16) * 16;
+                rect.width       = ((right + 16) / 16) * 16 - rect.x;
+                rect.height      = ((bottom + 16) / 16) * 16 - rect.y;
 
                 // Found valid dirty rect.
                 // 1. Insert it in the sorted array of the dirty rects.
                 // 2. Mark the related dirty rects as visited so they will not be removed below.
                 // 3. Keep only last 3 dirty rects for the same node and renderer (Tizen uses 3 back buffers, Ubuntu 1).
-                dirtyRect.rect = rect;
+                dirtyRect.rect    = rect;
                 auto dirtyRectPos = std::lower_bound(itemsDirtyRects.begin(), itemsDirtyRects.end(), dirtyRect);
-                dirtyRectPos = itemsDirtyRects.insert(dirtyRectPos, dirtyRect);
+                dirtyRectPos      = itemsDirtyRects.insert(dirtyRectPos, dirtyRect);
 
                 int c = 1;
-                while (++dirtyRectPos != itemsDirtyRects.end())
+                while(++dirtyRectPos != itemsDirtyRects.end())
                 {
-                  if (dirtyRectPos->node != item.mNode || dirtyRectPos->renderer != item.mRenderer)
+                  if(dirtyRectPos->node != item.mNode || dirtyRectPos->renderer != item.mRenderer)
                   {
                     break;
                   }
 
                   dirtyRectPos->visited = true;
-                  Rect<int>& dirtRect = dirtyRectPos->rect;
+                  Rect<int>& dirtRect   = dirtyRectPos->rect;
                   rect.Merge(dirtRect);
 
                   c++;
-                  if (c > 3) // no more then 3 previous rects
+                  if(c > 3) // no more then 3 previous rects
                   {
                     itemsDirtyRects.erase(dirtyRectPos);
                     break;
@@ -757,9 +739,9 @@ void RenderManager::PreRender( Integration::Scene& scene, std::vector<Rect<int>>
               // 1. The item is not dirty, the node and renderer referenced by the item are still exist.
               // 2. Mark the related dirty rects as visited so they will not be removed below.
               auto dirtyRectPos = std::lower_bound(itemsDirtyRects.begin(), itemsDirtyRects.end(), dirtyRect);
-              while (dirtyRectPos != itemsDirtyRects.end())
+              while(dirtyRectPos != itemsDirtyRects.end())
               {
-                if (dirtyRectPos->node != item.mNode || dirtyRectPos->renderer != item.mRenderer)
+                if(dirtyRectPos->node != item.mNode || dirtyRectPos->renderer != item.mRenderer)
                 {
                   break;
                 }
@@ -777,9 +759,9 @@ void RenderManager::PreRender( Integration::Scene& scene, std::vector<Rect<int>>
   // Check removed nodes or removed renderers dirty rects
   auto i = itemsDirtyRects.begin();
   auto j = itemsDirtyRects.begin();
-  while (i != itemsDirtyRects.end())
+  while(i != itemsDirtyRects.end())
   {
-    if (i->visited)
+    if(i->visited)
     {
       *j++ = *i;
     }
@@ -795,35 +777,35 @@ void RenderManager::PreRender( Integration::Scene& scene, std::vector<Rect<int>>
   damagedRectCleaner.SetCleanOnReturn(false);
 }
 
-void RenderManager::RenderScene( Integration::RenderStatus& status, Integration::Scene& scene, bool renderToFbo )
+void RenderManager::RenderScene(Integration::RenderStatus& status, Integration::Scene& scene, bool renderToFbo)
 {
   Rect<int> clippingRect;
-  RenderScene( status, scene, renderToFbo, clippingRect);
+  RenderScene(status, scene, renderToFbo, clippingRect);
 }
 
-void RenderManager::RenderScene( Integration::RenderStatus& status, Integration::Scene& scene, bool renderToFbo, Rect<int>& clippingRect )
+void RenderManager::RenderScene(Integration::RenderStatus& status, Integration::Scene& scene, bool renderToFbo, Rect<int>& clippingRect)
 {
-  Internal::Scene& sceneInternal = GetImplementation( scene );
-  SceneGraph::Scene* sceneObject = sceneInternal.GetSceneObject();
+  Internal::Scene&   sceneInternal = GetImplementation(scene);
+  SceneGraph::Scene* sceneObject   = sceneInternal.GetSceneObject();
 
-  uint32_t count = sceneObject->GetRenderInstructions().Count( mImpl->renderBufferIndex );
+  uint32_t count = sceneObject->GetRenderInstructions().Count(mImpl->renderBufferIndex);
 
-  for( uint32_t i = 0; i < count; ++i )
+  for(uint32_t i = 0; i < count; ++i)
   {
-    RenderInstruction& instruction = sceneObject->GetRenderInstructions().At( mImpl->renderBufferIndex, i );
+    RenderInstruction& instruction = sceneObject->GetRenderInstructions().At(mImpl->renderBufferIndex, i);
 
-    if ( ( renderToFbo && !instruction.mFrameBuffer ) || ( !renderToFbo && instruction.mFrameBuffer ) )
+    if((renderToFbo && !instruction.mFrameBuffer) || (!renderToFbo && instruction.mFrameBuffer))
     {
       continue; // skip
     }
 
     // Mark that we will require a post-render step to be performed (includes swap-buffers).
-    status.SetNeedsPostRender( true );
+    status.SetNeedsPostRender(true);
 
     Rect<int32_t> viewportRect;
-    Vector4   clearColor;
+    Vector4       clearColor;
 
-    if ( instruction.mIsClearColorSet )
+    if(instruction.mIsClearColorSet)
     {
       clearColor = instruction.mClearColor;
     }
@@ -832,22 +814,22 @@ void RenderManager::RenderScene( Integration::RenderStatus& status, Integration:
       clearColor = Dali::RenderTask::DEFAULT_CLEAR_COLOR;
     }
 
-    Rect<int32_t> surfaceRect = mImpl->defaultSurfaceRect;
-    Integration::DepthBufferAvailable depthBufferAvailable = mImpl->depthBufferAvailable;
+    Rect<int32_t>                       surfaceRect            = mImpl->defaultSurfaceRect;
+    Integration::DepthBufferAvailable   depthBufferAvailable   = mImpl->depthBufferAvailable;
     Integration::StencilBufferAvailable stencilBufferAvailable = mImpl->stencilBufferAvailable;
-    int surfaceOrientation = sceneInternal.GetSurfaceOrientation();
+    int                                 surfaceOrientation     = sceneInternal.GetSurfaceOrientation();
 
-    if ( instruction.mFrameBuffer )
+    if(instruction.mFrameBuffer)
     {
       // offscreen buffer
-      if ( mImpl->currentContext != &mImpl->context )
+      if(mImpl->currentContext != &mImpl->context)
       {
         // Switch to shared context for off-screen buffer
         mImpl->currentContext = &mImpl->context;
 
-        if ( mImpl->currentContext->IsSurfacelessContextSupported() )
+        if(mImpl->currentContext->IsSurfacelessContextSupported())
         {
-          mImpl->glContextHelperAbstraction.MakeSurfacelessContextCurrent();
+          mImpl->graphicsController.GetGlContextHelperAbstraction().MakeSurfacelessContextCurrent();
         }
 
         // Clear the current cached program when the context is switched
@@ -856,9 +838,9 @@ void RenderManager::RenderScene( Integration::RenderStatus& status, Integration:
     }
     else
     {
-      if ( mImpl->currentContext->IsSurfacelessContextSupported() )
+      if(mImpl->currentContext->IsSurfacelessContextSupported())
       {
-        if ( mImpl->currentContext != sceneObject->GetContext() )
+        if(mImpl->currentContext != sceneObject->GetContext())
         {
           // Switch the correct context if rendering to a surface
           mImpl->currentContext = sceneObject->GetContext();
@@ -868,37 +850,37 @@ void RenderManager::RenderScene( Integration::RenderStatus& status, Integration:
         }
       }
 
-      surfaceRect = Rect<int32_t>( 0, 0, static_cast<int32_t>( scene.GetSize().width ), static_cast<int32_t>( scene.GetSize().height ) );
+      surfaceRect = Rect<int32_t>(0, 0, static_cast<int32_t>(scene.GetSize().width), static_cast<int32_t>(scene.GetSize().height));
     }
 
     // Make sure that GL context must be created
-     mImpl->currentContext->GlContextCreated();
+    mImpl->currentContext->GlContextCreated();
 
     // reset the program matrices for all programs once per frame
     // this ensures we will set view and projection matrix once per program per camera
     mImpl->programController.ResetProgramMatrices();
 
-    if( instruction.mFrameBuffer )
+    if(instruction.mFrameBuffer)
     {
-      instruction.mFrameBuffer->Bind( *mImpl->currentContext );
+      instruction.mFrameBuffer->Bind(*mImpl->currentContext);
 
       // For each offscreen buffer, update the dependency list with the new texture id used by this frame buffer.
-      for (unsigned int i0 = 0, i1 = instruction.mFrameBuffer->GetColorAttachmentCount(); i0 < i1; ++i0)
+      for(unsigned int i0 = 0, i1 = instruction.mFrameBuffer->GetColorAttachmentCount(); i0 < i1; ++i0)
       {
-        mImpl->textureDependencyList.PushBack( instruction.mFrameBuffer->GetTextureId(i0) );
+        mImpl->textureDependencyList.PushBack(instruction.mFrameBuffer->GetTextureId(i0));
       }
     }
     else
     {
-      mImpl->currentContext->BindFramebuffer( GL_FRAMEBUFFER, 0u );
+      mImpl->currentContext->BindFramebuffer(GL_FRAMEBUFFER, 0u);
     }
 
-    if ( !instruction.mFrameBuffer )
+    if(!instruction.mFrameBuffer)
     {
-      mImpl->currentContext->Viewport( surfaceRect.x,
-                                       surfaceRect.y,
-                                       surfaceRect.width,
-                                       surfaceRect.height );
+      mImpl->currentContext->Viewport(surfaceRect.x,
+                                      surfaceRect.y,
+                                      surfaceRect.width,
+                                      surfaceRect.height);
     }
 
     // Clear the entire color, depth and stencil buffers for the default framebuffer, if required.
@@ -907,44 +889,44 @@ void RenderManager::RenderScene( Integration::RenderStatus& status, Integration:
     // and then stall. That problem is only noticeable when rendering a large number of vertices per frame.
     GLbitfield clearMask = GL_COLOR_BUFFER_BIT;
 
-    mImpl->currentContext->ColorMask( true );
+    mImpl->currentContext->ColorMask(true);
 
-    if( depthBufferAvailable == Integration::DepthBufferAvailable::TRUE )
+    if(depthBufferAvailable == Integration::DepthBufferAvailable::TRUE)
     {
-      mImpl->currentContext->DepthMask( true );
+      mImpl->currentContext->DepthMask(true);
       clearMask |= GL_DEPTH_BUFFER_BIT;
     }
 
-    if( stencilBufferAvailable == Integration::StencilBufferAvailable::TRUE)
+    if(stencilBufferAvailable == Integration::StencilBufferAvailable::TRUE)
     {
-      mImpl->currentContext->ClearStencil( 0 );
-      mImpl->currentContext->StencilMask( 0xFF ); // 8 bit stencil mask, all 1's
+      mImpl->currentContext->ClearStencil(0);
+      mImpl->currentContext->StencilMask(0xFF); // 8 bit stencil mask, all 1's
       clearMask |= GL_STENCIL_BUFFER_BIT;
     }
 
-    if( !instruction.mIgnoreRenderToFbo && ( instruction.mFrameBuffer != nullptr ) )
+    if(!instruction.mIgnoreRenderToFbo && (instruction.mFrameBuffer != nullptr))
     {
       // Offscreen buffer rendering
-      if ( instruction.mIsViewportSet )
+      if(instruction.mIsViewportSet)
       {
         // For glViewport the lower-left corner is (0,0)
-        const int32_t y = ( instruction.mFrameBuffer->GetHeight() - instruction.mViewport.height ) - instruction.mViewport.y;
-        viewportRect.Set( instruction.mViewport.x,  y, instruction.mViewport.width, instruction.mViewport.height );
+        const int32_t y = (instruction.mFrameBuffer->GetHeight() - instruction.mViewport.height) - instruction.mViewport.y;
+        viewportRect.Set(instruction.mViewport.x, y, instruction.mViewport.width, instruction.mViewport.height);
       }
       else
       {
-        viewportRect.Set( 0, 0, instruction.mFrameBuffer->GetWidth(), instruction.mFrameBuffer->GetHeight() );
+        viewportRect.Set(0, 0, instruction.mFrameBuffer->GetWidth(), instruction.mFrameBuffer->GetHeight());
       }
       surfaceOrientation = 0;
     }
     else // No Offscreen frame buffer rendering
     {
       // Check whether a viewport is specified, otherwise the full surface size is used
-      if ( instruction.mIsViewportSet )
+      if(instruction.mIsViewportSet)
       {
         // For glViewport the lower-left corner is (0,0)
-        const int32_t y = ( surfaceRect.height - instruction.mViewport.height ) - instruction.mViewport.y;
-        viewportRect.Set( instruction.mViewport.x,  y, instruction.mViewport.width, instruction.mViewport.height );
+        const int32_t y = (surfaceRect.height - instruction.mViewport.height) - instruction.mViewport.y;
+        viewportRect.Set(instruction.mViewport.x, y, instruction.mViewport.width, instruction.mViewport.height);
       }
       else
       {
@@ -956,19 +938,19 @@ void RenderManager::RenderScene( Integration::RenderStatus& status, Integration:
     mImpl->currentContext->SetSurfaceOrientation(surfaceOrientation);
 
     bool clearFullFrameRect = true;
-    if( instruction.mFrameBuffer != nullptr )
+    if(instruction.mFrameBuffer != nullptr)
     {
-      Viewport frameRect( 0, 0, instruction.mFrameBuffer->GetWidth(), instruction.mFrameBuffer->GetHeight() );
-      clearFullFrameRect = ( frameRect == viewportRect );
+      Viewport frameRect(0, 0, instruction.mFrameBuffer->GetWidth(), instruction.mFrameBuffer->GetHeight());
+      clearFullFrameRect = (frameRect == viewportRect);
     }
     else
     {
-      clearFullFrameRect = ( surfaceRect == viewportRect );
+      clearFullFrameRect = (surfaceRect == viewportRect);
     }
 
-    if (!clippingRect.IsEmpty())
+    if(!clippingRect.IsEmpty())
     {
-      if (!clippingRect.Intersect(viewportRect))
+      if(!clippingRect.Intersect(viewportRect))
       {
         DALI_LOG_ERROR("Invalid clipping rect %d %d %d %d\n", clippingRect.x, clippingRect.y, clippingRect.width, clippingRect.height);
         clippingRect = Rect<int>();
@@ -978,15 +960,15 @@ void RenderManager::RenderScene( Integration::RenderStatus& status, Integration:
 
     mImpl->currentContext->Viewport(viewportRect.x, viewportRect.y, viewportRect.width, viewportRect.height);
 
-    if (instruction.mIsClearColorSet)
+    if(instruction.mIsClearColorSet)
     {
       mImpl->currentContext->ClearColor(clearColor.r,
                                         clearColor.g,
                                         clearColor.b,
                                         clearColor.a);
-      if (!clearFullFrameRect)
+      if(!clearFullFrameRect)
       {
-        if (!clippingRect.IsEmpty())
+        if(!clippingRect.IsEmpty())
         {
           mImpl->currentContext->SetScissorTest(true);
           mImpl->currentContext->Scissor(clippingRect.x, clippingRect.y, clippingRect.width, clippingRect.height);
@@ -1012,41 +994,38 @@ void RenderManager::RenderScene( Integration::RenderStatus& status, Integration:
     mImpl->boundTextures.Clear();
 
     mImpl->renderAlgorithms.ProcessRenderInstruction(
-        instruction,
-        *mImpl->currentContext,
-        mImpl->renderBufferIndex,
-        depthBufferAvailable,
-        stencilBufferAvailable,
-        mImpl->boundTextures,
-        clippingRect );
+      instruction,
+      *mImpl->currentContext,
+      mImpl->renderBufferIndex,
+      depthBufferAvailable,
+      stencilBufferAvailable,
+      mImpl->boundTextures,
+      clippingRect);
 
     // Synchronise the FBO/Texture access when there are multiple contexts
-    if ( mImpl->currentContext->IsSurfacelessContextSupported() )
+    if(mImpl->currentContext->IsSurfacelessContextSupported())
     {
       // Check whether any binded texture is in the dependency list
       bool textureFound = false;
 
-      if ( mImpl->boundTextures.Count() > 0u && mImpl->textureDependencyList.Count() > 0u )
+      if(mImpl->boundTextures.Count() > 0u && mImpl->textureDependencyList.Count() > 0u)
       {
-        for ( auto textureId : mImpl->textureDependencyList )
+        for(auto textureId : mImpl->textureDependencyList)
         {
-
-          textureFound = std::find_if( mImpl->boundTextures.Begin(), mImpl->boundTextures.End(),
-                                       [textureId]( GLuint id )
-                                       {
-                                         return textureId == id;
-                                       } ) != mImpl->boundTextures.End();
+          textureFound = std::find_if(mImpl->boundTextures.Begin(), mImpl->boundTextures.End(), [textureId](GLuint id) {
+                           return textureId == id;
+                         }) != mImpl->boundTextures.End();
         }
       }
 
-      if ( textureFound )
+      if(textureFound)
       {
-        if ( instruction.mFrameBuffer )
+        if(instruction.mFrameBuffer)
         {
           // For off-screen buffer
 
           // Wait until all rendering calls for the currently context are executed
-          mImpl->glContextHelperAbstraction.WaitClient();
+          mImpl->graphicsController.GetGlContextHelperAbstraction().WaitClient();
 
           // Clear the dependency list
           mImpl->textureDependencyList.Clear();
@@ -1054,9 +1033,8 @@ void RenderManager::RenderScene( Integration::RenderStatus& status, Integration:
         else
         {
           // Worker thread lambda function
-          auto& glContextHelperAbstraction = mImpl->glContextHelperAbstraction;
-          auto workerFunction = [&glContextHelperAbstraction]( int workerThread )
-          {
+          auto& glContextHelperAbstraction = mImpl->graphicsController.GetGlContextHelperAbstraction();
+          auto  workerFunction             = [&glContextHelperAbstraction](int workerThread) {
             // Switch to the shared context in the worker thread
             glContextHelperAbstraction.MakeSurfacelessContextCurrent();
 
@@ -1068,8 +1046,8 @@ void RenderManager::RenderScene( Integration::RenderStatus& status, Integration:
             glContextHelperAbstraction.MakeContextNull();
           };
 
-          auto future = mImpl->threadPool->SubmitTask( 0u, workerFunction );
-          if ( future )
+          auto future = mImpl->threadPool->SubmitTask(0u, workerFunction);
+          if(future)
           {
             mImpl->threadPool->Wait();
 
@@ -1080,52 +1058,50 @@ void RenderManager::RenderScene( Integration::RenderStatus& status, Integration:
       }
     }
 
-    if( instruction.mRenderTracker && instruction.mFrameBuffer )
+    if(instruction.mRenderTracker && instruction.mFrameBuffer)
     {
       // This will create a sync object every frame this render tracker
       // is alive (though it should be now be created only for
       // render-once render tasks)
-      instruction.mRenderTracker->CreateSyncObject( mImpl->glSyncAbstraction );
+      instruction.mRenderTracker->CreateSyncObject(mImpl->graphicsController.GetGlSyncAbstraction());
       instruction.mRenderTracker = nullptr; // Only create once.
     }
 
-    if ( renderToFbo )
+    if(renderToFbo)
     {
       mImpl->currentContext->Flush();
     }
   }
 
-  GLenum attachments[] = { GL_DEPTH, GL_STENCIL };
+  GLenum attachments[] = {GL_DEPTH, GL_STENCIL};
   mImpl->currentContext->InvalidateFramebuffer(GL_FRAMEBUFFER, 2, attachments);
-
 }
 
-void RenderManager::PostRender( bool uploadOnly )
+void RenderManager::PostRender(bool uploadOnly)
 {
-  if ( !uploadOnly )
+  if(!uploadOnly)
   {
-    if ( mImpl->currentContext->IsSurfacelessContextSupported() )
+    if(mImpl->currentContext->IsSurfacelessContextSupported())
     {
-      mImpl->glContextHelperAbstraction.MakeSurfacelessContextCurrent();
+      mImpl->graphicsController.GetGlContextHelperAbstraction().MakeSurfacelessContextCurrent();
     }
 
-    GLenum attachments[] = { GL_DEPTH, GL_STENCIL };
+    GLenum attachments[] = {GL_DEPTH, GL_STENCIL};
     mImpl->context.InvalidateFramebuffer(GL_FRAMEBUFFER, 2, attachments);
   }
 
   //Notify RenderGeometries that rendering has finished
-  for ( auto&& iter : mImpl->geometryContainer )
+  for(auto&& iter : mImpl->geometryContainer)
   {
     iter->OnRenderFinished();
   }
 
   mImpl->UpdateTrackers();
 
-
   uint32_t count = 0u;
-  for( uint32_t i = 0; i < mImpl->sceneContainer.size(); ++i )
+  for(uint32_t i = 0; i < mImpl->sceneContainer.size(); ++i)
   {
-    count += mImpl->sceneContainer[i]->GetRenderInstructions().Count( mImpl->renderBufferIndex );
+    count += mImpl->sceneContainer[i]->GetRenderInstructions().Count(mImpl->renderBufferIndex);
   }
 
   const bool haveInstructions = count > 0u;
index 8474a8a..0e48c76 100644 (file)
@@ -2,7 +2,7 @@
 #define DALI_INTERNAL_SCENE_GRAPH_RENDER_MANAGER_H
 
 /*
- * Copyright (c) 2020 Samsung Electronics Co., Ltd.
+ * Copyright (c) 2021 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.
  */
 
 // INTERNAL INCLUDES
-#include <dali/public-api/math/rect.h>
+#include <dali/graphics-api/graphics-controller.h>
 #include <dali/integration-api/core-enumerations.h>
 #include <dali/internal/common/shader-saver.h>
 #include <dali/internal/event/rendering/texture-impl.h>
 #include <dali/internal/render/gl-resources/gpu-buffer.h>
 #include <dali/internal/render/renderers/render-vertex-buffer.h>
+#include <dali/public-api/math/rect.h>
 
 namespace Dali
 {
-
 namespace Integration
 {
 class GlAbstraction;
@@ -36,7 +36,7 @@ class GlSyncAbstraction;
 class GlContextHelperAbstraction;
 class RenderStatus;
 class Scene;
-}
+} // namespace Integration
 
 struct Vector4;
 
@@ -54,7 +54,7 @@ struct Sampler;
 class RenderTracker;
 class Geometry;
 class Texture;
-}
+} // namespace Render
 
 namespace SceneGraph
 {
@@ -71,21 +71,16 @@ class Scene;
 class RenderManager
 {
 public:
-
   /**
    * Construct a new RenderManager.
-   * @param[in]  glAbstraction              The GL abstraction used for rendering.
-   * @param[in]  glSyncAbstraction          The GL sync abstraction used fence sync creation/deletion.
-   * @param[in]  glContextHelperAbstraction The GL context helper abstraction for accessing GL context.
+   * @param[in]  graphicsController         The graphics controller for a given rendering backend
    * @param[in]  depthBufferAvailable       Whether the depth buffer is available
    * @param[in]  stencilBufferAvailable     Whether the stencil buffer is available
    */
-  static RenderManager* New( Integration::GlAbstraction& glAbstraction,
-                             Integration::GlSyncAbstraction& glSyncAbstraction,
-                             Integration::GlContextHelperAbstraction& glContextHelperAbstraction,
-                             Integration::DepthBufferAvailable depthBufferAvailable,
-                             Integration::StencilBufferAvailable stencilBufferAvailable,
-                             Integration::PartialUpdateAvailable partialUpdateAvailable );
+  static RenderManager* New(Graphics::Controller&               graphicsController,
+                            Integration::DepthBufferAvailable   depthBufferAvailable,
+                            Integration::StencilBufferAvailable stencilBufferAvailable,
+                            Integration::PartialUpdateAvailable partialUpdateAvailable);
 
   /**
    * Non-virtual destructor; not intended as a base class
@@ -114,21 +109,21 @@ public:
    * @param[in] upstream The abstract interface to send any received ShaderDatas onwards to..
    * @note This should be called during core initialisation if shader binaries are to be used.
    */
-  void SetShaderSaver( ShaderSaver& upstream );
+  void SetShaderSaver(ShaderSaver& upstream);
 
-  // The following methods should be called via RenderQueue messages
+  // The foltlowing methods should be called via RenderQueue messages
 
   /*
    * Set the frame time delta (time elapsed since the last frame.
    * @param[in] deltaTime the delta time
    */
-  void SetFrameDeltaTime( float deltaTime );
+  void SetFrameDeltaTime(float deltaTime);
 
   /**
    * Returns the rectangle for the default surface (probably the application window).
    * @return Rectangle for the surface.
    */
-  void SetDefaultSurfaceRect( const Rect<int>& rect );
+  void SetDefaultSurfaceRect(const Rect<int>& rect);
 
   /**
    * Returns the orintation for the default surface (probably the application window).
@@ -141,35 +136,35 @@ public:
    * @param[in] renderer The renderer to add.
    * @post renderer is owned by RenderManager
    */
-  void AddRenderer( OwnerPointer< Render::Renderer >& renderer );
+  void AddRenderer(OwnerPointer<Render::Renderer>& renderer);
 
   /**
    * Remove a Renderer from the render manager.
    * @param[in] renderer The renderer to remove.
    * @post renderer is destroyed.
    */
-  void RemoveRenderer( Render::Renderer* renderer );
+  void RemoveRenderer(Render::Renderer* renderer);
 
   /**
    * Add a sampler to the render manager.
    * @param[in] sampler The sampler to add.
    * @post sampler is owned by RenderManager
    */
-  void AddSampler( OwnerPointer< Render::Sampler >& sampler );
+  void AddSampler(OwnerPointer<Render::Sampler>& sampler);
 
   /**
    * Remove a sampler from the render manager.
    * @param[in] sampler The sampler to remove.
    * @post sampler is destroyed.
    */
-  void RemoveSampler( Render::Sampler* sampler );
+  void RemoveSampler(Render::Sampler* sampler);
 
   /**
    * Set minification and magnification filter modes for a sampler
    * @param[in] minFilterMode Filter mode to use when the texture is minificated
    * @param[in] magFilterMode Filter mode to use when the texture is magnified
    */
-  void SetFilterMode( Render::Sampler* sampler, uint32_t minFilterMode, uint32_t magFilterMode );
+  void SetFilterMode(Render::Sampler* sampler, uint32_t minFilterMode, uint32_t magFilterMode);
 
   /**
    * Set wrapping mode for a sampler
@@ -177,42 +172,42 @@ public:
    * @param[in] uWrapMode Wrap mode in the x direction
    * @param[in] vWrapMode Wrap mode in the y direction
    */
-  void SetWrapMode( Render::Sampler* sampler, uint32_t rWrapMode, uint32_t sWrapMode, uint32_t tWrapMode );
+  void SetWrapMode(Render::Sampler* sampler, uint32_t rWrapMode, uint32_t sWrapMode, uint32_t tWrapMode);
 
   /**
    * Add a property buffer to the render manager.
    * @param[in] vertexBuffer The property buffer to add.
    * @post propertBuffer is owned by RenderManager
    */
-  void AddVertexBuffer( OwnerPointer< Render::VertexBuffer >& vertexBuffer );
+  void AddVertexBuffer(OwnerPointer<Render::VertexBuffer>& vertexBuffer);
 
   /**
    * Remove a property buffer from the render manager.
    * @param[in] vertexBuffer The property buffer to remove.
    * @post vertexBuffer is destroyed.
    */
-  void RemoveVertexBuffer( Render::VertexBuffer* vertexBuffer );
+  void RemoveVertexBuffer(Render::VertexBuffer* vertexBuffer);
 
   /**
    * Add a geometry to the render manager.
    * @param[in] geometry The geometry to add.
    * @post geometry is owned by RenderManager
    */
-  void AddGeometry( OwnerPointer< Render::Geometry >& geometry );
+  void AddGeometry(OwnerPointer<Render::Geometry>& geometry);
 
   /**
    * Remove a geometry from the render manager.
    * @param[in] geometry The geometry to remove.
    * @post geometry is destroyed.
    */
-  void RemoveGeometry( Render::Geometry* geometry );
+  void RemoveGeometry(Render::Geometry* geometry);
 
   /**
    * Adds a property buffer to a geometry from the render manager.
    * @param[in] geometry The geometry
    * @param[in] vertexBuffer The property buffer to remove.
    */
-  void AttachVertexBuffer( Render::Geometry* geometry, Render::VertexBuffer* vertexBuffer );
+  void AttachVertexBuffer(Render::Geometry* geometry, Render::VertexBuffer* vertexBuffer);
 
   /**
    * Remove a property buffer from a Render::Geometry from the render manager.
@@ -220,14 +215,14 @@ public:
    * @param[in] vertexBuffer The property buffer to remove.
    * @post property buffer is destroyed.
    */
-  void RemoveVertexBuffer( Render::Geometry* geometry, Render::VertexBuffer* vertexBuffer );
+  void RemoveVertexBuffer(Render::Geometry* geometry, Render::VertexBuffer* vertexBuffer);
 
   /**
    * Sets the format of an existing property buffer
    * @param[in] vertexBuffer The property buffer.
    * @param[in] format The new format of the buffer
    */
-  void SetVertexBufferFormat( Render::VertexBuffer* vertexBuffer, OwnerPointer< Render::VertexBuffer::Format>& format );
+  void SetVertexBufferFormat(Render::VertexBuffer* vertexBuffer, OwnerPointer<Render::VertexBuffer::Format>& format);
 
   /**
    * Sets the data of an existing property buffer
@@ -235,33 +230,33 @@ public:
    * @param[in] data The new data of the buffer
    * @param[in] size The new size of the buffer
    */
-  void SetVertexBufferData( Render::VertexBuffer* vertexBuffer, OwnerPointer< Vector<uint8_t> >& data, uint32_t size );
+  void SetVertexBufferData(Render::VertexBuffer* vertexBuffer, OwnerPointer<Vector<uint8_t>>& data, uint32_t size);
 
   /**
    * Sets the data for the index buffer of an existing geometry
    * @param[in] geometry The geometry
    * @param[in] data A vector containing the indices
    */
-  void SetIndexBuffer( Render::Geometry* geometry, Dali::Vector<uint16_t>& data );
+  void SetIndexBuffer(Render::Geometry* geometry, Dali::Vector<uint16_t>& data);
 
   /**
    * Set the geometry type of an existing render geometry
    * @param[in] geometry The render geometry
    * @param[in] geometryType The new geometry type
    */
-  void SetGeometryType( Render::Geometry* geometry, uint32_t geometryType );
+  void SetGeometryType(Render::Geometry* geometry, uint32_t geometryType);
 
   /**
    * Adds a texture to the render manager
    * @param[in] texture The texture to add
    */
-  void AddTexture( OwnerPointer< Render::Texture >& texture );
+  void AddTexture(OwnerPointer<Render::Texture>& texture);
 
   /**
    * Removes a texture from the render manager
    * @param[in] texture The texture to remove
    */
-  void RemoveTexture( Render::Texture* texture );
+  void RemoveTexture(Render::Texture* texture);
 
   /**
    * Uploads data to an existing texture
@@ -269,25 +264,25 @@ public:
    * @param[in] pixelData The pixel data object
    * @param[in] params The parameters for the upload
    */
-  void UploadTexture( Render::Texture* texture, PixelDataPtr pixelData, const Texture::UploadParams& params );
+  void UploadTexture(Render::Texture* texture, PixelDataPtr pixelData, const Texture::UploadParams& params);
 
   /**
    * Generates mipmaps for a given texture
    * @param[in] texture The texture
    */
-  void GenerateMipmaps( Render::Texture* texture );
+  void GenerateMipmaps(Render::Texture* texture);
 
   /**
    * Adds a framebuffer to the render manager
    * @param[in] frameBuffer The framebuffer to add
    */
-  void AddFrameBuffer( OwnerPointer< Render::FrameBuffer >& frameBuffer );
+  void AddFrameBuffer(OwnerPointer<Render::FrameBuffer>& frameBuffer);
 
   /**
    * Removes a framebuffer from the render manager
    * @param[in] frameBuffer The framebuffer to remove
    */
-  void RemoveFrameBuffer( Render::FrameBuffer* frameBuffer );
+  void RemoveFrameBuffer(Render::FrameBuffer* frameBuffer);
 
   /**
    * Attaches a texture as color output to the existing frame buffer
@@ -296,7 +291,7 @@ public:
    * @param[in] mipmapLevel The mipmap of the texture to be attached
    * @param[in] layer Indicates which layer of a cube map or array texture to attach. Unused for 2D textures
    */
-  void AttachColorTextureToFrameBuffer( Render::FrameBuffer* frameBuffer, Render::Texture* texture, uint32_t mipmapLevel, uint32_t layer );
+  void AttachColorTextureToFrameBuffer(Render::FrameBuffer* frameBuffer, Render::Texture* texture, uint32_t mipmapLevel, uint32_t layer);
 
   /**
    * Attaches a texture as depth output to the existing frame buffer
@@ -304,7 +299,7 @@ public:
    * @param[in] texture The texture that will be used as output when rendering
    * @param[in] mipmapLevel The mipmap of the texture to be attached
    */
-  void AttachDepthTextureToFrameBuffer( Render::FrameBuffer* frameBuffer, Render::Texture* texture, uint32_t mipmapLevel );
+  void AttachDepthTextureToFrameBuffer(Render::FrameBuffer* frameBuffer, Render::Texture* texture, uint32_t mipmapLevel);
 
   /**
    * Attaches a texture as depth/stencil output to the existing frame buffer
@@ -312,25 +307,25 @@ public:
    * @param[in] texture The texture that will be used as output when rendering
    * @param[in] mipmapLevel The mipmap of the texture to be attached
    */
-  void AttachDepthStencilTextureToFrameBuffer( Render::FrameBuffer* frameBuffer, Render::Texture* texture, uint32_t mipmapLevel );
+  void AttachDepthStencilTextureToFrameBuffer(Render::FrameBuffer* frameBuffer, Render::Texture* texture, uint32_t mipmapLevel);
 
   /**
    * Initializes a Scene to the render manager
    * @param[in] scene The Scene to initialize
    */
-  void InitializeScene( SceneGraph::Scene* scene );
+  void InitializeScene(SceneGraph::Scene* scene);
 
   /**
    * Uninitializes a Scene to the render manager
    * @param[in] scene The Scene to uninitialize
    */
-  void UninitializeScene( SceneGraph::Scene* scene );
+  void UninitializeScene(SceneGraph::Scene* scene);
 
   /**
    * This is called when the surface of the scene has been replaced.
    * @param[in] scene The scene.
    */
-  void SurfaceReplaced( SceneGraph::Scene* scene );
+  void SurfaceReplaced(SceneGraph::Scene* scene);
 
   /**
    * Adds a render tracker to the RenderManager. RenderManager takes ownership of the
@@ -338,13 +333,13 @@ public:
    * object, usually an offscreen render task.
    * @param[in] renderTracker The render tracker
    */
-  void AddRenderTracker( Render::RenderTracker* renderTracker );
+  void AddRenderTracker(Render::RenderTracker* renderTracker);
 
   /**
    * Removes a render tracker from the RenderManager.
    * @param[in] renderTracker The render tracker to remove.
    */
-  void RemoveRenderTracker( Render::RenderTracker* renderTracker );
+  void RemoveRenderTracker(Render::RenderTracker* renderTracker);
 
   /**
    * returns the Program controller for sending program messages
@@ -363,7 +358,7 @@ public:
    * @param[in] forceClear force the Clear on the framebuffer even if nothing is rendered.
    * @param[in] uploadOnly uploadOnly Upload the resource only without rendering.
    */
-  void PreRender( Integration::RenderStatus& status, bool forceClear, bool uploadOnly );
+  void PreRender(Integration::RenderStatus& status, bool forceClear, bool uploadOnly);
 
   // This method should be called from Core::PreRender()
 
@@ -375,7 +370,7 @@ public:
    * @param[in] scene The scene to be rendered.
    * @param[out] damagedRects The list of damaged rects for the current render pass.
    */
-  void PreRender( Integration::Scene& scene, std::vector<Rect<int>>& damagedRects );
+  void PreRender(Integration::Scene& scene, std::vector<Rect<int>>& damagedRects);
 
   // This method should be called from Core::RenderScene()
 
@@ -389,7 +384,7 @@ public:
    * @param[in] scene The scene to be rendered.
    * @param[in] renderToFbo True to render off-screen frame buffers only if any, and False to render the surface only.
    */
-  void RenderScene( Integration::RenderStatus& status, Integration::Scene& scene, bool renderToFbo );
+  void RenderScene(Integration::RenderStatus& status, Integration::Scene& scene, bool renderToFbo);
 
   /**
    * Render a scene in the next frame. This method should be preceded by a call up PreRender.
@@ -402,7 +397,7 @@ public:
    * @param[in] renderToFbo True to render off-screen frame buffers only if any, and False to render the surface only.
    * @param[in] clippingRect The clipping rect for the rendered scene.
    */
-  void RenderScene( Integration::RenderStatus& status, Integration::Scene& scene, bool renderToFbo, Rect<int>& clippingRect );
+  void RenderScene(Integration::RenderStatus& status, Integration::Scene& scene, bool renderToFbo, Rect<int>& clippingRect);
 
   // This method should be called from Core::PostRender()
 
@@ -413,29 +408,24 @@ public:
    * @pre The GL context must have been created, and made current.
    * @param[in] uploadOnly uploadOnly Upload the resource only without rendering.
    */
-  void PostRender( bool uploadOnly );
-
+  void PostRender(bool uploadOnly);
 
 private:
-
 private:
-
   /**
    * Construct a new RenderManager.
    */
   RenderManager();
 
   // Undefined
-  RenderManager( const RenderManager& );
+  RenderManager(const RenderManager&);
 
   // Undefined
-  RenderManager& operator=( const RenderManager& rhs );
+  RenderManager& operator=(const RenderManager& rhs);
 
 private:
-
   struct Impl;
   Impl* mImpl;
-
 };
 
 } // namespace SceneGraph
index 279113f..53d504f 100644 (file)
@@ -1,5 +1,5 @@
 /*
- * Copyright (c) 2020 Samsung Electronics Co., Ltd.
+ * Copyright (c) 2021 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.
 #include <type_traits>
 
 // INTERNAL INCLUDES
-#include <dali/public-api/common/constants.h>
-#include <dali/public-api/rendering/texture-set.h>
-#include <dali/integration-api/platform-abstraction.h>
 #include <dali/integration-api/debug.h>
+#include <dali/integration-api/platform-abstraction.h>
 #include <dali/internal/render/common/render-manager.h>
+#include <dali/public-api/common/constants.h>
+#include <dali/public-api/rendering/texture-set.h>
 
 namespace Dali
 {
-
 namespace Internal
 {
-
 namespace // unnamed namespace
 {
-
-static_assert( TEXTURE_UNIT_LAST <= Context::MAX_TEXTURE_UNITS, "TEXTURE_UNIT_LAST is greater than Context::MAX_TEXTURE_UNITS" );
+static_assert(TEXTURE_UNIT_LAST <= Context::MAX_TEXTURE_UNITS, "TEXTURE_UNIT_LAST is greater than Context::MAX_TEXTURE_UNITS");
 
 /**
  * GL error strings
@@ -47,16 +44,15 @@ static_assert( TEXTURE_UNIT_LAST <= Context::MAX_TEXTURE_UNITS, "TEXTURE_UNIT_LA
 struct errorStrings
 {
   const GLenum errorCode;
-  const char* errorString;
+  const char*  errorString;
 };
 errorStrings errors[] =
-{
-   { GL_NO_ERROR,           "GL_NO_ERROR" },
-   { GL_INVALID_ENUM,       "GL_INVALID_ENUM" },
-   { GL_INVALID_VALUE,      "GL_INVALID_VALUE" },
-   { GL_INVALID_OPERATION,  "GL_INVALID_OPERATION" },
-   { GL_OUT_OF_MEMORY,      "GL_OUT_OF_MEMORY" }
-};
+  {
+    {GL_NO_ERROR, "GL_NO_ERROR"},
+    {GL_INVALID_ENUM, "GL_INVALID_ENUM"},
+    {GL_INVALID_VALUE, "GL_INVALID_VALUE"},
+    {GL_INVALID_OPERATION, "GL_INVALID_OPERATION"},
+    {GL_OUT_OF_MEMORY, "GL_OUT_OF_MEMORY"}};
 
 } // unnamed namespace
 
@@ -64,12 +60,12 @@ errorStrings errors[] =
 Debug::Filter* gContextLogFilter = Debug::Filter::New(Debug::Concise, false, "LOG_CONTEXT_STATE");
 #endif
 
-Context::Context( Integration::GlAbstraction& glAbstraction )
-: Context( glAbstraction, nullptr )
+Context::Context(Integration::GlAbstraction& glAbstraction)
+: Context(glAbstraction, nullptr)
 {
 }
 
-Context::Context( Integration::GlAbstraction& glAbstraction, OwnerContainer< Context* >* contexts )
+Context::Context(Integration::GlAbstraction& glAbstraction, OwnerContainer<Context*>* contexts)
 : mGlAbstraction(glAbstraction),
   mGlContextCreated(false),
   mColorMask(true),
@@ -88,26 +84,26 @@ Context::Context( Integration::GlAbstraction& glAbstraction, OwnerContainer< Con
   mBoundArrayBufferId(0),
   mBoundElementArrayBufferId(0),
   mBoundTransformFeedbackBufferId(0),
-  mActiveTextureUnit( TEXTURE_UNIT_LAST ),
+  mActiveTextureUnit(TEXTURE_UNIT_LAST),
   mBlendColor(Color::TRANSPARENT),
   mBlendFuncSeparateSrcRGB(GL_ONE),
   mBlendFuncSeparateDstRGB(GL_ZERO),
   mBlendFuncSeparateSrcAlpha(GL_ONE),
   mBlendFuncSeparateDstAlpha(GL_ZERO),
-  mBlendEquationSeparateModeRGB( GL_FUNC_ADD ),
-  mBlendEquationSeparateModeAlpha( GL_FUNC_ADD ),
-  mStencilFunc( GL_ALWAYS ),
-  mStencilFuncRef( 0 ),
-  mStencilFuncMask( 0xFFFFFFFF ),
-  mStencilOpFail( GL_KEEP ),
-  mStencilOpDepthFail( GL_KEEP ),
-  mStencilOpDepthPass( GL_KEEP ),
-  mDepthFunction( GL_LESS ),
+  mBlendEquationSeparateModeRGB(GL_FUNC_ADD),
+  mBlendEquationSeparateModeAlpha(GL_FUNC_ADD),
+  mStencilFunc(GL_ALWAYS),
+  mStencilFuncRef(0),
+  mStencilFuncMask(0xFFFFFFFF),
+  mStencilOpFail(GL_KEEP),
+  mStencilOpDepthFail(GL_KEEP),
+  mStencilOpDepthPass(GL_KEEP),
+  mDepthFunction(GL_LESS),
   mMaxTextureSize(0),
-  mClearColor(Color::WHITE),    // initial color, never used until it's been set by the user
-  mCullFaceMode( FaceCullingMode::NONE ),
-  mViewPort( 0, 0, 0, 0 ),
-  mSceneContexts( contexts ),
+  mClearColor(Color::WHITE), // initial color, never used until it's been set by the user
+  mCullFaceMode(FaceCullingMode::NONE),
+  mViewPort(0, 0, 0, 0),
+  mSceneContexts(contexts),
   mSurfaceOrientation(0)
 {
 }
@@ -118,7 +114,7 @@ void Context::GlContextCreated()
 {
   DALI_LOG_INFO(gContextLogFilter, Debug::Verbose, "Context::GlContextCreated()\n");
 
-  if( !mGlContextCreated )
+  if(!mGlContextCreated)
   {
     mGlContextCreated = true;
 
@@ -137,11 +133,11 @@ void Context::GlContextDestroyed()
   mGlContextCreated = false;
 }
 
-const char* Context::ErrorToString( GLenum errorCode )
+const char* Context::ErrorToString(GLenum errorCode)
 {
-  for( unsigned int i = 0; i < sizeof(errors) / sizeof(errors[0]); ++i)
+  for(unsigned int i = 0; i < sizeof(errors) / sizeof(errors[0]); ++i)
   {
-    if (errorCode == errors[i].errorCode)
+    if(errorCode == errors[i].errorCode)
     {
       return errors[i].errorString;
     }
@@ -149,59 +145,57 @@ const char* Context::ErrorToString( GLenum errorCode )
   return "Unknown Open GLES error";
 }
 
-const Rect< int >& Context::GetViewport()
+const Rect<int>& Context::GetViewport()
 {
   return mViewPort;
 }
 
 void Context::FlushVertexAttributeLocations()
 {
-  for( unsigned int i = 0; i < MAX_ATTRIBUTE_CACHE_SIZE; ++i )
+  for(unsigned int i = 0; i < MAX_ATTRIBUTE_CACHE_SIZE; ++i)
   {
     // see if our cached state is different to the actual state
-    if (mVertexAttributeCurrentState[ i ] != mVertexAttributeCachedState[ i ] )
+    if(mVertexAttributeCurrentState[i] != mVertexAttributeCachedState[i])
     {
       // it's different so make the change to the driver
       // and update the cached state
-      mVertexAttributeCurrentState[ i ] = mVertexAttributeCachedState[ i ];
+      mVertexAttributeCurrentState[i] = mVertexAttributeCachedState[i];
 
-      if (mVertexAttributeCurrentState[ i ] )
+      if(mVertexAttributeCurrentState[i])
       {
         LOG_GL("EnableVertexAttribArray %d\n", i);
-        CHECK_GL( mGlAbstraction, mGlAbstraction.EnableVertexAttribArray( i ) );
+        CHECK_GL(mGlAbstraction, mGlAbstraction.EnableVertexAttribArray(i));
       }
       else
       {
         LOG_GL("DisableVertexAttribArray %d\n", i);
-        CHECK_GL( mGlAbstraction, mGlAbstraction.DisableVertexAttribArray( i ) );
+        CHECK_GL(mGlAbstraction, mGlAbstraction.DisableVertexAttribArray(i));
       }
     }
   }
-
 }
 
 void Context::SetVertexAttributeLocation(unsigned int location, bool state)
 {
-
-  if( location >= MAX_ATTRIBUTE_CACHE_SIZE )
+  if(location >= MAX_ATTRIBUTE_CACHE_SIZE)
   {
     // not cached, make the gl call through context
-    if ( state )
+    if(state)
     {
-       LOG_GL("EnableVertexAttribArray %d\n", location);
-       CHECK_GL( mGlAbstraction, mGlAbstraction.EnableVertexAttribArray( location ) );
+      LOG_GL("EnableVertexAttribArray %d\n", location);
+      CHECK_GL(mGlAbstraction, mGlAbstraction.EnableVertexAttribArray(location));
     }
     else
     {
       LOG_GL("DisableVertexAttribArray %d\n", location);
-      CHECK_GL( mGlAbstraction, mGlAbstraction.DisableVertexAttribArray( location ) );
+      CHECK_GL(mGlAbstraction, mGlAbstraction.DisableVertexAttribArray(location));
     }
   }
   else
   {
     // set the cached state, it will be set at the next draw call
     // if it's different from the current driver state
-    mVertexAttributeCachedState[ location ] = state;
+    mVertexAttributeCachedState[location] = state;
   }
 }
 
@@ -210,34 +204,34 @@ void Context::InitializeGlState()
   DALI_LOG_INFO(gContextLogFilter, Debug::Verbose, "Context::InitializeGlState()\n");
   DALI_ASSERT_DEBUG(mGlContextCreated);
 
-  mClearColorSet = false;
-  mColorMask = true;
-  mStencilMask = 0xFF;
-  mBlendEnabled = false;
-  mDepthBufferEnabled = false;
-  mDepthMaskEnabled = false;
-  mPolygonOffsetFillEnabled = false;
+  mClearColorSet                = false;
+  mColorMask                    = true;
+  mStencilMask                  = 0xFF;
+  mBlendEnabled                 = false;
+  mDepthBufferEnabled           = false;
+  mDepthMaskEnabled             = false;
+  mPolygonOffsetFillEnabled     = false;
   mSampleAlphaToCoverageEnabled = false;
-  mSampleCoverageEnabled = false;
-  mScissorTestEnabled = false;
-  mStencilBufferEnabled = false;
-  mDitherEnabled = false; // This and GL_MULTISAMPLE are the only GL capability which defaults to true
+  mSampleCoverageEnabled        = false;
+  mScissorTestEnabled           = false;
+  mStencilBufferEnabled         = false;
+  mDitherEnabled                = false; // This and GL_MULTISAMPLE are the only GL capability which defaults to true
   mGlAbstraction.Disable(GL_DITHER);
 
-  mBoundArrayBufferId = 0;
-  mBoundElementArrayBufferId = 0;
+  mBoundArrayBufferId             = 0;
+  mBoundElementArrayBufferId      = 0;
   mBoundTransformFeedbackBufferId = 0;
-  mActiveTextureUnit = TEXTURE_UNIT_IMAGE;
+  mActiveTextureUnit              = TEXTURE_UNIT_IMAGE;
 
   mUsingDefaultBlendColor = true; //Default blend color is (0,0,0,0)
 
-  mBlendFuncSeparateSrcRGB = GL_ONE;
-  mBlendFuncSeparateDstRGB = GL_ZERO;
+  mBlendFuncSeparateSrcRGB   = GL_ONE;
+  mBlendFuncSeparateDstRGB   = GL_ZERO;
   mBlendFuncSeparateSrcAlpha = GL_ONE;
   mBlendFuncSeparateDstAlpha = GL_ZERO;
 
   // initial state is GL_FUNC_ADD for both RGB and Alpha blend modes
-  mBlendEquationSeparateModeRGB = GL_FUNC_ADD;
+  mBlendEquationSeparateModeRGB   = GL_FUNC_ADD;
   mBlendEquationSeparateModeAlpha = GL_FUNC_ADD;
 
   mCullFaceMode = FaceCullingMode::NONE; //By default cullface is disabled, front face is set to CCW and cull face is set to back
@@ -249,11 +243,11 @@ void Context::InitializeGlState()
   mViewPort.x = mViewPort.y = mViewPort.width = mViewPort.height = 0;
 
   //Initialze vertex attribute cache
-  memset( &mVertexAttributeCachedState, 0, sizeof(mVertexAttributeCachedState) );
-  memset( &mVertexAttributeCurrentState, 0, sizeof(mVertexAttributeCurrentState) );
+  memset(&mVertexAttributeCachedState, 0, sizeof(mVertexAttributeCachedState));
+  memset(&mVertexAttributeCurrentState, 0, sizeof(mVertexAttributeCurrentState));
 
   //Initialize bound 2d texture cache
-  memset( &mBoundTextureId, 0, sizeof(mBoundTextureId) );
+  memset(&mBoundTextureId, 0, sizeof(mBoundTextureId));
 
   mFrameBufferStateCache.Reset();
 }
@@ -262,8 +256,8 @@ void Context::InitializeGlState()
 
 void Context::PrintCurrentState()
 {
-  const char* cullFaceModes[] = { "CullNone", "CullFront", "CullBack", "CullFrontAndBack" };
-  DALI_LOG_INFO( gContextLogFilter, Debug::General,
+  const char* cullFaceModes[] = {"CullNone", "CullFront", "CullBack", "CullFrontAndBack"};
+  DALI_LOG_INFO(gContextLogFilter, Debug::General,
                 "\n----------------- Context State BEGIN -----------------\n"
                 "Blend = %s\n"
                 "Cull Face = %s\n"
@@ -277,7 +271,7 @@ void Context::PrintCurrentState()
                 "Stencil Test = %s\n"
                 "----------------- Context State END -----------------\n",
                 mBlendEnabled ? "Enabled" : "Disabled",
-                cullFaceModes[ mCullFaceMode ],
+                cullFaceModes[mCullFaceMode],
                 mDepthBufferEnabled ? "Enabled" : "Disabled",
                 mDepthMaskEnabled ? "Enabled" : "Disabled",
                 mDitherEnabled ? "Enabled" : "Disabled",
index a66cee1..339c2cb 100644 (file)
@@ -2,7 +2,7 @@
 #define DALI_INTERNAL_CONTEXT_H
 
 /*
- * Copyright (c) 2020 Samsung Electronics Co., Ltd.
+ * Copyright (c) 2021 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.
  */
 
 // INTERNAL INCLUDES
-#include <dali/public-api/common/dali-vector.h>
-#include <dali/public-api/common/dali-common.h>
-#include <dali/public-api/math/rect.h>
-#include <dali/public-api/math/vector4.h>
-#include <dali/public-api/rendering/renderer.h>
 #include <dali/devel-api/common/owner-container.h>
 #include <dali/integration-api/debug.h>
 #include <dali/integration-api/gl-abstraction.h>
 #include <dali/integration-api/gl-defines.h>
 #include <dali/internal/render/common/performance-monitor.h>
-#include <dali/internal/render/gl-resources/texture-units.h>
 #include <dali/internal/render/gl-resources/frame-buffer-state-cache.h>
 #include <dali/internal/render/gl-resources/gl-call-debug.h>
+#include <dali/internal/render/gl-resources/texture-units.h>
+#include <dali/public-api/common/dali-common.h>
+#include <dali/public-api/common/dali-vector.h>
+#include <dali/public-api/math/rect.h>
+#include <dali/public-api/math/vector4.h>
+#include <dali/public-api/rendering/renderer.h>
 
 namespace Dali
 {
-
 namespace Internal
 {
-
 /**
  * Context records the current GL state, and provides access to the OpenGL ES 2.0 API.
  * Context avoids duplicate GL calls, if the same setting etc. is requested repeatedly.
@@ -46,7 +44,6 @@ namespace Internal
 class Context
 {
 public:
-
   /**
    * FrameBuffer Clear mode
    */
@@ -62,7 +59,7 @@ public:
    */
   static constexpr unsigned int MAX_ATTRIBUTE_CACHE_SIZE = 8;
 
-  static constexpr unsigned int MAX_TEXTURE_UNITS = 8; // for GLES 2.0 8 is guaranteed, which is more than DALi uses anyways
+  static constexpr unsigned int MAX_TEXTURE_UNITS  = 8; // for GLES 2.0 8 is guaranteed, which is more than DALi uses anyways
   static constexpr unsigned int MAX_TEXTURE_TARGET = 3; // We support only GL_TEXTURE_2D, GL_TEXTURE_CUBE_MAP and GL_TEXTURE_EXTERNAL_OES now
 
   /**
@@ -72,7 +69,7 @@ public:
    * @exception Context already created.
    * @param glAbstraction the gl abstraction.
    */
-  Context( Integration::GlAbstraction& glAbstraction );
+  Context(Integration::GlAbstraction& glAbstraction);
 
   /**
    * Creates the Dali Context object for texture (and surface rendering if required).
@@ -82,7 +79,7 @@ public:
    * @param glAbstraction the gl abstraction.
    * @param contexts The list of scene contexts (for surface rendering)
    */
-  Context( Integration::GlAbstraction& glAbstraction, OwnerContainer< Context* >* contexts );
+  Context(Integration::GlAbstraction& glAbstraction, OwnerContainer<Context*>* contexts);
 
   /**
    * Destructor
@@ -103,12 +100,18 @@ public:
    * Query whether the OpenGL context has been created.
    * @return True if the OpenGL context has been created.
    */
-  bool IsGlContextCreated() { return mGlContextCreated; }
+  bool IsGlContextCreated()
+  {
+    return mGlContextCreated;
+  }
 
   /**
    * @return the GLAbstraction
    */
-  Integration::GlAbstraction& GetAbstraction() { return mGlAbstraction; }
+  Integration::GlAbstraction& GetAbstraction()
+  {
+    return mGlAbstraction;
+  }
 
 #ifdef DEBUG_ENABLED
 
@@ -124,14 +127,14 @@ public:
    * @param errorCode to convert
    * @return C string
    */
-  const char* ErrorToString( GLenum errorCode );
+  const char* ErrorToString(GLenum errorCode);
 
   /**
    * Helper to print GL string to debug log
    */
   void PrintGlString(const char* stringName, GLenum stringId)
   {
-    DALI_LOG_INFO(Debug::Filter::gRender, Debug::General, "GL %s = %s\n", stringName, reinterpret_cast< const char * >( GetString( stringId ) ) );
+    DALI_LOG_INFO(Debug::Filter::gRender, Debug::General, "GL %s = %s\n", stringName, reinterpret_cast<const char*>(GetString(stringId)));
   }
 
   /**
@@ -142,8 +145,8 @@ public:
     // reset the cached buffer id's
     // fixes problem where some drivers will a generate a buffer with the
     // same id, as the last deleted buffer id.
-    mBoundArrayBufferId = 0;
-    mBoundElementArrayBufferId = 0;
+    mBoundArrayBufferId             = 0;
+    mBoundElementArrayBufferId      = 0;
     mBoundTransformFeedbackBufferId = 0;
   }
 
@@ -209,21 +212,21 @@ public:
   /**
    * Wrapper for TextureRequiresConverting of Dali::Integration::GlAbstraction
    */
-  bool TextureRequiresConverting( const GLenum imageGlFormat, const GLenum textureGlFormat, const bool isSubImage ) const
+  bool TextureRequiresConverting(const GLenum imageGlFormat, const GLenum textureGlFormat, const bool isSubImage) const
   {
-    return mGlAbstraction.TextureRequiresConverting( imageGlFormat, textureGlFormat, isSubImage );
+    return mGlAbstraction.TextureRequiresConverting(imageGlFormat, textureGlFormat, isSubImage);
   }
 
   /**
    * Wrapper for OpenGL ES 2.0 glActiveTexture()
    */
-  void ActiveTexture( TextureUnit textureUnit )
+  void ActiveTexture(TextureUnit textureUnit)
   {
-    if ( textureUnit != mActiveTextureUnit )
+    if(textureUnit != mActiveTextureUnit)
     {
       mActiveTextureUnit = textureUnit;
       LOG_GL("ActiveTexture %x\n", textureUnit);
-      CHECK_GL( mGlAbstraction, mGlAbstraction.ActiveTexture(TextureUnitAsGLenum(textureUnit)) );
+      CHECK_GL(mGlAbstraction, mGlAbstraction.ActiveTexture(TextureUnitAsGLenum(textureUnit)));
     }
   }
 
@@ -233,7 +236,7 @@ public:
   void BeginQuery(GLenum target, GLuint id)
   {
     LOG_GL("BeginQuery %d %d\n", target, id);
-    CHECK_GL( mGlAbstraction, mGlAbstraction.BeginQuery(target, id) );
+    CHECK_GL(mGlAbstraction, mGlAbstraction.BeginQuery(target, id));
   }
 
   /**
@@ -242,7 +245,7 @@ public:
   void BeginTransformFeedback(GLenum primitiveMode)
   {
     LOG_GL("BeginTransformFeedback %x\n", primitiveMode);
-    CHECK_GL( mGlAbstraction, mGlAbstraction.BeginTransformFeedback(primitiveMode) );
+    CHECK_GL(mGlAbstraction, mGlAbstraction.BeginTransformFeedback(primitiveMode));
   }
 
   /**
@@ -255,12 +258,12 @@ public:
   void BindArrayBuffer(GLuint buffer)
   {
     // Avoid unecessary calls to BindBuffer
-    if (mBoundArrayBufferId != buffer)
+    if(mBoundArrayBufferId != buffer)
     {
       mBoundArrayBufferId = buffer;
 
       LOG_GL("BindBuffer GL_ARRAY_BUFFER %d\n", buffer);
-      CHECK_GL( mGlAbstraction, mGlAbstraction.BindBuffer(GL_ARRAY_BUFFER, buffer) );
+      CHECK_GL(mGlAbstraction, mGlAbstraction.BindBuffer(GL_ARRAY_BUFFER, buffer));
     }
   }
 
@@ -270,12 +273,12 @@ public:
   void BindElementArrayBuffer(GLuint buffer)
   {
     // Avoid unecessary calls to BindBuffer
-    if (mBoundElementArrayBufferId!= buffer)
+    if(mBoundElementArrayBufferId != buffer)
     {
       mBoundElementArrayBufferId = buffer;
 
       LOG_GL("BindBuffer GL_ELEMENT_ARRAY_BUFFER %d\n", buffer);
-      CHECK_GL( mGlAbstraction, mGlAbstraction.BindBuffer(GL_ELEMENT_ARRAY_BUFFER, buffer) );
+      CHECK_GL(mGlAbstraction, mGlAbstraction.BindBuffer(GL_ELEMENT_ARRAY_BUFFER, buffer));
     }
   }
 
@@ -285,12 +288,12 @@ public:
   void BindTransformFeedbackBuffer(GLuint buffer)
   {
     // Avoid unecessary calls to BindBuffer
-    if (mBoundTransformFeedbackBufferId != buffer)
+    if(mBoundTransformFeedbackBufferId != buffer)
     {
       mBoundTransformFeedbackBufferId = buffer;
 
       LOG_GL("BindBuffer GL_TRANSFORM_FEEDBACK_BUFFER %d\n", buffer);
-      CHECK_GL( mGlAbstraction, mGlAbstraction.BindBuffer(GL_TRANSFORM_FEEDBACK_BUFFER , buffer) );
+      CHECK_GL(mGlAbstraction, mGlAbstraction.BindBuffer(GL_TRANSFORM_FEEDBACK_BUFFER, buffer));
     }
   }
 
@@ -300,12 +303,12 @@ public:
   void BindTransformFeedbackBufferBase(GLuint index, GLuint buffer)
   {
     // Avoid unecessary calls to BindBufferBase
-    if (mBoundTransformFeedbackBufferId != buffer)
+    if(mBoundTransformFeedbackBufferId != buffer)
     {
       mBoundTransformFeedbackBufferId = buffer;
 
       LOG_GL("BindBufferBase GL_TRANSFORM_FEEDBACK_BUFFER %d %d\n", index, buffer);
-      CHECK_GL( mGlAbstraction, mGlAbstraction.BindBufferBase(GL_TRANSFORM_FEEDBACK_BUFFER, index, buffer) );
+      CHECK_GL(mGlAbstraction, mGlAbstraction.BindBufferBase(GL_TRANSFORM_FEEDBACK_BUFFER, index, buffer));
     }
   }
 
@@ -314,10 +317,10 @@ public:
    */
   void BindFramebuffer(GLenum target, GLuint framebuffer)
   {
-    mFrameBufferStateCache.SetCurrentFrameBuffer( framebuffer );
+    mFrameBufferStateCache.SetCurrentFrameBuffer(framebuffer);
 
     LOG_GL("BindFramebuffer %d %d\n", target, framebuffer);
-    CHECK_GL( mGlAbstraction, mGlAbstraction.BindFramebuffer(target, framebuffer) );
+    CHECK_GL(mGlAbstraction, mGlAbstraction.BindFramebuffer(target, framebuffer));
   }
 
   /**
@@ -326,7 +329,7 @@ public:
   void BindRenderbuffer(GLenum target, GLuint renderbuffer)
   {
     LOG_GL("BindRenderbuffer %d %d\n", target, renderbuffer);
-    CHECK_GL( mGlAbstraction, mGlAbstraction.BindRenderbuffer(target, renderbuffer) );
+    CHECK_GL(mGlAbstraction, mGlAbstraction.BindRenderbuffer(target, renderbuffer));
   }
 
   /**
@@ -335,7 +338,7 @@ public:
   void BindTransformFeedback(GLenum target, GLuint id)
   {
     LOG_GL("BindTransformFeedback %d %d\n", target, id);
-    CHECK_GL( mGlAbstraction, mGlAbstraction.BindTransformFeedback(target, id) );
+    CHECK_GL(mGlAbstraction, mGlAbstraction.BindTransformFeedback(target, id));
   }
 
   /**
@@ -347,7 +350,7 @@ public:
    * @param textureunit to bind to
    * @param texture to bind
    */
-  void BindTextureForUnit( TextureUnit textureunit, int target, GLuint texture )
+  void BindTextureForUnit(TextureUnit textureunit, int target, GLuint texture)
   {
     ActiveTexture(textureunit);
     BindTexture(target, texture);
@@ -356,14 +359,14 @@ public:
   /**
    * Wrapper for OpenGL ES 2.0 glBindTexture( target )
    */
-  void BindTexture( int target, GLuint texture )
+  void BindTexture(int target, GLuint texture)
   {
     int16_t index = GetTextureIndexFromGlFormat(target);
     if(index >= 0)
     {
-      if(mBoundTextureId[ mActiveTextureUnit ][index] != texture)
+      if(mBoundTextureId[mActiveTextureUnit][index] != texture)
       {
-        mBoundTextureId[ mActiveTextureUnit ][index] = texture;
+        mBoundTextureId[mActiveTextureUnit][index] = texture;
 
         LOG_GL("BindTexture target(%d) %d\n", target, texture);
         CHECK_GL(mGlAbstraction, mGlAbstraction.BindTexture(target, texture));
@@ -382,9 +385,9 @@ public:
    */
   void SetDefaultBlendColor()
   {
-    if( ! mUsingDefaultBlendColor )
+    if(!mUsingDefaultBlendColor)
     {
-      SetCustomBlendColor( Color::TRANSPARENT );
+      SetCustomBlendColor(Color::TRANSPARENT);
       mUsingDefaultBlendColor = true;
     }
   }
@@ -392,14 +395,14 @@ public:
   /**
    * Wrapper for OpenGL ES 2.0 glBlendColor()
    */
-  void SetCustomBlendColor( const Vector4& color )
+  void SetCustomBlendColor(const Vector4& color)
   {
-    if( mUsingDefaultBlendColor || mBlendColor != color )
+    if(mUsingDefaultBlendColor || mBlendColor != color)
     {
-      LOG_GL( "BlendColor %f %f %f %f\n", color.r, color.g, color.b, color.a );
-      CHECK_GL( mGlAbstraction, mGlAbstraction.BlendColor( color.r, color.g, color.b, color.a ) );
+      LOG_GL("BlendColor %f %f %f %f\n", color.r, color.g, color.b, color.a);
+      CHECK_GL(mGlAbstraction, mGlAbstraction.BlendColor(color.r, color.g, color.b, color.a));
       mUsingDefaultBlendColor = false;
-      mBlendColor = color;
+      mBlendColor             = color;
     }
   }
 
@@ -411,12 +414,12 @@ public:
     // DO NOT USE BlendEquationSeparate to set the same rgb and alpha modes
     // KHR blending extensions require use of glBlendEquation
 
-    if( mBlendEquationSeparateModeRGB != mode || mBlendEquationSeparateModeAlpha != mode )
+    if(mBlendEquationSeparateModeRGB != mode || mBlendEquationSeparateModeAlpha != mode)
     {
-      mBlendEquationSeparateModeRGB = mode;
+      mBlendEquationSeparateModeRGB   = mode;
       mBlendEquationSeparateModeAlpha = mode;
       LOG_GL("BlendEquation %d\n", mode);
-      CHECK_GL( mGlAbstraction, mGlAbstraction.BlendEquation( mode ) );
+      CHECK_GL(mGlAbstraction, mGlAbstraction.BlendEquation(mode));
     }
   }
 
@@ -425,13 +428,13 @@ public:
    */
   void BlendEquationSeparate(GLenum modeRGB, GLenum modeAlpha)
   {
-    if( ( modeRGB != mBlendEquationSeparateModeRGB ) ||
-        ( modeAlpha != mBlendEquationSeparateModeAlpha ) )
+    if((modeRGB != mBlendEquationSeparateModeRGB) ||
+       (modeAlpha != mBlendEquationSeparateModeAlpha))
     {
-      mBlendEquationSeparateModeRGB = modeRGB;
+      mBlendEquationSeparateModeRGB   = modeRGB;
       mBlendEquationSeparateModeAlpha = modeAlpha;
       LOG_GL("BlendEquationSeparate %d %d\n", modeRGB, modeAlpha);
-      CHECK_GL( mGlAbstraction, mGlAbstraction.BlendEquationSeparate(modeRGB, modeAlpha) );
+      CHECK_GL(mGlAbstraction, mGlAbstraction.BlendEquationSeparate(modeRGB, modeAlpha));
     }
   }
 
@@ -441,24 +444,24 @@ public:
   void BlendFunc(GLenum sfactor, GLenum dfactor)
   {
     // reuse the BlendFuncSeparate as thats what the DDK does anyways
-    BlendFuncSeparate( sfactor, dfactor, sfactor, dfactor );
+    BlendFuncSeparate(sfactor, dfactor, sfactor, dfactor);
   }
 
   /**
    * Wrapper for OpenGL ES 2.0 glBlendFuncSeparate()
    */
-  void BlendFuncSeparate( GLenum srcRGB, GLenum dstRGB, GLenum srcAlpha, GLenum dstAlpha )
+  void BlendFuncSeparate(GLenum srcRGB, GLenum dstRGB, GLenum srcAlpha, GLenum dstAlpha)
   {
-    if( ( mBlendFuncSeparateSrcRGB != srcRGB )||( mBlendFuncSeparateDstRGB != dstRGB )||
-        ( mBlendFuncSeparateSrcAlpha != srcAlpha )||( mBlendFuncSeparateDstAlpha != dstAlpha ) )
+    if((mBlendFuncSeparateSrcRGB != srcRGB) || (mBlendFuncSeparateDstRGB != dstRGB) ||
+       (mBlendFuncSeparateSrcAlpha != srcAlpha) || (mBlendFuncSeparateDstAlpha != dstAlpha))
     {
-      mBlendFuncSeparateSrcRGB = srcRGB;
-      mBlendFuncSeparateDstRGB = dstRGB;
+      mBlendFuncSeparateSrcRGB   = srcRGB;
+      mBlendFuncSeparateDstRGB   = dstRGB;
       mBlendFuncSeparateSrcAlpha = srcAlpha;
       mBlendFuncSeparateDstAlpha = dstAlpha;
 
-      LOG_GL( "BlendFuncSeparate %d %d %d %d\n", srcRGB, dstRGB, srcAlpha, dstAlpha );
-      CHECK_GL( mGlAbstraction, mGlAbstraction.BlendFuncSeparate( srcRGB, dstRGB, srcAlpha, dstAlpha ) );
+      LOG_GL("BlendFuncSeparate %d %d %d %d\n", srcRGB, dstRGB, srcAlpha, dstAlpha);
+      CHECK_GL(mGlAbstraction, mGlAbstraction.BlendFuncSeparate(srcRGB, dstRGB, srcAlpha, dstAlpha));
     }
   }
 
@@ -467,8 +470,8 @@ public:
    */
   void BlitFramebuffer(GLint srcX0, GLint srcY0, GLint srcX1, GLint srcY1, GLint dstX0, GLint dstY0, GLint dstX1, GLint dstY1, GLbitfield mask, GLenum filter)
   {
-    LOG_GL( "BlitFramebuffer %d %d %d %d %d %d %d %d %x %d\n", srcX0, srcY0, srcX1, srcY1, dstX0, dstY0, dstX1, dstY1, mask, filter );
-    CHECK_GL( mGlAbstraction, mGlAbstraction.BlitFramebuffer( srcX0, srcY0, srcX1, srcY1, dstX0, dstY0, dstX1, dstY1, mask, filter ) );
+    LOG_GL("BlitFramebuffer %d %d %d %d %d %d %d %d %x %d\n", srcX0, srcY0, srcX1, srcY1, dstX0, dstY0, dstX1, dstY1, mask, filter);
+    CHECK_GL(mGlAbstraction, mGlAbstraction.BlitFramebuffer(srcX0, srcY0, srcX1, srcY1, dstX0, dstY0, dstX1, dstY1, mask, filter));
   }
 
   /**
@@ -477,7 +480,7 @@ public:
   void BufferData(GLenum target, GLsizeiptr size, const void* data, GLenum usage)
   {
     LOG_GL("BufferData %d %d %p %d\n", target, size, data, usage);
-    CHECK_GL( mGlAbstraction, mGlAbstraction.BufferData(target, size, data, usage) );
+    CHECK_GL(mGlAbstraction, mGlAbstraction.BufferData(target, size, data, usage));
   }
 
   /**
@@ -486,7 +489,7 @@ public:
   void BufferSubData(GLenum target, GLintptr offset, GLsizeiptr size, const void* data)
   {
     LOG_GL("BufferSubData %d %d %d %p\n", target, offset, size, data);
-    CHECK_GL( mGlAbstraction, mGlAbstraction.BufferSubData(target, offset, size, data) );
+    CHECK_GL(mGlAbstraction, mGlAbstraction.BufferSubData(target, offset, size, data));
   }
 
   /**
@@ -495,22 +498,22 @@ public:
   GLenum CheckFramebufferStatus(GLenum target)
   {
     LOG_GL("CheckFramebufferStatus %d\n", target);
-    GLenum value = CHECK_GL( mGlAbstraction, mGlAbstraction.CheckFramebufferStatus(target) );
+    GLenum value = CHECK_GL(mGlAbstraction, mGlAbstraction.CheckFramebufferStatus(target));
     return value;
   }
 
   /**
    * Wrapper for OpenGL ES 2.0 glClear()
    */
-  void Clear(GLbitfield mask, ClearMode mode )
+  void Clear(GLbitfield mask, ClearMode mode)
   {
-    bool forceClear = (mode == FORCE_CLEAR );
-    mask = mFrameBufferStateCache.GetClearMask( mask, forceClear , mScissorTestEnabled );
+    bool forceClear = (mode == FORCE_CLEAR);
+    mask            = mFrameBufferStateCache.GetClearMask(mask, forceClear, mScissorTestEnabled);
 
-    if( mask > 0 )
+    if(mask > 0)
     {
       LOG_GL("Clear %d\n", mask);
-      CHECK_GL( mGlAbstraction, mGlAbstraction.Clear( mask ) );
+      CHECK_GL(mGlAbstraction, mGlAbstraction.Clear(mask));
     }
   }
 
@@ -519,15 +522,15 @@ public:
    */
   void ClearColor(GLclampf red, GLclampf green, GLclampf blue, GLclampf alpha)
   {
-    Vector4 newCol(red,green,blue,alpha);
+    Vector4 newCol(red, green, blue, alpha);
 
-    if (!mClearColorSet || mClearColor !=newCol )
+    if(!mClearColorSet || mClearColor != newCol)
     {
       LOG_GL("ClearColor %f %f %f %f\n", red, green, blue, alpha);
-      CHECK_GL( mGlAbstraction, mGlAbstraction.ClearColor(red, green, blue, alpha) );
+      CHECK_GL(mGlAbstraction, mGlAbstraction.ClearColor(red, green, blue, alpha));
 
       mClearColorSet = true;
-      mClearColor = newCol;
+      mClearColor    = newCol;
     }
   }
 
@@ -537,7 +540,7 @@ public:
   void ClearDepthf(GLclampf depth)
   {
     LOG_GL("ClearDepthf %f\n", depth);
-    CHECK_GL( mGlAbstraction, mGlAbstraction.ClearDepthf(depth) );
+    CHECK_GL(mGlAbstraction, mGlAbstraction.ClearDepthf(depth));
   }
 
   /**
@@ -546,63 +549,58 @@ public:
   void ClearStencil(GLint s)
   {
     LOG_GL("ClearStencil %d\n", s);
-    CHECK_GL( mGlAbstraction, mGlAbstraction.ClearStencil(s) );
+    CHECK_GL(mGlAbstraction, mGlAbstraction.ClearStencil(s));
   }
 
   /**
    * Wrapper for OpenGL ES 2.0 glColorMask()
    * @note This has been optimized to a single boolean value (masking individual channels is not required)
    */
-  void ColorMask( bool flag )
+  void ColorMask(bool flag)
   {
     // only change state if needed
-    if( flag != mColorMask )
+    if(flag != mColorMask)
     {
       mColorMask = flag;
       LOG_GL("ColorMask %s %s %s %s\n", flag ? "True" : "False", flag ? "True" : "False", flag ? "True" : "False", flag ? "True" : "False");
-      CHECK_GL( mGlAbstraction, mGlAbstraction.ColorMask(flag, flag, flag, flag) );
+      CHECK_GL(mGlAbstraction, mGlAbstraction.ColorMask(flag, flag, flag, flag));
     }
   }
 
   /**
    * Wrapper for OpenGL ES 2.0 glCompressedTexImage2D()
    */
-  void CompressedTexImage2D(GLenum target, GLint level, GLenum internalformat, GLsizei width, GLsizei height,
-                            GLint border, GLsizei imageSize, const void* data)
+  void CompressedTexImage2D(GLenum target, GLint level, GLenum internalformat, GLsizei width, GLsizei height, GLint border, GLsizei imageSize, const void* data)
   {
     LOG_GL("CompressedTexImage2D %d %d %x %d %d %d %d %p\n", target, level, internalformat, width, height, border, imageSize, data);
-    CHECK_GL( mGlAbstraction, mGlAbstraction.CompressedTexImage2D(target, level, internalformat, width, height, border, imageSize, data) );
+    CHECK_GL(mGlAbstraction, mGlAbstraction.CompressedTexImage2D(target, level, internalformat, width, height, border, imageSize, data));
   }
 
   /**
    * Wrapper for OpenGL ES 3.0 glCompressedTexImage3D()
    */
-  void CompressedTexImage3D(GLenum target, GLint level, GLenum internalformat, GLsizei width, GLsizei height, GLsizei depth,
-                            GLint border, GLsizei imageSize, const void* data)
+  void CompressedTexImage3D(GLenum target, GLint level, GLenum internalformat, GLsizei width, GLsizei height, GLsizei depth, GLint border, GLsizei imageSize, const void* data)
   {
     LOG_GL("CompressedTexImage3D %d %d %x %d %d %d %d %d %p\n", target, level, internalformat, width, height, depth, border, imageSize, data);
-    CHECK_GL( mGlAbstraction, mGlAbstraction.CompressedTexImage3D(target, level, internalformat, width, height, depth, border, imageSize, data) );
+    CHECK_GL(mGlAbstraction, mGlAbstraction.CompressedTexImage3D(target, level, internalformat, width, height, depth, border, imageSize, data));
   }
 
   /**
    * Wrapper for OpenGL ES 2.0 glCompressedTexSubImage2D()
    */
-  void CompressedTexSubImage2D(GLenum target, GLint level, GLint xoffset, GLint yoffset, GLsizei width, GLsizei height,
-                               GLenum format, GLsizei imageSize, const void* data)
+  void CompressedTexSubImage2D(GLenum target, GLint level, GLint xoffset, GLint yoffset, GLsizei width, GLsizei height, GLenum format, GLsizei imageSize, const void* data)
   {
     LOG_GL("CompressedTexSubImage2D %x %d %d %d %d %d %x %d %p\n", target, level, xoffset, yoffset, width, height, format, imageSize, data);
-    CHECK_GL( mGlAbstraction, mGlAbstraction.CompressedTexSubImage2D(target, level, xoffset, yoffset, width, height, format, imageSize, data) );
+    CHECK_GL(mGlAbstraction, mGlAbstraction.CompressedTexSubImage2D(target, level, xoffset, yoffset, width, height, format, imageSize, data));
   }
 
   /**
    * Wrapper for OpenGL ES 3.0 glCompressedTexSubImage3D()
    */
-  void CompressedTexSubImage3D(GLenum target, GLint level, GLint xoffset, GLint yoffset, GLint zoffset,
-                               GLsizei width, GLsizei height, GLsizei depth,
-                               GLenum format, GLsizei imageSize, const void* data)
+  void CompressedTexSubImage3D(GLenum target, GLint level, GLint xoffset, GLint yoffset, GLint zoffset, GLsizei width, GLsizei height, GLsizei depth, GLenum format, GLsizei imageSize, const void* data)
   {
     LOG_GL("CompressedTexSubImage3D %x %d %d %d %d %d %d %d %x %d %p\n", target, level, xoffset, yoffset, xoffset, width, height, depth, format, imageSize, data);
-    CHECK_GL( mGlAbstraction, mGlAbstraction.CompressedTexSubImage3D(target, level, xoffset, yoffset, zoffset, width, height, depth, format, imageSize, data) );
+    CHECK_GL(mGlAbstraction, mGlAbstraction.CompressedTexSubImage3D(target, level, xoffset, yoffset, zoffset, width, height, depth, format, imageSize, data));
   }
 
   /**
@@ -611,7 +609,7 @@ public:
   void CopyTexImage2D(GLenum target, GLint level, GLenum internalformat, GLint x, GLint y, GLsizei width, GLsizei height, GLint border)
   {
     LOG_GL("CopyTexImage2D %x %d %x %d %d %d %d %d\n", target, level, internalformat, x, y, width, height, border);
-    CHECK_GL( mGlAbstraction, mGlAbstraction.CopyTexImage2D(target, level, internalformat, x, y, width, height, border) );
+    CHECK_GL(mGlAbstraction, mGlAbstraction.CopyTexImage2D(target, level, internalformat, x, y, width, height, border));
   }
 
   /**
@@ -620,7 +618,7 @@ public:
   void CopyTexSubImage2D(GLenum target, GLint level, GLint xoffset, GLint yoffset, GLint x, GLint y, GLsizei width, GLsizei height)
   {
     LOG_GL("CopyTexSubImage2D %x %d %d %d %d %d %d %d\n", target, level, xoffset, yoffset, x, y, width, height);
-    CHECK_GL( mGlAbstraction, mGlAbstraction.CopyTexSubImage2D(target, level, xoffset, yoffset, x, y, width, height) );
+    CHECK_GL(mGlAbstraction, mGlAbstraction.CopyTexSubImage2D(target, level, xoffset, yoffset, x, y, width, height));
   }
 
   /**
@@ -629,7 +627,7 @@ public:
   void CopyTexSubImage3D(GLenum target, GLint level, GLint xoffset, GLint yoffset, GLint zoffset, GLint x, GLint y, GLsizei width, GLsizei height)
   {
     LOG_GL("CopyTexSubImage3D %x %d %d %d %d %d %d %d %d\n", target, level, xoffset, yoffset, zoffset, x, y, width, height);
-    CHECK_GL( mGlAbstraction, mGlAbstraction.CopyTexSubImage3D(target, level, xoffset, yoffset, zoffset, x, y, width, height) );
+    CHECK_GL(mGlAbstraction, mGlAbstraction.CopyTexSubImage3D(target, level, xoffset, yoffset, zoffset, x, y, width, height));
   }
 
   /**
@@ -637,7 +635,7 @@ public:
    * enables GL_CULL_FACE if in any of the face culling modes
    * otherwise disables GL_CULL_FACE
    */
-  void CullFace( Dali::FaceCullingMode::Type mode )
+  void CullFace(Dali::FaceCullingMode::Type mode)
   {
     // Avoid unnecessary calls to gl
     if(mCullFaceMode != mode)
@@ -648,34 +646,34 @@ public:
         case Dali::FaceCullingMode::NONE:
         {
           LOG_GL("Disable GL_CULL_FACE\n");
-          CHECK_GL( mGlAbstraction, mGlAbstraction.Disable(GL_CULL_FACE) );
+          CHECK_GL(mGlAbstraction, mGlAbstraction.Disable(GL_CULL_FACE));
           break;
         }
 
         case Dali::FaceCullingMode::FRONT:
         {
           LOG_GL("Enable GL_CULL_FACE\n");
-          CHECK_GL( mGlAbstraction, mGlAbstraction.Enable(GL_CULL_FACE) );
+          CHECK_GL(mGlAbstraction, mGlAbstraction.Enable(GL_CULL_FACE));
           LOG_GL("Enable GL_FRONT\n");
-          CHECK_GL( mGlAbstraction, mGlAbstraction.CullFace(GL_FRONT) );
+          CHECK_GL(mGlAbstraction, mGlAbstraction.CullFace(GL_FRONT));
           break;
         }
 
         case Dali::FaceCullingMode::BACK:
         {
           LOG_GL("Enable GL_CULL_FACE\n");
-          CHECK_GL( mGlAbstraction, mGlAbstraction.Enable(GL_CULL_FACE) );
+          CHECK_GL(mGlAbstraction, mGlAbstraction.Enable(GL_CULL_FACE));
           LOG_GL("Enable GL_BACK\n");
-          CHECK_GL( mGlAbstraction, mGlAbstraction.CullFace(GL_BACK) );
+          CHECK_GL(mGlAbstraction, mGlAbstraction.CullFace(GL_BACK));
           break;
         }
 
         case Dali::FaceCullingMode::FRONT_AND_BACK:
         {
           LOG_GL("Enable GL_CULL_FACE\n");
-          CHECK_GL( mGlAbstraction, mGlAbstraction.Enable(GL_CULL_FACE) );
+          CHECK_GL(mGlAbstraction, mGlAbstraction.Enable(GL_CULL_FACE));
           LOG_GL("Enable GL_FRONT_AND_BACK\n");
-          CHECK_GL( mGlAbstraction, mGlAbstraction.CullFace(GL_FRONT_AND_BACK) );
+          CHECK_GL(mGlAbstraction, mGlAbstraction.CullFace(GL_FRONT_AND_BACK));
           break;
         }
 
@@ -690,21 +688,21 @@ public:
    */
   void DeleteBuffers(GLsizei n, const GLuint* buffers)
   {
-    if( this->IsGlContextCreated() )
+    if(this->IsGlContextCreated())
     {
       LOG_GL("DeleteBuffers %d %p\n", n, buffers);
-      CHECK_GL( mGlAbstraction, mGlAbstraction.DeleteBuffers(n, buffers) );
+      CHECK_GL(mGlAbstraction, mGlAbstraction.DeleteBuffers(n, buffers));
     }
 
     ResetBufferCache();
 
     // Need to reset the buffer cache in the surface contexts
     // This will only be executed by the surfaceless context when there are contexts for surface rendering
-    if ( mSceneContexts )
+    if(mSceneContexts)
     {
-      for ( auto&& context : *mSceneContexts )
+      for(auto&& context : *mSceneContexts)
       {
-        if ( context )
+        if(context)
         {
           context->ResetBufferCache();
         }
@@ -717,10 +715,10 @@ public:
    */
   void DeleteFramebuffers(GLsizei n, const GLuint* framebuffers)
   {
-    mFrameBufferStateCache.FrameBuffersDeleted( n, framebuffers );
+    mFrameBufferStateCache.FrameBuffersDeleted(n, framebuffers);
 
     LOG_GL("DeleteFramebuffers %d %p\n", n, framebuffers);
-    CHECK_GL( mGlAbstraction, mGlAbstraction.DeleteFramebuffers(n, framebuffers) );
+    CHECK_GL(mGlAbstraction, mGlAbstraction.DeleteFramebuffers(n, framebuffers));
   }
 
   /**
@@ -729,7 +727,7 @@ public:
   void DeleteQueries(GLsizei n, GLuint* ids)
   {
     LOG_GL("DeleteQueries %d %p\n", n, ids);
-    CHECK_GL( mGlAbstraction, mGlAbstraction.DeleteQueries(n, ids) );
+    CHECK_GL(mGlAbstraction, mGlAbstraction.DeleteQueries(n, ids));
   }
 
   /**
@@ -738,7 +736,7 @@ public:
   void DeleteRenderbuffers(GLsizei n, const GLuint* renderbuffers)
   {
     LOG_GL("DeleteRenderbuffers %d %p\n", n, renderbuffers);
-    CHECK_GL( mGlAbstraction, mGlAbstraction.DeleteRenderbuffers(n, renderbuffers) );
+    CHECK_GL(mGlAbstraction, mGlAbstraction.DeleteRenderbuffers(n, renderbuffers));
   }
 
   /**
@@ -747,17 +745,17 @@ public:
   void DeleteTextures(GLsizei n, const GLuint* textures)
   {
     LOG_GL("DeleteTextures %d %p\n", n, textures);
-    CHECK_GL( mGlAbstraction, mGlAbstraction.DeleteTextures(n, textures) );
+    CHECK_GL(mGlAbstraction, mGlAbstraction.DeleteTextures(n, textures));
 
     ResetTextureCache();
 
     // Need to reset the texture cache in the scene contexts
     // This will only be executed by the surfaceless context when there are contexts for surface rendering
-    if ( mSceneContexts )
+    if(mSceneContexts)
     {
-      for ( auto&& context : *mSceneContexts )
+      for(auto&& context : *mSceneContexts)
       {
-        if ( context )
+        if(context)
         {
           context->ResetTextureCache();
         }
@@ -771,7 +769,7 @@ public:
   void DeleteTransformFeedbacks(GLsizei n, GLuint* ids)
   {
     LOG_GL("DeleteTransformFeedbacks %d %p\n", n, ids);
-    CHECK_GL( mGlAbstraction, mGlAbstraction.DeleteTransformFeedbacks(n, ids) );
+    CHECK_GL(mGlAbstraction, mGlAbstraction.DeleteTransformFeedbacks(n, ids));
   }
 
   /**
@@ -779,11 +777,11 @@ public:
    */
   void DepthFunc(GLenum func)
   {
-    if( func != mDepthFunction )
+    if(func != mDepthFunction)
     {
       mDepthFunction = func;
       LOG_GL("DepthFunc %x\n", func);
-      CHECK_GL( mGlAbstraction, mGlAbstraction.DepthFunc(func) );
+      CHECK_GL(mGlAbstraction, mGlAbstraction.DepthFunc(func));
     }
   }
 
@@ -794,11 +792,11 @@ public:
   {
     bool booleanFlag = flag != GL_FALSE;
     // only change state if needed
-    if( booleanFlag != mDepthMaskEnabled )
+    if(booleanFlag != mDepthMaskEnabled)
     {
       mDepthMaskEnabled = booleanFlag;
       LOG_GL("DepthMask %s\n", booleanFlag ? "True" : "False");
-      CHECK_GL( mGlAbstraction, mGlAbstraction.DepthMask( mDepthMaskEnabled ) );
+      CHECK_GL(mGlAbstraction, mGlAbstraction.DepthMask(mDepthMaskEnabled));
     }
   }
 
@@ -808,7 +806,7 @@ public:
   void DepthRangef(GLclampf zNear, GLclampf zFar)
   {
     LOG_GL("DepthRangef %f %f\n", zNear, zFar);
-    CHECK_GL( mGlAbstraction, mGlAbstraction.DepthRangef(zNear, zFar) );
+    CHECK_GL(mGlAbstraction, mGlAbstraction.DepthRangef(zNear, zFar));
   }
 
   /**
@@ -821,11 +819,11 @@ public:
    */
   void DrawArrays(GLenum mode, GLint first, GLsizei count)
   {
-    mFrameBufferStateCache.DrawOperation( mColorMask, DepthBufferWriteEnabled(), StencilBufferWriteEnabled() );
+    mFrameBufferStateCache.DrawOperation(mColorMask, DepthBufferWriteEnabled(), StencilBufferWriteEnabled());
     FlushVertexAttributeLocations();
 
     LOG_GL("DrawArrays %x %d %d\n", mode, first, count);
-    CHECK_GL( mGlAbstraction, mGlAbstraction.DrawArrays(mode, first, count) );
+    CHECK_GL(mGlAbstraction, mGlAbstraction.DrawArrays(mode, first, count));
   }
 
   /**
@@ -833,11 +831,11 @@ public:
    */
   void DrawArraysInstanced(GLenum mode, GLint first, GLsizei count, GLsizei instanceCount)
   {
-    mFrameBufferStateCache.DrawOperation( mColorMask, DepthBufferWriteEnabled(), StencilBufferWriteEnabled() );
+    mFrameBufferStateCache.DrawOperation(mColorMask, DepthBufferWriteEnabled(), StencilBufferWriteEnabled());
     FlushVertexAttributeLocations();
 
     LOG_GL("DrawArraysInstanced %x %d %d %d\n", mode, first, count, instanceCount);
-    CHECK_GL( mGlAbstraction, mGlAbstraction.DrawArraysInstanced(mode, first, count,instanceCount) );
+    CHECK_GL(mGlAbstraction, mGlAbstraction.DrawArraysInstanced(mode, first, count, instanceCount));
   }
 
   /**
@@ -845,9 +843,9 @@ public:
    */
   void DrawBuffers(GLsizei n, const GLenum* bufs)
   {
-    mFrameBufferStateCache.DrawOperation( mColorMask, DepthBufferWriteEnabled(), StencilBufferWriteEnabled() );
+    mFrameBufferStateCache.DrawOperation(mColorMask, DepthBufferWriteEnabled(), StencilBufferWriteEnabled());
     LOG_GL("DrawBuffers %d %p\n", n, bufs);
-    CHECK_GL( mGlAbstraction, mGlAbstraction.DrawBuffers(n, bufs) );
+    CHECK_GL(mGlAbstraction, mGlAbstraction.DrawBuffers(n, bufs));
   }
 
   /**
@@ -855,12 +853,12 @@ public:
    */
   void DrawElements(GLenum mode, GLsizei count, GLenum type, const void* indices)
   {
-    mFrameBufferStateCache.DrawOperation( mColorMask, DepthBufferWriteEnabled(), StencilBufferWriteEnabled() );
+    mFrameBufferStateCache.DrawOperation(mColorMask, DepthBufferWriteEnabled(), StencilBufferWriteEnabled());
 
     FlushVertexAttributeLocations();
 
     LOG_GL("DrawElements %x %d %d %p\n", mode, count, type, indices);
-    CHECK_GL( mGlAbstraction, mGlAbstraction.DrawElements(mode, count, type, indices) );
+    CHECK_GL(mGlAbstraction, mGlAbstraction.DrawElements(mode, count, type, indices));
   }
 
   /**
@@ -868,12 +866,12 @@ public:
    */
   void DrawElementsInstanced(GLenum mode, GLsizei count, GLenum type, const void* indices, GLsizei instanceCount)
   {
-    mFrameBufferStateCache.DrawOperation( mColorMask, DepthBufferWriteEnabled(), StencilBufferWriteEnabled() );
+    mFrameBufferStateCache.DrawOperation(mColorMask, DepthBufferWriteEnabled(), StencilBufferWriteEnabled());
 
     FlushVertexAttributeLocations();
 
     LOG_GL("DrawElementsInstanced %x %d %d %p %d\n", mode, count, type, indices, instanceCount);
-    CHECK_GL( mGlAbstraction, mGlAbstraction.DrawElementsInstanced(mode, count, type, indices, instanceCount) );
+    CHECK_GL(mGlAbstraction, mGlAbstraction.DrawElementsInstanced(mode, count, type, indices, instanceCount));
   }
 
   /**
@@ -881,11 +879,11 @@ public:
    */
   void DrawRangeElements(GLenum mode, GLuint start, GLuint end, GLsizei count, GLenum type, const void* indices)
   {
-    mFrameBufferStateCache.DrawOperation( mColorMask, DepthBufferWriteEnabled(), StencilBufferWriteEnabled() );
+    mFrameBufferStateCache.DrawOperation(mColorMask, DepthBufferWriteEnabled(), StencilBufferWriteEnabled());
     FlushVertexAttributeLocations();
 
     LOG_GL("DrawRangeElements %x %u %u %d %d %p\n", mode, start, end, count, type, indices);
-    CHECK_GL( mGlAbstraction, mGlAbstraction.DrawRangeElements(mode, start, end, count, type, indices) );
+    CHECK_GL(mGlAbstraction, mGlAbstraction.DrawRangeElements(mode, start, end, count, type, indices));
   }
 
   /**
@@ -894,7 +892,7 @@ public:
   void GenQueries(GLsizei n, GLuint* ids)
   {
     LOG_GL("GenQueries %d %p\n", n, ids);
-    CHECK_GL( mGlAbstraction, mGlAbstraction.GenQueries(n, ids) );
+    CHECK_GL(mGlAbstraction, mGlAbstraction.GenQueries(n, ids));
   }
 
   /**
@@ -903,7 +901,7 @@ public:
   void GenTransformFeedbacks(GLsizei n, GLuint* ids)
   {
     LOG_GL("GenTransformFeedbacks %d %p\n", n, ids);
-    CHECK_GL( mGlAbstraction, mGlAbstraction.GenTransformFeedbacks(n, ids) );
+    CHECK_GL(mGlAbstraction, mGlAbstraction.GenTransformFeedbacks(n, ids));
   }
 
   /**
@@ -937,41 +935,41 @@ public:
     return result;
   }
 
-  void EnableVertexAttributeArray( GLuint location )
+  void EnableVertexAttributeArray(GLuint location)
   {
-    SetVertexAttributeLocation( location, true);
+    SetVertexAttributeLocation(location, true);
   }
 
-  void DisableVertexAttributeArray( GLuint location )
+  void DisableVertexAttributeArray(GLuint location)
   {
-    SetVertexAttributeLocation( location, false);
+    SetVertexAttributeLocation(location, false);
   }
 
   /**
    * Wrapper for OpenGL ES 3.0 glVertexAttribDivisor()
    */
-  void VertexAttribDivisor ( GLuint index, GLuint divisor )
+  void VertexAttribDivisor(GLuint index, GLuint divisor)
   {
-    LOG_GL("VertexAttribDivisor(%d, %d)\n", index, divisor );
-    CHECK_GL( mGlAbstraction, mGlAbstraction.VertexAttribDivisor( index, divisor ) );
+    LOG_GL("VertexAttribDivisor(%d, %d)\n", index, divisor);
+    CHECK_GL(mGlAbstraction, mGlAbstraction.VertexAttribDivisor(index, divisor));
   }
 
   /**
    * Wrapper for OpenGL ES 2.0 glVertexAttribPointer()
    */
-  void VertexAttribPointer( GLuint index, GLint size, GLenum type, GLboolean normalized, GLsizei stride, const void* ptr )
+  void VertexAttribPointer(GLuint index, GLint size, GLenum type, GLboolean normalized, GLsizei stride, const void* ptr)
   {
-    LOG_GL("VertexAttribPointer(%d, %d, %d, %d, %d, %x)\n", index, size, type, normalized, stride, ptr );
-    CHECK_GL( mGlAbstraction, mGlAbstraction.VertexAttribPointer( index, size, type, normalized, stride, ptr ) );
+    LOG_GL("VertexAttribPointer(%d, %d, %d, %d, %d, %x)\n", index, size, type, normalized, stride, ptr);
+    CHECK_GL(mGlAbstraction, mGlAbstraction.VertexAttribPointer(index, size, type, normalized, stride, ptr));
   }
 
   /**
    * Wrapper for OpenGL ES 3.0 glInvalidateFramebuffer()
    */
-  void InvalidateFramebuffer(GLenum target, GLsizei numAttachments, const GLenum *attachments)
+  void InvalidateFramebuffer(GLenum target, GLsizei numAttachments, const GLenumattachments)
   {
     LOG_GL("InvalidateFramebuffer\n");
-    CHECK_GL( mGlAbstraction, mGlAbstraction.InvalidateFramebuffer(target, numAttachments, attachments) );
+    CHECK_GL(mGlAbstraction, mGlAbstraction.InvalidateFramebuffer(target, numAttachments, attachments));
   }
 
   /**
@@ -986,19 +984,19 @@ public:
   void SetBlend(bool enable)
   {
     // Avoid unecessary calls to glEnable/glDisable
-    if (enable != mBlendEnabled)
+    if(enable != mBlendEnabled)
     {
       mBlendEnabled = enable;
 
-      if (enable)
+      if(enable)
       {
         LOG_GL("Enable GL_BLEND\n");
-        CHECK_GL( mGlAbstraction, mGlAbstraction.Enable(GL_BLEND) );
+        CHECK_GL(mGlAbstraction, mGlAbstraction.Enable(GL_BLEND));
       }
       else
       {
         LOG_GL("Disable GL_BLEND\n");
-        CHECK_GL( mGlAbstraction, mGlAbstraction.Disable(GL_BLEND) );
+        CHECK_GL(mGlAbstraction, mGlAbstraction.Disable(GL_BLEND));
       }
     }
   }
@@ -1011,22 +1009,22 @@ public:
    *
    * @param[in] enable True if GL_DEPTH_TEST should be enabled.
    */
-  void EnableDepthBuffer( bool enable )
+  void EnableDepthBuffer(bool enable)
   {
     // Avoid unecessary calls to glEnable/glDisable
-    if( enable != mDepthBufferEnabled )
+    if(enable != mDepthBufferEnabled)
     {
       mDepthBufferEnabled = enable;
 
-      if (enable)
+      if(enable)
       {
         LOG_GL("Enable GL_DEPTH_TEST\n");
-        CHECK_GL( mGlAbstraction, mGlAbstraction.Enable(GL_DEPTH_TEST) );
+        CHECK_GL(mGlAbstraction, mGlAbstraction.Enable(GL_DEPTH_TEST));
       }
       else
       {
         LOG_GL("Disable GL_DEPTH_TEST\n");
-        CHECK_GL( mGlAbstraction, mGlAbstraction.Disable(GL_DEPTH_TEST) );
+        CHECK_GL(mGlAbstraction, mGlAbstraction.Disable(GL_DEPTH_TEST));
       }
     }
   }
@@ -1038,19 +1036,19 @@ public:
   void SetDither(bool enable)
   {
     // Avoid unecessary calls to glEnable/glDisable
-    if (enable != mDitherEnabled)
+    if(enable != mDitherEnabled)
     {
       mDitherEnabled = enable;
 
-      if (enable)
+      if(enable)
       {
         LOG_GL("Enable GL_DITHER\n");
-        CHECK_GL( mGlAbstraction, mGlAbstraction.Enable(GL_DITHER) );
+        CHECK_GL(mGlAbstraction, mGlAbstraction.Enable(GL_DITHER));
       }
       else
       {
         LOG_GL("Disable GL_DITHER\n");
-        CHECK_GL( mGlAbstraction, mGlAbstraction.Disable(GL_DITHER) );
+        CHECK_GL(mGlAbstraction, mGlAbstraction.Disable(GL_DITHER));
       }
     }
   }
@@ -1062,19 +1060,19 @@ public:
   void SetPolygonOffsetFill(bool enable)
   {
     // Avoid unecessary calls to glEnable/glDisable
-    if (enable != mPolygonOffsetFillEnabled)
+    if(enable != mPolygonOffsetFillEnabled)
     {
       mPolygonOffsetFillEnabled = enable;
 
-      if (enable)
+      if(enable)
       {
         LOG_GL("Enable GL_POLYGON_OFFSET_FILL\n");
-        CHECK_GL( mGlAbstraction, mGlAbstraction.Enable(GL_POLYGON_OFFSET_FILL) );
+        CHECK_GL(mGlAbstraction, mGlAbstraction.Enable(GL_POLYGON_OFFSET_FILL));
       }
       else
       {
         LOG_GL("Disable GL_POLYGON_OFFSET_FILL\n");
-        CHECK_GL( mGlAbstraction, mGlAbstraction.Disable(GL_POLYGON_OFFSET_FILL) );
+        CHECK_GL(mGlAbstraction, mGlAbstraction.Disable(GL_POLYGON_OFFSET_FILL));
       }
     }
   }
@@ -1086,19 +1084,19 @@ public:
   void SetSampleAlphaToCoverage(bool enable)
   {
     // Avoid unecessary calls to glEnable/glDisable
-    if (enable != mSampleAlphaToCoverageEnabled)
+    if(enable != mSampleAlphaToCoverageEnabled)
     {
       mSampleAlphaToCoverageEnabled = enable;
 
-      if (enable)
+      if(enable)
       {
         LOG_GL("Enable GL_SAMPLE_ALPHA_TO_COVERAGE\n");
-        CHECK_GL( mGlAbstraction, mGlAbstraction.Enable(GL_SAMPLE_ALPHA_TO_COVERAGE) );
+        CHECK_GL(mGlAbstraction, mGlAbstraction.Enable(GL_SAMPLE_ALPHA_TO_COVERAGE));
       }
       else
       {
         LOG_GL("Disable GL_SAMPLE_ALPHA_TO_COVERAGE\n");
-        CHECK_GL( mGlAbstraction, mGlAbstraction.Disable(GL_SAMPLE_ALPHA_TO_COVERAGE) );
+        CHECK_GL(mGlAbstraction, mGlAbstraction.Disable(GL_SAMPLE_ALPHA_TO_COVERAGE));
       }
     }
   }
@@ -1110,19 +1108,19 @@ public:
   void SetSampleCoverage(bool enable)
   {
     // Avoid unecessary calls to glEnable/glDisable
-    if (enable != mSampleCoverageEnabled)
+    if(enable != mSampleCoverageEnabled)
     {
       mSampleCoverageEnabled = enable;
 
-      if (enable)
+      if(enable)
       {
         LOG_GL("Enable GL_SAMPLE_COVERAGE\n");
-        CHECK_GL( mGlAbstraction, mGlAbstraction.Enable(GL_SAMPLE_COVERAGE) );
+        CHECK_GL(mGlAbstraction, mGlAbstraction.Enable(GL_SAMPLE_COVERAGE));
       }
       else
       {
         LOG_GL("Disable GL_SAMPLE_COVERAGE\n");
-        CHECK_GL( mGlAbstraction, mGlAbstraction.Disable(GL_SAMPLE_COVERAGE) );
+        CHECK_GL(mGlAbstraction, mGlAbstraction.Disable(GL_SAMPLE_COVERAGE));
       }
     }
   }
@@ -1134,19 +1132,19 @@ public:
   void SetScissorTest(bool enable)
   {
     // Avoid unecessary calls to glEnable/glDisable
-    if (enable != mScissorTestEnabled)
+    if(enable != mScissorTestEnabled)
     {
       mScissorTestEnabled = enable;
 
-      if (enable)
+      if(enable)
       {
         LOG_GL("Enable GL_SCISSOR_TEST\n");
-        CHECK_GL( mGlAbstraction, mGlAbstraction.Enable(GL_SCISSOR_TEST) );
+        CHECK_GL(mGlAbstraction, mGlAbstraction.Enable(GL_SCISSOR_TEST));
       }
       else
       {
         LOG_GL("Disable GL_SCISSOR_TEST\n");
-        CHECK_GL( mGlAbstraction, mGlAbstraction.Disable(GL_SCISSOR_TEST) );
+        CHECK_GL(mGlAbstraction, mGlAbstraction.Disable(GL_SCISSOR_TEST));
       }
     }
   }
@@ -1161,19 +1159,19 @@ public:
   void EnableStencilBuffer(bool enable)
   {
     // Avoid unecessary calls to glEnable/glDisable
-    if( enable != mStencilBufferEnabled )
+    if(enable != mStencilBufferEnabled)
     {
       mStencilBufferEnabled = enable;
 
-      if (enable)
+      if(enable)
       {
         LOG_GL("Enable GL_STENCIL_TEST\n");
-        CHECK_GL( mGlAbstraction, mGlAbstraction.Enable(GL_STENCIL_TEST) );
+        CHECK_GL(mGlAbstraction, mGlAbstraction.Enable(GL_STENCIL_TEST));
       }
       else
       {
         LOG_GL("Disable GL_STENCIL_TEST\n");
-        CHECK_GL( mGlAbstraction, mGlAbstraction.Disable(GL_STENCIL_TEST) );
+        CHECK_GL(mGlAbstraction, mGlAbstraction.Disable(GL_STENCIL_TEST));
       }
     }
   }
@@ -1184,7 +1182,7 @@ public:
   void EndQuery(GLenum target)
   {
     LOG_GL("EndQuery %d\n", target);
-    CHECK_GL( mGlAbstraction, mGlAbstraction.EndQuery(target) );
+    CHECK_GL(mGlAbstraction, mGlAbstraction.EndQuery(target));
   }
 
   /**
@@ -1193,7 +1191,7 @@ public:
   void EndTransformFeedback()
   {
     LOG_GL("EndTransformFeedback\n");
-    CHECK_GL( mGlAbstraction, mGlAbstraction.EndTransformFeedback() );
+    CHECK_GL(mGlAbstraction, mGlAbstraction.EndTransformFeedback());
   }
 
   /**
@@ -1202,7 +1200,7 @@ public:
   void Finish(void)
   {
     LOG_GL("Finish\n");
-    CHECK_GL( mGlAbstraction, mGlAbstraction.Finish() );
+    CHECK_GL(mGlAbstraction, mGlAbstraction.Finish());
   }
 
   /**
@@ -1211,7 +1209,7 @@ public:
   void Flush(void)
   {
     LOG_GL("Flush\n");
-    CHECK_GL( mGlAbstraction, mGlAbstraction.Flush() );
+    CHECK_GL(mGlAbstraction, mGlAbstraction.Flush());
   }
 
   /**
@@ -1220,7 +1218,7 @@ public:
   void FramebufferRenderbuffer(GLenum target, GLenum attachment, GLenum renderbuffertarget, GLuint renderbuffer)
   {
     LOG_GL("FramebufferRenderbuffer %x %x %x %d\n", target, attachment, renderbuffertarget, renderbuffer);
-    CHECK_GL( mGlAbstraction, mGlAbstraction.FramebufferRenderbuffer(target, attachment, renderbuffertarget, renderbuffer) );
+    CHECK_GL(mGlAbstraction, mGlAbstraction.FramebufferRenderbuffer(target, attachment, renderbuffertarget, renderbuffer));
   }
 
   /**
@@ -1229,7 +1227,7 @@ public:
   void FramebufferTexture2D(GLenum target, GLenum attachment, GLenum textarget, GLuint texture, GLint level)
   {
     LOG_GL("FramebufferTexture2D %x %x %x %d %d\n", target, attachment, textarget, texture, level);
-    CHECK_GL( mGlAbstraction, mGlAbstraction.FramebufferTexture2D(target, attachment, textarget, texture, level) );
+    CHECK_GL(mGlAbstraction, mGlAbstraction.FramebufferTexture2D(target, attachment, textarget, texture, level));
   }
 
   /**
@@ -1238,7 +1236,7 @@ public:
   void FramebufferTextureLayer(GLenum target, GLenum attachment, GLuint texture, GLint level, GLint layer)
   {
     LOG_GL("FramebufferTextureLayer %x %x %d %d %d\n", target, attachment, texture, level, layer);
-    CHECK_GL( mGlAbstraction, mGlAbstraction.FramebufferTextureLayer(target, attachment, texture, level, layer) );
+    CHECK_GL(mGlAbstraction, mGlAbstraction.FramebufferTextureLayer(target, attachment, texture, level, layer));
   }
 
   /**
@@ -1247,7 +1245,7 @@ public:
   void FrontFace(GLenum mode)
   {
     LOG_GL("FrontFace %x\n", mode);
-    CHECK_GL( mGlAbstraction, mGlAbstraction.FrontFace(mode) );
+    CHECK_GL(mGlAbstraction, mGlAbstraction.FrontFace(mode));
   }
 
   /**
@@ -1256,7 +1254,7 @@ public:
   void GenBuffers(GLsizei n, GLuint* buffers)
   {
     LOG_GL("GenBuffers %d\n", n, buffers);
-    CHECK_GL( mGlAbstraction, mGlAbstraction.GenBuffers(n, buffers) );
+    CHECK_GL(mGlAbstraction, mGlAbstraction.GenBuffers(n, buffers));
   }
 
   /**
@@ -1265,7 +1263,7 @@ public:
   void GenerateMipmap(GLenum target)
   {
     LOG_GL("GenerateMipmap %x\n", target);
-    CHECK_GL( mGlAbstraction, mGlAbstraction.GenerateMipmap(target) );
+    CHECK_GL(mGlAbstraction, mGlAbstraction.GenerateMipmap(target));
   }
 
   /**
@@ -1274,9 +1272,9 @@ public:
   void GenFramebuffers(GLsizei n, GLuint* framebuffers)
   {
     LOG_GL("GenFramebuffers %d %p\n", n, framebuffers);
-    CHECK_GL( mGlAbstraction, mGlAbstraction.GenFramebuffers(n, framebuffers) );
+    CHECK_GL(mGlAbstraction, mGlAbstraction.GenFramebuffers(n, framebuffers));
 
-    mFrameBufferStateCache.FrameBuffersCreated( n, framebuffers );
+    mFrameBufferStateCache.FrameBuffersCreated(n, framebuffers);
   }
 
   /**
@@ -1285,7 +1283,7 @@ public:
   void GenRenderbuffers(GLsizei n, GLuint* renderbuffers)
   {
     LOG_GL("GenRenderbuffers %d %p\n", n, renderbuffers);
-    CHECK_GL( mGlAbstraction, mGlAbstraction.GenRenderbuffers(n, renderbuffers) );
+    CHECK_GL(mGlAbstraction, mGlAbstraction.GenRenderbuffers(n, renderbuffers));
   }
 
   /**
@@ -1294,7 +1292,7 @@ public:
   void GenTextures(GLsizei n, GLuint* textures)
   {
     LOG_GL("GenTextures %d %p\n", n, textures);
-    CHECK_GL( mGlAbstraction, mGlAbstraction.GenTextures(n, textures) );
+    CHECK_GL(mGlAbstraction, mGlAbstraction.GenTextures(n, textures));
   }
 
   /**
@@ -1303,7 +1301,7 @@ public:
   void GetBooleanv(GLenum pname, GLboolean* params)
   {
     LOG_GL("GetBooleanv %x\n", pname);
-    CHECK_GL( mGlAbstraction, mGlAbstraction.GetBooleanv(pname, params) );
+    CHECK_GL(mGlAbstraction, mGlAbstraction.GetBooleanv(pname, params));
   }
 
   /**
@@ -1312,7 +1310,7 @@ public:
   void GetBufferParameteriv(GLenum target, GLenum pname, GLint* params)
   {
     LOG_GL("GetBufferParameteriv %x %x %p\n", target, pname, params);
-    CHECK_GL( mGlAbstraction, mGlAbstraction.GetBufferParameteriv(target, pname, params) );
+    CHECK_GL(mGlAbstraction, mGlAbstraction.GetBufferParameteriv(target, pname, params));
   }
 
   /**
@@ -1321,7 +1319,7 @@ public:
   void GetBufferPointerv(GLenum target, GLenum pname, GLvoid** params)
   {
     LOG_GL("GetBufferPointerv %x %x %p\n", target, pname, params);
-    CHECK_GL( mGlAbstraction, mGlAbstraction.GetBufferPointerv(target, pname, params) );
+    CHECK_GL(mGlAbstraction, mGlAbstraction.GetBufferPointerv(target, pname, params));
   }
 
   /**
@@ -1339,7 +1337,7 @@ public:
   void GetFloatv(GLenum pname, GLfloat* params)
   {
     LOG_GL("GetFloatv %x\n", pname);
-    CHECK_GL( mGlAbstraction, mGlAbstraction.GetFloatv(pname, params) );
+    CHECK_GL(mGlAbstraction, mGlAbstraction.GetFloatv(pname, params));
   }
 
   /**
@@ -1348,7 +1346,7 @@ public:
   void GetFramebufferAttachmentParameteriv(GLenum target, GLenum attachment, GLenum pname, GLint* params)
   {
     LOG_GL("GetFramebufferAttachmentParameteriv %x %x %x\n", target, attachment, pname);
-    CHECK_GL( mGlAbstraction, mGlAbstraction.GetFramebufferAttachmentParameteriv(target, attachment, pname, params) );
+    CHECK_GL(mGlAbstraction, mGlAbstraction.GetFramebufferAttachmentParameteriv(target, attachment, pname, params));
   }
 
   /**
@@ -1357,7 +1355,7 @@ public:
   void GetIntegerv(GLenum pname, GLint* params)
   {
     LOG_GL("GetIntegerv %x\n", pname);
-    CHECK_GL( mGlAbstraction, mGlAbstraction.GetIntegerv(pname, params) );
+    CHECK_GL(mGlAbstraction, mGlAbstraction.GetIntegerv(pname, params));
   }
 
   /**
@@ -1366,7 +1364,7 @@ public:
   void GetQueryiv(GLenum target, GLenum pname, GLint* params)
   {
     LOG_GL("GetQueryiv %x %x\n", target, pname);
-    CHECK_GL( mGlAbstraction, mGlAbstraction.GetQueryiv(target, pname, params) );
+    CHECK_GL(mGlAbstraction, mGlAbstraction.GetQueryiv(target, pname, params));
   }
 
   /**
@@ -1375,7 +1373,7 @@ public:
   void GetQueryObjectuiv(GLuint id, GLenum pname, GLuint* params)
   {
     LOG_GL("GetQueryObjectuiv %u %x %p\n", id, pname, params);
-    CHECK_GL( mGlAbstraction, mGlAbstraction.GetQueryObjectuiv(id, pname, params) );
+    CHECK_GL(mGlAbstraction, mGlAbstraction.GetQueryObjectuiv(id, pname, params));
   }
 
   /**
@@ -1384,7 +1382,7 @@ public:
   void GetRenderbufferParameteriv(GLenum target, GLenum pname, GLint* params)
   {
     LOG_GL("GetRenderbufferParameteriv %x %x\n", target, pname);
-    CHECK_GL( mGlAbstraction, mGlAbstraction.GetRenderbufferParameteriv(target, pname, params) );
+    CHECK_GL(mGlAbstraction, mGlAbstraction.GetRenderbufferParameteriv(target, pname, params));
   }
 
   /**
@@ -1393,7 +1391,7 @@ public:
   const GLubyte* GetString(GLenum name)
   {
     LOG_GL("GetString %x\n", name);
-    const GLubyte* str = CHECK_GL( mGlAbstraction, mGlAbstraction.GetString(name) );
+    const GLubyte* str = CHECK_GL(mGlAbstraction, mGlAbstraction.GetString(name));
     return str;
   }
 
@@ -1403,7 +1401,7 @@ public:
   void GetTexParameterfv(GLenum target, GLenum pname, GLfloat* params)
   {
     LOG_GL("GetTexParameterfv %x %x\n", target, pname);
-    CHECK_GL( mGlAbstraction, mGlAbstraction.GetTexParameterfv(target, pname, params) );
+    CHECK_GL(mGlAbstraction, mGlAbstraction.GetTexParameterfv(target, pname, params));
   }
 
   /**
@@ -1412,7 +1410,7 @@ public:
   void GetTexParameteriv(GLenum target, GLenum pname, GLint* params)
   {
     LOG_GL("GetTexParameteriv %x %x\n", target, pname);
-    CHECK_GL( mGlAbstraction, mGlAbstraction.GetTexParameteriv(target, pname, params) );
+    CHECK_GL(mGlAbstraction, mGlAbstraction.GetTexParameteriv(target, pname, params));
   }
 
   /**
@@ -1421,7 +1419,7 @@ public:
   void Hint(GLenum target, GLenum mode)
   {
     LOG_GL("Hint %x %x\n", target, mode);
-    CHECK_GL( mGlAbstraction, mGlAbstraction.Hint(target, mode) );
+    CHECK_GL(mGlAbstraction, mGlAbstraction.Hint(target, mode));
   }
 
   /**
@@ -1430,7 +1428,7 @@ public:
   GLboolean IsBuffer(GLuint buffer)
   {
     LOG_GL("IsBuffer %d\n", buffer);
-    GLboolean val = CHECK_GL( mGlAbstraction, mGlAbstraction.IsBuffer(buffer) );
+    GLboolean val = CHECK_GL(mGlAbstraction, mGlAbstraction.IsBuffer(buffer));
     return val;
   }
 
@@ -1440,7 +1438,7 @@ public:
   GLboolean IsEnabled(GLenum cap)
   {
     LOG_GL("IsEnabled %x\n", cap);
-    GLboolean val = CHECK_GL( mGlAbstraction, mGlAbstraction.IsEnabled(cap) );
+    GLboolean val = CHECK_GL(mGlAbstraction, mGlAbstraction.IsEnabled(cap));
     return val;
   }
 
@@ -1450,7 +1448,7 @@ public:
   GLboolean IsFramebuffer(GLuint framebuffer)
   {
     LOG_GL("IsFramebuffer %d\n", framebuffer);
-    GLboolean val = CHECK_GL( mGlAbstraction, mGlAbstraction.IsFramebuffer(framebuffer) );
+    GLboolean val = CHECK_GL(mGlAbstraction, mGlAbstraction.IsFramebuffer(framebuffer));
     return val;
   }
 
@@ -1460,7 +1458,7 @@ public:
   GLboolean IsQuery(GLuint id)
   {
     LOG_GL("IsQuery %u\n", id);
-    GLboolean val = CHECK_GL( mGlAbstraction, mGlAbstraction.IsQuery(id) );
+    GLboolean val = CHECK_GL(mGlAbstraction, mGlAbstraction.IsQuery(id));
     return val;
   }
 
@@ -1470,7 +1468,7 @@ public:
   GLboolean IsRenderbuffer(GLuint renderbuffer)
   {
     LOG_GL("IsRenderbuffer %d\n", renderbuffer);
-    GLboolean val = CHECK_GL( mGlAbstraction, mGlAbstraction.IsRenderbuffer(renderbuffer) );
+    GLboolean val = CHECK_GL(mGlAbstraction, mGlAbstraction.IsRenderbuffer(renderbuffer));
     return val;
   }
 
@@ -1480,7 +1478,7 @@ public:
   GLboolean IsTexture(GLuint texture)
   {
     LOG_GL("IsTexture %d\n", texture);
-    GLboolean val = CHECK_GL( mGlAbstraction, mGlAbstraction.IsTexture(texture) );
+    GLboolean val = CHECK_GL(mGlAbstraction, mGlAbstraction.IsTexture(texture));
     return val;
   }
 
@@ -1490,7 +1488,7 @@ public:
   GLboolean IsTransformFeedback(GLuint id)
   {
     LOG_GL("IsTransformFeedback %u\n", id);
-    GLboolean val = CHECK_GL( mGlAbstraction, mGlAbstraction.IsTransformFeedback(id) );
+    GLboolean val = CHECK_GL(mGlAbstraction, mGlAbstraction.IsTransformFeedback(id));
     return val;
   }
 
@@ -1500,7 +1498,7 @@ public:
   void LineWidth(GLfloat width)
   {
     LOG_GL("LineWidth %f\n", width);
-    CHECK_GL( mGlAbstraction, mGlAbstraction.LineWidth(width) );
+    CHECK_GL(mGlAbstraction, mGlAbstraction.LineWidth(width));
   }
 
   /**
@@ -1509,7 +1507,7 @@ public:
   void PauseTransformFeedback()
   {
     LOG_GL("PauseTransformFeedback\n");
-    CHECK_GL( mGlAbstraction, mGlAbstraction.PauseTransformFeedback() );
+    CHECK_GL(mGlAbstraction, mGlAbstraction.PauseTransformFeedback());
   }
 
   /**
@@ -1518,7 +1516,7 @@ public:
   void PixelStorei(GLenum pname, GLint param)
   {
     LOG_GL("PixelStorei %x %d\n", pname, param);
-    CHECK_GL( mGlAbstraction, mGlAbstraction.PixelStorei(pname, param) );
+    CHECK_GL(mGlAbstraction, mGlAbstraction.PixelStorei(pname, param));
   }
 
   /**
@@ -1527,7 +1525,7 @@ public:
   void PolygonOffset(GLfloat factor, GLfloat units)
   {
     LOG_GL("PolygonOffset %f %f\n", factor, units);
-    CHECK_GL( mGlAbstraction, mGlAbstraction.PolygonOffset(factor, units) );
+    CHECK_GL(mGlAbstraction, mGlAbstraction.PolygonOffset(factor, units));
   }
 
   /**
@@ -1536,7 +1534,7 @@ public:
   void ReadPixels(GLint x, GLint y, GLsizei width, GLsizei height, GLenum format, GLenum type, void* pixels)
   {
     LOG_GL("ReadPixels %d %d %d %d %x %x\n", x, y, width, height, format, type);
-    CHECK_GL( mGlAbstraction, mGlAbstraction.ReadPixels(x, y, width, height, format, type, pixels) );
+    CHECK_GL(mGlAbstraction, mGlAbstraction.ReadPixels(x, y, width, height, format, type, pixels));
   }
 
   /**
@@ -1545,7 +1543,7 @@ public:
   void RenderbufferStorage(GLenum target, GLenum internalformat, GLsizei width, GLsizei height)
   {
     LOG_GL("RenderbufferStorage %x %x %d %d\n", target, internalformat, width, height);
-    CHECK_GL( mGlAbstraction, mGlAbstraction.RenderbufferStorage(target, internalformat, width, height) );
+    CHECK_GL(mGlAbstraction, mGlAbstraction.RenderbufferStorage(target, internalformat, width, height));
   }
 
   /**
@@ -1554,7 +1552,7 @@ public:
   void RenderbufferStorageMultisample(GLenum target, GLsizei samples, GLenum internalformat, GLsizei width, GLsizei height)
   {
     LOG_GL("RenderbufferStorageMultisample %x %u %x %d %d\n", target, samples, internalformat, width, height);
-    CHECK_GL( mGlAbstraction, mGlAbstraction.RenderbufferStorageMultisample(target, samples, internalformat, width, height) );
+    CHECK_GL(mGlAbstraction, mGlAbstraction.RenderbufferStorageMultisample(target, samples, internalformat, width, height));
   }
 
   /**
@@ -1563,7 +1561,7 @@ public:
   void ResumeTransformFeedback()
   {
     LOG_GL("ResumeTransformFeedback\n");
-    CHECK_GL( mGlAbstraction, mGlAbstraction.ResumeTransformFeedback() );
+    CHECK_GL(mGlAbstraction, mGlAbstraction.ResumeTransformFeedback());
   }
 
   /**
@@ -1572,7 +1570,7 @@ public:
   void SampleCoverage(GLclampf value, GLboolean invert)
   {
     LOG_GL("SampleCoverage %f %s\n", value, invert ? "True" : "False");
-    CHECK_GL( mGlAbstraction, mGlAbstraction.SampleCoverage(value, invert) );
+    CHECK_GL(mGlAbstraction, mGlAbstraction.SampleCoverage(value, invert));
   }
 
   /**
@@ -1623,14 +1621,14 @@ public:
    */
   void StencilFunc(GLenum func, GLint ref, GLuint mask)
   {
-    if( ( func != mStencilFunc ) || ( ref != mStencilFuncRef ) || ( mask != mStencilFuncMask ) )
+    if((func != mStencilFunc) || (ref != mStencilFuncRef) || (mask != mStencilFuncMask))
     {
-      mStencilFunc = func;
-      mStencilFuncRef = ref;
+      mStencilFunc     = func;
+      mStencilFuncRef  = ref;
       mStencilFuncMask = mask;
 
       LOG_GL("StencilFunc %x %d %d\n", func, ref, mask);
-      CHECK_GL( mGlAbstraction, mGlAbstraction.StencilFunc(func, ref, mask) );
+      CHECK_GL(mGlAbstraction, mGlAbstraction.StencilFunc(func, ref, mask));
     }
   }
 
@@ -1640,7 +1638,7 @@ public:
   void StencilFuncSeparate(GLenum face, GLenum func, GLint ref, GLuint mask)
   {
     LOG_GL("StencilFuncSeparate %x %x %d %d\n", face, func, ref, mask);
-    CHECK_GL( mGlAbstraction, mGlAbstraction.StencilFuncSeparate(face, func, ref, mask) );
+    CHECK_GL(mGlAbstraction, mGlAbstraction.StencilFuncSeparate(face, func, ref, mask));
   }
 
   /**
@@ -1648,12 +1646,12 @@ public:
    */
   void StencilMask(GLuint mask)
   {
-    if( mask != mStencilMask )
+    if(mask != mStencilMask)
     {
       mStencilMask = mask;
 
       LOG_GL("StencilMask %d\n", mask);
-      CHECK_GL( mGlAbstraction, mGlAbstraction.StencilMask(mask) );
+      CHECK_GL(mGlAbstraction, mGlAbstraction.StencilMask(mask));
     }
   }
 
@@ -1663,7 +1661,7 @@ public:
   void StencilMaskSeparate(GLenum face, GLuint mask)
   {
     LOG_GL("StencilMaskSeparate %x %d\n", face, mask);
-    CHECK_GL( mGlAbstraction, mGlAbstraction.StencilMaskSeparate(face, mask) );
+    CHECK_GL(mGlAbstraction, mGlAbstraction.StencilMaskSeparate(face, mask));
   }
 
   /**
@@ -1671,14 +1669,14 @@ public:
    */
   void StencilOp(GLenum fail, GLenum zfail, GLenum zpass)
   {
-    if( ( fail != mStencilOpFail ) || ( zfail != mStencilOpDepthFail ) || ( zpass != mStencilOpDepthPass ) )
+    if((fail != mStencilOpFail) || (zfail != mStencilOpDepthFail) || (zpass != mStencilOpDepthPass))
     {
-      mStencilOpFail = fail;
+      mStencilOpFail      = fail;
       mStencilOpDepthFail = zfail;
       mStencilOpDepthPass = zpass;
 
       LOG_GL("StencilOp %x %x %x\n", fail, zfail, zpass);
-      CHECK_GL( mGlAbstraction, mGlAbstraction.StencilOp(fail, zfail, zpass) );
+      CHECK_GL(mGlAbstraction, mGlAbstraction.StencilOp(fail, zfail, zpass));
     }
   }
 
@@ -1688,27 +1686,25 @@ public:
   void StencilOpSeparate(GLenum face, GLenum fail, GLenum zfail, GLenum zpass)
   {
     LOG_GL("StencilOpSeparate %x %x %x %x\n", face, fail, zfail, zpass);
-    CHECK_GL( mGlAbstraction, mGlAbstraction.StencilOpSeparate(face, fail, zfail, zpass) );
+    CHECK_GL(mGlAbstraction, mGlAbstraction.StencilOpSeparate(face, fail, zfail, zpass));
   }
 
   /**
    * Wrapper for OpenGL ES 2.0 glTexImage2D()
    */
-  void TexImage2D(GLenum target, GLint level, GLint internalformat, GLsizei width, GLsizei height,
-                  GLint border, GLenum format, GLenum type, const void* pixels)
+  void TexImage2D(GLenum target, GLint level, GLint internalformat, GLsizei width, GLsizei height, GLint border, GLenum format, GLenum type, const void* pixels)
   {
     LOG_GL("TexImage2D %x %d %d %dx%d %d %x %x %p\n", target, level, internalformat, width, height, border, format, type, pixels);
-    CHECK_GL( mGlAbstraction, mGlAbstraction.TexImage2D(target, level, internalformat, width, height, border, format, type, pixels) );
+    CHECK_GL(mGlAbstraction, mGlAbstraction.TexImage2D(target, level, internalformat, width, height, border, format, type, pixels));
   }
 
   /**
    * Wrapper for OpenGL ES 3.0 glTexImage3D()
    */
-  void TexImage3D(GLenum target, GLint level, GLint internalformat, GLsizei width, GLsizei height, GLsizei depth,
-                  GLint border, GLenum format, GLenum type, const void* pixels)
+  void TexImage3D(GLenum target, GLint level, GLint internalformat, GLsizei width, GLsizei height, GLsizei depth, GLint border, GLenum format, GLenum type, const void* pixels)
   {
     LOG_GL("TexImage3D %x %d %d %dx%dx%d %d %x %x %p\n", target, level, internalformat, width, height, depth, border, format, type, pixels);
-    CHECK_GL( mGlAbstraction, mGlAbstraction.TexImage3D(target, level, internalformat, width, height, depth, border, format, type, pixels) );
+    CHECK_GL(mGlAbstraction, mGlAbstraction.TexImage3D(target, level, internalformat, width, height, depth, border, format, type, pixels));
   }
 
   /**
@@ -1717,7 +1713,7 @@ public:
   void TexParameterf(GLenum target, GLenum pname, GLfloat param)
   {
     LOG_GL("TexParameterf %x %x %f\n", target, pname, param);
-    CHECK_GL( mGlAbstraction, mGlAbstraction.TexParameterf(target, pname, param) );
+    CHECK_GL(mGlAbstraction, mGlAbstraction.TexParameterf(target, pname, param));
   }
 
   /**
@@ -1726,7 +1722,7 @@ public:
   void TexParameterfv(GLenum target, GLenum pname, const GLfloat* params)
   {
     LOG_GL("TexParameterfv %x %x\n", target, pname);
-    CHECK_GL( mGlAbstraction, mGlAbstraction.TexParameterfv(target, pname, params) );
+    CHECK_GL(mGlAbstraction, mGlAbstraction.TexParameterfv(target, pname, params));
   }
 
   /**
@@ -1735,7 +1731,7 @@ public:
   void TexParameteri(GLenum target, GLenum pname, GLint param)
   {
     LOG_GL("TexParameteri %x %x %d\n", target, pname, param);
-    CHECK_GL( mGlAbstraction, mGlAbstraction.TexParameteri(target, pname, param) );
+    CHECK_GL(mGlAbstraction, mGlAbstraction.TexParameteri(target, pname, param));
   }
 
   /**
@@ -1744,28 +1740,25 @@ public:
   void TexParameteriv(GLenum target, GLenum pname, const GLint* params)
   {
     LOG_GL("TexParameteriv %x %x\n", target, pname);
-    CHECK_GL( mGlAbstraction, mGlAbstraction.TexParameteriv(target, pname, params) );
+    CHECK_GL(mGlAbstraction, mGlAbstraction.TexParameteriv(target, pname, params));
   }
 
   /**
    * Wrapper for OpenGL ES 2.0 glTexSubImage2D()
    */
-  void TexSubImage2D(GLenum target, GLint level, GLint xoffset, GLint yoffset, GLsizei width, GLsizei height,
-                     GLenum format, GLenum type, const void* pixels)
+  void TexSubImage2D(GLenum target, GLint level, GLint xoffset, GLint yoffset, GLsizei width, GLsizei height, GLenum format, GLenum type, const void* pixels)
   {
     LOG_GL("TexSubImage2D %x %d %d %d %d %d %x %x %p\n", target, level, xoffset, yoffset, width, height, format, type, pixels);
-    CHECK_GL( mGlAbstraction, mGlAbstraction.TexSubImage2D(target, level, xoffset, yoffset, width, height, format, type, pixels) );
+    CHECK_GL(mGlAbstraction, mGlAbstraction.TexSubImage2D(target, level, xoffset, yoffset, width, height, format, type, pixels));
   }
 
   /**
    * Wrapper for OpenGL ES 3.0 glTexSubImage3D()
    */
-  void TexSubImage3D(GLenum target, GLint level, GLint xoffset, GLint yoffset, GLint zoffset,
-                     GLsizei width, GLsizei height, GLsizei depth,
-                     GLenum format, GLenum type, const void* pixels)
+  void TexSubImage3D(GLenum target, GLint level, GLint xoffset, GLint yoffset, GLint zoffset, GLsizei width, GLsizei height, GLsizei depth, GLenum format, GLenum type, const void* pixels)
   {
     LOG_GL("TexSubImage3D %x %d %d %d %d %d %d %d %x %x %p\n", target, level, xoffset, yoffset, zoffset, width, height, depth, format, type, pixels);
-    CHECK_GL( mGlAbstraction, mGlAbstraction.TexSubImage3D(target, level, xoffset, yoffset, zoffset, width, height, depth, format, type, pixels) );
+    CHECK_GL(mGlAbstraction, mGlAbstraction.TexSubImage3D(target, level, xoffset, yoffset, zoffset, width, height, depth, format, type, pixels));
   }
 
   /**
@@ -1774,7 +1767,7 @@ public:
   GLboolean UnmapBuffer(GLenum target)
   {
     LOG_GL("UnmapBuffer %x \n", target);
-    GLboolean val = CHECK_GL( mGlAbstraction, mGlAbstraction.UnmapBuffer(target) );
+    GLboolean val = CHECK_GL(mGlAbstraction, mGlAbstraction.UnmapBuffer(target));
     return val;
   }
 
@@ -1820,8 +1813,8 @@ public:
    */
   void BlendBarrier()
   {
-    LOG_GL( "BlendBarrier\n" );
-    CHECK_GL( mGlAbstraction, mGlAbstraction.BlendBarrier() );
+    LOG_GL("BlendBarrier\n");
+    CHECK_GL(mGlAbstraction, mGlAbstraction.BlendBarrier());
   }
 
   /**
@@ -1835,7 +1828,7 @@ public:
 
   void SetSurfaceOrientation(int orientation)
   {
-    LOG_GL( "SetSurfaceOrientation: orientation: %d\n", orientation );
+    LOG_GL("SetSurfaceOrientation: orientation: %d\n", orientation);
     mSurfaceOrientation = orientation;
   }
 
@@ -1843,10 +1836,9 @@ public:
    * Get the current viewport.
    * @return Viewport rectangle.
    */
-  const Rect< int >& GetViewport();
+  const Rect<int>& GetViewport();
 
 private: // Implementation
-
   /**
    * @return true if next draw operation will write to depth buffer
    */
@@ -1860,7 +1852,7 @@ private: // Implementation
    */
   bool StencilBufferWriteEnabled() const
   {
-    return mStencilBufferEnabled && ( mStencilMask > 0 );
+    return mStencilBufferEnabled && (mStencilMask > 0);
   }
 
   /**
@@ -1882,34 +1874,33 @@ private: // Implementation
   void InitializeGlState();
 
 private: // Data
-
   Integration::GlAbstraction& mGlAbstraction;
 
   bool mGlContextCreated; ///< True if the OpenGL context has been created
 
   // glEnable/glDisable states
-  bool mColorMask;
+  bool   mColorMask;
   GLuint mStencilMask;
-  bool mBlendEnabled;
-  bool mDepthBufferEnabled;
-  bool mDepthMaskEnabled;
-  bool mDitherEnabled;
-  bool mPolygonOffsetFillEnabled;
-  bool mSampleAlphaToCoverageEnabled;
-  bool mSampleCoverageEnabled;
-  bool mScissorTestEnabled;
-  bool mStencilBufferEnabled;
-  bool mClearColorSet;
-  bool mUsingDefaultBlendColor;
+  bool   mBlendEnabled;
+  bool   mDepthBufferEnabled;
+  bool   mDepthMaskEnabled;
+  bool   mDitherEnabled;
+  bool   mPolygonOffsetFillEnabled;
+  bool   mSampleAlphaToCoverageEnabled;
+  bool   mSampleCoverageEnabled;
+  bool   mScissorTestEnabled;
+  bool   mStencilBufferEnabled;
+  bool   mClearColorSet;
+  bool   mUsingDefaultBlendColor;
 
   // glBindBuffer() state
-  GLuint mBoundArrayBufferId;        ///< The ID passed to glBindBuffer(GL_ARRAY_BUFFER)
-  GLuint mBoundElementArrayBufferId; ///< The ID passed to glBindBuffer(GL_ELEMENT_ARRAY_BUFFER)
+  GLuint mBoundArrayBufferId;             ///< The ID passed to glBindBuffer(GL_ARRAY_BUFFER)
+  GLuint mBoundElementArrayBufferId;      ///< The ID passed to glBindBuffer(GL_ELEMENT_ARRAY_BUFFER)
   GLuint mBoundTransformFeedbackBufferId; ///< The ID passed to glBindBuffer(GL_TRANSFORM_FEEDBACK_BUFFER)
 
   // glBindTexture() state
   TextureUnit mActiveTextureUnit;
-  GLuint mBoundTextureId[ MAX_TEXTURE_UNITS ][MAX_TEXTURE_TARGET];  ///< The ID passed to glBindTexture()
+  GLuint      mBoundTextureId[MAX_TEXTURE_UNITS][MAX_TEXTURE_TARGET]; ///< The ID passed to glBindTexture()
 
   // glBlendColor() state
   Vector4 mBlendColor; ///< Blend color
@@ -1921,35 +1912,35 @@ private: // Data
   GLenum mBlendFuncSeparateDstAlpha; ///< The dstAlpha parameter passed to glBlendFuncSeparate()
 
   // glBlendEquationSeparate state
-  GLenum mBlendEquationSeparateModeRGB;    ///< Controls RGB blend mode
-  GLenum mBlendEquationSeparateModeAlpha;  ///< Controls Alpha blend mode
+  GLenum mBlendEquationSeparateModeRGB;   ///< Controls RGB blend mode
+  GLenum mBlendEquationSeparateModeAlpha; ///< Controls Alpha blend mode
 
   // glStencilFunc() and glStencilOp() state.
   GLenum mStencilFunc;
-  GLint mStencilFuncRef;
+  GLint  mStencilFuncRef;
   GLuint mStencilFuncMask;
   GLenum mStencilOpFail;
   GLenum mStencilOpDepthFail;
   GLenum mStencilOpDepthPass;
 
-  GLenum mDepthFunction;  ///The depth function
+  GLenum mDepthFunction; ///The depth function
 
-  GLint mMaxTextureSize;      ///< return value from GetIntegerv(GL_MAX_TEXTURE_SIZE)
-  Vector4 mClearColor;        ///< clear color
+  GLint   mMaxTextureSize; ///< return value from GetIntegerv(GL_MAX_TEXTURE_SIZE)
+  Vector4 mClearColor;     ///< clear color
 
   // Face culling mode
   Dali::FaceCullingMode::Type mCullFaceMode;
 
   // cached viewport size
-  Rect< int > mViewPort;
+  Rect<int> mViewPort;
 
   // Vertex Attribute Buffer enable caching
-  bool mVertexAttributeCachedState[ MAX_ATTRIBUTE_CACHE_SIZE ];    ///< Value cache for Enable Vertex Attribute
-  bool mVertexAttributeCurrentState[ MAX_ATTRIBUTE_CACHE_SIZE ];   ///< Current state on the driver for Enable Vertex Attribute
+  bool mVertexAttributeCachedState[MAX_ATTRIBUTE_CACHE_SIZE];  ///< Value cache for Enable Vertex Attribute
+  bool mVertexAttributeCurrentState[MAX_ATTRIBUTE_CACHE_SIZE]; ///< Current state on the driver for Enable Vertex Attribute
 
-  FrameBufferStateCache mFrameBufferStateCache;   ///< frame buffer state cache
+  FrameBufferStateCache mFrameBufferStateCache; ///< frame buffer state cache
 
-  OwnerContainer< Context* >* mSceneContexts;      ///< The pointer of the container of contexts for surface rendering
+  OwnerContainer<Context*>* mSceneContexts; ///< The pointer of the container of contexts for surface rendering
 
   int mSurfaceOrientation;
 };
index 1452564..00ed24c 100644 (file)
@@ -1,5 +1,5 @@
 /*
- * Copyright (c) 2018 Samsung Electronics Co., Ltd.
+ * Copyright (c) 2021 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.
 
 namespace Dali
 {
-
 namespace Internal
 {
-
-ProgramController::ProgramController( Integration::GlAbstraction& glAbstraction )
-: mShaderSaver( nullptr ),
-  mGlAbstraction( glAbstraction ),
-  mCurrentProgram( nullptr ),
-  mProgramBinaryFormat( 0 ),
-  mNumberOfProgramBinaryFormats( 0 )
+ProgramController::ProgramController(Graphics::Controller& graphicsController)
+: mShaderSaver(nullptr),
+  mGraphicsController(graphicsController),
+  mCurrentProgram(nullptr),
+  mProgramBinaryFormat(0),
+  mNumberOfProgramBinaryFormats(0)
 {
   // we have 17 default programs so make room for those and a few custom ones as well
-  mProgramCache.Reserve( 32 );
+  mProgramCache.Reserve(32);
 }
 
 ProgramController::~ProgramController() = default;
@@ -46,31 +44,32 @@ ProgramController::~ProgramController() = default;
 void ProgramController::ResetProgramMatrices()
 {
   const ProgramIterator end = mProgramCache.End();
-  for ( ProgramIterator iter = mProgramCache.Begin(); iter != end; ++iter )
+  for(ProgramIterator iter = mProgramCache.Begin(); iter != end; ++iter)
   {
     Program* program = (*iter)->GetProgram();
-    program->SetProjectionMatrix( nullptr );
-    program->SetViewMatrix( nullptr );
+    program->SetProjectionMatrix(nullptr);
+    program->SetViewMatrix(nullptr);
   }
 }
 
 void ProgramController::GlContextCreated()
 {
   // reset any potential previous errors
-  LOG_GL( "GetError()\n" );
-  CHECK_GL( mGlAbstraction, mGlAbstraction.GetError() );
+  LOG_GL("GetError()\n");
+  Integration::GlAbstraction& glAbstraction = GetGlAbstraction();
+  CHECK_GL(glAbstraction, glAbstraction.GetError());
 
   // find out if program binaries are supported and the format enum as well
   Dali::Vector<GLint> programBinaryFormats;
 
-  CHECK_GL( mGlAbstraction, mGlAbstraction.GetIntegerv(GL_NUM_PROGRAM_BINARY_FORMATS_OES, &mNumberOfProgramBinaryFormats ) );
-  LOG_GL("GetIntegerv(GL_NUM_PROGRAM_BINARY_FORMATS_OES) = %d\n", mNumberOfProgramBinaryFormats );
+  CHECK_GL(glAbstraction(), glAbstraction.GetIntegerv(GL_NUM_PROGRAM_BINARY_FORMATS_OES, &mNumberOfProgramBinaryFormats));
+  LOG_GL("GetIntegerv(GL_NUM_PROGRAM_BINARY_FORMATS_OES) = %d\n", mNumberOfProgramBinaryFormats);
 
-  if( GL_NO_ERROR == mGlAbstraction.GetError() && 0 < mNumberOfProgramBinaryFormats )
+  if(GL_NO_ERROR == glAbstraction.GetError() && 0 < mNumberOfProgramBinaryFormats)
   {
-    programBinaryFormats.Resize( mNumberOfProgramBinaryFormats );
-    CHECK_GL( mGlAbstraction, mGlAbstraction.GetIntegerv(GL_PROGRAM_BINARY_FORMATS_OES, &programBinaryFormats[0] ) );
-    LOG_GL("GetIntegerv(GL_PROGRAM_BINARY_FORMATS_OES) = %d\n", programBinaryFormats[0] );
+    programBinaryFormats.Resize(mNumberOfProgramBinaryFormats);
+    CHECK_GL(glAbstraction, glAbstraction.GetIntegerv(GL_PROGRAM_BINARY_FORMATS_OES, &programBinaryFormats[0]));
+    LOG_GL("GetIntegerv(GL_PROGRAM_BINARY_FORMATS_OES) = %d\n", programBinaryFormats[0]);
     mProgramBinaryFormat = programBinaryFormats[0];
   }
 }
@@ -78,12 +77,12 @@ void ProgramController::GlContextCreated()
 void ProgramController::GlContextDestroyed()
 {
   mNumberOfProgramBinaryFormats = 0;
-  mProgramBinaryFormat = 0;
+  mProgramBinaryFormat          = 0;
 
-  SetCurrentProgram( nullptr );
+  SetCurrentProgram(nullptr);
   // Inform programs they are no longer valid
   const ProgramIterator end = mProgramCache.End();
-  for ( ProgramIterator iter = mProgramCache.Begin(); iter != end; ++iter )
+  for(ProgramIterator iter = mProgramCache.Begin(); iter != end; ++iter)
   {
     (*iter)->GetProgram()->GlContextDestroyed();
   }
@@ -91,17 +90,17 @@ void ProgramController::GlContextDestroyed()
 
 Integration::GlAbstraction& ProgramController::GetGlAbstraction()
 {
-  return mGlAbstraction;
+  return mGraphicsController.GetGlAbstraction();
 }
 
-Program* ProgramController::GetProgram( size_t shaderHash )
+Program* ProgramController::GetProgram(size_t shaderHash)
 {
-  Program* program = nullptr;
-  const ProgramIterator end = mProgramCache.End();
-  for ( ProgramIterator iter = mProgramCache.Begin(); iter != end; ++iter )
+  Program*              program = nullptr;
+  const ProgramIterator end     = mProgramCache.End();
+  for(ProgramIterator iter = mProgramCache.Begin(); iter != end; ++iter)
   {
     size_t hash = (*iter)->GetHash();
-    if( shaderHash == hash )
+    if(shaderHash == hash)
     {
       program = (*iter)->GetProgram();
       break;
@@ -110,11 +109,11 @@ Program* ProgramController::GetProgram( size_t shaderHash )
   return program;
 }
 
-void ProgramController::AddProgram( size_t shaderHash, Program* program )
+void ProgramController::AddProgram(size_t shaderHash, Program* program)
 {
   // we expect unique hash values so its event thread sides job to guarantee that
   // AddProgram is only called after program checks that GetProgram returns NULL
-  mProgramCache.PushBack( new ProgramPair( program, shaderHash ) );
+  mProgramCache.PushBack(new ProgramPair(program, shaderHash));
 }
 
 Program* ProgramController::GetCurrentProgram()
@@ -122,7 +121,7 @@ Program* ProgramController::GetCurrentProgram()
   return mCurrentProgram;
 }
 
-void ProgramController::SetCurrentProgram( Program* program )
+void ProgramController::SetCurrentProgram(Program* program)
 {
   mCurrentProgram = program;
 }
@@ -137,25 +136,25 @@ GLenum ProgramController::ProgramBinaryFormat()
   return mProgramBinaryFormat;
 }
 
-void ProgramController::StoreBinary( Internal::ShaderDataPtr programData )
+void ProgramController::StoreBinary(Internal::ShaderDataPtr programData)
 {
-  DALI_ASSERT_DEBUG( programData->GetBufferSize() > 0 );
-  DALI_ASSERT_DEBUG( mShaderSaver && "SetShaderSaver() should have been called during startup." );
+  DALI_ASSERT_DEBUG(programData->GetBufferSize() > 0);
+  DALI_ASSERT_DEBUG(mShaderSaver && "SetShaderSaver() should have been called during startup.");
 
-  if( mShaderSaver != nullptr )
+  if(mShaderSaver != nullptr)
   {
-    mShaderSaver->SaveBinary( programData );
+    mShaderSaver->SaveBinary(programData);
   }
 }
 
-void ProgramController::SetShaderSaver( ShaderSaver& shaderSaver )
+void ProgramController::SetShaderSaver(ShaderSaver& shaderSaver)
 {
   mShaderSaver = &shaderSaver;
 }
 
 void ProgramController::ClearCurrentProgram()
 {
-  SetCurrentProgram( nullptr );
+  SetCurrentProgram(nullptr);
 }
 
 } // namespace Internal
index 0ab4cc8..dad9a44 100644 (file)
@@ -2,7 +2,7 @@
 #define DALI_INTERNAL_PROGRAM_CONTROLLER_H
 
 /*
- * Copyright (c) 2019 Samsung Electronics Co., Ltd.
+ * Copyright (c) 2021 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.
 
 // INTERNAL INCLUDES
 #include <dali/devel-api/common/owner-container.h>
+#include <dali/graphics-api/graphics-controller.h>
 #include <dali/internal/common/shader-data.h>
-#include <dali/internal/render/shaders/program.h>
 #include <dali/internal/render/shaders/program-cache.h>
+#include <dali/internal/render/shaders/program.h>
 
 namespace Dali
 {
-
 namespace Internal
 {
-
 class ShaderSaver;
 
 /**
@@ -38,22 +37,22 @@ class ShaderSaver;
 class ProgramController : public ProgramCache
 {
 public:
-
   /**
    * Wrapper for a program and its hash code
    */
   class ProgramPair
   {
   public: // API
-
     /**
      * Constructor
      * @param program
      * @param shaderHash
      */
-    ProgramPair( Program* program, size_t shaderHash )
-    : mProgram( program ), mShaderHash( shaderHash )
-    { }
+    ProgramPair(Program* program, size_t shaderHash)
+    : mProgram(program),
+      mShaderHash(shaderHash)
+    {
+    }
 
     /**
      * Destructor, non-virtual as not a base
@@ -82,19 +81,19 @@ public:
     }
 
   private: // Not implemented
-    ProgramPair( const ProgramPair& );
-    ProgramPair& operator=( const ProgramPair& );
+    ProgramPair(const ProgramPair&);
+    ProgramPair& operator=(const ProgramPair&);
 
   private: // Data
     Program* mProgram;
-    size_t mShaderHash;
+    size_t   mShaderHash;
   };
 
   /**
    * Constructor
-   * @param postProcessDispatcher to send save binary message back to update
+   * graphicsController The graphics backend controller
    */
-  ProgramController( Integration::GlAbstraction& glAbstraction );
+  ProgramController(Graphics::Controller& graphicsController);
 
   /**
    * Destructor, non virtual as not a base class
@@ -102,7 +101,6 @@ public:
   ~ProgramController() override;
 
 public: // API
-
   /**
    * Resets the program matrices. Must be called at the beginning of every frame
    */
@@ -122,7 +120,7 @@ public: // API
    * Set the destination for compiler shader binaries so they can be saved.
    * @note Must be called during initialisation.
    */
-  void SetShaderSaver( ShaderSaver& shaderSaver );
+  void SetShaderSaver(ShaderSaver& shaderSaver);
 
   /**
    * Clear current cached program
@@ -130,7 +128,6 @@ public: // API
   void ClearCurrentProgram();
 
 private: // From ProgramCache
-
   /**
    * @copydoc ProgramCache::GetGlAbstraction
    */
@@ -139,12 +136,12 @@ private: // From ProgramCache
   /**
    * @copydoc ProgramCache::GetProgram
    */
-  Program* GetProgram( size_t shaderHash ) override;
+  Program* GetProgram(size_t shaderHash) override;
 
   /**
    * @copydoc ProgramCache::AddProgram
    */
-  void AddProgram( size_t shaderHash, Program* program ) override;
+  void AddProgram(size_t shaderHash, Program* program) override;
 
   /**
    * @copydoc ProgramCache::GetCurrentProgram
@@ -154,7 +151,7 @@ private: // From ProgramCache
   /**
    * @copydoc ProgramCache::SetCurrentProgram
    */
-  void SetCurrentProgram( Program* program ) override;
+  void SetCurrentProgram(Program* program) override;
 
   /**
    * @copydoc ProgramCache::IsBinarySupported
@@ -169,18 +166,16 @@ private: // From ProgramCache
   /**
    * @copydoc ProgramCache::StoreBinary
    */
-  void StoreBinary( Internal::ShaderDataPtr programData ) override;
+  void StoreBinary(Internal::ShaderDataPtr programData) override;
 
 private: // not implemented as non-copyable
-
-  ProgramController( const ProgramController& rhs );
-  ProgramController& operator=( const ProgramController& rhs );
+  ProgramController(const ProgramController& rhs);
+  ProgramController& operator=(const ProgramController& rhs);
 
 private: // Data
-
-  ShaderSaver* mShaderSaver;
-  Integration::GlAbstraction& mGlAbstraction;
-  Program* mCurrentProgram;
+  ShaderSaver*          mShaderSaver;
+  Graphics::Controller& mGraphicsController;
+  Program*              mCurrentProgram;
 
   using ProgramContainer = OwnerContainer<ProgramPair*>;
   using ProgramIterator  = ProgramContainer::Iterator;
@@ -188,7 +183,6 @@ private: // Data
 
   GLint mProgramBinaryFormat;
   GLint mNumberOfProgramBinaryFormats;
-
 };
 
 } // namespace Internal
@@ -196,4 +190,3 @@ private: // Data
 } // namespace Dali
 
 #endif // DALI_INTERNAL_PROGRAM_CONTROLLER_H
-
index 6bedf32..dd180a4 100644 (file)
@@ -136,3 +136,4 @@ exit 0
 %files integration-devel
 %defattr(-,root,root,-)
 %{_includedir}/dali/integration-api/*
+%{_includedir}/dali/graphics-api/*