// gpu/ipc/common/constants.mojom.js is auto generated by mojom_bindings_generator.py, do not edit

// Copyright 2014 The Chromium Authors
// Use of this source code is governed by a BSD-style license that can be
// found in the LICENSE file.

'use strict';

(function() {
  var mojomId = 'gpu/ipc/common/constants.mojom';
  if (mojo.internal.isMojomLoaded(mojomId)) {
    console.warn('The following mojom is loaded multiple times: ' + mojomId);
    return;
  }
  mojo.internal.markMojomLoaded(mojomId);
  var bindings = mojo;
  var associatedBindings = mojo;
  var codec = mojo.internal;
  var validator = mojo.internal;

  var exports = mojo.internal.exposeNamespace('gpu.mojom');


  var CommandBufferNamespace = {};
  CommandBufferNamespace.INVALID = -1;
  CommandBufferNamespace.GPU_IO = 0;
  CommandBufferNamespace.IN_PROCESS = 1;
  CommandBufferNamespace.VIZ_SKIA_OUTPUT_SURFACE = 2;
  CommandBufferNamespace.VIZ_SKIA_OUTPUT_SURFACE_NON_DDL = 3;
  CommandBufferNamespace.GPU_CHANNEL_SHARED_IMAGE_INTERFACE = 4;
  CommandBufferNamespace.WEBNN_CONTEXT_INTERFACE = 5;
  CommandBufferNamespace.MIN_VALUE = -1;
  CommandBufferNamespace.MAX_VALUE = 5;

  CommandBufferNamespace.isKnownEnumValue = function(value) {
    switch (value) {
    case -1:
    case 0:
    case 1:
    case 2:
    case 3:
    case 4:
    case 5:
      return true;
    }
    return false;
  };

  CommandBufferNamespace.toKnownEnumValue = function(value) {
    return value;
  };

  CommandBufferNamespace.validate = function(enumValue) {
    const isExtensible = false;
    if (isExtensible || this.isKnownEnumValue(enumValue))
      return validator.validationError.NONE;

    return validator.validationError.UNKNOWN_ENUM_VALUE;
  };
  var Error = {};
  Error.kNoError = 0;
  Error.kInvalidSize = 1;
  Error.kOutOfBounds = 2;
  Error.kUnknownCommand = 3;
  Error.kInvalidArguments = 4;
  Error.kLostContext = 5;
  Error.kGenericError = 6;
  Error.kDeferCommandUntilLater = 7;
  Error.kDeferLaterCommands = 8;
  Error.MIN_VALUE = 0;
  Error.MAX_VALUE = 8;

  Error.isKnownEnumValue = function(value) {
    switch (value) {
    case 0:
    case 1:
    case 2:
    case 3:
    case 4:
    case 5:
    case 6:
    case 7:
    case 8:
      return true;
    }
    return false;
  };

  Error.toKnownEnumValue = function(value) {
    return value;
  };

  Error.validate = function(enumValue) {
    const isExtensible = false;
    if (isExtensible || this.isKnownEnumValue(enumValue))
      return validator.validationError.NONE;

    return validator.validationError.UNKNOWN_ENUM_VALUE;
  };
  var ContextLostReason = {};
  ContextLostReason.kGuilty = 0;
  ContextLostReason.kInnocent = 1;
  ContextLostReason.kUnknown = 2;
  ContextLostReason.kOutOfMemory = 3;
  ContextLostReason.kMakeCurrentFailed = 4;
  ContextLostReason.kGpuChannelLost = 5;
  ContextLostReason.kInvalidGpuMessage = 6;
  ContextLostReason.MIN_VALUE = 0;
  ContextLostReason.MAX_VALUE = 6;

  ContextLostReason.isKnownEnumValue = function(value) {
    switch (value) {
    case 0:
    case 1:
    case 2:
    case 3:
    case 4:
    case 5:
    case 6:
      return true;
    }
    return false;
  };

  ContextLostReason.toKnownEnumValue = function(value) {
    return value;
  };

  ContextLostReason.validate = function(enumValue) {
    const isExtensible = false;
    if (isExtensible || this.isKnownEnumValue(enumValue))
      return validator.validationError.NONE;

    return validator.validationError.UNKNOWN_ENUM_VALUE;
  };

  exports.CommandBufferNamespace = CommandBufferNamespace;
  exports.Error = Error;
  exports.ContextLostReason = ContextLostReason;
})();