-#ifndef __DALI_INTERNAL_DISCARD_QUEUE_H__
-#define __DALI_INTERNAL_DISCARD_QUEUE_H__
+#ifndef DALI_INTERNAL_DISCARD_QUEUE_H
+#define DALI_INTERNAL_DISCARD_QUEUE_H
/*
- * Copyright (c) 2014 Samsung Electronics Co., Ltd.
+ * Copyright (c) 2019 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/devel-api/common/owner-container.h>
#include <dali/internal/common/buffer-index.h>
#include <dali/internal/update/nodes/node-declarations.h>
-#include <dali/internal/update/rendering/scene-graph-geometry.h>
#include <dali/internal/update/rendering/scene-graph-texture-set.h>
#include <dali/internal/update/rendering/scene-graph-renderer.h>
namespace Internal
{
-class Texture;
-
namespace SceneGraph
{
-class Node;
class RenderQueue;
class Shader;
+class Camera;
+class Scene;
/**
class DiscardQueue
{
public:
-
- typedef OwnerContainer< Shader* > ShaderQueue;
- typedef OwnerContainer< Geometry* > GeometryQueue;
- typedef OwnerContainer< TextureSet* > TextureSetQueue;
- typedef OwnerContainer< Renderer* > RendererQueue;
+ using ShaderQueue = OwnerContainer<Shader*>;
+ using RendererQueue = OwnerContainer<Renderer*>;
+ using CameraQueue = OwnerContainer<Camera*>;
+ using SceneQueue = OwnerContainer<Scene*>;
/**
* Create a new DiscardQueue.
void Add( BufferIndex updateBufferIndex, Node* node );
/**
- * Adds an unwanted geometry to the discard queue.
- * A message will be sent to clean up GL resources in the next Render
- */
- void Add( BufferIndex updateBufferIndex, Geometry* geometry );
-
- /**
- * Adds an unwanted texture set to the discard queue.
- * A message will be sent to clean up GL resources in the next Render.
- */
- void Add( BufferIndex updateBufferIndex, TextureSet* textureSet );
-
- /**
* Adds an unwanted shader to the discard queue.
* A message will be sent to clean-up GL resources in the next Render.
* @pre This method is not thread-safe, and should only be called from the update-thread.
void Add( BufferIndex updateBufferIndex, Renderer* renderer );
/**
+ * Adds an unwanted Camera to the discard queue.
+ * This is done because Render thread may use Matrices from the camera
+ * @param[in] updateBufferIndex The current update buffer index.
+ * @param[in] camera The discarded renderer; DiscardQueue takes ownership.
+ */
+ void Add( BufferIndex updateBufferIndex, Camera* camera );
+
+ /**
+ * Adds an unwanted Scene to the discard queue.
+ * A message will be sent to clean up GL resources in the next Render.
+ * @param[in] updateBufferIndex The current update buffer index.
+ * @param[in] scene The discarded scene; DiscardQueue takes ownership.
+ */
+ void Add( BufferIndex updateBufferIndex, Scene* scene );
+
+ /**
* Release the nodes which were queued in the frame N-2.
* @pre This method should be called (once) at the beginning of every Update.
* @param[in] updateBufferIndex The current update buffer index.
RenderQueue& mRenderQueue; ///< Used to send GL clean-up messages for the next Render.
- // Messages are queued here when the update buffer index == 0
- NodeOwnerContainer mNodeQueue0;
- ShaderQueue mShaderQueue0;
- GeometryQueue mGeometryQueue0;
- TextureSetQueue mTextureSetQueue0;
- RendererQueue mRendererQueue0;
-
- // Messages are queued here when the update buffer index == 1
- NodeOwnerContainer mNodeQueue1;
- ShaderQueue mShaderQueue1;
- GeometryQueue mGeometryQueue1;
- TextureSetQueue mTextureSetQueue1;
- RendererQueue mRendererQueue1;
+ // Messages are queued here following the current update buffer number
+ OwnerContainer< Node* > mNodeQueue[2];
+ ShaderQueue mShaderQueue[2];
+ RendererQueue mRendererQueue[2];
+ CameraQueue mCameraQueue[2];
+ SceneQueue mSceneQueue[2];
};
} // namespace SceneGraph
} // namespace Dali
-#endif // __DALI_INTERNAL_RESOURCE_DISCARD_QUEUE_H__
+#endif // DALI_INTERNAL_DISCARD_QUEUE_H