summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
-rwxr-xr-xgpu/command_buffer/build_gles2_cmd_buffer.py225
-rw-r--r--ppapi/c/dev/ppb_gles_chromium_texture_mapping_dev.h3
-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.cc6
-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/proxy/interface_list.cc11
-rw-r--r--ppapi/shared_impl/ppb_opengles2_shared.cc396
-rw-r--r--ppapi/shared_impl/ppb_opengles2_shared.h10
-rw-r--r--webkit/plugins/ppapi/plugin_module.cc11
14 files changed, 829 insertions, 209 deletions
diff --git a/gpu/command_buffer/build_gles2_cmd_buffer.py b/gpu/command_buffer/build_gles2_cmd_buffer.py
index d092034..ca2c747 100755
--- a/gpu/command_buffer/build_gles2_cmd_buffer.py
+++ b/gpu/command_buffer/build_gles2_cmd_buffer.py
@@ -731,6 +731,17 @@ _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.
#
@@ -763,6 +774,7 @@ _ENUM_LISTS = {
# 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': {
@@ -799,6 +811,7 @@ _FUNCTION_INFO = {
'decoder_func': 'DoBlitFramebufferEXT',
'unit_test': False,
'extension': True,
+ 'pepper_interface': 'FramebufferBlit',
},
'BufferData': {
'type': 'Manual',
@@ -834,6 +847,7 @@ _FUNCTION_INFO = {
'result': ['GLint'],
'extension': True,
'chromium': True,
+ 'pepper_interface': 'ChromiumEnableFeature',
},
'CompileShader': {'decoder_func': 'DoCompileShader', 'unit_test': False},
'CompressedTexImage2D': {
@@ -1187,12 +1201,14 @@ _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': {
@@ -1214,6 +1230,7 @@ _FUNCTION_INFO = {
'expectation': False,
'unit_test': False,
'extension': True,
+ 'pepper_interface': 'FramebufferMultisample',
},
'ReadPixels': {
'cmd_comment':
@@ -1390,12 +1407,14 @@ _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'},
@@ -1499,6 +1518,7 @@ _FUNCTION_INFO = {
'GLsizei primcount',
'extension': True,
'unit_test': False,
+ 'pepper_interface': 'InstancedArrays',
},
'DrawElementsInstancedANGLE': {
'type': 'Manual',
@@ -1507,12 +1527,14 @@ _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',
},
}
@@ -1603,6 +1625,18 @@ 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
@@ -1615,10 +1649,15 @@ 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 + '\n')
+ self.__AddLine(line1 + nolint + lineend + '\n')
match = re.match("( +)", line1)
indent = ""
if match:
@@ -4948,6 +4987,15 @@ 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'):
@@ -5138,6 +5186,38 @@ 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."""
@@ -5336,6 +5416,8 @@ 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(),
@@ -5364,6 +5446,10 @@ 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."""
@@ -5726,36 +5812,44 @@ const size_t GLES2Util::enum_to_string_table_len_ =
""")
file.Close()
- def WritePepperGLES2Interface(self, filename):
+ def WritePepperGLES2Interface(self, filename, dev):
"""Writes the Pepper OpenGLES interface definition."""
file = CHeaderWriter(
filename,
"// OpenGL ES interface.\n",
- 3)
-
- 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")
+ 2)
- 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("#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("\nstruct PPB_OpenGLES2 {\n")
- for func in self.original_functions:
- if not func.IsCoreGLFunction():
+ for interface in self.pepper_interfaces:
+ if interface.dev != dev:
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()
@@ -5785,7 +5879,7 @@ const size_t GLES2Util::enum_to_string_table_len_ =
file.Write("}\n\n")
for func in self.original_functions:
- if not func.IsCoreGLFunction():
+ if not func.InAnyPepperExtension():
continue
original_arg = func.MakeTypedOriginalArgString("")
@@ -5802,21 +5896,23 @@ const size_t GLES2Util::enum_to_string_table_len_ =
func.MakeOriginalArgString("")))
file.Write("}\n\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")
-
file.Write("} // namespace\n")
- file.Write("""
-const PPB_OpenGLES2* PPB_OpenGLES2_Shared::GetInterface() {
- return &ppb_opengles2;
-}
+ 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(" };\n")
+ file.Write(" return &ppb_opengles2;\n")
+ file.Write("}\n")
-""")
file.Write("} // namespace ppapi\n")
file.Close()
@@ -5831,23 +5927,35 @@ const PPB_OpenGLES2* PPB_OpenGLES2_Shared::GetInterface() {
file.Write("#include \"ppapi/lib/gl/gles2/gl2ext_ppapi.h\"\n\n")
for func in self.original_functions:
- if not func.IsCoreGLFunction():
+ if not func.InAnyPepperExtension():
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 = "glGetInterfacePPAPI()"
+ interface_str = "glGet%sInterfacePPAPI()" % interface.GetName()
original_arg = func.MakeOriginalArgString("")
context_arg = "glGetCurrentContextPPAPI()"
if len(original_arg):
arg = context_arg + ", " + original_arg
else:
arg = context_arg
- file.Write(" %s%s->%s(%s);\n" %
- (return_str, interface_str, func.name, 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("}\n\n")
+ file.Close()
def WritePepperGLES2NaClProxy(self, filename):
"""Writes the Pepper OpenGLES interface implementation for NaCl."""
@@ -5859,15 +5967,14 @@ const PPB_OpenGLES2* PPB_OpenGLES2_Shared::GetInterface() {
"/plugin_ppb_graphics_3d.h\"\n\n")
file.Write("#include \"gpu/command_buffer/client/gles2_implementation.h\"")
- file.Write("\n#include \"native_client/src/third_party"
- "/ppapi/c/dev/ppb_opengles_dev.h\"\n\n")
+ file.Write("\n#include \"ppapi/c/ppb_opengles2.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.IsCoreGLFunction():
+ if not func.InAnyPepperExtension():
continue
args = func.MakeTypedOriginalArgString("")
if len(args) != 0:
@@ -5886,17 +5993,21 @@ const PPB_OpenGLES2* PPB_OpenGLES2_Shared::GetInterface() {
file.Write("\n} // namespace\n\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")
+ 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.Close()
@@ -5936,7 +6047,8 @@ 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")
+ gen.WritePepperGLES2Interface("c/ppb_opengles2.h", False)
+ gen.WritePepperGLES2Interface("c/dev/ppb_opengles2ext_dev.h", True)
gen.WriteGLES2ToPPAPIBridge("lib/gl/gles2/gles2.c")
elif options.alternate_mode == "chrome_ppapi":
@@ -5945,6 +6057,7 @@ 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
index 8ad0093..e07e870 100644
--- a/ppapi/c/dev/ppb_gles_chromium_texture_mapping_dev.h
+++ b/ppapi/c/dev/ppb_gles_chromium_texture_mapping_dev.h
@@ -13,6 +13,9 @@
#define PPB_GLES_CHROMIUM_TEXTURE_MAPPING_DEV_INTERFACE \
PPB_GLES_CHROMIUM_TEXTURE_MAPPING_DEV_INTERFACE_0_1
+// This interface is deprecated. Please use
+// PPB_OPENGLES2_CHROMIUMMAPSUB_DEV_INTERFACE_1_0 instead.
+
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
diff --git a/ppapi/c/dev/ppb_opengles2ext_dev.h b/ppapi/c/dev/ppb_opengles2ext_dev.h
new file mode 100644
index 0000000..2aa172f
--- /dev/null
+++ b/ppapi/c/dev/ppb_opengles2ext_dev.h
@@ -0,0 +1,82 @@
+// 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 62d842d..6bdc09d 100644
--- a/ppapi/lib/gl/gles2/gl2ext_ppapi.c
+++ b/ppapi/lib/gl/gles2/gl2ext_ppapi.c
@@ -1,4 +1,4 @@
-// Copyright (c) 2011 The Chromium Authors. All rights reserved.
+// 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.
@@ -26,6 +26,16 @@
// 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;
@@ -35,6 +45,28 @@ 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;
}
@@ -55,3 +87,27 @@ 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 fcfabd8..d33814e 100644
--- a/ppapi/lib/gl/gles2/gl2ext_ppapi.h
+++ b/ppapi/lib/gl/gles2/gl2ext_ppapi.h
@@ -1,4 +1,4 @@
-// Copyright (c) 2011 The Chromium Authors. All rights reserved.
+// 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.
@@ -12,6 +12,7 @@
#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" {
@@ -36,6 +37,16 @@ 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 8dba474..f0ae66f 100644
--- a/ppapi/lib/gl/gles2/gles2.c
+++ b/ppapi/lib/gl/gles2/gles2.c
@@ -1,4 +1,4 @@
-// Copyright (c) 2011 The Chromium Authors. All rights reserved.
+// 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.
@@ -753,3 +753,95 @@ 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 9eb4215bd..d5ede41 100644
--- a/ppapi/native_client/src/shared/ppapi_proxy/browser_globals.cc
+++ b/ppapi/native_client/src/shared/ppapi_proxy/browser_globals.cc
@@ -19,6 +19,7 @@
#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"
@@ -188,6 +189,11 @@ const void* GetBrowserInterface(const char* interface_name) {
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 9d47004..0a61662 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) 2011 The Chromium Authors. All rights reserved.
+// 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.
@@ -629,6 +629,65 @@ 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
@@ -779,3 +838,43 @@ 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 fb3cb04..3e9132a 100644
--- a/ppapi/native_client/src/shared/ppapi_proxy/plugin_ppb.cc
+++ b/ppapi/native_client/src/shared/ppapi_proxy/plugin_ppb.cc
@@ -90,7 +90,22 @@ InterfaceMapElement interface_map[] = {
PluginNetAddressPrivate::GetInterface0_1(), true },
{ PPB_NETADDRESS_PRIVATE_INTERFACE_1_0,
PluginNetAddressPrivate::GetInterface1_0(), true },
- { PPB_OPENGLES2_INTERFACE, PluginGraphics3D::GetOpenGLESInterface(),
+ { 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(),
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 84af986..a071e4b 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,6 +11,7 @@
#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 {
@@ -32,6 +33,16 @@ 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/proxy/interface_list.cc b/ppapi/proxy/interface_list.cc
index 9bf73c2..f5b97f3 100644
--- a/ppapi/proxy/interface_list.cc
+++ b/ppapi/proxy/interface_list.cc
@@ -19,6 +19,7 @@
#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,6 +181,16 @@ 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_opengles2_shared.cc b/ppapi/shared_impl/ppb_opengles2_shared.cc
index 635ea41..52a297f 100644
--- a/ppapi/shared_impl/ppb_opengles2_shared.cc
+++ b/ppapi/shared_impl/ppb_opengles2_shared.cc
@@ -1,4 +1,4 @@
-// Copyright (c) 2011 The Chromium Authors. All rights reserved.
+// 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.
@@ -743,156 +743,258 @@ 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);
+}
-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
-};
+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);
+}
-} // namespace
+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);
+}
+
+} // 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 2b4c9f9..672133c 100644
--- a/ppapi/shared_impl/ppb_opengles2_shared.h
+++ b/ppapi/shared_impl/ppb_opengles2_shared.h
@@ -1,4 +1,4 @@
-// Copyright (c) 2011 The Chromium Authors. All rights reserved.
+// 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.
@@ -6,6 +6,7 @@
#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 {
@@ -13,6 +14,13 @@ 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/webkit/plugins/ppapi/plugin_module.cc b/webkit/plugins/ppapi/plugin_module.cc
index f9edaae..746e515 100644
--- a/webkit/plugins/ppapi/plugin_module.cc
+++ b/webkit/plugins/ppapi/plugin_module.cc
@@ -28,6 +28,7 @@
#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,6 +345,16 @@ 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)