aboutsummaryrefslogtreecommitdiffhomepage
path: root/src/gpu/gl/GrGLPathProgram.h
blob: c7ca3dc226b95ef1eb92bc6495020f0f20b4d50e (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
37
38
39
40
41
42
43
44
45
46
47
48
49
/*
 * 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 GrGLPathProgram_DEFINED
#define GrGLPathProgram_DEFINED

#include "gl/GrGLProgram.h"
#include "gl/GrGLPathProgramDataManager.h"

/*
 * The default GrGL programs consist of at the very least a vertex and fragment shader.
 * 1.3+ Nvpr ignores the vertex shader, but both require
 * specialized methods for setting transform data.  NVPR also requires setting the
 * projection matrix through a special function call.
 */
class GrGLPathProgram : public GrGLProgram {
protected:
    typedef GrGLPathProgramDataManager::SeparableVaryingInfoArray SeparableVaryingInfoArray;
    GrGLPathProgram(GrGLGpu*,
                    const GrProgramDesc&,
                    const BuiltinUniformHandles&,
                    GrGLuint programID,
                    const UniformInfoArray&,
                    const SeparableVaryingInfoArray&,
                    GrGLInstalledGeoProc*,
                    GrGLInstalledXferProc* xferProcessor,
                    GrGLInstalledFragProcs* fragmentProcessors,
                    SkTArray<UniformHandle>* passSamplerUniforms);

private:
    void didSetData() override;
    virtual void setTransformData(const GrPrimitiveProcessor&,
                                  const GrPendingFragmentStage&,
                                  int index,
                                  GrGLInstalledFragProc*) override;
    void onSetRenderTargetState(const GrPrimitiveProcessor&, const GrPipeline&) override;

    friend class GrGLPathProgramBuilder;

    GrGLPathProgramDataManager fPathProgramDataManager;

    typedef GrGLProgram INHERITED;
};

#endif