gpu/command_buffer/build_cmd_buffer_lib.py
def WritePepperGLES2Interface(self, filename, dev):
    """Writes the Pepper OpenGLES interface definition."""
    with CWriter(filename, self.year) as f:
      f.write("label Chrome {\n")
      f.write("  M39 = 1.0\n")
      f.write("};\n\n")

      if not dev:
        # Declare GL types.
        f.write("[version=1.0]\n")
        f.write("describe {\n")
        for gltype in ['GLbitfield', 'GLboolean', 'GLbyte', 'GLclampf',
                       'GLclampx', 'GLenum', 'GLfixed', 'GLfloat', 'GLint',
                       'GLintptr', 'GLshort', 'GLsizei', 'GLsizeiptr',
                       'GLubyte', 'GLuint', 'GLushort']:
          f.write("  %s;\n" % gltype)
          f.write("  %s_ptr_t;\n" % gltype)
        f.write("};\n\n")

      # C level typedefs.
      f.write("#inline c\n")
      f.write("#include \"ppapi/c/pp_resource.h\"\n")
      if dev:
        f.write("#include \"ppapi/c/ppb_opengles2.h\"\n\n")
      else:
        f.write("\n#ifndef __gl2_h_\n")
        for (k, v) in _GL_TYPES.iteritems():
          f.write("typedef %s %s;\n" % (v, k))
        f.write("#ifdef _WIN64\n")
        for (k, v) in _GL_TYPES_64.iteritems():
          f.write("typedef %s %s;\n" % (v, k))
        f.write("#else\n")
        for (k, v) in _GL_TYPES_32.iteritems():
          f.write("typedef %s %s;\n" % (v, k))
        f.write("#endif  // _WIN64\n")
        f.write("#endif  // __gl2_h_\n\n")
      f.write("#endinl\n")

      for interface in self.pepper_interfaces:
        if interface.dev != dev:
          continue
        # Historically, we provide OpenGLES2 interfaces with struct
        # namespace. Not to break code which uses the interface as
        # "struct OpenGLES2", we put it in struct namespace.
        f.write('\n[macro="%s", force_struct_namespace]\n' %
                   interface.GetInterfaceName())
        f.write("interface %s {\n" % interface.GetStructName())
        for func in self.original_functions:
          if not func.InPepperInterface(interface):
            continue

          ret_type = func.MapCTypeToPepperIdlType(func.return_type,
                                                  is_for_return_type=True)
          func_prefix = "  %s %s(" % (ret_type, func.GetPepperName())
          f.write(func_prefix)
          f.write("[in] PP_Resource context")
          for arg in func.MakeTypedPepperIdlArgStrings():
            f.write(",\n" + " " * len(func_prefix) + arg)
          f.write(");\n")
        f.write("};\n\n")
Writes the Pepper OpenGLES interface definition.
Writes the Pepper OpenGLES interface definition.
Writes the Pepper OpenGLES interface definition .
def WritePepperGLES2Interface(self, filename, dev):
    with CWriter(filename, self.year) as f:
      f.write("label Chrome {\n")
      f.write("  M39 = 1.0\n")
      f.write("};\n\n")
      if not dev:
        f.write("[version=1.0]\n")
        f.write("describe {\n")
        for gltype in ['GLbitfield', 'GLboolean', 'GLbyte', 'GLclampf',
                       'GLclampx', 'GLenum', 'GLfixed', 'GLfloat', 'GLint',
                       'GLintptr', 'GLshort', 'GLsizei', 'GLsizeiptr',
                       'GLubyte', 'GLuint', 'GLushort']:
          f.write("  %s;\n" % gltype)
          f.write("  %s_ptr_t;\n" % gltype)
        f.write("};\n\n")
      f.write("#inline c\n")
      f.write("#include \"ppapi/c/pp_resource.h\"\n")
      if dev:
        f.write("#include \"ppapi/c/ppb_opengles2.h\"\n\n")
      else:
        f.write("\n#ifndef __gl2_h_\n")
        for (k, v) in _GL_TYPES.iteritems():
          f.write("typedef %s %s;\n" % (v, k))
        f.write("#ifdef _WIN64\n")
        for (k, v) in _GL_TYPES_64.iteritems():
          f.write("typedef %s %s;\n" % (v, k))
        f.write("#else\n")
        for (k, v) in _GL_TYPES_32.iteritems():
          f.write("typedef %s %s;\n" % (v, k))
        f.write("#endif  // _WIN64\n")
        f.write("#endif  // __gl2_h_\n\n")
      f.write("#endinl\n")
      for interface in self.pepper_interfaces:
        if interface.dev != dev:
          continue
        f.write('\n[macro="%s", force_struct_namespace]\n' %
                   interface.GetInterfaceName())
        f.write("interface %s {\n" % interface.GetStructName())
        for func in self.original_functions:
          if not func.InPepperInterface(interface):
            continue
          ret_type = func.MapCTypeToPepperIdlType(func.return_type,
                                                  is_for_return_type=True)
          func_prefix = "  %s %s(" % (ret_type, func.GetPepperName())
          f.write(func_prefix)
          f.write("[in] PP_Resource context")
          for arg in func.MakeTypedPepperIdlArgStrings():
            f.write(",\n" + " " * len(func_prefix) + arg)
          f.write(");\n")
        f.write("};\n\n")
def WritePepperGLES2Interface ( self , filename , dev ) : with CWriter ( filename , self . year ) as f : f . write ( "label Chrome {\n" ) f . write ( "  M39 = 1.0\n" ) f . write ( "};\n\n" ) if not dev : f . write ( "[version=1.0]\n" ) f . write ( "describe {\n" ) for gltype in [ 'GLbitfield' , 'GLboolean' , 'GLbyte' , 'GLclampf' , 'GLclampx' , 'GLenum' , 'GLfixed' , 'GLfloat' , 'GLint' , 'GLintptr' , 'GLshort' , 'GLsizei' , 'GLsizeiptr' , 'GLubyte' , 'GLuint' , 'GLushort' ] : f . write ( "  %s;\n" % gltype ) f . write ( "  %s_ptr_t;\n" % gltype ) f . write ( "};\n\n" ) f . write ( "#inline c\n" ) f . write ( "#include \"ppapi/c/pp_resource.h\"\n" ) if dev : f . write ( "#include \"ppapi/c/ppb_opengles2.h\"\n\n" ) else : f . write ( "\n#ifndef __gl2_h_\n" ) for ( k , v ) in _GL_TYPES . iteritems ( ) : f . write ( "typedef %s %s;\n" % ( v , k ) ) f . write ( "#ifdef _WIN64\n" ) for ( k , v ) in _GL_TYPES_64 . iteritems ( ) : f . write ( "typedef %s %s;\n" % ( v , k ) ) f . write ( "#else\n" ) for ( k , v ) in _GL_TYPES_32 . iteritems ( ) : f . write ( "typedef %s %s;\n" % ( v , k ) ) f . write ( "#endif  // _WIN64\n" ) f . write ( "#endif  // __gl2_h_\n\n" ) f . write ( "#endinl\n" ) for interface in self . pepper_interfaces : if interface . dev != dev : continue f . write ( '\n[macro="%s", force_struct_namespace]\n' % interface . GetInterfaceName ( ) ) f . write ( "interface %s {\n" % interface . GetStructName ( ) ) for func in self . original_functions : if not func . InPepperInterface ( interface ) : continue ret_type = func . MapCTypeToPepperIdlType ( func . return_type , is_for_return_type = True ) func_prefix = "  %s %s(" % ( ret_type , func . GetPepperName ( ) ) f . write ( func_prefix ) f . write ( "[in] PP_Resource context" ) for arg in func . MakeTypedPepperIdlArgStrings ( ) : f . write ( ",\n" + " " * len ( func_prefix ) + arg ) f . write ( ");\n" ) f . write ( "};\n\n" )
Writes the Pepper OpenGLES interface definition.
Writes the Pepper OpenGLES interface definition .
"""Writes the Pepper OpenGLES interface definition.""" # Declare GL types. # C level typedefs. # Historically, we provide OpenGLES2 interfaces with struct # namespace. Not to break code which uses the interface as # "struct OpenGLES2", we put it in struct namespace.
self
filename
dev