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

#ifndef GrTextureDomainEffect_DEFINED
#define GrTextureDomainEffect_DEFINED

//#include "GrCustomStage.h"
#include "GrSingleTextureEffect.h"
#include "GrRect.h"

class GrGLTextureDomainEffect;

/**
 * Limits a texture's lookup coordinates to a domain.
 */
class GrTextureDomainEffect : public GrSingleTextureEffect {

public:

    GrTextureDomainEffect(GrTexture*, GrRect domain);
    virtual ~GrTextureDomainEffect();

    static const char* Name() { return "TextureDomain"; }

    typedef GrGLTextureDomainEffect GLProgramStage;

    virtual const GrProgramStageFactory& getFactory() const SK_OVERRIDE;
    virtual bool isEqual(const GrCustomStage&) const SK_OVERRIDE;

    const GrRect& domain() const { return fTextureDomain; }

protected:

    GrRect fTextureDomain;

private:

    typedef GrSingleTextureEffect INHERITED;
};

#endif