aboutsummaryrefslogtreecommitdiffhomepage
path: root/src/gpu/gl/GrGLPathProcessor.h
blob: 0f5cad2013a8e520d690a8d71a546ad960d51b0e (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
50
51
52
/*
 * Copyright 2013 Google Inc.
 *
 * Use of this source code is governed by a BSD-style license that can be
 * found in the LICENSE file.
 */

#ifndef GrGLPathProcessor_DEFINED
#define GrGLPathProcessor_DEFINED

#include "GrGLPrimitiveProcessor.h"

class GrPathProcessor;
class GrGLPathRendering;
class GrGLGpu;
class GrGLPathProgramDataManager;

class GrGLPathProcessor : public GrGLPrimitiveProcessor {
public:
    GrGLPathProcessor(const GrPathProcessor&, const GrBatchTracker&);

    static void GenKey(const GrPathProcessor&,
                       const GrBatchTracker& bt,
                       const GrGLSLCaps&,
                       GrProcessorKeyBuilder* b);

    void emitCode(EmitArgs&) override;

    void emitTransforms(GrGLGPBuilder*, const TransformsIn&, TransformsOut*);

    void bindSeparableVaryings(GrGLGpu* gpu, GrGLuint programID);
    void resolveSeparableVaryings(GrGLGpu* gpu, GrGLuint programId);

    void setData(const GrGLProgramDataManager&,
                 const GrPrimitiveProcessor&,
                 const GrBatchTracker&) override;

    void setTransformData(const GrPrimitiveProcessor&,
                          const GrGLPathProgramDataManager&,
                          int index,
                          const SkTArray<const GrCoordTransform*, true>& transforms);

    virtual void didSetData(GrGLPathRendering*) {}

private:
    UniformHandle fColorUniform;
    GrColor fColor;

    typedef GrGLPrimitiveProcessor INHERITED;
};

#endif