summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorjbauman@chromium.org <jbauman@chromium.org@0039d316-1c4b-4281-b951-d872f2087c98>2012-02-26 19:05:20 +0000
committerjbauman@chromium.org <jbauman@chromium.org@0039d316-1c4b-4281-b951-d872f2087c98>2012-02-26 19:05:20 +0000
commit94653576aefb53eb73c86e67f4044c4d1bf01221 (patch)
treefa14971f3b30742b05946ab0346c63736fac8168
parent6965d7dcbce91c55c492ff34983a8a3a35f14740 (diff)
downloadchromium_src-94653576aefb53eb73c86e67f4044c4d1bf01221.zip
chromium_src-94653576aefb53eb73c86e67f4044c4d1bf01221.tar.gz
chromium_src-94653576aefb53eb73c86e67f4044c4d1bf01221.tar.bz2
Revert 123696 - Add Pepper support for several GL extensions
Add support to the command buffer code generator to generate multiple pepper interfaces, and use that to generate interfaces for ANGLE_instanced_arrays, ANGLE_framebuffer_blit, ANGLE_framebuffer_multisample, CHROMIUM_enable_feature, and CHROMIUM_map_sub. BUG=93148 TEST= Review URL: https://chromiumcodereview.appspot.com/9420017 TBR=jbauman@chromium.org Review URL: https://chromiumcodereview.appspot.com/9466042 git-svn-id: svn://svn.chromium.org/chrome/trunk/src@123697 0039d316-1c4b-4281-b951-d872f2087c98
-rwxr-xr-xgpu/command_buffer/build_gles2_cmd_buffer.py225
-rw-r--r--ppapi/c/dev/ppb_gles_chromium_texture_mapping_dev.h47
-rw-r--r--ppapi/c/dev/ppb_opengles2ext_dev.h82
-rw-r--r--ppapi/lib/gl/gles2/gl2ext_ppapi.c58
-rw-r--r--ppapi/lib/gl/gles2/gl2ext_ppapi.h13
-rw-r--r--ppapi/lib/gl/gles2/gles2.c94
-rw-r--r--ppapi/native_client/src/shared/ppapi_proxy/browser_globals.cc8
-rw-r--r--ppapi/native_client/src/shared/ppapi_proxy/plugin_opengles.cc101
-rw-r--r--ppapi/native_client/src/shared/ppapi_proxy/plugin_ppb.cc17
-rw-r--r--ppapi/native_client/src/shared/ppapi_proxy/plugin_ppb_graphics_3d.h11
-rw-r--r--ppapi/ppapi_shared.gypi1
-rw-r--r--ppapi/proxy/interface_list.cc12
-rw-r--r--ppapi/shared_impl/ppb_graphics_3d_shared.cc17
-rw-r--r--ppapi/shared_impl/ppb_graphics_3d_shared.h10
-rw-r--r--ppapi/shared_impl/ppb_opengles2_shared.cc396
-rw-r--r--ppapi/shared_impl/ppb_opengles2_shared.h10
-rw-r--r--ppapi/thunk/interfaces_ppb_public_dev.h3
-rw-r--r--ppapi/thunk/ppb_gles_chromium_texture_mapping_thunk.cc55
-rw-r--r--ppapi/thunk/ppb_graphics_3d_api.h13
-rw-r--r--webkit/plugins/ppapi/plugin_module.cc12
20 files changed, 359 insertions, 826 deletions
diff --git a/gpu/command_buffer/build_gles2_cmd_buffer.py b/gpu/command_buffer/build_gles2_cmd_buffer.py
index ca2c747..d092034 100755
--- a/gpu/command_buffer/build_gles2_cmd_buffer.py
+++ b/gpu/command_buffer/build_gles2_cmd_buffer.py
@@ -731,17 +731,6 @@ _ENUM_LISTS = {
},
}
-# This table specifies the different pepper interfaces that are supported for
-# GL commands. 'dev' is true if it's a dev interface.
-_PEPPER_INTERFACES = [
- {'name': '', 'dev': False},
- {'name': 'InstancedArrays', 'dev': True},
- {'name': 'FramebufferBlit', 'dev': True},
- {'name': 'FramebufferMultisample', 'dev': True},
- {'name': 'ChromiumEnableFeature', 'dev': True},
- {'name': 'ChromiumMapSub', 'dev': True},
-]
-
# This table specifies types and other special data for the commands that
# will be generated.
#
@@ -774,7 +763,6 @@ _PEPPER_INTERFACES = [
# bind function.
# valid_args: A dictionary of argument indices to args to use in unit tests
# when they can not be automatically determined.
-# pepper_interface: The pepper interface that is used for this extension
_FUNCTION_INFO = {
'ActiveTexture': {
@@ -811,7 +799,6 @@ _FUNCTION_INFO = {
'decoder_func': 'DoBlitFramebufferEXT',
'unit_test': False,
'extension': True,
- 'pepper_interface': 'FramebufferBlit',
},
'BufferData': {
'type': 'Manual',
@@ -847,7 +834,6 @@ _FUNCTION_INFO = {
'result': ['GLint'],
'extension': True,
'chromium': True,
- 'pepper_interface': 'ChromiumEnableFeature',
},
'CompileShader': {'decoder_func': 'DoCompileShader', 'unit_test': False},
'CompressedTexImage2D': {
@@ -1201,14 +1187,12 @@ _FUNCTION_INFO = {
'extension': True,
'chromium': True,
'client_test': False,
- 'pepper_interface': 'ChromiumMapSub',
},
'MapTexSubImage2DCHROMIUM': {
'gen_cmd': False,
'extension': True,
'chromium': True,
'client_test': False,
- 'pepper_interface': 'ChromiumMapSub',
},
'PixelStorei': {'type': 'Manual'},
'PostSubBufferCHROMIUM': {
@@ -1230,7 +1214,6 @@ _FUNCTION_INFO = {
'expectation': False,
'unit_test': False,
'extension': True,
- 'pepper_interface': 'FramebufferMultisample',
},
'ReadPixels': {
'cmd_comment':
@@ -1407,14 +1390,12 @@ _FUNCTION_INFO = {
'extension': True,
'chromium': True,
'client_test': False,
- 'pepper_interface': 'ChromiumMapSub',
- },
+ },
'UnmapTexSubImage2DCHROMIUM': {
'gen_cmd': False,
'extension': True,
'chromium': True,
'client_test': False,
- 'pepper_interface': 'ChromiumMapSub',
},
'UseProgram': {'decoder_func': 'DoUseProgram', 'unit_test': False},
'ValidateProgram': {'decoder_func': 'DoValidateProgram'},
@@ -1518,7 +1499,6 @@ _FUNCTION_INFO = {
'GLsizei primcount',
'extension': True,
'unit_test': False,
- 'pepper_interface': 'InstancedArrays',
},
'DrawElementsInstancedANGLE': {
'type': 'Manual',
@@ -1527,14 +1507,12 @@ _FUNCTION_INFO = {
'extension': True,
'unit_test': False,
'client_test': False,
- 'pepper_interface': 'InstancedArrays',
},
'VertexAttribDivisorANGLE': {
'type': 'Manual',
'cmd_args': 'GLuint index, GLuint divisor',
'extension': True,
'unit_test': False,
- 'pepper_interface': 'InstancedArrays',
},
}
@@ -1625,18 +1603,6 @@ class CWriter(object):
while not done:
splitter = string[0:end].rfind(',')
if splitter < 0 or (splitter > 0 and string[splitter - 1] == '"'):
- if last_splitter == -1:
- break
- return last_splitter
- elif splitter >= 80:
- end = splitter
- else:
- return splitter
- end = len(string)
- last_splitter = -1
- while not done:
- splitter = string[0:end].rfind(' ')
- if splitter < 0 or (splitter > 0 and string[splitter - 1] == '"'):
return last_splitter
elif splitter >= 80:
end = splitter
@@ -1649,15 +1615,10 @@ class CWriter(object):
i = self.__FindSplit(line)
if i > 0:
line1 = line[0:i + 1]
- if line1[-1] == ' ':
- line1 = line1[:-1]
- lineend = ''
- if line1[0] == '#':
- lineend = ' \\'
nolint = ''
if len(line1) > 80:
nolint = ' // NOLINT'
- self.__AddLine(line1 + nolint + lineend + '\n')
+ self.__AddLine(line1 + nolint + '\n')
match = re.match("( +)", line1)
indent = ""
if match:
@@ -4987,15 +4948,6 @@ class Function(object):
def IsCoreGLFunction(self):
return not self.GetInfo('extension')
- def InPepperInterface(self, interface):
- ext = self.GetInfo('pepper_interface')
- if not interface.GetName():
- return self.IsCoreGLFunction()
- return ext == interface.GetName()
-
- def InAnyPepperExtension(self):
- return self.IsCoreGLFunction() or self.GetInfo('pepper_interface')
-
def GetGLFunctionName(self):
"""Gets the function to call to execute GL for this command."""
if self.GetInfo('decoder_func'):
@@ -5186,38 +5138,6 @@ class Function(object):
self.type_handler.WriteFormatTest(self, file)
-class PepperInterface(object):
- """A class that represents a function."""
-
- def __init__(self, info):
- self.name = info["name"]
- self.dev = info["dev"]
-
- def GetName(self):
- return self.name
-
- def GetInterfaceName(self):
- upperint = ""
- dev = ""
- if self.name:
- upperint = "_" + self.name.upper()
- if self.dev:
- dev = "_DEV"
- return "PPB_OPENGLES2%s%s_INTERFACE" % (upperint, dev)
-
- def GetInterfaceString(self):
- dev = ""
- if self.dev:
- dev = "(Dev)"
- return "PPB_OpenGLES2%s%s" % (self.name, dev)
-
- def GetStructName(self):
- dev = ""
- if self.dev:
- dev = "_Dev"
- return "PPB_OpenGLES2%s%s" % (self.name, dev)
-
-
class ImmediateFunction(Function):
"""A class that represnets an immediate function command."""
@@ -5416,8 +5336,6 @@ class GLGenerator(object):
self._function_info = {}
self._empty_type_handler = TypeHandler()
self._empty_function_info = FunctionInfo({}, self._empty_type_handler)
- self.pepper_interfaces = []
- self.interface_info = {}
self._type_handlers = {
'Bind': BindHandler(),
@@ -5446,10 +5364,6 @@ class GLGenerator(object):
type = info['type']
self._function_info[func_name] = FunctionInfo(info,
self.GetTypeHandler(type))
- for interface in _PEPPER_INTERFACES:
- interface = PepperInterface(interface)
- self.pepper_interfaces.append(interface)
- self.interface_info[interface.GetName()] = interface
def AddFunction(self, func):
"""Adds a function."""
@@ -5812,44 +5726,36 @@ const size_t GLES2Util::enum_to_string_table_len_ =
""")
file.Close()
- def WritePepperGLES2Interface(self, filename, dev):
+ def WritePepperGLES2Interface(self, filename):
"""Writes the Pepper OpenGLES interface definition."""
file = CHeaderWriter(
filename,
"// OpenGL ES interface.\n",
- 2)
+ 3)
- file.Write("#include \"ppapi/c/pp_resource.h\"\n")
- if dev:
- file.Write("#include \"ppapi/c/ppb_opengles2.h\"\n\n")
- else:
- file.Write("\n#ifndef __gl2_h_\n")
- for (k, v) in _GL_TYPES.iteritems():
- file.Write("typedef %s %s;\n" % (v, k))
- file.Write("#endif // __gl2_h_\n\n")
+ file.Write("#include \"ppapi/c/pp_resource.h\"\n\n")
+
+ file.Write("#ifndef __gl2_h_\n")
+ for (k, v) in _GL_TYPES.iteritems():
+ file.Write("typedef %s %s;\n" % (v, k))
+ file.Write("#endif // __gl2_h_\n\n")
- for interface in self.pepper_interfaces:
- if interface.dev != dev:
+ file.Write("#define PPB_OPENGLES2_INTERFACE_1_0 \"PPB_OpenGLES2;1.0\"\n")
+ file.Write("#define PPB_OPENGLES2_INTERFACE PPB_OPENGLES2_INTERFACE_1_0\n")
+
+ file.Write("\nstruct PPB_OpenGLES2 {\n")
+ for func in self.original_functions:
+ if not func.IsCoreGLFunction():
continue
- file.Write("#define %s_1_0 \"%s;1.0\"\n" %
- (interface.GetInterfaceName(), interface.GetInterfaceString()))
- file.Write("#define %s %s_1_0\n" %
- (interface.GetInterfaceName(), interface.GetInterfaceName()))
-
- file.Write("\nstruct %s {\n" % interface.GetStructName())
- for func in self.original_functions:
- if not func.InPepperInterface(interface):
- continue
-
- original_arg = func.MakeTypedOriginalArgString("")
- context_arg = "PP_Resource context"
- if len(original_arg):
- arg = context_arg + ", " + original_arg
- else:
- arg = context_arg
- file.Write(" %s (*%s)(%s);\n" % (func.return_type, func.name, arg))
- file.Write("};\n\n")
+ original_arg = func.MakeTypedOriginalArgString("")
+ context_arg = "PP_Resource context"
+ if len(original_arg):
+ arg = context_arg + ", " + original_arg
+ else:
+ arg = context_arg
+ file.Write(" %s (*%s)(%s);\n" % (func.return_type, func.name, arg))
+ file.Write("};\n\n")
file.Close()
@@ -5879,7 +5785,7 @@ const size_t GLES2Util::enum_to_string_table_len_ =
file.Write("}\n\n")
for func in self.original_functions:
- if not func.InAnyPepperExtension():
+ if not func.IsCoreGLFunction():
continue
original_arg = func.MakeTypedOriginalArgString("")
@@ -5896,23 +5802,21 @@ const size_t GLES2Util::enum_to_string_table_len_ =
func.MakeOriginalArgString("")))
file.Write("}\n\n")
- file.Write("} // namespace\n")
+ file.Write("\nconst struct PPB_OpenGLES2 ppb_opengles2 = {\n")
+ file.Write(" &")
+ file.Write(",\n &".join(
+ f.name for f in self.original_functions if f.IsCoreGLFunction()))
+ file.Write("\n")
+ file.Write("};\n\n")
- for interface in self.pepper_interfaces:
- file.Write("const %s* PPB_OpenGLES2_Shared::Get%sInterface() {\n" %
- (interface.GetStructName(), interface.GetName()))
- file.Write(" static const struct %s "
- "ppb_opengles2 = {\n" % interface.GetStructName())
- file.Write(" &")
- file.Write(",\n &".join(
- f.name for f in self.original_functions
- if f.InPepperInterface(interface)))
- file.Write("\n")
+ file.Write("} // namespace\n")
- file.Write(" };\n")
- file.Write(" return &ppb_opengles2;\n")
- file.Write("}\n")
+ file.Write("""
+const PPB_OpenGLES2* PPB_OpenGLES2_Shared::GetInterface() {
+ return &ppb_opengles2;
+}
+""")
file.Write("} // namespace ppapi\n")
file.Close()
@@ -5927,35 +5831,23 @@ const size_t GLES2Util::enum_to_string_table_len_ =
file.Write("#include \"ppapi/lib/gl/gles2/gl2ext_ppapi.h\"\n\n")
for func in self.original_functions:
- if not func.InAnyPepperExtension():
+ if not func.IsCoreGLFunction():
continue
- interface = self.interface_info[func.GetInfo('pepper_interface') or '']
-
file.Write("%s GL_APIENTRY gl%s(%s) {\n" %
(func.return_type, func.name,
func.MakeTypedOriginalArgString("")))
return_str = "" if func.return_type == "void" else "return "
- interface_str = "glGet%sInterfacePPAPI()" % interface.GetName()
+ interface_str = "glGetInterfacePPAPI()"
original_arg = func.MakeOriginalArgString("")
context_arg = "glGetCurrentContextPPAPI()"
if len(original_arg):
arg = context_arg + ", " + original_arg
else:
arg = context_arg
- if interface.GetName():
- file.Write(" const struct %s* ext = %s;\n" %
- (interface.GetStructName(), interface_str))
- file.Write(" if (ext)\n")
- file.Write(" %sext->%s(%s);\n" %
- (return_str, func.name, arg))
- if return_str:
- file.Write(" %s0;\n" % return_str)
- else:
- file.Write(" %s%s->%s(%s);\n" %
- (return_str, interface_str, func.name, arg))
+ file.Write(" %s%s->%s(%s);\n" %
+ (return_str, interface_str, func.name, arg))
file.Write("}\n\n")
- file.Close()
def WritePepperGLES2NaClProxy(self, filename):
"""Writes the Pepper OpenGLES interface implementation for NaCl."""
@@ -5967,14 +5859,15 @@ const size_t GLES2Util::enum_to_string_table_len_ =
"/plugin_ppb_graphics_3d.h\"\n\n")
file.Write("#include \"gpu/command_buffer/client/gles2_implementation.h\"")
- file.Write("\n#include \"ppapi/c/ppb_opengles2.h\"\n\n")
+ file.Write("\n#include \"native_client/src/third_party"
+ "/ppapi/c/dev/ppb_opengles_dev.h\"\n\n")
file.Write("using ppapi_proxy::PluginGraphics3D;\n")
file.Write("using ppapi_proxy::PluginResource;\n\n")
file.Write("namespace {\n\n")
for func in self.original_functions:
- if not func.InAnyPepperExtension():
+ if not func.IsCoreGLFunction():
continue
args = func.MakeTypedOriginalArgString("")
if len(args) != 0:
@@ -5993,21 +5886,17 @@ const size_t GLES2Util::enum_to_string_table_len_ =
file.Write("\n} // namespace\n\n")
- for interface in self.pepper_interfaces:
- file.Write("const %s* "
- "PluginGraphics3D::GetOpenGLES%sInterface() {\n" %
- (interface.GetStructName(), interface.GetName()))
-
- file.Write(" const static struct %s ppb_opengles = {\n" %
- interface.GetStructName())
- file.Write(" &")
- file.Write(",\n &".join(
- f.name for f in self.original_functions
- if f.InPepperInterface(interface)))
- file.Write("\n")
- file.Write(" };\n")
- file.Write(" return &ppb_opengles;\n")
- file.Write("}\n")
+ file.Write("const PPB_OpenGLES2* "
+ "PluginGraphics3D::GetOpenGLESInterface() {\n")
+
+ file.Write(" const static struct PPB_OpenGLES2 ppb_opengles = {\n")
+ file.Write(" &")
+ file.Write(",\n &".join(
+ f.name for f in self.original_functions if f.IsCoreGLFunction()))
+ file.Write("\n")
+ file.Write(" };\n")
+ file.Write(" return &ppb_opengles;\n")
+ file.Write("}\n")
file.Close()
@@ -6047,8 +5936,7 @@ def main(argv):
if options.alternate_mode == "ppapi":
# To trigger this action, do "make ppapi_gles_bindings"
os.chdir("ppapi");
- gen.WritePepperGLES2Interface("c/ppb_opengles2.h", False)
- gen.WritePepperGLES2Interface("c/dev/ppb_opengles2ext_dev.h", True)
+ gen.WritePepperGLES2Interface("c/ppb_opengles2.h")
gen.WriteGLES2ToPPAPIBridge("lib/gl/gles2/gles2.c")
elif options.alternate_mode == "chrome_ppapi":
@@ -6057,7 +5945,6 @@ def main(argv):
"ppapi/shared_impl/ppb_opengles2_shared.cc")
elif options.alternate_mode == "nacl_ppapi":
- os.chdir("ppapi")
gen.WritePepperGLES2NaClProxy(
"native_client/src/shared/ppapi_proxy/plugin_opengles.cc")
diff --git a/ppapi/c/dev/ppb_gles_chromium_texture_mapping_dev.h b/ppapi/c/dev/ppb_gles_chromium_texture_mapping_dev.h
new file mode 100644
index 0000000..8ad0093
--- /dev/null
+++ b/ppapi/c/dev/ppb_gles_chromium_texture_mapping_dev.h
@@ -0,0 +1,47 @@
+// Copyright (c) 2012 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 PPAPI_C_DEV_PPB_GLES_CHROMIUM_TEXTURE_MAPPING_DEV_H_
+#define PPAPI_C_DEV_PPB_GLES_CHROMIUM_TEXTURE_MAPPING_DEV_H_
+
+#include "ppapi/c/pp_resource.h"
+#include "ppapi/c/ppb_opengles2.h"
+
+#define PPB_GLES_CHROMIUM_TEXTURE_MAPPING_DEV_INTERFACE_0_1 \
+ "PPB_GLESChromiumTextureMapping(Dev);0.1"
+#define PPB_GLES_CHROMIUM_TEXTURE_MAPPING_DEV_INTERFACE \
+ PPB_GLES_CHROMIUM_TEXTURE_MAPPING_DEV_INTERFACE_0_1
+
+struct PPB_GLESChromiumTextureMapping_Dev_0_1 {
+ // Maps the sub-image of a texture. 'level', 'xoffset', 'yoffset', 'width',
+ // 'height', 'format' and 'type' correspond to the similarly named parameters
+ // of TexSubImage2D, and define the sub-image region, as well as the format of
+ // the data. 'access' must be one of GL_READ_ONLY, GL_WRITE_ONLY or
+ // GL_READ_WRITE. If READ is included, the returned buffer will contain the
+ // pixel data for the sub-image. If WRITE is included, the pixel data for the
+ // sub-image will be updated to the contents of the buffer when
+ // UnmapTexSubImage2DCHROMIUM is called. NOTE: for a GL_WRITE_ONLY map, it
+ // means that all the values of the buffer must be written.
+ void* (*MapTexSubImage2DCHROMIUM)(
+ PP_Resource context,
+ GLenum target,
+ GLint level,
+ GLint xoffset,
+ GLint yoffset,
+ GLsizei width,
+ GLsizei height,
+ GLenum format,
+ GLenum type,
+ GLenum access);
+
+ // Unmaps the sub-image of a texture. If the sub-image was mapped with one of
+ // the WRITE accesses, the pixels are updated at this time to the contents of
+ // the buffer. 'mem' must be the pointer returned by MapTexSubImage2DCHROMIUM.
+ void (*UnmapTexSubImage2DCHROMIUM)(PP_Resource context, const void* mem);
+};
+
+typedef struct PPB_GLESChromiumTextureMapping_Dev_0_1
+ PPB_GLESChromiumTextureMapping_Dev;
+
+#endif // PPAPI_C_DEV_PPB_GLES_CHROMIUM_TEXTURE_MAPPING_DEV_H_
diff --git a/ppapi/c/dev/ppb_opengles2ext_dev.h b/ppapi/c/dev/ppb_opengles2ext_dev.h
deleted file mode 100644
index 2aa172f..0000000
--- a/ppapi/c/dev/ppb_opengles2ext_dev.h
+++ /dev/null
@@ -1,82 +0,0 @@
-// Copyright (c) 2012 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.
-
-// This file is auto-generated from
-// gpu/command_buffer/build_gles2_cmd_buffer.py
-// DO NOT EDIT!
-
-// OpenGL ES interface.
-#ifndef C_DEV_PPB_OPENGLES2EXT_DEV_H_
-#define C_DEV_PPB_OPENGLES2EXT_DEV_H_
-
-#include "ppapi/c/pp_resource.h"
-#include "ppapi/c/ppb_opengles2.h"
-
-#define PPB_OPENGLES2_INSTANCEDARRAYS_DEV_INTERFACE_1_0 \
- "PPB_OpenGLES2InstancedArrays(Dev);1.0"
-#define PPB_OPENGLES2_INSTANCEDARRAYS_DEV_INTERFACE \
- PPB_OPENGLES2_INSTANCEDARRAYS_DEV_INTERFACE_1_0
-
-struct PPB_OpenGLES2InstancedArrays_Dev {
- void (*DrawArraysInstancedANGLE)(
- PP_Resource context, GLenum mode, GLint first, GLsizei count,
- GLsizei primcount);
- void (*DrawElementsInstancedANGLE)(
- PP_Resource context, GLenum mode, GLsizei count, GLenum type,
- const void* indices, GLsizei primcount);
- void (*VertexAttribDivisorANGLE)(
- PP_Resource context, GLuint index, GLuint divisor);
-};
-
-#define PPB_OPENGLES2_FRAMEBUFFERBLIT_DEV_INTERFACE_1_0 \
- "PPB_OpenGLES2FramebufferBlit(Dev);1.0"
-#define PPB_OPENGLES2_FRAMEBUFFERBLIT_DEV_INTERFACE \
- PPB_OPENGLES2_FRAMEBUFFERBLIT_DEV_INTERFACE_1_0
-
-struct PPB_OpenGLES2FramebufferBlit_Dev {
- void (*BlitFramebufferEXT)(
- PP_Resource context, GLint srcX0, GLint srcY0, GLint srcX1, GLint srcY1,
- GLint dstX0, GLint dstY0, GLint dstX1, GLint dstY1, GLbitfield mask,
- GLenum filter);
-};
-
-#define PPB_OPENGLES2_FRAMEBUFFERMULTISAMPLE_DEV_INTERFACE_1_0 \
- "PPB_OpenGLES2FramebufferMultisample(Dev);1.0"
-#define PPB_OPENGLES2_FRAMEBUFFERMULTISAMPLE_DEV_INTERFACE \
- PPB_OPENGLES2_FRAMEBUFFERMULTISAMPLE_DEV_INTERFACE_1_0
-
-struct PPB_OpenGLES2FramebufferMultisample_Dev {
- void (*RenderbufferStorageMultisampleEXT)(
- PP_Resource context, GLenum target, GLsizei samples,
- GLenum internalformat, GLsizei width, GLsizei height);
-};
-
-#define PPB_OPENGLES2_CHROMIUMENABLEFEATURE_DEV_INTERFACE_1_0 \
- "PPB_OpenGLES2ChromiumEnableFeature(Dev);1.0"
-#define PPB_OPENGLES2_CHROMIUMENABLEFEATURE_DEV_INTERFACE \
- PPB_OPENGLES2_CHROMIUMENABLEFEATURE_DEV_INTERFACE_1_0
-
-struct PPB_OpenGLES2ChromiumEnableFeature_Dev {
- GLboolean (*EnableFeatureCHROMIUM)(PP_Resource context, const char* feature);
-};
-
-#define PPB_OPENGLES2_CHROMIUMMAPSUB_DEV_INTERFACE_1_0 \
- "PPB_OpenGLES2ChromiumMapSub(Dev);1.0"
-#define PPB_OPENGLES2_CHROMIUMMAPSUB_DEV_INTERFACE \
- PPB_OPENGLES2_CHROMIUMMAPSUB_DEV_INTERFACE_1_0
-
-struct PPB_OpenGLES2ChromiumMapSub_Dev {
- void* (*MapBufferSubDataCHROMIUM)(
- PP_Resource context, GLuint target, GLintptr offset, GLsizeiptr size,
- GLenum access);
- void (*UnmapBufferSubDataCHROMIUM)(PP_Resource context, const void* mem);
- void* (*MapTexSubImage2DCHROMIUM)(
- PP_Resource context, GLenum target, GLint level, GLint xoffset,
- GLint yoffset, GLsizei width, GLsizei height, GLenum format, GLenum type,
- GLenum access);
- void (*UnmapTexSubImage2DCHROMIUM)(PP_Resource context, const void* mem);
-};
-
-#endif // C_DEV_PPB_OPENGLES2EXT_DEV_H_
-
diff --git a/ppapi/lib/gl/gles2/gl2ext_ppapi.c b/ppapi/lib/gl/gles2/gl2ext_ppapi.c
index 6bdc09d..62d842d 100644
--- a/ppapi/lib/gl/gles2/gl2ext_ppapi.c
+++ b/ppapi/lib/gl/gles2/gl2ext_ppapi.c
@@ -1,4 +1,4 @@
-// Copyright (c) 2012 The Chromium Authors. All rights reserved.
+// 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.
@@ -26,16 +26,6 @@
// TODO(alokp): This will need to be thread-safe if we build gles2 as a
// shared library.
static const struct PPB_OpenGLES2* g_gles2_interface = NULL;
-static const struct PPB_OpenGLES2InstancedArrays_Dev*
- g_gles2_instanced_arrays_interface = NULL;
-static const struct PPB_OpenGLES2FramebufferBlit_Dev*
- g_gles2_framebuffer_blit_interface = NULL;
-static const struct PPB_OpenGLES2FramebufferMultisample_Dev*
- g_gles2_framebuffer_multisample_interface = NULL;
-static const struct PPB_OpenGLES2ChromiumEnableFeature_Dev*
- g_gles2_chromium_enable_feature_interface = NULL;
-static const struct PPB_OpenGLES2ChromiumMapSub_Dev*
- g_gles2_chromium_map_sub_interface = NULL;
// TODO(alokp): Make sure PP_TLS works on all supported platforms.
static PP_TLS PP_Resource g_current_context = 0;
@@ -45,28 +35,6 @@ GLboolean GL_APIENTRY glInitializePPAPI(
if (!g_gles2_interface) {
g_gles2_interface = get_browser_interface(PPB_OPENGLES2_INTERFACE);
}
- if (!g_gles2_instanced_arrays_interface) {
- g_gles2_instanced_arrays_interface =
- get_browser_interface(PPB_OPENGLES2_INSTANCEDARRAYS_DEV_INTERFACE);
- }
- if (!g_gles2_framebuffer_blit_interface) {
- g_gles2_framebuffer_blit_interface =
- get_browser_interface(PPB_OPENGLES2_FRAMEBUFFERBLIT_DEV_INTERFACE);
- }
- if (!g_gles2_framebuffer_multisample_interface) {
- g_gles2_framebuffer_multisample_interface =
- get_browser_interface(
- PPB_OPENGLES2_FRAMEBUFFERMULTISAMPLE_DEV_INTERFACE);
- }
- if (!g_gles2_chromium_enable_feature_interface) {
- g_gles2_chromium_enable_feature_interface =
- get_browser_interface(
- PPB_OPENGLES2_CHROMIUMENABLEFEATURE_DEV_INTERFACE);
- }
- if (!g_gles2_chromium_map_sub_interface) {
- g_gles2_chromium_map_sub_interface =
- get_browser_interface(PPB_OPENGLES2_CHROMIUMMAPSUB_DEV_INTERFACE);
- }
return g_gles2_interface ? GL_TRUE : GL_FALSE;
}
@@ -87,27 +55,3 @@ const struct PPB_OpenGLES2* GL_APIENTRY glGetInterfacePPAPI() {
return g_gles2_interface;
}
-const struct PPB_OpenGLES2InstancedArrays_Dev* GL_APIENTRY
- glGetInstancedArraysInterfacePPAPI() {
- return g_gles2_instanced_arrays_interface;
-}
-
-const struct PPB_OpenGLES2FramebufferBlit_Dev* GL_APIENTRY
- glGetFramebufferBlitInterfacePPAPI() {
- return g_gles2_framebuffer_blit_interface;
-}
-
-const struct PPB_OpenGLES2FramebufferMultisample_Dev* GL_APIENTRY
- glGetFramebufferMultisampleInterfacePPAPI() {
- return g_gles2_framebuffer_multisample_interface;
-}
-
-const struct PPB_OpenGLES2ChromiumEnableFeature_Dev* GL_APIENTRY
- glGetChromiumEnableFeatureInterfacePPAPI() {
- return g_gles2_chromium_enable_feature_interface;
-}
-
-const struct PPB_OpenGLES2ChromiumMapSub_Dev* GL_APIENTRY
- glGetChromiumMapSubInterfacePPAPI() {
- return g_gles2_chromium_map_sub_interface;
-}
diff --git a/ppapi/lib/gl/gles2/gl2ext_ppapi.h b/ppapi/lib/gl/gles2/gl2ext_ppapi.h
index d33814e..fcfabd8 100644
--- a/ppapi/lib/gl/gles2/gl2ext_ppapi.h
+++ b/ppapi/lib/gl/gles2/gl2ext_ppapi.h
@@ -1,4 +1,4 @@
-// Copyright (c) 2012 The Chromium Authors. All rights reserved.
+// 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.
@@ -12,7 +12,6 @@
#include "ppapi/c/pp_resource.h"
#include "ppapi/c/ppb.h"
#include "ppapi/c/ppb_opengles2.h"
-#include "ppapi/c/dev/ppb_opengles2ext_dev.h"
#ifdef __cplusplus
extern "C" {
@@ -37,16 +36,6 @@ GL_APICALL PP_Resource GL_APIENTRY glGetCurrentContextPPAPI();
// Returns OpenGL ES 2.0 interface.
GL_APICALL const struct PPB_OpenGLES2* GL_APIENTRY glGetInterfacePPAPI();
-GL_APICALL const struct PPB_OpenGLES2InstancedArrays_Dev* GL_APIENTRY
- glGetInstancedArraysInterfacePPAPI();
-GL_APICALL const struct PPB_OpenGLES2FramebufferBlit_Dev* GL_APIENTRY
- glGetFramebufferBlitInterfacePPAPI();
-GL_APICALL const struct PPB_OpenGLES2FramebufferMultisample_Dev* GL_APIENTRY
- glGetFramebufferMultisampleInterfacePPAPI();
-GL_APICALL const struct PPB_OpenGLES2ChromiumEnableFeature_Dev* GL_APIENTRY
- glGetChromiumEnableFeatureInterfacePPAPI();
-GL_APICALL const struct PPB_OpenGLES2ChromiumMapSub_Dev* GL_APIENTRY
- glGetChromiumMapSubInterfacePPAPI();
#ifdef __cplusplus
}
diff --git a/ppapi/lib/gl/gles2/gles2.c b/ppapi/lib/gl/gles2/gles2.c
index f0ae66f..8dba474 100644
--- a/ppapi/lib/gl/gles2/gles2.c
+++ b/ppapi/lib/gl/gles2/gles2.c
@@ -1,4 +1,4 @@
-// Copyright (c) 2012 The Chromium Authors. All rights reserved.
+// 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.
@@ -753,95 +753,3 @@ void GL_APIENTRY glViewport(GLint x, GLint y, GLsizei width, GLsizei height) {
glGetCurrentContextPPAPI(), x, y, width, height);
}
-void GL_APIENTRY glBlitFramebufferEXT(
- GLint srcX0, GLint srcY0, GLint srcX1, GLint srcY1, GLint dstX0,
- GLint dstY0, GLint dstX1, GLint dstY1, GLbitfield mask, GLenum filter) {
- const struct PPB_OpenGLES2FramebufferBlit_Dev* ext =
- glGetFramebufferBlitInterfacePPAPI();
- if (ext)
- ext->BlitFramebufferEXT(
- glGetCurrentContextPPAPI(), srcX0, srcY0, srcX1, srcY1, dstX0, dstY0,
- dstX1, dstY1, mask, filter);
-}
-
-void GL_APIENTRY glRenderbufferStorageMultisampleEXT(
- GLenum target, GLsizei samples, GLenum internalformat, GLsizei width,
- GLsizei height) {
- const struct PPB_OpenGLES2FramebufferMultisample_Dev* ext =
- glGetFramebufferMultisampleInterfacePPAPI();
- if (ext)
- ext->RenderbufferStorageMultisampleEXT(
- glGetCurrentContextPPAPI(), target, samples, internalformat, width,
- height);
-}
-
-GLboolean GL_APIENTRY glEnableFeatureCHROMIUM(const char* feature) {
- const struct PPB_OpenGLES2ChromiumEnableFeature_Dev* ext =
- glGetChromiumEnableFeatureInterfacePPAPI();
- if (ext)
- return ext->EnableFeatureCHROMIUM(glGetCurrentContextPPAPI(), feature);
- return 0;
-}
-
-void* GL_APIENTRY glMapBufferSubDataCHROMIUM(
- GLuint target, GLintptr offset, GLsizeiptr size, GLenum access) {
- const struct PPB_OpenGLES2ChromiumMapSub_Dev* ext =
- glGetChromiumMapSubInterfacePPAPI();
- if (ext)
- return ext->MapBufferSubDataCHROMIUM(
- glGetCurrentContextPPAPI(), target, offset, size, access);
- return 0;
-}
-
-void GL_APIENTRY glUnmapBufferSubDataCHROMIUM(const void* mem) {
- const struct PPB_OpenGLES2ChromiumMapSub_Dev* ext =
- glGetChromiumMapSubInterfacePPAPI();
- if (ext)
- ext->UnmapBufferSubDataCHROMIUM(glGetCurrentContextPPAPI(), mem);
-}
-
-void* GL_APIENTRY glMapTexSubImage2DCHROMIUM(
- GLenum target, GLint level, GLint xoffset, GLint yoffset, GLsizei width,
- GLsizei height, GLenum format, GLenum type, GLenum access) {
- const struct PPB_OpenGLES2ChromiumMapSub_Dev* ext =
- glGetChromiumMapSubInterfacePPAPI();
- if (ext)
- return ext->MapTexSubImage2DCHROMIUM(
- glGetCurrentContextPPAPI(), target, level, xoffset, yoffset, width,
- height, format, type, access);
- return 0;
-}
-
-void GL_APIENTRY glUnmapTexSubImage2DCHROMIUM(const void* mem) {
- const struct PPB_OpenGLES2ChromiumMapSub_Dev* ext =
- glGetChromiumMapSubInterfacePPAPI();
- if (ext)
- ext->UnmapTexSubImage2DCHROMIUM(glGetCurrentContextPPAPI(), mem);
-}
-
-void GL_APIENTRY glDrawArraysInstancedANGLE(
- GLenum mode, GLint first, GLsizei count, GLsizei primcount) {
- const struct PPB_OpenGLES2InstancedArrays_Dev* ext =
- glGetInstancedArraysInterfacePPAPI();
- if (ext)
- ext->DrawArraysInstancedANGLE(
- glGetCurrentContextPPAPI(), mode, first, count, primcount);
-}
-
-void GL_APIENTRY glDrawElementsInstancedANGLE(
- GLenum mode, GLsizei count, GLenum type, const void* indices,
- GLsizei primcount) {
- const struct PPB_OpenGLES2InstancedArrays_Dev* ext =
- glGetInstancedArraysInterfacePPAPI();
- if (ext)
- ext->DrawElementsInstancedANGLE(
- glGetCurrentContextPPAPI(), mode, count, type, indices, primcount);
-}
-
-void GL_APIENTRY glVertexAttribDivisorANGLE(GLuint index, GLuint divisor) {
- const struct PPB_OpenGLES2InstancedArrays_Dev* ext =
- glGetInstancedArraysInterfacePPAPI();
- if (ext)
- ext->VertexAttribDivisorANGLE(glGetCurrentContextPPAPI(), index, divisor);
-}
-
diff --git a/ppapi/native_client/src/shared/ppapi_proxy/browser_globals.cc b/ppapi/native_client/src/shared/ppapi_proxy/browser_globals.cc
index 712b83a..9eb4215bd 100644
--- a/ppapi/native_client/src/shared/ppapi_proxy/browser_globals.cc
+++ b/ppapi/native_client/src/shared/ppapi_proxy/browser_globals.cc
@@ -17,8 +17,8 @@
#include "native_client/src/shared/ppapi_proxy/utility.h"
#include "native_client/src/shared/srpc/nacl_srpc.h"
#include "native_client/src/trusted/plugin/plugin.h"
+#include "ppapi/c/dev/ppb_gles_chromium_texture_mapping_dev.h"
#include "ppapi/c/dev/ppb_layer_compositor_dev.h"
-#include "ppapi/c/dev/ppb_opengles2ext_dev.h"
#include "ppapi/c/ppb_graphics_3d.h"
#include "ppapi/c/ppb_opengles2.h"
#include "ppapi/c/trusted/ppb_graphics_3d_trusted.h"
@@ -186,12 +186,8 @@ const void* GetBrowserInterface(const char* interface_name) {
static const char* disabled_interface_names[] = {
PPB_GRAPHICS_3D_INTERFACE,
PPB_GRAPHICS_3D_TRUSTED_INTERFACE,
+ PPB_GLES_CHROMIUM_TEXTURE_MAPPING_DEV_INTERFACE,
PPB_OPENGLES2_INTERFACE,
- PPB_OPENGLES2_INSTANCEDARRAYS_DEV_INTERFACE,
- PPB_OPENGLES2_FRAMEBUFFERBLIT_DEV_INTERFACE,
- PPB_OPENGLES2_FRAMEBUFFERMULTISAMPLE_DEV_INTERFACE,
- PPB_OPENGLES2_CHROMIUMENABLEFEATURE_DEV_INTERFACE,
- PPB_OPENGLES2_CHROMIUMMAPSUB_DEV_INTERFACE,
PPB_LAYER_COMPOSITOR_DEV_INTERFACE
};
for (size_t i = 0; i < NACL_ARRAY_SIZE(disabled_interface_names); i++) {
diff --git a/ppapi/native_client/src/shared/ppapi_proxy/plugin_opengles.cc b/ppapi/native_client/src/shared/ppapi_proxy/plugin_opengles.cc
index 0a61662..9d47004 100644
--- a/ppapi/native_client/src/shared/ppapi_proxy/plugin_opengles.cc
+++ b/ppapi/native_client/src/shared/ppapi_proxy/plugin_opengles.cc
@@ -1,4 +1,4 @@
-// Copyright (c) 2012 The Chromium Authors. All rights reserved.
+// 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.
@@ -629,65 +629,6 @@ void Viewport(
PP_Resource context, GLint x, GLint y, GLsizei width, GLsizei height) {
PluginGraphics3D::implFromResource(context)->Viewport(x, y, width, height);
}
-void BlitFramebufferEXT(
- PP_Resource context, GLint srcX0, GLint srcY0, GLint srcX1, GLint srcY1,
- GLint dstX0, GLint dstY0, GLint dstX1, GLint dstY1, GLbitfield mask,
- GLenum filter) {
- PluginGraphics3D::implFromResource(
- context)->BlitFramebufferEXT(
- srcX0, srcY0, srcX1, srcY1, dstX0, dstY0, dstX1, dstY1, mask,
- filter);
-}
-void RenderbufferStorageMultisampleEXT(
- PP_Resource context, GLenum target, GLsizei samples, GLenum internalformat,
- GLsizei width, GLsizei height) {
- PluginGraphics3D::implFromResource(
- context)->RenderbufferStorageMultisampleEXT(
- target, samples, internalformat, width, height);
-}
-GLboolean EnableFeatureCHROMIUM(PP_Resource context, const char* feature) {
- return PluginGraphics3D::implFromResource(
- context)->EnableFeatureCHROMIUM(feature);
-}
-void* MapBufferSubDataCHROMIUM(
- PP_Resource context, GLuint target, GLintptr offset, GLsizeiptr size,
- GLenum access) {
- return PluginGraphics3D::implFromResource(
- context)->MapBufferSubDataCHROMIUM(target, offset, size, access);
-}
-void UnmapBufferSubDataCHROMIUM(PP_Resource context, const void* mem) {
- PluginGraphics3D::implFromResource(context)->UnmapBufferSubDataCHROMIUM(mem);
-}
-void* MapTexSubImage2DCHROMIUM(
- PP_Resource context, GLenum target, GLint level, GLint xoffset,
- GLint yoffset, GLsizei width, GLsizei height, GLenum format, GLenum type,
- GLenum access) {
- return PluginGraphics3D::implFromResource(
- context)->MapTexSubImage2DCHROMIUM(
- target, level, xoffset, yoffset, width, height, format, type,
- access);
-}
-void UnmapTexSubImage2DCHROMIUM(PP_Resource context, const void* mem) {
- PluginGraphics3D::implFromResource(context)->UnmapTexSubImage2DCHROMIUM(mem);
-}
-void DrawArraysInstancedANGLE(
- PP_Resource context, GLenum mode, GLint first, GLsizei count,
- GLsizei primcount) {
- PluginGraphics3D::implFromResource(
- context)->DrawArraysInstancedANGLE(mode, first, count, primcount);
-}
-void DrawElementsInstancedANGLE(
- PP_Resource context, GLenum mode, GLsizei count, GLenum type,
- const void* indices, GLsizei primcount) {
- PluginGraphics3D::implFromResource(
- context)->DrawElementsInstancedANGLE(
- mode, count, type, indices, primcount);
-}
-void VertexAttribDivisorANGLE(
- PP_Resource context, GLuint index, GLuint divisor) {
- PluginGraphics3D::implFromResource(
- context)->VertexAttribDivisorANGLE(index, divisor);
-}
} // namespace
@@ -838,43 +779,3 @@ const PPB_OpenGLES2* PluginGraphics3D::GetOpenGLESInterface() {
};
return &ppb_opengles;
}
-const PPB_OpenGLES2InstancedArrays_Dev*
- PluginGraphics3D::GetOpenGLESInstancedArraysInterface() {
- const static struct PPB_OpenGLES2InstancedArrays_Dev ppb_opengles = {
- &DrawArraysInstancedANGLE,
- &DrawElementsInstancedANGLE,
- &VertexAttribDivisorANGLE
- };
- return &ppb_opengles;
-}
-const PPB_OpenGLES2FramebufferBlit_Dev*
- PluginGraphics3D::GetOpenGLESFramebufferBlitInterface() {
- const static struct PPB_OpenGLES2FramebufferBlit_Dev ppb_opengles = {
- &BlitFramebufferEXT
- };
- return &ppb_opengles;
-}
-const PPB_OpenGLES2FramebufferMultisample_Dev*
- PluginGraphics3D::GetOpenGLESFramebufferMultisampleInterface() {
- const static struct PPB_OpenGLES2FramebufferMultisample_Dev ppb_opengles = {
- &RenderbufferStorageMultisampleEXT
- };
- return &ppb_opengles;
-}
-const PPB_OpenGLES2ChromiumEnableFeature_Dev*
- PluginGraphics3D::GetOpenGLESChromiumEnableFeatureInterface() {
- const static struct PPB_OpenGLES2ChromiumEnableFeature_Dev ppb_opengles = {
- &EnableFeatureCHROMIUM
- };
- return &ppb_opengles;
-}
-const PPB_OpenGLES2ChromiumMapSub_Dev*
- PluginGraphics3D::GetOpenGLESChromiumMapSubInterface() {
- const static struct PPB_OpenGLES2ChromiumMapSub_Dev ppb_opengles = {
- &MapBufferSubDataCHROMIUM,
- &UnmapBufferSubDataCHROMIUM,
- &MapTexSubImage2DCHROMIUM,
- &UnmapTexSubImage2DCHROMIUM
- };
- return &ppb_opengles;
-}
diff --git a/ppapi/native_client/src/shared/ppapi_proxy/plugin_ppb.cc b/ppapi/native_client/src/shared/ppapi_proxy/plugin_ppb.cc
index 3e9132a..fb3cb04 100644
--- a/ppapi/native_client/src/shared/ppapi_proxy/plugin_ppb.cc
+++ b/ppapi/native_client/src/shared/ppapi_proxy/plugin_ppb.cc
@@ -90,22 +90,7 @@ InterfaceMapElement interface_map[] = {
PluginNetAddressPrivate::GetInterface0_1(), true },
{ PPB_NETADDRESS_PRIVATE_INTERFACE_1_0,
PluginNetAddressPrivate::GetInterface1_0(), true },
- { PPB_OPENGLES2_INTERFACE_1_0, PluginGraphics3D::GetOpenGLESInterface(),
- true },
- { PPB_OPENGLES2_INSTANCEDARRAYS_DEV_INTERFACE_1_0,
- PluginGraphics3D::GetOpenGLESInstancedArraysInterface(),
- true },
- { PPB_OPENGLES2_FRAMEBUFFERBLIT_DEV_INTERFACE_1_0,
- PluginGraphics3D::GetOpenGLESFramebufferBlitInterface(),
- true },
- { PPB_OPENGLES2_FRAMEBUFFERMULTISAMPLE_DEV_INTERFACE_1_0,
- PluginGraphics3D::GetOpenGLESFramebufferMultisampleInterface(),
- true },
- { PPB_OPENGLES2_CHROMIUMENABLEFEATURE_DEV_INTERFACE_1_0,
- PluginGraphics3D::GetOpenGLESChromiumEnableFeatureInterface(),
- true },
- { PPB_OPENGLES2_CHROMIUMMAPSUB_DEV_INTERFACE_1_0,
- PluginGraphics3D::GetOpenGLESChromiumMapSubInterface(),
+ { PPB_OPENGLES2_INTERFACE, PluginGraphics3D::GetOpenGLESInterface(),
true },
{ PPB_PDF_INTERFACE, PluginPDF::GetInterface(), true },
{ PPB_SCROLLBAR_DEV_INTERFACE, PluginScrollbar::GetInterface(), true },
diff --git a/ppapi/native_client/src/shared/ppapi_proxy/plugin_ppb_graphics_3d.h b/ppapi/native_client/src/shared/ppapi_proxy/plugin_ppb_graphics_3d.h
index a071e4b..84af986 100644
--- a/ppapi/native_client/src/shared/ppapi_proxy/plugin_ppb_graphics_3d.h
+++ b/ppapi/native_client/src/shared/ppapi_proxy/plugin_ppb_graphics_3d.h
@@ -11,7 +11,6 @@
#include "ppapi/c/pp_graphics_3d.h"
#include "ppapi/c/ppb_graphics_3d.h"
#include "ppapi/c/ppb_opengles2.h"
-#include "ppapi/c/dev/ppb_opengles2ext_dev.h"
#include "ppapi/c/pp_instance.h"
namespace gpu {
@@ -33,16 +32,6 @@ class PluginGraphics3D : public PluginResource {
static const PPB_Graphics3D* GetInterface();
static const PPB_OpenGLES2* GetOpenGLESInterface();
- static const PPB_OpenGLES2InstancedArrays_Dev*
- GetOpenGLESInstancedArraysInterface();
- static const PPB_OpenGLES2FramebufferBlit_Dev*
- GetOpenGLESFramebufferBlitInterface();
- static const PPB_OpenGLES2FramebufferMultisample_Dev*
- GetOpenGLESFramebufferMultisampleInterface();
- static const PPB_OpenGLES2ChromiumEnableFeature_Dev*
- GetOpenGLESChromiumEnableFeatureInterface();
- static const PPB_OpenGLES2ChromiumMapSub_Dev*
- GetOpenGLESChromiumMapSubInterface();
virtual bool InitFromBrowserResource(PP_Resource graphics3d_id);
diff --git a/ppapi/ppapi_shared.gypi b/ppapi/ppapi_shared.gypi
index a11fca8..56df78c1 100644
--- a/ppapi/ppapi_shared.gypi
+++ b/ppapi/ppapi_shared.gypi
@@ -186,6 +186,7 @@
'thunk/ppb_flash_net_connector_thunk.cc',
'thunk/ppb_fullscreen_thunk.cc',
'thunk/ppb_gamepad_thunk.cc',
+ 'thunk/ppb_gles_chromium_texture_mapping_thunk.cc',
'thunk/ppb_graphics_2d_api.h',
'thunk/ppb_graphics_2d_thunk.cc',
'thunk/ppb_graphics_3d_api.h',
diff --git a/ppapi/proxy/interface_list.cc b/ppapi/proxy/interface_list.cc
index 2a2ed23..9bf73c2 100644
--- a/ppapi/proxy/interface_list.cc
+++ b/ppapi/proxy/interface_list.cc
@@ -14,11 +14,11 @@
#include "ppapi/c/dev/ppb_device_ref_dev.h"
#include "ppapi/c/dev/ppb_font_dev.h"
#include "ppapi/c/dev/ppb_fullscreen_dev.h"
+#include "ppapi/c/dev/ppb_gles_chromium_texture_mapping_dev.h"
#include "ppapi/c/dev/ppb_ime_input_event_dev.h"
#include "ppapi/c/dev/ppb_keyboard_input_event_dev.h"
#include "ppapi/c/dev/ppb_memory_dev.h"
#include "ppapi/c/dev/ppb_message_loop_dev.h"
-#include "ppapi/c/dev/ppb_opengles2ext_dev.h"
#include "ppapi/c/dev/ppb_resource_array_dev.h"
#include "ppapi/c/dev/ppb_testing_dev.h"
#include "ppapi/c/dev/ppb_text_input_dev.h"
@@ -180,16 +180,6 @@ InterfaceList::InterfaceList() {
PPB_MessageLoop_Proxy::GetInterface());
AddPPB(PPB_OPENGLES2_INTERFACE_1_0, API_ID_NONE,
PPB_OpenGLES2_Shared::GetInterface());
- AddPPB(PPB_OPENGLES2_INSTANCEDARRAYS_DEV_INTERFACE_1_0, API_ID_NONE,
- PPB_OpenGLES2_Shared::GetInstancedArraysInterface());
- AddPPB(PPB_OPENGLES2_FRAMEBUFFERBLIT_DEV_INTERFACE_1_0, API_ID_NONE,
- PPB_OpenGLES2_Shared::GetFramebufferBlitInterface());
- AddPPB(PPB_OPENGLES2_FRAMEBUFFERMULTISAMPLE_DEV_INTERFACE_1_0, API_ID_NONE,
- PPB_OpenGLES2_Shared::GetFramebufferMultisampleInterface());
- AddPPB(PPB_OPENGLES2_CHROMIUMENABLEFEATURE_DEV_INTERFACE_1_0, API_ID_NONE,
- PPB_OpenGLES2_Shared::GetChromiumEnableFeatureInterface());
- AddPPB(PPB_OPENGLES2_CHROMIUMMAPSUB_DEV_INTERFACE_1_0, API_ID_NONE,
- PPB_OpenGLES2_Shared::GetChromiumMapSubInterface());
AddPPB(PPB_VAR_ARRAY_BUFFER_INTERFACE_1_0, API_ID_NONE,
PPB_Var_Shared::GetVarArrayBufferInterface1_0());
AddPPB(PPB_VAR_INTERFACE_1_1, API_ID_NONE,
diff --git a/ppapi/shared_impl/ppb_graphics_3d_shared.cc b/ppapi/shared_impl/ppb_graphics_3d_shared.cc
index 2b8b205..13184eb 100644
--- a/ppapi/shared_impl/ppb_graphics_3d_shared.cc
+++ b/ppapi/shared_impl/ppb_graphics_3d_shared.cc
@@ -71,6 +71,23 @@ int32_t PPB_Graphics3D_Shared::SwapBuffers(PP_CompletionCallback callback) {
return DoSwapBuffers();
}
+void* PPB_Graphics3D_Shared::MapTexSubImage2DCHROMIUM(GLenum target,
+ GLint level,
+ GLint xoffset,
+ GLint yoffset,
+ GLsizei width,
+ GLsizei height,
+ GLenum format,
+ GLenum type,
+ GLenum access) {
+ return gles2_impl_->MapTexSubImage2DCHROMIUM(
+ target, level, xoffset, yoffset, width, height, format, type, access);
+}
+
+void PPB_Graphics3D_Shared::UnmapTexSubImage2DCHROMIUM(const void* mem) {
+ gles2_impl_->UnmapTexSubImage2DCHROMIUM(mem);
+}
+
void PPB_Graphics3D_Shared::SwapBuffersACK(int32_t pp_error) {
DCHECK(HasPendingSwap());
TrackedCallback::ClearAndRun(&swap_callback_, pp_error);
diff --git a/ppapi/shared_impl/ppb_graphics_3d_shared.h b/ppapi/shared_impl/ppb_graphics_3d_shared.h
index 92a2b20..ee72144 100644
--- a/ppapi/shared_impl/ppb_graphics_3d_shared.h
+++ b/ppapi/shared_impl/ppb_graphics_3d_shared.h
@@ -37,6 +37,16 @@ class PPAPI_SHARED_EXPORT PPB_Graphics3D_Shared
virtual int32_t GetError() OVERRIDE;
virtual int32_t ResizeBuffers(int32_t width, int32_t height) OVERRIDE;
virtual int32_t SwapBuffers(PP_CompletionCallback callback) OVERRIDE;
+ virtual void* MapTexSubImage2DCHROMIUM(GLenum target,
+ GLint level,
+ GLint xoffset,
+ GLint yoffset,
+ GLsizei width,
+ GLsizei height,
+ GLenum format,
+ GLenum type,
+ GLenum access) OVERRIDE;
+ virtual void UnmapTexSubImage2DCHROMIUM(const void* mem) OVERRIDE;
gpu::gles2::GLES2Implementation* gles2_impl() {
return gles2_impl_.get();
diff --git a/ppapi/shared_impl/ppb_opengles2_shared.cc b/ppapi/shared_impl/ppb_opengles2_shared.cc
index 52a297f..635ea41 100644
--- a/ppapi/shared_impl/ppb_opengles2_shared.cc
+++ b/ppapi/shared_impl/ppb_opengles2_shared.cc
@@ -1,4 +1,4 @@
-// Copyright (c) 2012 The Chromium Authors. All rights reserved.
+// 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.
@@ -743,258 +743,156 @@ void Viewport(
GetGLES(context_id)->Viewport(x, y, width, height);
}
-void BlitFramebufferEXT(
- PP_Resource context_id, GLint srcX0, GLint srcY0, GLint srcX1, GLint srcY1,
- GLint dstX0, GLint dstY0, GLint dstX1, GLint dstY1, GLbitfield mask,
- GLenum filter) {
- GetGLES(
- context_id)->BlitFramebufferEXT(
- srcX0, srcY0, srcX1, srcY1, dstX0, dstY0, dstX1, dstY1, mask,
- filter);
-}
-
-void RenderbufferStorageMultisampleEXT(
- PP_Resource context_id, GLenum target, GLsizei samples,
- GLenum internalformat, GLsizei width, GLsizei height) {
- GetGLES(
- context_id)->RenderbufferStorageMultisampleEXT(
- target, samples, internalformat, width, height);
-}
-GLboolean EnableFeatureCHROMIUM(PP_Resource context_id, const char* feature) {
- return GetGLES(context_id)->EnableFeatureCHROMIUM(feature);
-}
-
-void* MapBufferSubDataCHROMIUM(
- PP_Resource context_id, GLuint target, GLintptr offset, GLsizeiptr size,
- GLenum access) {
- return GetGLES(
- context_id)->MapBufferSubDataCHROMIUM(target, offset, size, access);
-}
-
-void UnmapBufferSubDataCHROMIUM(PP_Resource context_id, const void* mem) {
- GetGLES(context_id)->UnmapBufferSubDataCHROMIUM(mem);
-}
-
-void* MapTexSubImage2DCHROMIUM(
- PP_Resource context_id, GLenum target, GLint level, GLint xoffset,
- GLint yoffset, GLsizei width, GLsizei height, GLenum format, GLenum type,
- GLenum access) {
- return GetGLES(
- context_id)->MapTexSubImage2DCHROMIUM(
- target, level, xoffset, yoffset, width, height, format, type,
- access);
-}
-
-void UnmapTexSubImage2DCHROMIUM(PP_Resource context_id, const void* mem) {
- GetGLES(context_id)->UnmapTexSubImage2DCHROMIUM(mem);
-}
-
-void DrawArraysInstancedANGLE(
- PP_Resource context_id, GLenum mode, GLint first, GLsizei count,
- GLsizei primcount) {
- GetGLES(context_id)->DrawArraysInstancedANGLE(mode, first, count, primcount);
-}
-
-void DrawElementsInstancedANGLE(
- PP_Resource context_id, GLenum mode, GLsizei count, GLenum type,
- const void* indices, GLsizei primcount) {
- GetGLES(
- context_id)->DrawElementsInstancedANGLE(
- mode, count, type, indices, primcount);
-}
-
-void VertexAttribDivisorANGLE(
- PP_Resource context_id, GLuint index, GLuint divisor) {
- GetGLES(context_id)->VertexAttribDivisorANGLE(index, divisor);
-}
+const struct PPB_OpenGLES2 ppb_opengles2 = {
+ &ActiveTexture,
+ &AttachShader,
+ &BindAttribLocation,
+ &BindBuffer,
+ &BindFramebuffer,
+ &BindRenderbuffer,
+ &BindTexture,
+ &BlendColor,
+ &BlendEquation,
+ &BlendEquationSeparate,
+ &BlendFunc,
+ &BlendFuncSeparate,
+ &BufferData,
+ &BufferSubData,
+ &CheckFramebufferStatus,
+ &Clear,
+ &ClearColor,
+ &ClearDepthf,
+ &ClearStencil,
+ &ColorMask,
+ &CompileShader,
+ &CompressedTexImage2D,
+ &CompressedTexSubImage2D,
+ &CopyTexImage2D,
+ &CopyTexSubImage2D,
+ &CreateProgram,
+ &CreateShader,
+ &CullFace,
+ &DeleteBuffers,
+ &DeleteFramebuffers,
+ &DeleteProgram,
+ &DeleteRenderbuffers,
+ &DeleteShader,
+ &DeleteTextures,
+ &DepthFunc,
+ &DepthMask,
+ &DepthRangef,
+ &DetachShader,
+ &Disable,
+ &DisableVertexAttribArray,
+ &DrawArrays,
+ &DrawElements,
+ &Enable,
+ &EnableVertexAttribArray,
+ &Finish,
+ &Flush,
+ &FramebufferRenderbuffer,
+ &FramebufferTexture2D,
+ &FrontFace,
+ &GenBuffers,
+ &GenerateMipmap,
+ &GenFramebuffers,
+ &GenRenderbuffers,
+ &GenTextures,
+ &GetActiveAttrib,
+ &GetActiveUniform,
+ &GetAttachedShaders,
+ &GetAttribLocation,
+ &GetBooleanv,
+ &GetBufferParameteriv,
+ &GetError,
+ &GetFloatv,
+ &GetFramebufferAttachmentParameteriv,
+ &GetIntegerv,
+ &GetProgramiv,
+ &GetProgramInfoLog,
+ &GetRenderbufferParameteriv,
+ &GetShaderiv,
+ &GetShaderInfoLog,
+ &GetShaderPrecisionFormat,
+ &GetShaderSource,
+ &GetString,
+ &GetTexParameterfv,
+ &GetTexParameteriv,
+ &GetUniformfv,
+ &GetUniformiv,
+ &GetUniformLocation,
+ &GetVertexAttribfv,
+ &GetVertexAttribiv,
+ &GetVertexAttribPointerv,
+ &Hint,
+ &IsBuffer,
+ &IsEnabled,
+ &IsFramebuffer,
+ &IsProgram,
+ &IsRenderbuffer,
+ &IsShader,
+ &IsTexture,
+ &LineWidth,
+ &LinkProgram,
+ &PixelStorei,
+ &PolygonOffset,
+ &ReadPixels,
+ &ReleaseShaderCompiler,
+ &RenderbufferStorage,
+ &SampleCoverage,
+ &Scissor,
+ &ShaderBinary,
+ &ShaderSource,
+ &StencilFunc,
+ &StencilFuncSeparate,
+ &StencilMask,
+ &StencilMaskSeparate,
+ &StencilOp,
+ &StencilOpSeparate,
+ &TexImage2D,
+ &TexParameterf,
+ &TexParameterfv,
+ &TexParameteri,
+ &TexParameteriv,
+ &TexSubImage2D,
+ &Uniform1f,
+ &Uniform1fv,
+ &Uniform1i,
+ &Uniform1iv,
+ &Uniform2f,
+ &Uniform2fv,
+ &Uniform2i,
+ &Uniform2iv,
+ &Uniform3f,
+ &Uniform3fv,
+ &Uniform3i,
+ &Uniform3iv,
+ &Uniform4f,
+ &Uniform4fv,
+ &Uniform4i,
+ &Uniform4iv,
+ &UniformMatrix2fv,
+ &UniformMatrix3fv,
+ &UniformMatrix4fv,
+ &UseProgram,
+ &ValidateProgram,
+ &VertexAttrib1f,
+ &VertexAttrib1fv,
+ &VertexAttrib2f,
+ &VertexAttrib2fv,
+ &VertexAttrib3f,
+ &VertexAttrib3fv,
+ &VertexAttrib4f,
+ &VertexAttrib4fv,
+ &VertexAttribPointer,
+ &Viewport
+};
} // namespace
+
const PPB_OpenGLES2* PPB_OpenGLES2_Shared::GetInterface() {
- static const struct PPB_OpenGLES2 ppb_opengles2 = {
- &ActiveTexture,
- &AttachShader,
- &BindAttribLocation,
- &BindBuffer,
- &BindFramebuffer,
- &BindRenderbuffer,
- &BindTexture,
- &BlendColor,
- &BlendEquation,
- &BlendEquationSeparate,
- &BlendFunc,
- &BlendFuncSeparate,
- &BufferData,
- &BufferSubData,
- &CheckFramebufferStatus,
- &Clear,
- &ClearColor,
- &ClearDepthf,
- &ClearStencil,
- &ColorMask,
- &CompileShader,
- &CompressedTexImage2D,
- &CompressedTexSubImage2D,
- &CopyTexImage2D,
- &CopyTexSubImage2D,
- &CreateProgram,
- &CreateShader,
- &CullFace,
- &DeleteBuffers,
- &DeleteFramebuffers,
- &DeleteProgram,
- &DeleteRenderbuffers,
- &DeleteShader,
- &DeleteTextures,
- &DepthFunc,
- &DepthMask,
- &DepthRangef,
- &DetachShader,
- &Disable,
- &DisableVertexAttribArray,
- &DrawArrays,
- &DrawElements,
- &Enable,
- &EnableVertexAttribArray,
- &Finish,
- &Flush,
- &FramebufferRenderbuffer,
- &FramebufferTexture2D,
- &FrontFace,
- &GenBuffers,
- &GenerateMipmap,
- &GenFramebuffers,
- &GenRenderbuffers,
- &GenTextures,
- &GetActiveAttrib,
- &GetActiveUniform,
- &GetAttachedShaders,
- &GetAttribLocation,
- &GetBooleanv,
- &GetBufferParameteriv,
- &GetError,
- &GetFloatv,
- &GetFramebufferAttachmentParameteriv,
- &GetIntegerv,
- &GetProgramiv,
- &GetProgramInfoLog,
- &GetRenderbufferParameteriv,
- &GetShaderiv,
- &GetShaderInfoLog,
- &GetShaderPrecisionFormat,
- &GetShaderSource,
- &GetString,
- &GetTexParameterfv,
- &GetTexParameteriv,
- &GetUniformfv,
- &GetUniformiv,
- &GetUniformLocation,
- &GetVertexAttribfv,
- &GetVertexAttribiv,
- &GetVertexAttribPointerv,
- &Hint,
- &IsBuffer,
- &IsEnabled,
- &IsFramebuffer,
- &IsProgram,
- &IsRenderbuffer,
- &IsShader,
- &IsTexture,
- &LineWidth,
- &LinkProgram,
- &PixelStorei,
- &PolygonOffset,
- &ReadPixels,
- &ReleaseShaderCompiler,
- &RenderbufferStorage,
- &SampleCoverage,
- &Scissor,
- &ShaderBinary,
- &ShaderSource,
- &StencilFunc,
- &StencilFuncSeparate,
- &StencilMask,
- &StencilMaskSeparate,
- &StencilOp,
- &StencilOpSeparate,
- &TexImage2D,
- &TexParameterf,
- &TexParameterfv,
- &TexParameteri,
- &TexParameteriv,
- &TexSubImage2D,
- &Uniform1f,
- &Uniform1fv,
- &Uniform1i,
- &Uniform1iv,
- &Uniform2f,
- &Uniform2fv,
- &Uniform2i,
- &Uniform2iv,
- &Uniform3f,
- &Uniform3fv,
- &Uniform3i,
- &Uniform3iv,
- &Uniform4f,
- &Uniform4fv,
- &Uniform4i,
- &Uniform4iv,
- &UniformMatrix2fv,
- &UniformMatrix3fv,
- &UniformMatrix4fv,
- &UseProgram,
- &ValidateProgram,
- &VertexAttrib1f,
- &VertexAttrib1fv,
- &VertexAttrib2f,
- &VertexAttrib2fv,
- &VertexAttrib3f,
- &VertexAttrib3fv,
- &VertexAttrib4f,
- &VertexAttrib4fv,
- &VertexAttribPointer,
- &Viewport
- };
- return &ppb_opengles2;
-}
-const PPB_OpenGLES2InstancedArrays_Dev*
- PPB_OpenGLES2_Shared::GetInstancedArraysInterface() {
- static const struct PPB_OpenGLES2InstancedArrays_Dev ppb_opengles2 = {
- &DrawArraysInstancedANGLE,
- &DrawElementsInstancedANGLE,
- &VertexAttribDivisorANGLE
- };
- return &ppb_opengles2;
-}
-const PPB_OpenGLES2FramebufferBlit_Dev*
- PPB_OpenGLES2_Shared::GetFramebufferBlitInterface() {
- static const struct PPB_OpenGLES2FramebufferBlit_Dev ppb_opengles2 = {
- &BlitFramebufferEXT
- };
- return &ppb_opengles2;
-}
-const PPB_OpenGLES2FramebufferMultisample_Dev*
- PPB_OpenGLES2_Shared::GetFramebufferMultisampleInterface() {
- static const struct PPB_OpenGLES2FramebufferMultisample_Dev ppb_opengles2 = {
- &RenderbufferStorageMultisampleEXT
- };
- return &ppb_opengles2;
-}
-const PPB_OpenGLES2ChromiumEnableFeature_Dev*
- PPB_OpenGLES2_Shared::GetChromiumEnableFeatureInterface() {
- static const struct PPB_OpenGLES2ChromiumEnableFeature_Dev ppb_opengles2 = {
- &EnableFeatureCHROMIUM
- };
- return &ppb_opengles2;
-}
-const PPB_OpenGLES2ChromiumMapSub_Dev*
- PPB_OpenGLES2_Shared::GetChromiumMapSubInterface() {
- static const struct PPB_OpenGLES2ChromiumMapSub_Dev ppb_opengles2 = {
- &MapBufferSubDataCHROMIUM,
- &UnmapBufferSubDataCHROMIUM,
- &MapTexSubImage2DCHROMIUM,
- &UnmapTexSubImage2DCHROMIUM
- };
return &ppb_opengles2;
}
+
} // namespace ppapi
diff --git a/ppapi/shared_impl/ppb_opengles2_shared.h b/ppapi/shared_impl/ppb_opengles2_shared.h
index 672133c..2b4c9f9 100644
--- a/ppapi/shared_impl/ppb_opengles2_shared.h
+++ b/ppapi/shared_impl/ppb_opengles2_shared.h
@@ -1,4 +1,4 @@
-// Copyright (c) 2012 The Chromium Authors. All rights reserved.
+// 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.
@@ -6,7 +6,6 @@
#define PPAPI_SHARED_IMPL_PPB_OPENGLES2_SHARED_H_
#include "ppapi/c/ppb_opengles2.h"
-#include "ppapi/c/dev/ppb_opengles2ext_dev.h"
#include "ppapi/shared_impl/ppapi_shared_export.h"
namespace ppapi {
@@ -14,13 +13,6 @@ namespace ppapi {
class PPAPI_SHARED_EXPORT PPB_OpenGLES2_Shared {
public:
static const PPB_OpenGLES2* GetInterface();
- static const PPB_OpenGLES2InstancedArrays_Dev* GetInstancedArraysInterface();
- static const PPB_OpenGLES2FramebufferBlit_Dev* GetFramebufferBlitInterface();
- static const PPB_OpenGLES2FramebufferMultisample_Dev*
- GetFramebufferMultisampleInterface();
- static const PPB_OpenGLES2ChromiumEnableFeature_Dev*
- GetChromiumEnableFeatureInterface();
- static const PPB_OpenGLES2ChromiumMapSub_Dev* GetChromiumMapSubInterface();
};
} // namespace ppapi
diff --git a/ppapi/thunk/interfaces_ppb_public_dev.h b/ppapi/thunk/interfaces_ppb_public_dev.h
index 7fefec0..94696e4 100644
--- a/ppapi/thunk/interfaces_ppb_public_dev.h
+++ b/ppapi/thunk/interfaces_ppb_public_dev.h
@@ -27,6 +27,9 @@ PROXIED_IFACE(PPB_AudioInput, PPB_AUDIO_INPUT_DEV_INTERFACE_0_1,
PROXIED_IFACE(NoAPIName, PPB_IME_INPUT_EVENT_DEV_INTERFACE_0_1,
PPB_IMEInputEvent_Dev_0_1)
PROXIED_IFACE(PPB_Buffer, PPB_BUFFER_DEV_INTERFACE_0_4, PPB_Buffer_Dev_0_4)
+PROXIED_IFACE(PPB_Graphics3D,
+ PPB_GLES_CHROMIUM_TEXTURE_MAPPING_DEV_INTERFACE_0_1,
+ PPB_GLESChromiumTextureMapping_Dev_0_1)
PROXIED_IFACE(NoAPIName, PPB_CRYPTO_DEV_INTERFACE_0_1, PPB_Crypto_Dev_0_1)
PROXIED_IFACE(PPB_CursorControl, PPB_CURSOR_CONTROL_DEV_INTERFACE_0_4,
PPB_CursorControl_Dev_0_4)
diff --git a/ppapi/thunk/ppb_gles_chromium_texture_mapping_thunk.cc b/ppapi/thunk/ppb_gles_chromium_texture_mapping_thunk.cc
new file mode 100644
index 0000000..a9ecd05
--- /dev/null
+++ b/ppapi/thunk/ppb_gles_chromium_texture_mapping_thunk.cc
@@ -0,0 +1,55 @@
+// Copyright (c) 2012 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 "ppapi/thunk/thunk.h"
+#include "ppapi/thunk/enter.h"
+#include "ppapi/thunk/ppb_graphics_3d_api.h"
+#include "ppapi/thunk/resource_creation_api.h"
+
+namespace ppapi {
+namespace thunk {
+
+namespace {
+
+typedef EnterResource<PPB_Graphics3D_API> EnterGraphics3D;
+
+void* MapTexSubImage2DCHROMIUM(PP_Resource context,
+ GLenum target,
+ GLint level,
+ GLint xoffset,
+ GLint yoffset,
+ GLsizei width,
+ GLsizei height,
+ GLenum format,
+ GLenum type,
+ GLenum access) {
+ EnterGraphics3D enter(context, true);
+ if (enter.succeeded()) {
+ return enter.object()->MapTexSubImage2DCHROMIUM(
+ target, level, xoffset, yoffset, width, height, format, type, access);
+ }
+ return NULL;
+}
+
+void UnmapTexSubImage2DCHROMIUM(PP_Resource context, const void* mem) {
+ EnterGraphics3D enter(context, true);
+ if (enter.succeeded())
+ enter.object()->UnmapTexSubImage2DCHROMIUM(mem);
+}
+
+const PPB_GLESChromiumTextureMapping_Dev
+g_ppb_gles_chromium_texture_mapping_thunk = {
+ &MapTexSubImage2DCHROMIUM,
+ &UnmapTexSubImage2DCHROMIUM
+};
+
+} // namespace
+
+const PPB_GLESChromiumTextureMapping_Dev_0_1*
+GetPPB_GLESChromiumTextureMapping_Dev_0_1_Thunk() {
+ return &g_ppb_gles_chromium_texture_mapping_thunk;
+}
+
+} // namespace thunk
+} // namespace ppapi
diff --git a/ppapi/thunk/ppb_graphics_3d_api.h b/ppapi/thunk/ppb_graphics_3d_api.h
index ea865e2..84dc829 100644
--- a/ppapi/thunk/ppb_graphics_3d_api.h
+++ b/ppapi/thunk/ppb_graphics_3d_api.h
@@ -7,6 +7,7 @@
#include "ppapi/c/ppb_graphics_3d.h"
#include "ppapi/c/trusted/ppb_graphics_3d_trusted.h"
+#include "ppapi/c/dev/ppb_gles_chromium_texture_mapping_dev.h"
#include "ppapi/thunk/ppapi_thunk_export.h"
namespace ppapi {
@@ -36,6 +37,18 @@ class PPAPI_THUNK_EXPORT PPB_Graphics3D_API {
virtual PP_Graphics3DTrustedState FlushSync(int32_t put_offset) = 0;
virtual PP_Graphics3DTrustedState FlushSyncFast(int32_t put_offset,
int32_t last_known_get) = 0;
+
+ // GLESChromiumTextureMapping.
+ virtual void* MapTexSubImage2DCHROMIUM(GLenum target,
+ GLint level,
+ GLint xoffset,
+ GLint yoffset,
+ GLsizei width,
+ GLsizei height,
+ GLenum format,
+ GLenum type,
+ GLenum access) = 0;
+ virtual void UnmapTexSubImage2DCHROMIUM(const void* mem) = 0;
};
} // namespace thunk
diff --git a/webkit/plugins/ppapi/plugin_module.cc b/webkit/plugins/ppapi/plugin_module.cc
index 36553d7..380b31a 100644
--- a/webkit/plugins/ppapi/plugin_module.cc
+++ b/webkit/plugins/ppapi/plugin_module.cc
@@ -25,9 +25,9 @@
#include "ppapi/c/dev/ppb_find_dev.h"
#include "ppapi/c/dev/ppb_font_dev.h"
#include "ppapi/c/dev/ppb_fullscreen_dev.h"
+#include "ppapi/c/dev/ppb_gles_chromium_texture_mapping_dev.h"
#include "ppapi/c/dev/ppb_layer_compositor_dev.h"
#include "ppapi/c/dev/ppb_memory_dev.h"
-#include "ppapi/c/dev/ppb_opengles2ext_dev.h"
#include "ppapi/c/dev/ppb_resource_array_dev.h"
#include "ppapi/c/dev/ppb_scrollbar_dev.h"
#include "ppapi/c/dev/ppb_testing_dev.h"
@@ -344,16 +344,6 @@ const void* GetInterface(const char* name) {
return ::ppapi::thunk::GetPPB_Instance_Private_0_1_Thunk();
if (strcmp(name, PPB_OPENGLES2_INTERFACE) == 0)
return ::ppapi::PPB_OpenGLES2_Shared::GetInterface();
- if (strcmp(name, PPB_OPENGLES2_INSTANCEDARRAYS_DEV_INTERFACE) == 0)
- return ::ppapi::PPB_OpenGLES2_Shared::GetInstancedArraysInterface();
- if (strcmp(name, PPB_OPENGLES2_FRAMEBUFFERBLIT_DEV_INTERFACE) == 0)
- return ::ppapi::PPB_OpenGLES2_Shared::GetFramebufferBlitInterface();
- if (strcmp(name, PPB_OPENGLES2_FRAMEBUFFERMULTISAMPLE_DEV_INTERFACE) == 0)
- return ::ppapi::PPB_OpenGLES2_Shared::GetFramebufferMultisampleInterface();
- if (strcmp(name, PPB_OPENGLES2_CHROMIUMENABLEFEATURE_DEV_INTERFACE) == 0)
- return ::ppapi::PPB_OpenGLES2_Shared::GetChromiumEnableFeatureInterface();
- if (strcmp(name, PPB_OPENGLES2_CHROMIUMMAPSUB_DEV_INTERFACE) == 0)
- return ::ppapi::PPB_OpenGLES2_Shared::GetChromiumMapSubInterface();
if (strcmp(name, PPB_PROXY_PRIVATE_INTERFACE) == 0)
return PPB_Proxy_Impl::GetInterface();
if (strcmp(name, PPB_TCPSERVERSOCKET_PRIVATE_INTERFACE) == 0)