diff options
author | piman@google.com <piman@google.com@0039d316-1c4b-4281-b951-d872f2087c98> | 2010-01-29 22:24:40 +0000 |
---|---|---|
committer | piman@google.com <piman@google.com@0039d316-1c4b-4281-b951-d872f2087c98> | 2010-01-29 22:24:40 +0000 |
commit | 24b0f177b1a453bae38cdda6c4e07a4320a3e22b (patch) | |
tree | 2c235f13ebfb1aa214b0c694b84917792572166a /o3d | |
parent | 469af750e1435c1903f81f79649f72eb919853ad (diff) | |
download | chromium_src-24b0f177b1a453bae38cdda6c4e07a4320a3e22b.zip chromium_src-24b0f177b1a453bae38cdda6c4e07a4320a3e22b.tar.gz chromium_src-24b0f177b1a453bae38cdda6c4e07a4320a3e22b.tar.bz2 |
linux: fixes for the glsl renderer
Review URL: http://codereview.chromium.org/549203
git-svn-id: svn://svn.chromium.org/chrome/trunk/src@37552 0039d316-1c4b-4281-b951-d872f2087c98
Diffstat (limited to 'o3d')
-rw-r--r-- | o3d/core/cross/gles2/effect_gles2.cc | 5 | ||||
-rw-r--r-- | o3d/core/cross/gles2/gles2_headers.h | 3 | ||||
-rw-r--r-- | o3d/core/cross/gles2/utils_gles2.cc | 7 | ||||
-rw-r--r-- | o3d/core/cross/renderer_platform.h | 4 | ||||
-rw-r--r-- | o3d/core/linux/display_window_linux.h | 2 |
5 files changed, 11 insertions, 10 deletions
diff --git a/o3d/core/cross/gles2/effect_gles2.cc b/o3d/core/cross/gles2/effect_gles2.cc index f874334..1e24e5b 100644 --- a/o3d/core/cross/gles2/effect_gles2.cc +++ b/o3d/core/cross/gles2/effect_gles2.cc @@ -223,7 +223,7 @@ bool EffectGLES2::LoadFromFXString(const String& effect) { << "\" in Effect"; return false; } - bool column_major = matrix_load_order_str.c_str() == "ColumnMajor"; + bool column_major = matrix_load_order_str == "ColumnMajor"; MatrixLoadOrder matrix_load_order = column_major ? COLUMN_MAJOR : ROW_MAJOR; // Split the effect @@ -307,7 +307,6 @@ void EffectGLES2::GetShaderParamInfo( String name(name_buffer.get()); // TODO(gman): Should we check for error? // TODO(gman): Should we skip uniforms that start with "gl_"? - GLint location = glGetUniformLocation(program, name_buffer.get()); int num_elements = 0; if (size > 1) { // It's an array. @@ -360,7 +359,6 @@ void EffectGLES2::GetVaryingVertexShaderParamInfo( glGetActiveAttrib( program, ii, max_len + 1, &length, &size, &type, name_buffer.get()); // TODO(gman): Should we check for error? - GLint location = glGetAttribLocation(program, name_buffer.get()); String name(name_buffer.get()); // Since GLSL has no semantics just go by name. Stream::Semantic semantic; @@ -442,4 +440,3 @@ void EffectGLES2::PostDraw(ParamCacheGLES2* param_cache_gles2) { } } // namespace o3d - diff --git a/o3d/core/cross/gles2/gles2_headers.h b/o3d/core/cross/gles2/gles2_headers.h index d00e2ef..e31de99 100644 --- a/o3d/core/cross/gles2/gles2_headers.h +++ b/o3d/core/cross/gles2/gles2_headers.h @@ -35,7 +35,8 @@ #include <GL/glew.h> #if defined(OS_WIN) #include <GL/wglew.h> +#elif defined(OS_LINUX) +#include <GL/glx.h> #endif #endif // O3D_CORE_CROSS_GLES2_GL_HEADERS_H_ - diff --git a/o3d/core/cross/gles2/utils_gles2.cc b/o3d/core/cross/gles2/utils_gles2.cc index 1d48958..4d07e1c 100644 --- a/o3d/core/cross/gles2/utils_gles2.cc +++ b/o3d/core/cross/gles2/utils_gles2.cc @@ -29,7 +29,7 @@ * OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. */ - +#include "base/string_util.h" #include "core/cross/stream.h" #include "core/cross/types.h" #include "core/cross/gles2/utils_gles2.h" @@ -65,9 +65,9 @@ bool SemanticNameToSemantic( { kColor, sizeof(kColor) - 1, Stream::COLOR, }, { kTexcoord, sizeof(kTexcoord) - 1, Stream::TEXCOORD, }, }; - for (unsigned ii = 0; ii < arraysize(lookup); ++ii) { + for (unsigned ii = 0; ii < ARRAYSIZE_UNSAFE(lookup); ++ii) { const NameToSemantic& info = lookup[ii]; - if (!_strnicmp(info.name, name.c_str(), info.length)) { + if (!base::strncasecmp(info.name, name.c_str(), info.length)) { *semantic = info.semantic; *semantic_index = atoi(name.c_str() + info.length); return true; @@ -77,4 +77,3 @@ bool SemanticNameToSemantic( } } // namespace o3d - diff --git a/o3d/core/cross/renderer_platform.h b/o3d/core/cross/renderer_platform.h index faabb28..eb969c2 100644 --- a/o3d/core/cross/renderer_platform.h +++ b/o3d/core/cross/renderer_platform.h @@ -43,8 +43,12 @@ #include <OpenGL/OpenGL.h> #include <AGL/agl.h> #elif defined(OS_LINUX) +#if defined(RENDERER_GL) #include "core/cross/gl/gl_headers.h" #include <GL/glx.h> +#elif defined(RENDERER_GLES2) +#include "core/cross/gles2/gles2_headers.h" +#endif #elif defined(OS_WIN) && defined(RENDERER_GL) #include "core/cross/gl/gl_headers.h" #include <gl/GL.h> diff --git a/o3d/core/linux/display_window_linux.h b/o3d/core/linux/display_window_linux.h index 86b05e2..c78b915 100644 --- a/o3d/core/linux/display_window_linux.h +++ b/o3d/core/linux/display_window_linux.h @@ -33,7 +33,7 @@ #ifndef O3D_CORE_LINUX_DISPLAY_WINDOW_LINUX_H_ #define O3D_CORE_LINUX_DISPLAY_WINDOW_LINUX_H_ -#include <GL/glx.h> +#include <X11/Xlib.h> #include "core/cross/display_window.h" |