Move array utils out of deDefs.
authorJarkko Pöyry <jpoyry@google.com>
Mon, 16 Mar 2015 20:27:55 +0000 (13:27 -0700)
committerJarkko Pöyry <jpoyry@google.com>
Tue, 17 Mar 2015 02:58:59 +0000 (19:58 -0700)
Change-Id: I77748493f96d9a25288f903eff1eebcafaa9b2c8

20 files changed:
Android.mk
framework/common/tcuTexture.cpp
framework/delibs/decpp/CMakeLists.txt
framework/delibs/decpp/deArrayUtil.cpp [new file with mode: 0644]
framework/delibs/decpp/deArrayUtil.hpp [new file with mode: 0644]
framework/delibs/decpp/deDefs.hpp
framework/opengl/gluObjectWrapper.cpp
framework/opengl/gluShaderUtil.cpp
framework/opengl/gluTexture.hpp
framework/opengl/gluVarType.cpp
modules/gles31/functional/es31fCopyImageTests.cpp
modules/gles31/functional/es31fDrawBuffersIndexedTests.cpp
modules/gles31/functional/es31fProgramInterfaceQueryTests.cpp
modules/gles31/functional/es31fShaderCommonFunctionTests.cpp
modules/gles31/functional/es31fShaderSharedVarTests.cpp
modules/glshared/glsBufferTestUtil.cpp
modules/glshared/glsBuiltinPrecisionTests.cpp
modules/glshared/glsDrawTest.cpp
modules/glshared/glsVertexArrayTests.cpp
modules/internal/ditFrameworkTests.cpp

index e1235d4..99fd19f 100644 (file)
@@ -79,6 +79,7 @@ LOCAL_SRC_FILES := \
        framework/delibs/debase/deRandom.c \
        framework/delibs/debase/deString.c \
        framework/delibs/decpp/deArrayBuffer.cpp \
+       framework/delibs/decpp/deArrayUtil.cpp \
        framework/delibs/decpp/deBlockBuffer.cpp \
        framework/delibs/decpp/deCommandLine.cpp \
        framework/delibs/decpp/deDefs.cpp \
index ed11674..d403856 100644 (file)
@@ -31,6 +31,7 @@
 #include "tcuFloat.hpp"
 #include "tcuTextureUtil.hpp"
 #include "deStringUtil.hpp"
+#include "deArrayUtil.hpp"
 
 #include <limits>
 
index efc729c..a585e50 100644 (file)
@@ -5,6 +5,10 @@ if (NOT DE_DEFS)
 endif ()
 
 set(DECPP_SRCS
+       deArrayBuffer.cpp
+       deArrayBuffer.hpp
+       deArrayUtil.cpp
+       deArrayUtil.hpp
        deBlockBuffer.cpp
        deBlockBuffer.hpp
        deCommandLine.cpp
@@ -49,8 +53,6 @@ set(DECPP_SRCS
        deThreadSafeRingBuffer.hpp
        deUniquePtr.cpp
        deUniquePtr.hpp
-       deArrayBuffer.cpp
-       deArrayBuffer.hpp
        )
 
 add_library(decpp STATIC ${DECPP_SRCS})
diff --git a/framework/delibs/decpp/deArrayUtil.cpp b/framework/delibs/decpp/deArrayUtil.cpp
new file mode 100644 (file)
index 0000000..fc5f0e7
--- /dev/null
@@ -0,0 +1,26 @@
+/*-------------------------------------------------------------------------
+ * drawElements C++ Base Library
+ * -----------------------------
+ *
+ * Copyright 2015 The Android Open Source Project
+ *
+ * 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.
+ *
+ *//*!
+ * \file
+ * \brief Array utils
+ *//*--------------------------------------------------------------------*/
+
+#include "deArrayUtil.hpp"
+
+DE_EMPTY_CPP_FILE
diff --git a/framework/delibs/decpp/deArrayUtil.hpp b/framework/delibs/decpp/deArrayUtil.hpp
new file mode 100644 (file)
index 0000000..0a7311e
--- /dev/null
@@ -0,0 +1,49 @@
+#ifndef _DEARRAYUTIL_HPP
+#define _DEARRAYUTIL_HPP
+/*-------------------------------------------------------------------------
+ * drawElements C++ Base Library
+ * -----------------------------
+ *
+ * Copyright 2015 The Android Open Source Project
+ *
+ * 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.
+ *
+ *//*!
+ * \file
+ * \brief Array utils
+ *//*--------------------------------------------------------------------*/
+
+#include "deDefs.hpp"
+
+namespace de
+{
+
+//! Get an element of an array with a specified size.
+template <int LastElementIndex, int Size, typename Elem>
+const Elem& getSizedArrayElement (const Elem (&array)[Size], typename de::EnableIf<int, LastElementIndex==Size>::Type offset)
+{
+       DE_ASSERT(inBounds(offset, 0, Size));
+       return array[offset];
+}
+
+//! Get an element of an array with a compile-time constant size.
+template <int Size, typename Elem>
+const Elem& getArrayElement (const Elem (&array)[Size], int offset)
+{
+       DE_ASSERT(inBounds(offset, 0, Size));
+       return array[offset];
+}
+
+} // de
+
+#endif // _DEARRAYUTIL_HPP
index 6daa835..fe9b38b 100644 (file)
@@ -76,29 +76,12 @@ struct EnableIf
 {
 };
 
-
 template <typename T>
 struct EnableIf<T, true>
 {
        typedef T Type;
 };
 
-//! Get an element of an array with a specified size.
-template <int LastElementIndex, int Size, typename Elem>
-const Elem& getSizedArrayElement (const Elem (&array)[Size], typename de::EnableIf<int, LastElementIndex==Size>::Type offset)
-{
-       DE_ASSERT(inBounds(offset, 0, Size));
-       return array[offset];
-}
-
-//! Get an element of an array with a compile-time constant size.
-template <int Size, typename Elem>
-const Elem& getArrayElement (const Elem (&array)[Size], int offset)
-{
-       DE_ASSERT(inBounds(offset, 0, Size));
-       return array[offset];
-}
-
 } // de
 
 /*--------------------------------------------------------------------*//*!
index 45444d9..70fee4e 100644 (file)
@@ -26,6 +26,7 @@
 #include "gluStrUtil.hpp"
 #include "glwFunctions.hpp"
 #include "glwEnums.hpp"
+#include "deArrayUtil.hpp"
 
 #include <sstream>
 
index 99dd112..ef9233c 100644 (file)
@@ -23,6 +23,7 @@
 
 #include "gluShaderUtil.hpp"
 #include "glwEnums.hpp"
+#include "deArrayUtil.hpp"
 
 namespace glu
 {
index de77b72..45de10c 100644 (file)
@@ -29,6 +29,7 @@
 #include "tcuResource.hpp"
 #include "gluRenderContext.hpp"
 #include "gluContextInfo.hpp"
+#include "deArrayBuffer.hpp"
 
 #include <vector>
 #include <string>
index 25a27c2..9e516a9 100644 (file)
@@ -23,6 +23,7 @@
 
 #include "gluVarType.hpp"
 #include "deStringUtil.hpp"
+#include "deArrayUtil.hpp"
 
 namespace glu
 {
index cc23bf1..55df903 100644 (file)
@@ -53,6 +53,7 @@
 #include "deRandom.hpp"
 #include "deStringUtil.hpp"
 #include "deUniquePtr.hpp"
+#include "deArrayUtil.hpp"
 
 #include <map>
 #include <string>
index f851c70..05a5428 100644 (file)
@@ -50,6 +50,7 @@
 #include "tcuVectorUtil.hpp"
 
 #include "deRandom.hpp"
+#include "deArrayUtil.hpp"
 #include "deStringUtil.hpp"
 #include "deUniquePtr.hpp"
 
index 83fa13c..0bc1efc 100644 (file)
@@ -38,6 +38,7 @@
 #include "deSharedPtr.hpp"
 #include "deUniquePtr.hpp"
 #include "deSTLUtil.hpp"
+#include "deArrayUtil.hpp"
 
 #include <set>
 #include <map>
index 00ad997..22f3b57 100644 (file)
@@ -32,6 +32,7 @@
 #include "deRandom.hpp"
 #include "deMath.h"
 #include "deString.h"
+#include "deArrayUtil.hpp"
 
 namespace deqp
 {
index d8f79ce..d8e6cc3 100644 (file)
@@ -33,6 +33,7 @@
 #include "tcuVectorUtil.hpp"
 #include "tcuFormatUtil.hpp"
 #include "deRandom.hpp"
+#include "deArrayUtil.hpp"
 #include "glwFunctions.hpp"
 #include "glwEnums.hpp"
 
index 5ea1bd2..b00ff84 100644 (file)
@@ -36,6 +36,7 @@
 #include "gluShaderProgram.hpp"
 #include "deMemory.h"
 #include "deStringUtil.hpp"
+#include "deArrayUtil.hpp"
 
 #include <algorithm>
 
index eeef119..c7f103b 100644 (file)
@@ -32,6 +32,7 @@
 #include "deStringUtil.hpp"
 #include "deUniquePtr.hpp"
 #include "deSharedPtr.hpp"
+#include "deArrayUtil.hpp"
 
 #include "tcuCommandLine.hpp"
 #include "tcuFloatFormat.hpp"
index 05689db..e5f3fbc 100644 (file)
@@ -29,6 +29,7 @@
 #include "deStringUtil.hpp"
 #include "deFloat16.h"
 #include "deUniquePtr.hpp"
+#include "deArrayUtil.hpp"
 
 #include "tcuTestLog.hpp"
 #include "tcuPixelFormat.hpp"
index 8b6fcff..e5ec808 100644 (file)
@@ -44,6 +44,7 @@
 
 #include "deMath.h"
 #include "deStringUtil.hpp"
+#include "deArrayUtil.hpp"
 
 #include <cstring>
 #include <cmath>
index d9f17d6..fdf23dc 100644 (file)
 #include "rrRenderer.hpp"
 #include "tcuTextureUtil.hpp"
 #include "tcuVectorUtil.hpp"
-#include "deRandom.hpp"
 #include "tcuFloat.hpp"
 
+#include "deRandom.hpp"
+#include "deArrayUtil.hpp"
+
 namespace dit
 {