Flutter Engine
The Flutter Engine
GrGLSLVertexGeoBuilder.h
Go to the documentation of this file.
1/*
2 * Copyright 2017 Google Inc.
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 GrGLSLVertexGeoBuilder_DEFINED
9#define GrGLSLVertexGeoBuilder_DEFINED
10
15
17
18/**
19 * Base class for vertex shader builder. This is the stage that computes input geometry for the
20 * rasterizer.
21 */
23public:
24 // Copies the given text verbatim to the function definitions section. Does not mangle the name.
25 // 'functionDefinition' should be a fully valid SkSL function, complete with return type, name,
26 // arguments, braces, and a body.
27 void insertFunction(const char* functionDefinition) {
28 this->functions().append(functionDefinition);
29 }
32
33protected:
35
36 void emitNormalizedSkPosition(const char* devPos, SkSLType devPosType = SkSLType::kFloat2) {
37 this->emitNormalizedSkPosition(&this->code(), devPos, devPosType);
38 }
39
40 void emitNormalizedSkPosition(SkString* out, const char* devPos,
41 SkSLType devPosType = SkSLType::kFloat2);
42
44
46};
47
48
50public:
52
53private:
54 void onFinalize() override;
55
56 friend class GrGLProgramBuilder;
57
59};
60
61#endif
SkSLType
GrGLSLShaderBuilder(GrGLSLProgramBuilder *program)
this code().appendVAList(format
GrGLSLVertexBuilder(GrGLSLProgramBuilder *program)
void emitNormalizedSkPosition(const char *devPos, SkSLType devPosType=SkSLType::kFloat2)
void insertFunction(const char *functionDefinition)
this code().appendVAList(format
GrGLSLVertexGeoBuilder(GrGLSLProgramBuilder *program)
void append(const char text[])
Definition: SkString.h:203