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

#ifndef GrGLSLSampler_DEFINED
#define GrGLSLSampler_DEFINED

#include "GrTypes.h"
#include "SkTArray.h"
#include "glsl/GrGLSLProgramDataManager.h"

class GrGLSLSampler {
public:
    typedef GrGLSLProgramDataManager::UniformHandle UniformHandle;
    typedef SkTArray<GrGLSLSampler> SamplerArray;

    GrGLSLSampler(UniformHandle uniform, GrPixelConfig config)
        : fSamplerUniform(uniform)
        , fConfig(config) {
        SkASSERT(kUnknown_GrPixelConfig != fConfig);
    }

    GrPixelConfig config() const { return fConfig; }

private:
    UniformHandle fSamplerUniform;
    GrPixelConfig fConfig;

    friend class GrGLSLShaderBuilder;
};

#endif