summaryrefslogtreecommitdiffstats
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
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
-rw-r--r--DEPS2
-rw-r--r--content/renderer/renderer_webkitclient_impl.cc4
-rw-r--r--skia/skia.gyp8
-rw-r--r--ui/gfx/gl/gl.gyp4
-rw-r--r--ui/gfx/gl/gl_bindings_skia.h21
-rw-r--r--ui/gfx/gl/gl_bindings_skia_in_process.cc (renamed from ui/gfx/gl/gl_bindings_skia.cc)19
-rw-r--r--ui/gfx/gl/gl_bindings_skia_in_process.h18
-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
-rw-r--r--webkit/support/test_webkit_client.cc4
-rw-r--r--webkit/tools/test_shell/test_shell_webkit_init.cc2
12 files changed, 178 insertions, 46 deletions
diff --git a/DEPS b/DEPS
index 1b3ada1..65e449a 100644
--- a/DEPS
+++ b/DEPS
@@ -12,7 +12,7 @@ vars = {
"libjingle_revision": "55",
"libvpx_revision": "76510",
"ffmpeg_revision": "79854",
- "skia_revision": "1044",
+ "skia_revision": "1048",
"v8_revision": "7512",
}
diff --git a/content/renderer/renderer_webkitclient_impl.cc b/content/renderer/renderer_webkitclient_impl.cc
index c904137..92ec578f 100644
--- a/content/renderer/renderer_webkitclient_impl.cc
+++ b/content/renderer/renderer_webkitclient_impl.cc
@@ -42,6 +42,8 @@
#include "third_party/WebKit/Source/WebKit/chromium/public/WebStorageEventDispatcher.h"
#include "third_party/WebKit/Source/WebKit/chromium/public/WebURL.h"
#include "third_party/WebKit/Source/WebKit/chromium/public/WebVector.h"
+#include "ui/gfx/gl/gl_bindings_skia_in_process.h"
+#include "webkit/glue/gl_bindings_skia_cmd_buffer.h"
#include "webkit/glue/simple_webmimeregistry_impl.h"
#include "webkit/glue/webclipboard_impl.h"
#include "webkit/glue/webfileutilities_impl.h"
@@ -528,9 +530,11 @@ RendererWebKitClientImpl::createGraphicsContext3D() {
// layout tests (though not through this code) as well as for
// debugging and bringing up new ports.
if (CommandLine::ForCurrentProcess()->HasSwitch(switches::kInProcessWebGL)) {
+ gfx::BindSkiaToInProcessGL();
return new webkit::gpu::WebGraphicsContext3DInProcessImpl();
} else {
#if defined(ENABLE_GPU)
+ webkit_glue::BindSkiaToCommandBufferGL();
return new WebGraphicsContext3DCommandBufferImpl();
#else
return NULL;
diff --git a/skia/skia.gyp b/skia/skia.gyp
index 46c34e0..4ee25ff 100644
--- a/skia/skia.gyp
+++ b/skia/skia.gyp
@@ -17,6 +17,7 @@
'../third_party/skia/gpu/src/GrContext.cpp',
'../third_party/skia/gpu/src/GrCreatePathRenderer_none.cpp',
'../third_party/skia/gpu/src/GrDrawTarget.cpp',
+ '../third_party/skia/gpu/src/GrGLDefaultInterface_none.cpp',
'../third_party/skia/gpu/src/GrGLIndexBuffer.cpp',
'../third_party/skia/gpu/src/GrGLInterface.cpp',
'../third_party/skia/gpu/src/GrGLTexture.cpp',
@@ -666,8 +667,6 @@
'../third_party/skia/gpu/include',
'../third_party/skia/gpu/src',
'../third_party/skia/src/core',
-
- '../gpu',
],
'msvs_disabled_warnings': [4244, 4267,4345, 4390, 4554, 4800],
'mac_framework_dirs': [
@@ -732,7 +731,6 @@
'../build/linux/system.gyp:freetype2',
'../third_party/harfbuzz/harfbuzz.gyp:harfbuzz',
'../third_party/icu/icu.gyp:icuuc',
- '../gpu/gpu.gyp:gles2_c_lib',
],
'cflags': [
'-Wno-unused',
@@ -786,10 +784,6 @@
],
'dependencies': [
'../base/base.gyp:base',
- '../gpu/gpu.gyp:gles2_c_lib',
- '../gpu/gpu.gyp:gles2_implementation',
- '../gpu/gpu.gyp:command_buffer_client',
- '../gpu/gpu.gyp:command_buffer_common',
],
'direct_dependent_settings': {
'defines': [
diff --git a/ui/gfx/gl/gl.gyp b/ui/gfx/gl/gl.gyp
index f64804b..4cdb279 100644
--- a/ui/gfx/gl/gl.gyp
+++ b/ui/gfx/gl/gl.gyp
@@ -57,8 +57,8 @@
'sources': [
'gl_bindings.gypi',
'gl_bindings.h',
- 'gl_bindings_skia.cc',
- 'gl_bindings_skia.h',
+ 'gl_bindings_skia_in_process.cc',
+ 'gl_bindings_skia_in_process.h',
'gl_context.cc',
'gl_context.h',
'gl_context_linux.cc',
diff --git a/ui/gfx/gl/gl_bindings_skia.h b/ui/gfx/gl/gl_bindings_skia.h
deleted file mode 100644
index 4433c73..0000000
--- a/ui/gfx/gl/gl_bindings_skia.h
+++ /dev/null
@@ -1,21 +0,0 @@
-// 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 UI_GFX_GL_GL_BINDINGS_SKIA_H_
-#define UI_GFX_GL_GL_BINDINGS_SKIA_H_
-#pragma once
-
-namespace gfx {
-
-// The GPU back-end for skia normally makes direct calls to GLES2\gl. Call
-// this routine to bind the skia GL implementation to that exported by the
-// ui/gfx/gl entry points.
-// Note: This override is required to allow the skia gl calls to be correctly
-// routed around the command buffers during execution of the DumpRenderTree
-// layout tests.
-void BindSkiaToHostGL();
-
-}
-
-#endif // UI_GFX_GL_GL_BINDINGS_SKIA_H_
diff --git a/ui/gfx/gl/gl_bindings_skia.cc b/ui/gfx/gl/gl_bindings_skia_in_process.cc
index 4f861aa..396ea6b 100644
--- a/ui/gfx/gl/gl_bindings_skia.cc
+++ b/ui/gfx/gl/gl_bindings_skia_in_process.cc
@@ -3,26 +3,20 @@
// found in the LICENSE file.
-#include "ui/gfx/gl/gl_bindings_skia.h"
+#include "ui/gfx/gl/gl_bindings_skia_in_process.h"
#include "base/logging.h"
#include "ui/gfx/gl/gl_bindings.h"
#include "ui/gfx/gl/gl_implementation.h"
-// Skia is built against the headers in gpu\GLES. These functions
-// are exported without any call-type modifiers.
-#define GR_GL_FUNCTION_TYPE
-
#include "third_party/skia/gpu/include/GrGLInterface.h"
namespace {
extern "C" {
-
// The following stub functions are required because the glXXX routines exported
// via gl_bindings.h use call-type GL_BINDING_CALL, which on Windows is stdcall.
-// Skia has been built against the GLES headers, so the interfaces in
-// GrGLInterface are __cdecl.
+// Skia has been built such that its GrGLInterface GL pointers are __cdecl.
GLvoid StubGLActiveTexture(GLenum texture) {
glActiveTexture(texture);
@@ -69,12 +63,12 @@ GLvoid StubGLBlitFramebuffer(GLint srcX0, GLint srcY0, GLint srcX1, GLint srcY1,
mask, filter);
}
-GLvoid StubGLBufferData(GLenum target, GLsizei size, const void* data,
+GLvoid StubGLBufferData(GLenum target, GLsizeiptr size, const void* data,
GLenum usage) {
glBufferData(target, size, data, usage);
}
-GLvoid StubGLBufferSubData(GLenum target, GLint offset, GLsizei size,
+GLvoid StubGLBufferSubData(GLenum target, GLintptr offset, GLsizeiptr size,
const void* data) {
glBufferSubData(target, offset, size, data);
}
@@ -373,13 +367,11 @@ GLvoid StubGLVertexAttribPointer(GLuint indx, GLint size, GLenum type,
GLvoid StubGLViewport(GLint x, GLint y, GLsizei width, GLsizei height) {
glViewport(x, y, width, height);
}
-
} // extern "C"
// Populate |gl_interface| with pointers to the GL implementation used by
// Chrome.
void InitializeGrGLInterface(GrGLInterface* gl_interface) {
-
// Propagate the type of GL bindings exported back to skia.
switch (gfx::GetGLImplementation()) {
case gfx::kGLImplementationNone:
@@ -498,7 +490,7 @@ void InitializeGrGLInterface(GrGLInterface* gl_interface) {
namespace gfx {
-void BindSkiaToHostGL() {
+void BindSkiaToInProcessGL() {
static GrGLInterface host_gl_interface;
static bool host_StubGL_initialized = false;
if (!host_StubGL_initialized) {
@@ -509,3 +501,4 @@ void BindSkiaToHostGL() {
}
} // namespace gfx
+
diff --git a/ui/gfx/gl/gl_bindings_skia_in_process.h b/ui/gfx/gl/gl_bindings_skia_in_process.h
new file mode 100644
index 0000000..2905bf4
--- /dev/null
+++ b/ui/gfx/gl/gl_bindings_skia_in_process.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 UI_GFX_GL_GL_BINDINGS_SKIA_IN_PROCESS_H_
+#define UI_GFX_GL_GL_BINDINGS_SKIA_IN_PROCESS_H_
+#pragma once
+
+namespace gfx {
+
+// The GPU back-end for skia requires pointers to GL functions. This function
+// binds skia-gpu to the in-process GL
+void BindSkiaToInProcessGL();
+
+}
+
+#endif // UI_GFX_GL_GL_BINDINGS_SKIA_IN_PROCESS_H_
+
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',
diff --git a/webkit/support/test_webkit_client.cc b/webkit/support/test_webkit_client.cc
index 4d9347d..dadc401 100644
--- a/webkit/support/test_webkit_client.cc
+++ b/webkit/support/test_webkit_client.cc
@@ -31,7 +31,7 @@
#include "third_party/WebKit/Source/WebKit/chromium/public/WebStorageNamespace.h"
#include "third_party/WebKit/Source/WebKit/chromium/public/WebString.h"
#include "third_party/WebKit/Source/WebKit/chromium/public/WebURL.h"
-#include "ui/gfx/gl/gl_bindings_skia.h"
+#include "ui/gfx/gl/gl_bindings_skia_in_process.h"
#include "webkit/appcache/web_application_cache_host_impl.h"
#include "webkit/database/vfs_backend.h"
#include "webkit/extensions/v8/gc_extension.h"
@@ -352,6 +352,6 @@ WebKit::WebSharedWorkerRepository* TestWebKitClient::sharedWorkerRepository() {
}
WebKit::WebGraphicsContext3D* TestWebKitClient::createGraphicsContext3D() {
- gfx::BindSkiaToHostGL();
+ gfx::BindSkiaToInProcessGL();
return new webkit::gpu::WebGraphicsContext3DInProcessImpl();
}
diff --git a/webkit/tools/test_shell/test_shell_webkit_init.cc b/webkit/tools/test_shell/test_shell_webkit_init.cc
index 92ea733..a9b29ee 100644
--- a/webkit/tools/test_shell/test_shell_webkit_init.cc
+++ b/webkit/tools/test_shell/test_shell_webkit_init.cc
@@ -13,6 +13,7 @@
#include "third_party/WebKit/Source/WebKit/chromium/public/WebRuntimeFeatures.h"
#include "third_party/WebKit/Source/WebKit/chromium/public/WebScriptController.h"
#include "third_party/WebKit/Source/WebKit/chromium/public/WebSecurityPolicy.h"
+#include "ui/gfx/gl/gl_bindings_skia_in_process.h"
#include "v8/include/v8.h"
#include "webkit/tools/test_shell/test_shell.h"
@@ -289,5 +290,6 @@ TestShellWebKitInit::sharedWorkerRepository() {
}
WebKit::WebGraphicsContext3D* TestShellWebKitInit::createGraphicsContext3D() {
+ gfx::BindSkiaToInProcessGL();
return new webkit::gpu::WebGraphicsContext3DInProcessImpl();
}