Package icyllis.arc3d.granite

# Class FragmentStage

java.lang.Object
icyllis.arc3d.granite.FragmentStage

@Immutable public class FragmentStage extends Object
Represents a substage of a fragment shader, providing custom shader code to the Arc3D shading pipeline. Managed by `ShaderCodeSource`.

- ## Nested Class Summary

  Nested Classes
  Modifier and Type
  Class
  Description
  `static interface`
  `FragmentStage.GenerateExpression`
  Emit assignment expression statement.
  `static final record`
  `FragmentStage.Sampler`
  `static final record`
  `FragmentStage.Uniform`

- ## Field Summary

  Fields
  Modifier and Type
  Field
  Description
  `static final int`
  `kAlphaOnlyPaintColor_BuiltinStageID`
  Builtin Code Snippet ID, most are from Skia Graphite.
  `static final int`
  `kAngularGradientShader4_BuiltinStageID`
  Builtin Code Snippet ID, most are from Skia Graphite.
  `static final int`
  `kAngularGradientShader8_BuiltinStageID`
  Builtin Code Snippet ID, most are from Skia Graphite.
  `static final int`
  `kBlend_BuiltinStageID`
  Builtin Code Snippet ID, most are from Skia Graphite.
  `static final int`
  `kBlenderDstColor_ReqFlag`
  Requirement flags.
  `static final int`
  `kBlendModeBlender_BuiltinStageID`
  Builtin Code Snippet ID, most are from Skia Graphite.
  `static final int`
  `kBuiltinStageIDCount`
  `static final int`
  `kColorSpaceXformColorFilter_BuiltinStageID`
  Builtin Code Snippet ID, most are from Skia Graphite.
  `static final int`
  `kCompose_BuiltinStageID`
  Builtin Code Snippet ID, most are from Skia Graphite.
  `static final int`
  `kCubicImageShader_BuiltinStageID`
  Builtin Code Snippet ID, most are from Skia Graphite.
  `static final int`
  `kDitherShader_BuiltinStageID`
  Builtin Code Snippet ID, most are from Skia Graphite.
  `static final int`
  `kError_BuiltinStageID`
  Builtin Code Snippet ID, most are from Skia Graphite.
  `static final int`
  `kFirstFixedBlend_BuiltinStageID`
  `static final int`
  `kHWImageShader_BuiltinStageID`
  Builtin Code Snippet ID, most are from Skia Graphite.
  `static final int`
  `kImageShader_BuiltinStageID`
  Builtin Code Snippet ID, most are from Skia Graphite.
  `static final int`
  `kLast_BuiltinStageID`
  `static final int`
  `kLastFixedBlend_BuiltinStageID`
  `static final int`
  `kLinearGradientShader4_BuiltinStageID`
  Builtin Code Snippet ID, most are from Skia Graphite.
  `static final int`
  `kLinearGradientShader8_BuiltinStageID`
  Builtin Code Snippet ID, most are from Skia Graphite.
  `static final int`
  `kLocalCoords_ReqFlag`
  Requirement flags.
  `static final int`
  `kLocalMatrixShader_BuiltinStageID`
  Builtin Code Snippet ID, most are from Skia Graphite.
  `static final int`
  `kNone_ReqFlag`
  Requirement flags.
  `static final int`
  `kPassthrough_BuiltinStageID`
  Builtin Code Snippet ID, most are from Skia Graphite.
  `static final int`
  `kPorterDuffBlender_BuiltinStageID`
  Builtin Code Snippet ID, most are from Skia Graphite.
  `static final int`
  `kPrimitiveColor_BuiltinStageID`
  Builtin Code Snippet ID, most are from Skia Graphite.
  `static final int`
  `kPrimitiveColor_ReqFlag`
  `static final int`
  `kPriorStageOutput_ReqFlag`
  Requirement flags.
  `static final int`
  `kRadialGradientShader4_BuiltinStageID`
  Builtin Code Snippet ID, most are from Skia Graphite.
  `static final int`
  `kRadialGradientShader8_BuiltinStageID`
  Builtin Code Snippet ID, most are from Skia Graphite.
  `static final int`
  `kRGBOpaquePaintColor_BuiltinStageID`
  Builtin Code Snippet ID, most are from Skia Graphite.
  `static final int`
  `kSolidColorShader_BuiltinStageID`
  Builtin Code Snippet ID, most are from Skia Graphite.
  `final FragmentStage.GenerateExpression`
  `mExpressionGenerator`
  `final String`
  `mName`
  `final int`
  `mNumChildren`
  `final String[]`
  `mRequiredFunctions`
  `final int`
  `mRequirementFlags`
  `final FragmentStage.Sampler[]`
  `mSamplers`
  `final String`
  `mStaticFunctionName`
  `final FragmentStage.Uniform[]`
  `mUniforms`
  `static final String[]`
  `NO_FUNCTIONS`
  `static final FragmentStage.Sampler[]`
  `NO_SAMPLERS`
  `static final FragmentStage.Uniform[]`
  `NO_UNIFORMS`

- ## Constructor Summary

  Constructors
  Constructor
  Description
  `FragmentStage(String name, int requirementFlags, String staticFunctionName, String[] requiredFunctions, FragmentStage.Uniform[] uniforms, FragmentStage.Sampler[] samplers, FragmentStage.GenerateExpression expressionGenerator, int numChildren)`

- ## Method Summary

  Modifier and Type
  Method
  Description
  `void`
  `generateUniforms(UniformHandler uniformHandler, int stageIndex)`
  `String`
  `name()`

  ### Methods inherited from class java.lang.Object

  `clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait`

- ## Field Details

  - ### kError_BuiltinStageID

    public static final int kError_BuiltinStageID
    Builtin Code Snippet ID, most are from Skia Graphite. Do not use these ID outside Granite Renderer.
    See Also:
      - Constant Field Values

  - ### kPassthrough_BuiltinStageID

    public static final int kPassthrough_BuiltinStageID
    Builtin Code Snippet ID, most are from Skia Graphite. Do not use these ID outside Granite Renderer.
    See Also:
      - Constant Field Values

  - ### kSolidColorShader_BuiltinStageID

    public static final int kSolidColorShader_BuiltinStageID
    Builtin Code Snippet ID, most are from Skia Graphite. Do not use these ID outside Granite Renderer.
    See Also:
      - Constant Field Values

  - ### kRGBOpaquePaintColor_BuiltinStageID

    public static final int kRGBOpaquePaintColor_BuiltinStageID
    Builtin Code Snippet ID, most are from Skia Graphite. Do not use these ID outside Granite Renderer.
    See Also:
      - Constant Field Values

  - ### kAlphaOnlyPaintColor_BuiltinStageID

    public static final int kAlphaOnlyPaintColor_BuiltinStageID
    Builtin Code Snippet ID, most are from Skia Graphite. Do not use these ID outside Granite Renderer.
    See Also:
      - Constant Field Values

  - ### kLinearGradientShader4_BuiltinStageID

    public static final int kLinearGradientShader4_BuiltinStageID
    Builtin Code Snippet ID, most are from Skia Graphite. Do not use these ID outside Granite Renderer.
    See Also:
      - Constant Field Values

  - ### kLinearGradientShader8_BuiltinStageID

    public static final int kLinearGradientShader8_BuiltinStageID
    Builtin Code Snippet ID, most are from Skia Graphite. Do not use these ID outside Granite Renderer.
    See Also:
      - Constant Field Values

  - ### kRadialGradientShader4_BuiltinStageID

    public static final int kRadialGradientShader4_BuiltinStageID
    Builtin Code Snippet ID, most are from Skia Graphite. Do not use these ID outside Granite Renderer.
    See Also:
      - Constant Field Values

  - ### kRadialGradientShader8_BuiltinStageID

    public static final int kRadialGradientShader8_BuiltinStageID
    Builtin Code Snippet ID, most are from Skia Graphite. Do not use these ID outside Granite Renderer.
    See Also:
      - Constant Field Values

  - ### kAngularGradientShader4_BuiltinStageID

    public static final int kAngularGradientShader4_BuiltinStageID
    Builtin Code Snippet ID, most are from Skia Graphite. Do not use these ID outside Granite Renderer.
    See Also:
      - Constant Field Values

  - ### kAngularGradientShader8_BuiltinStageID

    public static final int kAngularGradientShader8_BuiltinStageID
    Builtin Code Snippet ID, most are from Skia Graphite. Do not use these ID outside Granite Renderer.
    See Also:
      - Constant Field Values

  - ### kLocalMatrixShader_BuiltinStageID

    public static final int kLocalMatrixShader_BuiltinStageID
    Builtin Code Snippet ID, most are from Skia Graphite. Do not use these ID outside Granite Renderer.
    See Also:
      - Constant Field Values

  - ### kImageShader_BuiltinStageID

    public static final int kImageShader_BuiltinStageID
    Builtin Code Snippet ID, most are from Skia Graphite. Do not use these ID outside Granite Renderer.
    See Also:
      - Constant Field Values

  - ### kCubicImageShader_BuiltinStageID

    public static final int kCubicImageShader_BuiltinStageID
    Builtin Code Snippet ID, most are from Skia Graphite. Do not use these ID outside Granite Renderer.
    See Also:
      - Constant Field Values

  - ### kHWImageShader_BuiltinStageID

    public static final int kHWImageShader_BuiltinStageID
    Builtin Code Snippet ID, most are from Skia Graphite. Do not use these ID outside Granite Renderer.
    See Also:
      - Constant Field Values

  - ### kDitherShader_BuiltinStageID

    public static final int kDitherShader_BuiltinStageID
    Builtin Code Snippet ID, most are from Skia Graphite. Do not use these ID outside Granite Renderer.
    See Also:
      - Constant Field Values

  - ### kColorSpaceXformColorFilter_BuiltinStageID

    public static final int kColorSpaceXformColorFilter_BuiltinStageID
    Builtin Code Snippet ID, most are from Skia Graphite. Do not use these ID outside Granite Renderer.
    See Also:
      - Constant Field Values

  - ### kBlend_BuiltinStageID

    public static final int kBlend_BuiltinStageID
    Builtin Code Snippet ID, most are from Skia Graphite. Do not use these ID outside Granite Renderer.
    See Also:
      - Constant Field Values

  - ### kBlendModeBlender_BuiltinStageID

    public static final int kBlendModeBlender_BuiltinStageID
    Builtin Code Snippet ID, most are from Skia Graphite. Do not use these ID outside Granite Renderer.
    See Also:
      - Constant Field Values

  - ### kPorterDuffBlender_BuiltinStageID

    public static final int kPorterDuffBlender_BuiltinStageID
    Builtin Code Snippet ID, most are from Skia Graphite. Do not use these ID outside Granite Renderer.
    See Also:
      - Constant Field Values

  - ### kPrimitiveColor_BuiltinStageID

    public static final int kPrimitiveColor_BuiltinStageID
    Builtin Code Snippet ID, most are from Skia Graphite. Do not use these ID outside Granite Renderer.
    See Also:
      - Constant Field Values

  - ### kCompose_BuiltinStageID

    public static final int kCompose_BuiltinStageID
    Builtin Code Snippet ID, most are from Skia Graphite. Do not use these ID outside Granite Renderer.
    See Also:
      - Constant Field Values

  - ### kFirstFixedBlend_BuiltinStageID

    public static final int kFirstFixedBlend_BuiltinStageID
    See Also:
      - Constant Field Values

  - ### kLastFixedBlend_BuiltinStageID

    public static final int kLastFixedBlend_BuiltinStageID

  - ### kLast_BuiltinStageID

    public static final int kLast_BuiltinStageID

  - ### kBuiltinStageIDCount

    public static final int kBuiltinStageIDCount

  - ### kNone_ReqFlag

    public static final int kNone_ReqFlag
    Requirement flags.
    See Also:
      - Constant Field Values

  - ### kLocalCoords_ReqFlag

    public static final int kLocalCoords_ReqFlag
    Requirement flags.
    See Also:
      - Constant Field Values

  - ### kPriorStageOutput_ReqFlag

    public static final int kPriorStageOutput_ReqFlag
    Requirement flags.
    See Also:
      - Constant Field Values

  - ### kBlenderDstColor_ReqFlag

    public static final int kBlenderDstColor_ReqFlag
    Requirement flags.
    See Also:
      - Constant Field Values

  - ### kPrimitiveColor_ReqFlag

    public static final int kPrimitiveColor_ReqFlag
    See Also:
      - Constant Field Values

  - ### NO_FUNCTIONS

    public static final String[] NO_FUNCTIONS

  - ### NO_UNIFORMS

    public static final FragmentStage.Uniform[] NO_UNIFORMS

  - ### NO_SAMPLERS

    public static final FragmentStage.Sampler[] NO_SAMPLERS

  - ### mName

    public final String mName

  - ### mRequirementFlags

    public final int mRequirementFlags

  - ### mStaticFunctionName

    public final String mStaticFunctionName

  - ### mRequiredFunctions

    public final String[] mRequiredFunctions

  - ### mUniforms

    public final FragmentStage.Uniform[] mUniforms

  - ### mSamplers

    public final FragmentStage.Sampler[] mSamplers

  - ### mExpressionGenerator

    public final FragmentStage.GenerateExpression mExpressionGenerator

  - ### mNumChildren

    public final int mNumChildren

- ## Constructor Details

  - ### FragmentStage

    public FragmentStage(String name, int requirementFlags, String staticFunctionName, String[] requiredFunctions, FragmentStage.Uniform[] uniforms, FragmentStage.Sampler[] samplers, FragmentStage.GenerateExpression expressionGenerator, int numChildren)

- ## Method Details

  - ### name

    @Nonnull public String name()

  - ### generateUniforms

    public void generateUniforms(UniformHandler uniformHandler, int stageIndex)