summaryrefslogtreecommitdiffstats
path: root/webkit/glue
diff options
context:
space:
mode:
authorbsalomon@google.com <bsalomon@google.com@0039d316-1c4b-4281-b951-d872f2087c98>2011-04-06 17:21:39 +0000
committerbsalomon@google.com <bsalomon@google.com@0039d316-1c4b-4281-b951-d872f2087c98>2011-04-06 17:21:39 +0000
commit4ca1a669c58326d586e35b4d43e9e97626edf0a6 (patch)
tree8f727d1da26c10b1884da118044a23910bd1ab87 /webkit/glue
parent8cc85fcb137d43a8221aed3bcd8b9e7da1e640a4 (diff)
downloadchromium_src-4ca1a669c58326d586e35b4d43e9e97626edf0a6.zip
chromium_src-4ca1a669c58326d586e35b4d43e9e97626edf0a6.tar.gz
chromium_src-4ca1a669c58326d586e35b4d43e9e97626edf0a6.tar.bz2
Roll Skia
Setup pointers to cmd buffer GLES2 interface in Ganesh Review URL: http://codereview.chromium.org/6691042 git-svn-id: svn://svn.chromium.org/chrome/trunk/src@80642 0039d316-1c4b-4281-b951-d872f2087c98
Diffstat (limited to 'webkit/glue')
-rw-r--r--webkit/glue/gl_bindings_skia_cmd_buffer.cc122
-rw-r--r--webkit/glue/gl_bindings_skia_cmd_buffer.h18
-rw-r--r--webkit/glue/webkit_glue.gypi2
3 files changed, 142 insertions, 0 deletions
diff --git a/webkit/glue/gl_bindings_skia_cmd_buffer.cc b/webkit/glue/gl_bindings_skia_cmd_buffer.cc
new file mode 100644
index 0000000..06010cb
--- /dev/null
+++ b/webkit/glue/gl_bindings_skia_cmd_buffer.cc
@@ -0,0 +1,122 @@
+// Copyright (c) 2011 The Chromium Authors. All rights reserved.
+// Use of this source code is governed by a BSD-style license that can be
+// found in the LICENSE file.
+
+
+#include "webkit/glue/gl_bindings_skia_cmd_buffer.h"
+
+#define GL_GLEXT_PROTOTYPES
+#include "gpu/GLES2/gl2.h"
+#include "gpu/GLES2/gl2ext.h"
+
+#include "third_party/skia/gpu/include/GrGLInterface.h"
+
+namespace webkit_glue {
+
+void BindSkiaToCommandBufferGL() {
+ static GrGLInterface cmd_buffer_interface = {
+ kES2_GrGLBinding,
+
+ glActiveTexture,
+ glAttachShader,
+ glBindAttribLocation,
+ glBindBuffer,
+ glBindTexture,
+ glBlendColor,
+ glBlendFunc,
+ glBufferData,
+ glBufferSubData,
+ glClear,
+ glClearColor,
+ glClearStencil,
+ NULL, // glClientActiveTexture
+ NULL, // glColor4ub
+ glColorMask,
+ NULL, // glColorPointer
+ glCompileShader,
+ glCompressedTexImage2D,
+ glCreateProgram,
+ glCreateShader,
+ glCullFace,
+ glDeleteBuffers,
+ glDeleteProgram,
+ glDeleteShader,
+ glDeleteTextures,
+ glDepthMask,
+ glDisable,
+ NULL, // glDisableClientState
+ glDisableVertexAttribArray,
+ glDrawArrays,
+ glDrawElements,
+ glEnable,
+ NULL, // glEnableClientState
+ glEnableVertexAttribArray,
+ glFrontFace,
+ glGenBuffers,
+ glGenTextures,
+ glGetBufferParameteriv,
+ glGetError,
+ glGetIntegerv,
+ glGetProgramInfoLog,
+ glGetProgramiv,
+ glGetShaderInfoLog,
+ glGetShaderiv,
+ glGetString,
+ glGetUniformLocation,
+ glLineWidth,
+ glLinkProgram,
+ NULL, // glLoadMatrixf
+ NULL, // glMatrixMode
+ glPixelStorei,
+ NULL, // glPointSize
+ glReadPixels,
+ glScissor,
+ NULL, // glShadeModel
+ glShaderSource,
+ glStencilFunc,
+ glStencilFuncSeparate,
+ glStencilMask,
+ glStencilMaskSeparate,
+ glStencilOp,
+ glStencilOpSeparate,
+ NULL, // glTexCoordPointer
+ NULL, // glTexEnvi
+ glTexImage2D,
+ glTexParameteri,
+ glTexSubImage2D,
+ glUniform1fv,
+ glUniform1i,
+ glUniform4fv,
+ glUniformMatrix3fv,
+ glUseProgram,
+ glVertexAttrib4fv,
+ glVertexAttribPointer,
+ NULL, // glVertexPointer
+ glViewport,
+ glBindFramebuffer,
+ glBindRenderbuffer,
+ glCheckFramebufferStatus,
+ glDeleteFramebuffers,
+ glDeleteRenderbuffers,
+ glFramebufferRenderbuffer,
+ glFramebufferTexture2D,
+ glGenFramebuffers,
+ glGenRenderbuffers,
+ glRenderbufferStorage,
+ glRenderbufferStorageMultisampleEXT,
+ glBlitFramebufferEXT,
+ NULL, // glResolveMultisampleFramebuffer
+ NULL, // glMapBuffer
+ NULL, // glUnmapBuffer
+
+ GrGLInterface::kStaticInitEndGuard
+ };
+ static bool host_StubGL_initialized = false;
+ if (!host_StubGL_initialized) {
+ GrGLSetGLInterface(&cmd_buffer_interface);
+ host_StubGL_initialized = true;
+ }
+}
+
+} // namespace webkit_glue
+
diff --git a/webkit/glue/gl_bindings_skia_cmd_buffer.h b/webkit/glue/gl_bindings_skia_cmd_buffer.h
new file mode 100644
index 0000000..206e4f9
--- /dev/null
+++ b/webkit/glue/gl_bindings_skia_cmd_buffer.h
@@ -0,0 +1,18 @@
+// Copyright (c) 2011 The Chromium Authors. All rights reserved.
+// Use of this source code is governed by a BSD-style license that can be
+// found in the LICENSE file.
+
+#ifndef WEBKIT_GLUE_GL_BINDINGS_SKIA_CMD_BUFFER_H_
+#define WEBKIT_GLUE_GL_BINDINGS_SKIA_CMD_BUFFER_H_
+#pragma once
+
+namespace webkit_glue {
+
+// The GPU back-end for skia requires pointers to GL functions. This function
+// binds skia-gpu to the cmd buffers GL.
+void BindSkiaToCommandBufferGL();
+
+} // namespace webkit_glue
+
+#endif // WEBKIT_GLUE_GL_BINDINGS_SKIA_CMD_BUFFER_H_
+
diff --git a/webkit/glue/webkit_glue.gypi b/webkit/glue/webkit_glue.gypi
index 7ab4a38..4d999e5 100644
--- a/webkit/glue/webkit_glue.gypi
+++ b/webkit/glue/webkit_glue.gypi
@@ -340,6 +340,8 @@
'form_field.h',
'ftp_directory_listing_response_delegate.cc',
'ftp_directory_listing_response_delegate.h',
+ 'gl_bindings_skia_cmd_buffer.cc',
+ 'gl_bindings_skia_cmd_buffer.h',
'glue_serialize.cc',
'glue_serialize.h',
'idb_bindings.cc',