gpu/command_buffer/build_cmd_buffer_lib.py
def WriteServiceImplementation(self, filename):
    """Writes the service decoder implementation."""
    comment = "// It is included by %s_cmd_decoder.cc\n" % _lower_prefix
    with CHeaderWriter(filename, self.year, comment) as f:
      for func in self.functions:
        func.WriteServiceImplementation(f)
      if self.capability_flags and _prefix == 'GLES2':
        f.write("""
bool GLES2DecoderImpl::SetCapabilityState(GLenum cap, bool enabled) {
  switch (cap) {
""")
        for capability in self.capability_flags:
          f.write("    case GL_%s:\n" % capability['name'].upper())
          if 'on_change' in capability:

            f.write("""\
              state_.enable_flags.%(name)s = enabled;
              if (state_.enable_flags.cached_%(name)s != enabled
                  || state_.ignore_cached_state) {
                %(on_change)s
              }
              return false;
              """ % capability)
          else:
            f.write("""\
              state_.enable_flags.%(name)s = enabled;
              if (state_.enable_flags.cached_%(name)s != enabled
                  || state_.ignore_cached_state) {
                state_.enable_flags.cached_%(name)s = enabled;
                return true;
              }
              return false;
              """ % capability)
        f.write("""    default:
      NOTREACHED();
      return false;
  }
}
""")
    self.generated_cpp_filenames.append(filename)
Writes the service decoder implementation.
Writes the service decoder implementation.
Writes the service decoder implementation .
def WriteServiceImplementation(self, filename):
    comment = "// It is included by %s_cmd_decoder.cc\n" % _lower_prefix
    with CHeaderWriter(filename, self.year, comment) as f:
      for func in self.functions:
        func.WriteServiceImplementation(f)
      if self.capability_flags and _prefix == 'GLES2':
        f.write("""
bool GLES2DecoderImpl::SetCapabilityState(GLenum cap, bool enabled) {
  switch (cap) {
""")
        for capability in self.capability_flags:
          f.write("    case GL_%s:\n" % capability['name'].upper())
          if 'on_change' in capability:
            f.write("""\
              state_.enable_flags.%(name)s = enabled;
              if (state_.enable_flags.cached_%(name)s != enabled
                  || state_.ignore_cached_state) {
                %(on_change)s
              }
              return false;
              """ % capability)
          else:
            f.write("""\
              state_.enable_flags.%(name)s = enabled;
              if (state_.enable_flags.cached_%(name)s != enabled
                  || state_.ignore_cached_state) {
                state_.enable_flags.cached_%(name)s = enabled;
                return true;
              }
              return false;
              """ % capability)
        f.write("""    default:
      NOTREACHED();
      return false;
  }
}
""")
    self.generated_cpp_filenames.append(filename)
def WriteServiceImplementation ( self , filename ) : comment = "// It is included by %s_cmd_decoder.cc\n" % _lower_prefix with CHeaderWriter ( filename , self . year , comment ) as f : for func in self . functions : func . WriteServiceImplementation ( f ) if self . capability_flags and _prefix == 'GLES2' : f . write ( """
bool GLES2DecoderImpl::SetCapabilityState(GLenum cap, bool enabled) {
  switch (cap) {
""" ) for capability in self . capability_flags : f . write ( "    case GL_%s:\n" % capability [ 'name' ] . upper ( ) ) if 'on_change' in capability : f . write ( """\
              state_.enable_flags.%(name)s = enabled;
              if (state_.enable_flags.cached_%(name)s != enabled
                  || state_.ignore_cached_state) {
                %(on_change)s
              }
              return false;
              """ % capability ) else : f . write ( """\
              state_.enable_flags.%(name)s = enabled;
              if (state_.enable_flags.cached_%(name)s != enabled
                  || state_.ignore_cached_state) {
                state_.enable_flags.cached_%(name)s = enabled;
                return true;
              }
              return false;
              """ % capability ) f . write ( """    default:
      NOTREACHED();
      return false;
  }
}
""" ) self . generated_cpp_filenames . append ( filename )
Writes the service decoder implementation.
Writes the service decoder implementation .
"""Writes the service decoder implementation."""
self
filename