gpu/command_buffer/build_cmd_buffer_lib.py
def WriteGLES2ToPPAPIBridge(self, filename):
    """Connects GLES2 helper library to PPB_OpenGLES2 interface"""
    with CWriter(filename, self.year) as f:
      f.write("#ifndef GL_GLEXT_PROTOTYPES\n")
      f.write("#define GL_GLEXT_PROTOTYPES\n")
      f.write("#endif\n")
      f.write("#include <GLES2/gl2.h>\n")
      f.write("#include <GLES2/gl2ext.h>\n")
      f.write("#include \"ppapi/lib/gl/gles2/gl2ext_ppapi.h\"\n\n")

      for func in self.original_functions:
        if not func.InAnyPepperExtension():
          continue

        interface = self.interface_info[func.GetInfo('pepper_interface') or '']

        f.write("%s GL_APIENTRY gl%s(%s) {\n" %
                   (func.return_type, func.GetPepperName(),
                    func.MakeTypedPepperArgString("")))
        return_str = "" if func.return_type == "void" else "return "
        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
        if interface.GetName():
          f.write("  const struct %s* ext = %s;\n" %
                     (interface.GetStructName(), interface_str))
          f.write("  if (ext)\n")
          f.write("    %sext->%s(%s);\n" %
                     (return_str, func.GetPepperName(), arg))
          if return_str:
            f.write("  %s0;\n" % return_str)
        else:
          f.write("  %s%s->%s(%s);\n" %
                     (return_str, interface_str, func.GetPepperName(), arg))
        f.write("}\n\n")
    self.generated_cpp_filenames.append(filename)
Connects GLES2 helper library to PPB_OpenGLES2 interface
Connects GLES2 helper library to PPB_OpenGLES2 interface
Connects GLES2 helper library to PPB_OpenGLES2 interface
def WriteGLES2ToPPAPIBridge(self, filename):
    with CWriter(filename, self.year) as f:
      f.write("#ifndef GL_GLEXT_PROTOTYPES\n")
      f.write("#define GL_GLEXT_PROTOTYPES\n")
      f.write("#endif\n")
      f.write("#include <GLES2/gl2.h>\n")
      f.write("#include <GLES2/gl2ext.h>\n")
      f.write("#include \"ppapi/lib/gl/gles2/gl2ext_ppapi.h\"\n\n")
      for func in self.original_functions:
        if not func.InAnyPepperExtension():
          continue
        interface = self.interface_info[func.GetInfo('pepper_interface') or '']
        f.write("%s GL_APIENTRY gl%s(%s) {\n" %
                   (func.return_type, func.GetPepperName(),
                    func.MakeTypedPepperArgString("")))
        return_str = "" if func.return_type == "void" else "return "
        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
        if interface.GetName():
          f.write("  const struct %s* ext = %s;\n" %
                     (interface.GetStructName(), interface_str))
          f.write("  if (ext)\n")
          f.write("    %sext->%s(%s);\n" %
                     (return_str, func.GetPepperName(), arg))
          if return_str:
            f.write("  %s0;\n" % return_str)
        else:
          f.write("  %s%s->%s(%s);\n" %
                     (return_str, interface_str, func.GetPepperName(), arg))
        f.write("}\n\n")
    self.generated_cpp_filenames.append(filename)
def WriteGLES2ToPPAPIBridge ( self , filename ) : with CWriter ( filename , self . year ) as f : f . write ( "#ifndef GL_GLEXT_PROTOTYPES\n" ) f . write ( "#define GL_GLEXT_PROTOTYPES\n" ) f . write ( "#endif\n" ) f . write ( "#include <GLES2/gl2.h>\n" ) f . write ( "#include <GLES2/gl2ext.h>\n" ) f . write ( "#include \"ppapi/lib/gl/gles2/gl2ext_ppapi.h\"\n\n" ) for func in self . original_functions : if not func . InAnyPepperExtension ( ) : continue interface = self . interface_info [ func . GetInfo ( 'pepper_interface' ) or '' ] f . write ( "%s GL_APIENTRY gl%s(%s) {\n" % ( func . return_type , func . GetPepperName ( ) , func . MakeTypedPepperArgString ( "" ) ) ) return_str = "" if func . return_type == "void" else "return " 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 if interface . GetName ( ) : f . write ( "  const struct %s* ext = %s;\n" % ( interface . GetStructName ( ) , interface_str ) ) f . write ( "  if (ext)\n" ) f . write ( "    %sext->%s(%s);\n" % ( return_str , func . GetPepperName ( ) , arg ) ) if return_str : f . write ( "  %s0;\n" % return_str ) else : f . write ( "  %s%s->%s(%s);\n" % ( return_str , interface_str , func . GetPepperName ( ) , arg ) ) f . write ( "}\n\n" ) self . generated_cpp_filenames . append ( filename )
Connects GLES2 helper library to PPB_OpenGLES2 interface
Connects GLES2 helper library to PPB_OpenGLES2 interface
"""Connects GLES2 helper library to PPB_OpenGLES2 interface"""
self
filename