Performance enhancement, cache glClear state
[platform/core/uifw/dali-core.git] / dali / internal / render / common / render-list.h
index ad838e9..f435628 100644 (file)
@@ -1,21 +1,22 @@
 #ifndef __DALI_INTERNAL_SCENE_GRAPH_RENDER_LIST_H__
 #define __DALI_INTERNAL_SCENE_GRAPH_RENDER_LIST_H__
 
-//
-// Copyright (c) 2014 Samsung Electronics Co., Ltd.
-//
-// Licensed under the Flora License, Version 1.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://floralicense.org/license/
-//
-// 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.
-//
+/*
+ * Copyright (c) 2014 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
 #include <dali/public-api/math/rect.h>
@@ -51,16 +52,22 @@ struct RenderList
 public:
 
   /**
-   * The RenderFlags describe how the objects are rendered using the depth buffer.
+   * The RenderFlags describe how the objects are rendered using the depth and stencil buffer.
+   *
+   * The flags which relate to GL_DEPTH_TEST and GL_STENCIL_TEST are called
+   * DEPTH_BUFFER_ENABLED and STENCIL_BUFFER_ENABLED to avoid any confusion.
+   * E.g. if GL_DEPTH_TEST is not enabled you can't write to the depth buffer, which can cause confusion.
+   *
    */
   enum RenderFlags
   {
-    DEPTH_TEST     = 0x01, ///< If depth testing should be used
-    DEPTH_WRITE    = 0x02, ///< If the depth buffer is writable
-    DEPTH_CLEAR    = 0x04, ///< If the depth buffer should first be cleared
-    STENCIL_TEST   = 0x08, ///< If stencil testing should be used
-    STENCIL_WRITE  = 0x10, ///< If the stencil buffer is writable
-    STENCIL_CLEAR  = 0x20  ///< If the stencil buffer should first be cleared
+    DEPTH_BUFFER_ENABLED   = 1 << 0, ///< If depth buffer should be used for writing / test operations
+    DEPTH_WRITE            = 1 << 1, ///< If the depth buffer is writable
+    DEPTH_CLEAR            = 1 << 2, ///< If the depth buffer should first be cleared
+    STENCIL_BUFFER_ENABLED = 1 << 3, ///< If stencil buffer should be used for writing / test operation
+    STENCIL_WRITE          = 1 << 4, ///< If the stencil buffer is writable
+    STENCIL_CLEAR          = 1 << 5, ///< If the stencil buffer should first be cleared
+
   };
 
   /**