-#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) 2016 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.
namespace SceneGraph
{
-class GeometryBatcher;
class RenderQueue;
class Shader;
class Camera;
+class Scene;
/**
class DiscardQueue
{
public:
-
- typedef OwnerContainer< Shader* > ShaderQueue;
- typedef OwnerContainer< Renderer* > RendererQueue;
- typedef OwnerContainer< Camera* > CameraQueue;
+ using ShaderQueue = OwnerContainer<Shader*>;
+ using RendererQueue = OwnerContainer<Renderer*>;
+ using CameraQueue = OwnerContainer<Camera*>;
+ using SceneQueue = OwnerContainer<Scene*>;
/**
* Create a new DiscardQueue.
void Add( BufferIndex updateBufferIndex, Camera* camera );
/**
- * Release the nodes which were queued in the frame N-2.
- * @pre This method should be called (once) at the beginning of every Update.
+ * 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 Clear( BufferIndex updateBufferIndex );
+ void Add( BufferIndex updateBufferIndex, Scene* scene );
/**
- * Sets pointer to the GeometryBatcher instance
- * @param[in] geometryBatcher Instance of the GeometryBatcher
+ * 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.
*/
- void SetGeometryBatcher( GeometryBatcher* geometryBatcher );
+ void Clear( BufferIndex updateBufferIndex );
private:
RenderQueue& mRenderQueue; ///< Used to send GL clean-up messages for the next Render.
// Messages are queued here following the current update buffer number
- NodeOwnerContainer mNodeQueue[2];
+ OwnerContainer< Node* > mNodeQueue[2];
ShaderQueue mShaderQueue[2];
RendererQueue mRendererQueue[2];
CameraQueue mCameraQueue[2];
-
-
- GeometryBatcher* mGeometryBatcher; ///< Geometry batcher needed to clean up batches upon node deletion
+ SceneQueue mSceneQueue[2];
};
} // namespace SceneGraph
} // namespace Dali
-#endif // __DALI_INTERNAL_RESOURCE_DISCARD_QUEUE_H__
+#endif // DALI_INTERNAL_DISCARD_QUEUE_H