summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorzmo <zmo@chromium.org>2015-04-30 16:36:27 -0700
committerCommit bot <commit-bot@chromium.org>2015-04-30 23:38:06 +0000
commit55b927983ae8d1225a4ff0b27ec61f6e3d8ea25a (patch)
tree01d00d2ee2f370b915e44db53ec510eec71ca67d
parent3d9e230dc93e58b5a434a64a1a5a79cf5d4b1277 (diff)
downloadchromium_src-55b927983ae8d1225a4ff0b27ec61f6e3d8ea25a.zip
chromium_src-55b927983ae8d1225a4ff0b27ec61f6e3d8ea25a.tar.gz
chromium_src-55b927983ae8d1225a4ff0b27ec61f6e3d8ea25a.tar.bz2
Add the gl{Compressed}TexSubImage3D bindings.
Except for the Mock interface, because gmock doesn't support 11 args. This allows the two functions to be functional, but not ready to be tested through gtest/gmock. BUG=456340 TEST=gpu_unittests R=kbr@chromium.org,sievers@chromium.org Review URL: https://codereview.chromium.org/1119853003 Cr-Commit-Position: refs/heads/master@{#327833}
-rw-r--r--gpu/command_buffer/service/gles2_cmd_decoder.cc9
-rwxr-xr-xui/gl/generate_bindings.py37
-rw-r--r--ui/gl/gl_bindings_api_autogen_gl.h22
-rw-r--r--ui/gl/gl_bindings_autogen_gl.cc166
-rw-r--r--ui/gl/gl_bindings_autogen_gl.h49
-rw-r--r--ui/gl/gl_bindings_autogen_mock.cc38
-rw-r--r--ui/gl/gl_bindings_autogen_mock.h22
-rw-r--r--ui/gl/gl_mock.h17
-rw-r--r--ui/gl/gl_mock_autogen_gl.h4
9 files changed, 339 insertions, 25 deletions
diff --git a/gpu/command_buffer/service/gles2_cmd_decoder.cc b/gpu/command_buffer/service/gles2_cmd_decoder.cc
index 29d4d5d..bc8721f 100644
--- a/gpu/command_buffer/service/gles2_cmd_decoder.cc
+++ b/gpu/command_buffer/service/gles2_cmd_decoder.cc
@@ -10009,15 +10009,6 @@ error::Error GLES2DecoderImpl::HandleTexSubImage2D(uint32 immediate_data_size,
target, level, xoffset, yoffset, width, height, format, type, pixels);
}
-// TODO(zmo): Remove the below stub once we add the real function binding.
-// Currently it's missing due to a gmock limitation.
-static void glTexSubImage3D(
- GLenum target, GLint level, GLint xoffset, GLint yoffset, GLint zoffset,
- GLsizei height, GLsizei width, GLsizei depth, GLenum format, GLenum type,
- const void* pixels) {
- NOTIMPLEMENTED();
-}
-
error::Error GLES2DecoderImpl::HandleTexSubImage3D(uint32 immediate_data_size,
const void* cmd_data) {
// TODO(zmo): Unsafe ES3 API.
diff --git a/ui/gl/generate_bindings.py b/ui/gl/generate_bindings.py
index f48b5fa..e61b480 100755
--- a/ui/gl/generate_bindings.py
+++ b/ui/gl/generate_bindings.py
@@ -208,13 +208,12 @@ GL_FUNCTIONS = [
'GLenum target, GLint level, GLint xoffset, GLint yoffset, '
'GLsizei width, GLsizei height, GLenum format, GLsizei imageSize, '
'const void* data', },
-# TODO(zmo): wait for MOCK_METHOD11.
-# { 'return_type': 'void',
-# 'versions': [{ 'name': 'glCompressedTexSubImage3D' }],
-# 'arguments':
-# 'GLenum target, GLint level, GLint xoffset, GLint yoffset, '
-# 'GLint zoffset, GLsizei width, GLsizei height, GLsizei depth, '
-# 'GLenum format, GLsizei imageSize, const void* data', },
+{ 'return_type': 'void',
+ 'versions': [{ 'name': 'glCompressedTexSubImage3D' }],
+ 'arguments':
+ 'GLenum target, GLint level, GLint xoffset, GLint yoffset, '
+ 'GLint zoffset, GLsizei width, GLsizei height, GLsizei depth, '
+ 'GLenum format, GLsizei imageSize, const void* data', },
{ 'return_type': 'void',
'versions': [{ 'name': 'glCopyBufferSubData' }],
'arguments':
@@ -953,13 +952,12 @@ GL_FUNCTIONS = [
'GLenum target, GLint level, GLint xoffset, GLint yoffset, '
'GLsizei width, GLsizei height, GLenum format, GLenum type, '
'const void* pixels', },
-# TODO(zmo): wait for MOCK_METHOD11.
-# { 'return_type': 'void',
-# 'versions': [{ 'name': 'glTexSubImage3D' }],
-# 'arguments':
-# 'GLenum target, GLint level, GLint xoffset, GLint yoffset, '
-# 'GLint zoffset, GLsizei width, GLsizei height, GLsizei depth, '
-# 'GLenum format, GLenum type, const void* pixels', },
+{ 'return_type': 'void',
+ 'versions': [{ 'name': 'glTexSubImage3D' }],
+ 'arguments':
+ 'GLenum target, GLint level, GLint xoffset, GLint yoffset, '
+ 'GLint zoffset, GLsizei width, GLsizei height, GLsizei depth, '
+ 'GLenum format, GLenum type, const void* pixels', },
{ 'return_type': 'void',
'versions': [{ 'name': 'glTransformFeedbackVaryings' }],
'arguments': 'GLuint program, GLsizei count, const char* const* varyings, '
@@ -1776,8 +1774,15 @@ def GenerateMockHeader(file, functions, set_name):
arg_count = 0
if len(args):
arg_count = func['arguments'].count(',') + 1
- file.write(' MOCK_METHOD%d(%s, %s(%s));\n' %
- (arg_count, func['known_as'][2:], func['return_type'], args))
+ # TODO(zmo): crbug.com/456340
+ # For now gmock supports at most 10 args.
+ if arg_count <= 10:
+ file.write(' MOCK_METHOD%d(%s, %s(%s));\n' %
+ (arg_count, func['known_as'][2:], func['return_type'], args))
+ else:
+ file.write(' // TODO(zmo): crbug.com/456340\n')
+ file.write(' // %s cannot be mocked because it has %d args.\n' %
+ (func['known_as'], arg_count))
file.write('\n')
diff --git a/ui/gl/gl_bindings_api_autogen_gl.h b/ui/gl/gl_bindings_api_autogen_gl.h
index 416a8d8..8ff72c0 100644
--- a/ui/gl/gl_bindings_api_autogen_gl.h
+++ b/ui/gl/gl_bindings_api_autogen_gl.h
@@ -141,6 +141,17 @@ void glCompressedTexSubImage2DFn(GLenum target,
GLenum format,
GLsizei imageSize,
const void* data) override;
+void glCompressedTexSubImage3DFn(GLenum target,
+ GLint level,
+ GLint xoffset,
+ GLint yoffset,
+ GLint zoffset,
+ GLsizei width,
+ GLsizei height,
+ GLsizei depth,
+ GLenum format,
+ GLsizei imageSize,
+ const void* data) override;
void glCopyBufferSubDataFn(GLenum readTarget,
GLenum writeTarget,
GLintptr readOffset,
@@ -582,6 +593,17 @@ void glTexSubImage2DFn(GLenum target,
GLenum format,
GLenum type,
const void* pixels) override;
+void glTexSubImage3DFn(GLenum target,
+ GLint level,
+ GLint xoffset,
+ GLint yoffset,
+ GLint zoffset,
+ GLsizei width,
+ GLsizei height,
+ GLsizei depth,
+ GLenum format,
+ GLenum type,
+ const void* pixels) override;
void glTransformFeedbackVaryingsFn(GLuint program,
GLsizei count,
const char* const* varyings,
diff --git a/ui/gl/gl_bindings_autogen_gl.cc b/ui/gl/gl_bindings_autogen_gl.cc
index 54e8f34..f7f23f22 100644
--- a/ui/gl/gl_bindings_autogen_gl.cc
+++ b/ui/gl/gl_bindings_autogen_gl.cc
@@ -87,6 +87,7 @@ void DriverGL::InitializeStaticBindings() {
fn.glCompressedTexSubImage2DFn =
reinterpret_cast<glCompressedTexSubImage2DProc>(
GetGLProcAddress("glCompressedTexSubImage2D"));
+ fn.glCompressedTexSubImage3DFn = 0;
fn.glCopyBufferSubDataFn = 0;
fn.glCopyTexImage2DFn = reinterpret_cast<glCopyTexImage2DProc>(
GetGLProcAddress("glCopyTexImage2D"));
@@ -346,6 +347,7 @@ void DriverGL::InitializeStaticBindings() {
fn.glTexStorage3DFn = 0;
fn.glTexSubImage2DFn = reinterpret_cast<glTexSubImage2DProc>(
GetGLProcAddress("glTexSubImage2D"));
+ fn.glTexSubImage3DFn = 0;
fn.glTransformFeedbackVaryingsFn = 0;
fn.glUniform1fFn =
reinterpret_cast<glUniform1fProc>(GetGLProcAddress("glUniform1f"));
@@ -739,6 +741,14 @@ void DriverGL::InitializeDynamicBindings(GLContext* context) {
DCHECK(fn.glCompressedTexImage3DFn);
}
+ debug_fn.glCompressedTexSubImage3DFn = 0;
+ if (!ver->is_es || ver->IsAtLeastGLES(3u, 0u)) {
+ fn.glCompressedTexSubImage3DFn =
+ reinterpret_cast<glCompressedTexSubImage3DProc>(
+ GetGLProcAddress("glCompressedTexSubImage3D"));
+ DCHECK(fn.glCompressedTexSubImage3DFn);
+ }
+
debug_fn.glCopyBufferSubDataFn = 0;
if (ver->IsAtLeastGLES(3u, 0u) || ver->IsAtLeastGL(3u, 1u)) {
fn.glCopyBufferSubDataFn = reinterpret_cast<glCopyBufferSubDataProc>(
@@ -1794,6 +1804,13 @@ void DriverGL::InitializeDynamicBindings(GLContext* context) {
DCHECK(fn.glTexStorage3DFn);
}
+ debug_fn.glTexSubImage3DFn = 0;
+ if (!ver->is_es || ver->IsAtLeastGLES(3u, 0u)) {
+ fn.glTexSubImage3DFn = reinterpret_cast<glTexSubImage3DProc>(
+ GetGLProcAddress("glTexSubImage3D"));
+ DCHECK(fn.glTexSubImage3DFn);
+ }
+
debug_fn.glTransformFeedbackVaryingsFn = 0;
if (ver->IsAtLeastGL(3u, 0u) || ver->IsAtLeastGLES(3u, 0u)) {
fn.glTransformFeedbackVaryingsFn =
@@ -2397,6 +2414,28 @@ static void GL_BINDING_CALL Debug_glCompressedTexSubImage2D(GLenum target,
target, level, xoffset, yoffset, width, height, format, imageSize, data);
}
+static void GL_BINDING_CALL Debug_glCompressedTexSubImage3D(GLenum target,
+ GLint level,
+ GLint xoffset,
+ GLint yoffset,
+ GLint zoffset,
+ GLsizei width,
+ GLsizei height,
+ GLsizei depth,
+ GLenum format,
+ GLsizei imageSize,
+ const void* data) {
+ GL_SERVICE_LOG("glCompressedTexSubImage3D"
+ << "(" << GLEnums::GetStringEnum(target) << ", " << level
+ << ", " << xoffset << ", " << yoffset << ", " << zoffset
+ << ", " << width << ", " << height << ", " << depth << ", "
+ << GLEnums::GetStringEnum(format) << ", " << imageSize << ", "
+ << static_cast<const void*>(data) << ")");
+ g_driver_gl.debug_fn.glCompressedTexSubImage3DFn(
+ target, level, xoffset, yoffset, zoffset, width, height, depth, format,
+ imageSize, data);
+}
+
static void GL_BINDING_CALL Debug_glCopyBufferSubData(GLenum readTarget,
GLenum writeTarget,
GLintptr readOffset,
@@ -4165,6 +4204,29 @@ static void GL_BINDING_CALL Debug_glTexSubImage2D(GLenum target,
height, format, type, pixels);
}
+static void GL_BINDING_CALL Debug_glTexSubImage3D(GLenum target,
+ GLint level,
+ GLint xoffset,
+ GLint yoffset,
+ GLint zoffset,
+ GLsizei width,
+ GLsizei height,
+ GLsizei depth,
+ GLenum format,
+ GLenum type,
+ const void* pixels) {
+ GL_SERVICE_LOG("glTexSubImage3D"
+ << "(" << GLEnums::GetStringEnum(target) << ", " << level
+ << ", " << xoffset << ", " << yoffset << ", " << zoffset
+ << ", " << width << ", " << height << ", " << depth << ", "
+ << GLEnums::GetStringEnum(format) << ", "
+ << GLEnums::GetStringEnum(type) << ", "
+ << static_cast<const void*>(pixels) << ")");
+ g_driver_gl.debug_fn.glTexSubImage3DFn(target, level, xoffset, yoffset,
+ zoffset, width, height, depth, format,
+ type, pixels);
+}
+
static void GL_BINDING_CALL
Debug_glTransformFeedbackVaryings(GLuint program,
GLsizei count,
@@ -4818,6 +4880,10 @@ void DriverGL::InitializeDebugBindings() {
debug_fn.glCompressedTexSubImage2DFn = fn.glCompressedTexSubImage2DFn;
fn.glCompressedTexSubImage2DFn = Debug_glCompressedTexSubImage2D;
}
+ if (!debug_fn.glCompressedTexSubImage3DFn) {
+ debug_fn.glCompressedTexSubImage3DFn = fn.glCompressedTexSubImage3DFn;
+ fn.glCompressedTexSubImage3DFn = Debug_glCompressedTexSubImage3D;
+ }
if (!debug_fn.glCopyBufferSubDataFn) {
debug_fn.glCopyBufferSubDataFn = fn.glCopyBufferSubDataFn;
fn.glCopyBufferSubDataFn = Debug_glCopyBufferSubData;
@@ -5583,6 +5649,10 @@ void DriverGL::InitializeDebugBindings() {
debug_fn.glTexSubImage2DFn = fn.glTexSubImage2DFn;
fn.glTexSubImage2DFn = Debug_glTexSubImage2D;
}
+ if (!debug_fn.glTexSubImage3DFn) {
+ debug_fn.glTexSubImage3DFn = fn.glTexSubImage3DFn;
+ fn.glTexSubImage3DFn = Debug_glTexSubImage3D;
+ }
if (!debug_fn.glTransformFeedbackVaryingsFn) {
debug_fn.glTransformFeedbackVaryingsFn = fn.glTransformFeedbackVaryingsFn;
fn.glTransformFeedbackVaryingsFn = Debug_glTransformFeedbackVaryings;
@@ -6079,6 +6149,22 @@ void GLApiBase::glCompressedTexSubImage2DFn(GLenum target,
target, level, xoffset, yoffset, width, height, format, imageSize, data);
}
+void GLApiBase::glCompressedTexSubImage3DFn(GLenum target,
+ GLint level,
+ GLint xoffset,
+ GLint yoffset,
+ GLint zoffset,
+ GLsizei width,
+ GLsizei height,
+ GLsizei depth,
+ GLenum format,
+ GLsizei imageSize,
+ const void* data) {
+ driver_->fn.glCompressedTexSubImage3DFn(target, level, xoffset, yoffset,
+ zoffset, width, height, depth, format,
+ imageSize, data);
+}
+
void GLApiBase::glCopyBufferSubDataFn(GLenum readTarget,
GLenum writeTarget,
GLintptr readOffset,
@@ -7128,6 +7214,21 @@ void GLApiBase::glTexSubImage2DFn(GLenum target,
format, type, pixels);
}
+void GLApiBase::glTexSubImage3DFn(GLenum target,
+ GLint level,
+ GLint xoffset,
+ GLint yoffset,
+ GLint zoffset,
+ GLsizei width,
+ GLsizei height,
+ GLsizei depth,
+ GLenum format,
+ GLenum type,
+ const void* pixels) {
+ driver_->fn.glTexSubImage3DFn(target, level, xoffset, yoffset, zoffset, width,
+ height, depth, format, type, pixels);
+}
+
void GLApiBase::glTransformFeedbackVaryingsFn(GLuint program,
GLsizei count,
const char* const* varyings,
@@ -7755,6 +7856,23 @@ void TraceGLApi::glCompressedTexSubImage2DFn(GLenum target,
height, format, imageSize, data);
}
+void TraceGLApi::glCompressedTexSubImage3DFn(GLenum target,
+ GLint level,
+ GLint xoffset,
+ GLint yoffset,
+ GLint zoffset,
+ GLsizei width,
+ GLsizei height,
+ GLsizei depth,
+ GLenum format,
+ GLsizei imageSize,
+ const void* data) {
+ TRACE_EVENT_BINARY_EFFICIENT0("gpu", "TraceGLAPI::glCompressedTexSubImage3D")
+ gl_api_->glCompressedTexSubImage3DFn(target, level, xoffset, yoffset, zoffset,
+ width, height, depth, format, imageSize,
+ data);
+}
+
void TraceGLApi::glCopyBufferSubDataFn(GLenum readTarget,
GLenum writeTarget,
GLintptr readOffset,
@@ -9006,6 +9124,22 @@ void TraceGLApi::glTexSubImage2DFn(GLenum target,
format, type, pixels);
}
+void TraceGLApi::glTexSubImage3DFn(GLenum target,
+ GLint level,
+ GLint xoffset,
+ GLint yoffset,
+ GLint zoffset,
+ GLsizei width,
+ GLsizei height,
+ GLsizei depth,
+ GLenum format,
+ GLenum type,
+ const void* pixels) {
+ TRACE_EVENT_BINARY_EFFICIENT0("gpu", "TraceGLAPI::glTexSubImage3D")
+ gl_api_->glTexSubImage3DFn(target, level, xoffset, yoffset, zoffset, width,
+ height, depth, format, type, pixels);
+}
+
void TraceGLApi::glTransformFeedbackVaryingsFn(GLuint program,
GLsizei count,
const char* const* varyings,
@@ -9724,6 +9858,23 @@ void NoContextGLApi::glCompressedTexSubImage2DFn(GLenum target,
"context";
}
+void NoContextGLApi::glCompressedTexSubImage3DFn(GLenum target,
+ GLint level,
+ GLint xoffset,
+ GLint yoffset,
+ GLint zoffset,
+ GLsizei width,
+ GLsizei height,
+ GLsizei depth,
+ GLenum format,
+ GLsizei imageSize,
+ const void* data) {
+ NOTREACHED() << "Trying to call glCompressedTexSubImage3D() without current "
+ "GL context";
+ LOG(ERROR) << "Trying to call glCompressedTexSubImage3D() without current GL "
+ "context";
+}
+
void NoContextGLApi::glCopyBufferSubDataFn(GLenum readTarget,
GLenum writeTarget,
GLintptr readOffset,
@@ -11186,6 +11337,21 @@ void NoContextGLApi::glTexSubImage2DFn(GLenum target,
LOG(ERROR) << "Trying to call glTexSubImage2D() without current GL context";
}
+void NoContextGLApi::glTexSubImage3DFn(GLenum target,
+ GLint level,
+ GLint xoffset,
+ GLint yoffset,
+ GLint zoffset,
+ GLsizei width,
+ GLsizei height,
+ GLsizei depth,
+ GLenum format,
+ GLenum type,
+ const void* pixels) {
+ NOTREACHED() << "Trying to call glTexSubImage3D() without current GL context";
+ LOG(ERROR) << "Trying to call glTexSubImage3D() without current GL context";
+}
+
void NoContextGLApi::glTransformFeedbackVaryingsFn(GLuint program,
GLsizei count,
const char* const* varyings,
diff --git a/ui/gl/gl_bindings_autogen_gl.h b/ui/gl/gl_bindings_autogen_gl.h
index 0494657..d63cd28 100644
--- a/ui/gl/gl_bindings_autogen_gl.h
+++ b/ui/gl/gl_bindings_autogen_gl.h
@@ -157,6 +157,17 @@ typedef void(GL_BINDING_CALL* glCompressedTexSubImage2DProc)(GLenum target,
GLenum format,
GLsizei imageSize,
const void* data);
+typedef void(GL_BINDING_CALL* glCompressedTexSubImage3DProc)(GLenum target,
+ GLint level,
+ GLint xoffset,
+ GLint yoffset,
+ GLint zoffset,
+ GLsizei width,
+ GLsizei height,
+ GLsizei depth,
+ GLenum format,
+ GLsizei imageSize,
+ const void* data);
typedef void(GL_BINDING_CALL* glCopyBufferSubDataProc)(GLenum readTarget,
GLenum writeTarget,
GLintptr readOffset,
@@ -700,6 +711,17 @@ typedef void(GL_BINDING_CALL* glTexSubImage2DProc)(GLenum target,
GLenum format,
GLenum type,
const void* pixels);
+typedef void(GL_BINDING_CALL* glTexSubImage3DProc)(GLenum target,
+ GLint level,
+ GLint xoffset,
+ GLint yoffset,
+ GLint zoffset,
+ GLsizei width,
+ GLsizei height,
+ GLsizei depth,
+ GLenum format,
+ GLenum type,
+ const void* pixels);
typedef void(GL_BINDING_CALL* glTransformFeedbackVaryingsProc)(
GLuint program,
GLsizei count,
@@ -969,6 +991,7 @@ struct ProcsGL {
glCompressedTexImage2DProc glCompressedTexImage2DFn;
glCompressedTexImage3DProc glCompressedTexImage3DFn;
glCompressedTexSubImage2DProc glCompressedTexSubImage2DFn;
+ glCompressedTexSubImage3DProc glCompressedTexSubImage3DFn;
glCopyBufferSubDataProc glCopyBufferSubDataFn;
glCopyTexImage2DProc glCopyTexImage2DFn;
glCopyTexSubImage2DProc glCopyTexSubImage2DFn;
@@ -1160,6 +1183,7 @@ struct ProcsGL {
glTexStorage2DEXTProc glTexStorage2DEXTFn;
glTexStorage3DProc glTexStorage3DFn;
glTexSubImage2DProc glTexSubImage2DFn;
+ glTexSubImage3DProc glTexSubImage3DFn;
glTransformFeedbackVaryingsProc glTransformFeedbackVaryingsFn;
glUniform1fProc glUniform1fFn;
glUniform1fvProc glUniform1fvFn;
@@ -1357,6 +1381,17 @@ class GL_EXPORT GLApi {
GLenum format,
GLsizei imageSize,
const void* data) = 0;
+ virtual void glCompressedTexSubImage3DFn(GLenum target,
+ GLint level,
+ GLint xoffset,
+ GLint yoffset,
+ GLint zoffset,
+ GLsizei width,
+ GLsizei height,
+ GLsizei depth,
+ GLenum format,
+ GLsizei imageSize,
+ const void* data) = 0;
virtual void glCopyBufferSubDataFn(GLenum readTarget,
GLenum writeTarget,
GLintptr readOffset,
@@ -1822,6 +1857,17 @@ class GL_EXPORT GLApi {
GLenum format,
GLenum type,
const void* pixels) = 0;
+ virtual void glTexSubImage3DFn(GLenum target,
+ GLint level,
+ GLint xoffset,
+ GLint yoffset,
+ GLint zoffset,
+ GLsizei width,
+ GLsizei height,
+ GLsizei depth,
+ GLenum format,
+ GLenum type,
+ const void* pixels) = 0;
virtual void glTransformFeedbackVaryingsFn(GLuint program,
GLsizei count,
const char* const* varyings,
@@ -2038,6 +2084,8 @@ class GL_EXPORT GLApi {
::gfx::g_current_gl_context->glCompressedTexImage3DFn
#define glCompressedTexSubImage2D \
::gfx::g_current_gl_context->glCompressedTexSubImage2DFn
+#define glCompressedTexSubImage3D \
+ ::gfx::g_current_gl_context->glCompressedTexSubImage3DFn
#define glCopyBufferSubData ::gfx::g_current_gl_context->glCopyBufferSubDataFn
#define glCopyTexImage2D ::gfx::g_current_gl_context->glCopyTexImage2DFn
#define glCopyTexSubImage2D ::gfx::g_current_gl_context->glCopyTexSubImage2DFn
@@ -2279,6 +2327,7 @@ class GL_EXPORT GLApi {
#define glTexStorage2DEXT ::gfx::g_current_gl_context->glTexStorage2DEXTFn
#define glTexStorage3D ::gfx::g_current_gl_context->glTexStorage3DFn
#define glTexSubImage2D ::gfx::g_current_gl_context->glTexSubImage2DFn
+#define glTexSubImage3D ::gfx::g_current_gl_context->glTexSubImage3DFn
#define glTransformFeedbackVaryings \
::gfx::g_current_gl_context->glTransformFeedbackVaryingsFn
#define glUniform1f ::gfx::g_current_gl_context->glUniform1fFn
diff --git a/ui/gl/gl_bindings_autogen_mock.cc b/ui/gl/gl_bindings_autogen_mock.cc
index 717198f..f724229 100644
--- a/ui/gl/gl_bindings_autogen_mock.cc
+++ b/ui/gl/gl_bindings_autogen_mock.cc
@@ -406,6 +406,24 @@ MockGLInterface::Mock_glCompressedTexSubImage2D(GLenum target,
}
void GL_BINDING_CALL
+MockGLInterface::Mock_glCompressedTexSubImage3D(GLenum target,
+ GLint level,
+ GLint xoffset,
+ GLint yoffset,
+ GLint zoffset,
+ GLsizei width,
+ GLsizei height,
+ GLsizei depth,
+ GLenum format,
+ GLsizei imageSize,
+ const void* data) {
+ MakeFunctionUnique("glCompressedTexSubImage3D");
+ interface_->CompressedTexSubImage3D(target, level, xoffset, yoffset, zoffset,
+ width, height, depth, format, imageSize,
+ data);
+}
+
+void GL_BINDING_CALL
MockGLInterface::Mock_glCopyBufferSubData(GLenum readTarget,
GLenum writeTarget,
GLintptr readOffset,
@@ -2113,6 +2131,22 @@ void GL_BINDING_CALL MockGLInterface::Mock_glTexSubImage2D(GLenum target,
format, type, pixels);
}
+void GL_BINDING_CALL MockGLInterface::Mock_glTexSubImage3D(GLenum target,
+ GLint level,
+ GLint xoffset,
+ GLint yoffset,
+ GLint zoffset,
+ GLsizei width,
+ GLsizei height,
+ GLsizei depth,
+ GLenum format,
+ GLenum type,
+ const void* pixels) {
+ MakeFunctionUnique("glTexSubImage3D");
+ interface_->TexSubImage3D(target, level, xoffset, yoffset, zoffset, width,
+ height, depth, format, type, pixels);
+}
+
void GL_BINDING_CALL
MockGLInterface::Mock_glTransformFeedbackVaryings(GLuint program,
GLsizei count,
@@ -2646,6 +2680,8 @@ void* GL_BINDING_CALL MockGLInterface::GetGLProcAddress(const char* name) {
return reinterpret_cast<void*>(Mock_glCompressedTexImage3D);
if (strcmp(name, "glCompressedTexSubImage2D") == 0)
return reinterpret_cast<void*>(Mock_glCompressedTexSubImage2D);
+ if (strcmp(name, "glCompressedTexSubImage3D") == 0)
+ return reinterpret_cast<void*>(Mock_glCompressedTexSubImage3D);
if (strcmp(name, "glCopyBufferSubData") == 0)
return reinterpret_cast<void*>(Mock_glCopyBufferSubData);
if (strcmp(name, "glCopyTexImage2D") == 0)
@@ -3117,6 +3153,8 @@ void* GL_BINDING_CALL MockGLInterface::GetGLProcAddress(const char* name) {
return reinterpret_cast<void*>(Mock_glTexStorage3D);
if (strcmp(name, "glTexSubImage2D") == 0)
return reinterpret_cast<void*>(Mock_glTexSubImage2D);
+ if (strcmp(name, "glTexSubImage3D") == 0)
+ return reinterpret_cast<void*>(Mock_glTexSubImage3D);
if (strcmp(name, "glTransformFeedbackVaryings") == 0)
return reinterpret_cast<void*>(Mock_glTransformFeedbackVaryings);
if (strcmp(name, "glUniform1f") == 0)
diff --git a/ui/gl/gl_bindings_autogen_mock.h b/ui/gl/gl_bindings_autogen_mock.h
index 54c8993..befe235 100644
--- a/ui/gl/gl_bindings_autogen_mock.h
+++ b/ui/gl/gl_bindings_autogen_mock.h
@@ -148,6 +148,17 @@ static void GL_BINDING_CALL Mock_glCompressedTexSubImage2D(GLenum target,
GLenum format,
GLsizei imageSize,
const void* data);
+static void GL_BINDING_CALL Mock_glCompressedTexSubImage3D(GLenum target,
+ GLint level,
+ GLint xoffset,
+ GLint yoffset,
+ GLint zoffset,
+ GLsizei width,
+ GLsizei height,
+ GLsizei depth,
+ GLenum format,
+ GLsizei imageSize,
+ const void* data);
static void GL_BINDING_CALL Mock_glCopyBufferSubData(GLenum readTarget,
GLenum writeTarget,
GLintptr readOffset,
@@ -747,6 +758,17 @@ static void GL_BINDING_CALL Mock_glTexSubImage2D(GLenum target,
GLenum format,
GLenum type,
const void* pixels);
+static void GL_BINDING_CALL Mock_glTexSubImage3D(GLenum target,
+ GLint level,
+ GLint xoffset,
+ GLint yoffset,
+ GLint zoffset,
+ GLsizei width,
+ GLsizei height,
+ GLsizei depth,
+ GLenum format,
+ GLenum type,
+ const void* pixels);
static void GL_BINDING_CALL
Mock_glTransformFeedbackVaryings(GLuint program,
GLsizei count,
diff --git a/ui/gl/gl_mock.h b/ui/gl/gl_mock.h
index b678a5e..2a375e6 100644
--- a/ui/gl/gl_mock.h
+++ b/ui/gl/gl_mock.h
@@ -33,6 +33,23 @@ class MockGLInterface {
// Member functions
#include "gl_mock_autogen_gl.h"
+ // TODO(zmo): crbug.com/456340
+ // Functions that cannot be mocked because they have more than 10 args.
+ void CompressedTexSubImage3D(
+ GLenum /*target*/, GLint /*level*/, GLint /*xoffset*/, GLint /*yoffset*/,
+ GLint /*zoffset*/, GLsizei /*width*/, GLsizei /*height*/,
+ GLsizei /*depth*/, GLenum /*format*/, GLsizei /*imageSize*/,
+ const void* /*data*/) {
+ NOTREACHED();
+ }
+ void TexSubImage3D(
+ GLenum /*target*/, GLint /*level*/, GLint /*xoffset*/, GLint /*yoffset*/,
+ GLint /*zoffset*/, GLsizei /*width*/, GLsizei /*height*/,
+ GLsizei /*depth*/, GLenum /*format*/, GLenum /*type*/,
+ const void* /*pixels*/) {
+ NOTREACHED();
+ }
+
private:
static MockGLInterface* interface_;
diff --git a/ui/gl/gl_mock_autogen_gl.h b/ui/gl/gl_mock_autogen_gl.h
index d4f3c12..7aa5706 100644
--- a/ui/gl/gl_mock_autogen_gl.h
+++ b/ui/gl/gl_mock_autogen_gl.h
@@ -132,6 +132,8 @@ MOCK_METHOD9(CompressedTexSubImage2D,
GLenum format,
GLsizei imageSize,
const void* data));
+// TODO(zmo): crbug.com/456340
+// glCompressedTexSubImage3D cannot be mocked because it has 11 args
MOCK_METHOD5(CopyBufferSubData,
void(GLenum readTarget,
GLenum writeTarget,
@@ -586,6 +588,8 @@ MOCK_METHOD9(TexSubImage2D,
GLenum format,
GLenum type,
const void* pixels));
+// TODO(zmo): crbug.com/456340
+// glTexSubImage3D cannot be mocked because it has 11 args
MOCK_METHOD4(TransformFeedbackVaryings,
void(GLuint program,
GLsizei count,