GrSingleTextureEffect.h revision 115b06f3d51902a122621e897360ba80153527b3
1/*
2 * Copyright 2012 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 GrSingleTextureEffect_DEFINED
9#define GrSingleTextureEffect_DEFINED
10
11#include "GrEffect.h"
12
13class GrGLSingleTextureEffect;
14
15/**
16 * An effect that merely blits a single texture; commonly used as a base class.
17 */
18class GrSingleTextureEffect : public GrEffect {
19
20public:
21    /** Uses default texture params (unfiltered, clamp) */
22    GrSingleTextureEffect(GrTexture* texture);
23
24    /** Uses default tile mode (clamp) */
25    GrSingleTextureEffect(GrTexture* texture, bool bilerp);
26
27    GrSingleTextureEffect(GrTexture* texture, const GrTextureParams&);
28
29    virtual ~GrSingleTextureEffect();
30
31    virtual const GrTextureAccess& textureAccess(int index) const SK_OVERRIDE;
32
33    static const char* Name() { return "Single Texture"; }
34
35    typedef GrGLSingleTextureEffect GLEffect;
36
37    virtual const GrBackendEffectFactory& getFactory() const SK_OVERRIDE;
38
39private:
40    GR_DECLARE_EFFECT_TEST;
41
42    GrTextureAccess fTextureAccess;
43
44    typedef GrEffect INHERITED;
45};
46
47#endif
48