-#ifndef __TEST_GL_ABSTRACTION_H__
-#define __TEST_GL_ABSTRACTION_H__
+#ifndef TEST_GL_ABSTRACTION_H
+#define TEST_GL_ABSTRACTION_H
/*
- * Copyright (c) 2014 Samsung Electronics Co., Ltd.
+ * Copyright (c) 2016 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 <map>
#include <cstdio>
#include <cstring> // for strcmp
+#include <typeinfo>
// INTERNAL INCLUDES
#include <dali/public-api/dali-core.h>
#include <dali/integration-api/core.h>
#include <dali/integration-api/gl-abstraction.h>
#include <dali/integration-api/gl-defines.h>
-#include "test-trace-call-stack.h"
+#include <test-trace-call-stack.h>
+#include <test-compare-types.h>
namespace Dali
{
inline void DepthMask(GLboolean flag)
{
+ mLastDepthMask = flag;
+ }
+
+ inline bool GetLastDepthMask() const
+ {
+ return mLastDepthMask;
}
inline void DepthRangef(GLclampf zNear, GLclampf zFar)
inline void GetShaderSource(GLuint shader, GLsizei bufsize, GLsizei* length, char* source)
{
const std::string shaderSource = mShaderSources[shader];
- if( static_cast<int>(shaderSource.length()) < bufsize )
+ const int shaderSourceLength = static_cast<int>(shaderSource.length());
+ if( shaderSourceLength < bufsize )
{
- strcpy(source, shaderSource.c_str());
- *length = shaderSource.length();
+ strncpy( source, shaderSource.c_str(), shaderSourceLength );
+ *length = shaderSourceLength;
}
else
{
GLenum mLastBlendFuncSrcAlpha;
GLenum mLastBlendFuncDstAlpha;
+ GLboolean mLastDepthMask;
+
// Data for manipulating the IDs returned by GenTextures
GLuint mLastAutoTextureIdUsed;
std::vector<GLuint> mNextTextureIds;
T uniformValue;
if ( GetUniformValue( program, uniform, uniformValue ) )
{
- return value == uniformValue;
+ return CompareType<T>(value, uniformValue, Math::MACHINE_EPSILON_10);
}
return false;
ProgramUniformValue<Matrix> mProgramUniformsMat4;
ProgramUniformValue<Matrix3> mProgramUniformsMat3;
+
+
+
inline const ProgramUniformValue<int>& GetProgramUniformsForType( const int ) const
{
return mProgramUniforms1i;
bool BlendDisabled(const Dali::TraceCallStack& callStack);
-
-
-#endif // __TEST_GL_ES_H__
+#endif // TEST_GL_ABSTRACTION_H