Flutter Engine
The Flutter Engine
GrTessellationShader.h
Go to the documentation of this file.
1/*
2 * Copyright 2020 Google LLC.
3 *
4 * Use of this source code is governed by a BSD-style license that can be
5 * found in the LICENSE file.
6 */
7
8#ifndef GrTessellationShader_DEFINED
9#define GrTessellationShader_DEFINED
10
15
16class SkArenaAlloc;
17
18 // This is a common base class for shaders in the GPU tessellator.
20public:
22 const SkMatrix& viewMatrix,
23 const SkPMColor4f& color)
25 , fPrimitiveType(primitiveType)
26 , fViewMatrix(viewMatrix)
27 , fColor(color) {
28 }
29
30 GrPrimitiveType primitiveType() const { return fPrimitiveType; }
31 const SkMatrix& viewMatrix() const { return fViewMatrix; }
32 const SkPMColor4f& color() const { return fColor;}
33
34 struct ProgramArgs {
41 const GrCaps* fCaps;
42 };
43
44 static const GrPipeline* MakePipeline(const ProgramArgs&, GrAAType,
46
48 const GrTessellationShader* shader,
49 const GrPipeline* pipeline,
50 const GrUserStencilSettings* stencil) {
51 return args.fArena->make<GrProgramInfo>(*args.fCaps, args.fWriteView, args.fUsesMSAASurface,
52 pipeline, stencil, shader, shader->fPrimitiveType,
53 args.fXferBarrierFlags, args.fColorLoadOp);
54 }
55
56 // SkSL functions that calculate Wang's formula for cubics or conics.
57 static const char* WangsFormulaSkSL();
58
59private:
60 const GrPrimitiveType fPrimitiveType;
61 const SkMatrix fViewMatrix;
62 const SkPMColor4f fColor;
63};
64
65#endif
GrPrimitiveType
Definition: GrTypesPriv.h:43
GrAAType
Definition: GrTypesPriv.h:200
GrLoadOp
Definition: GrTypesPriv.h:155
GrXferBarrierFlags
Definition: GrCaps.h:57
ClassID classID() const
Definition: GrProcessor.h:129
GrPrimitiveType primitiveType() const
static const char * WangsFormulaSkSL()
const SkPMColor4f & color() const
static const GrPipeline * MakePipeline(const ProgramArgs &, GrAAType, GrAppliedClip &&, GrProcessorSet &&)
const SkMatrix & viewMatrix() const
GrTessellationShader(ClassID classID, GrPrimitiveType primitiveType, const SkMatrix &viewMatrix, const SkPMColor4f &color)
static GrProgramInfo * MakeProgram(const ProgramArgs &args, const GrTessellationShader *shader, const GrPipeline *pipeline, const GrUserStencilSettings *stencil)
G_BEGIN_DECLS G_MODULE_EXPORT FlValue * args
const GrSurfaceProxyView & fWriteView