gpu/command_buffer/build_cmd_buffer_lib.py
def WriteClientContextStateImpl(self, filename):
    """Writes the context state client side implementation."""
    comment = "// It is included by client_context_state.cc\n"
    with CHeaderWriter(filename, self.year, comment) as f:
      code = []
      for capability in self.capability_flags:
        if 'extension_flag' in capability:
          continue
        code.append("%s(%s)" %
                    (capability['name'],
                     ('false', 'true')['default' in capability]))
      f.write(
        "ClientContextState::EnableFlags::EnableFlags()\n    : %s {\n}\n" %
        ",\n      ".join(code))
      f.write("\n")

      f.write("""
bool ClientContextState::SetCapabilityState(
    GLenum cap, bool enabled, bool* changed) {
  *changed = false;
  switch (cap) {
""")
      for capability in self.capability_flags:
        if 'extension_flag' in capability:
          continue
        f.write("    case GL_%s:\n" % capability['name'].upper())
        f.write("""      if (enable_flags.%(name)s != enabled) {
         *changed = true;
         enable_flags.%(name)s = enabled;
      }
      return true;
""" % capability)
      f.write("""    default:
      return false;
  }
}
""")
      f.write("""bool ClientContextState::GetEnabled(
    GLenum cap, bool* enabled) const {
  switch (cap) {
""")
      for capability in self.capability_flags:
        if 'extension_flag' in capability:
          continue
        f.write("    case GL_%s:\n" % capability['name'].upper())
        f.write("      *enabled = enable_flags.%s;\n" % capability['name'])
        f.write("      return true;\n")
      f.write("""    default:
      return false;
  }
}
""")
    self.generated_cpp_filenames.append(filename)
Writes the context state client side implementation.
Writes the context state client side implementation.
Writes the context state client side implementation .
def WriteClientContextStateImpl(self, filename):
    comment = "// It is included by client_context_state.cc\n"
    with CHeaderWriter(filename, self.year, comment) as f:
      code = []
      for capability in self.capability_flags:
        if 'extension_flag' in capability:
          continue
        code.append("%s(%s)" %
                    (capability['name'],
                     ('false', 'true')['default' in capability]))
      f.write(
        "ClientContextState::EnableFlags::EnableFlags()\n    : %s {\n}\n" %
        ",\n      ".join(code))
      f.write("\n")
      f.write("""
bool ClientContextState::SetCapabilityState(
    GLenum cap, bool enabled, bool* changed) {
  *changed = false;
  switch (cap) {
""")
      for capability in self.capability_flags:
        if 'extension_flag' in capability:
          continue
        f.write("    case GL_%s:\n" % capability['name'].upper())
        f.write("""      if (enable_flags.%(name)s != enabled) {
         *changed = true;
         enable_flags.%(name)s = enabled;
      }
      return true;
""" % capability)
      f.write("""    default:
      return false;
  }
}
""")
      f.write("""bool ClientContextState::GetEnabled(
    GLenum cap, bool* enabled) const {
  switch (cap) {
""")
      for capability in self.capability_flags:
        if 'extension_flag' in capability:
          continue
        f.write("    case GL_%s:\n" % capability['name'].upper())
        f.write("      *enabled = enable_flags.%s;\n" % capability['name'])
        f.write("      return true;\n")
      f.write("""    default:
      return false;
  }
}
""")
    self.generated_cpp_filenames.append(filename)
def WriteClientContextStateImpl ( self , filename ) : comment = "// It is included by client_context_state.cc\n" with CHeaderWriter ( filename , self . year , comment ) as f : code = [ ] for capability in self . capability_flags : if 'extension_flag' in capability : continue code . append ( "%s(%s)" % ( capability [ 'name' ] , ( 'false' , 'true' ) [ 'default' in capability ] ) ) f . write ( "ClientContextState::EnableFlags::EnableFlags()\n    : %s {\n}\n" % ",\n      " . join ( code ) ) f . write ( "\n" ) f . write ( """
bool ClientContextState::SetCapabilityState(
    GLenum cap, bool enabled, bool* changed) {
  *changed = false;
  switch (cap) {
""" ) for capability in self . capability_flags : if 'extension_flag' in capability : continue f . write ( "    case GL_%s:\n" % capability [ 'name' ] . upper ( ) ) f . write ( """      if (enable_flags.%(name)s != enabled) {
         *changed = true;
         enable_flags.%(name)s = enabled;
      }
      return true;
""" % capability ) f . write ( """    default:
      return false;
  }
}
""" ) f . write ( """bool ClientContextState::GetEnabled(
    GLenum cap, bool* enabled) const {
  switch (cap) {
""" ) for capability in self . capability_flags : if 'extension_flag' in capability : continue f . write ( "    case GL_%s:\n" % capability [ 'name' ] . upper ( ) ) f . write ( "      *enabled = enable_flags.%s;\n" % capability [ 'name' ] ) f . write ( "      return true;\n" ) f . write ( """    default:
      return false;
  }
}
""" ) self . generated_cpp_filenames . append ( filename )
Writes the context state client side implementation.
Writes the context state client side implementation .
"""Writes the context state client side implementation."""
self
filename