chromium/third_party/skia/src/core/SkSLTypeShared.h

/*
 * Copyright 2022 Google LLC
 *
 * Use of this source code is governed by a BSD-style license that can be
 * found in the LICENSE file.
 */

#ifndef SkSLTypeShared_DEFINED
#define SkSLTypeShared_DEFINED

#include "include/core/SkTypes.h"

/**
 * Types of shader-language-specific boxed variables we can create.
 */
enum class SkSLType : char {};
static const int kSkSLTypeCount =;

/** Returns the SkSL typename for this type. */
const char* SkSLTypeString(SkSLType t);

/** Is the shading language type float (including vectors/matrices)? */
static constexpr bool SkSLTypeIsFloatType(SkSLType type) {}

/** Is the shading language type integral (including vectors)? */
static constexpr bool SkSLTypeIsIntegralType(SkSLType type) {}

/** If the type represents a single value or vector return the vector length; otherwise, -1. */
static constexpr int SkSLTypeVecLength(SkSLType type) {}

/**
 * Is the shading language type supported as a uniform (ie, does it have a corresponding set
 * function on GrGLSLProgramDataManager)?
 */
static constexpr bool SkSLTypeCanBeUniformValue(SkSLType type) {}

/** Is the shading language type full precision? */
bool SkSLTypeIsFullPrecisionNumericType(SkSLType type);

/** If the type represents a square matrix, return its size; otherwise, -1. */
int SkSLTypeMatrixSize(SkSLType type);

/** If the type represents a square matrix, return its size; otherwise, -1. */
bool SkSLTypeIsCombinedSamplerType(SkSLType type);

#endif // SkSLTypeShared_DEFINED