aboutsummaryrefslogtreecommitdiffhomepage
path: root/src/gpu/gl/GrGLVaryingHandler.h
blob: e08a6c61510d1e0995e55d6a35f44a63887181c2 (plain)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
/*
 * Copyright 2015 Google Inc.
 *
 * Use of this source code is governed by a BSD-style license that can be
 * found in the LICENSE file.
 */

#ifndef GrGLVaryingHandler_DEFINED
#define GrGLVaryingHandler_DEFINED

#include "glsl/GrGLSLVarying.h"
#include "GrTypesPriv.h"
#include "gl/GrGLProgramDataManager.h"

class GrGLVaryingHandler : public GrGLSLVaryingHandler {
public:
    GrGLVaryingHandler(GrGLSLProgramBuilder* program)
        : INHERITED(program),
        fPathProcVaryingInfos(kVaryingsPerBlock) {}

    // This function is used by the NVPR PathProcessor to add a varying directly into the fragment
    // shader since there is no vertex shader.
    VaryingHandle addPathProcessingVarying(const char* name, GrGLSLVertToFrag*,
                                           GrSLPrecision fsPrecision = kDefault_GrSLPrecision);

private:
    void onFinalize() override;

    GrGLProgramDataManager::VaryingInfoArray fPathProcVaryingInfos;

    friend class GrGLProgramBuilder;

    typedef GrGLSLVaryingHandler INHERITED;
};

#endif