blob: 6157175cb460809cd90763fbf4baff7d640bb1cd [file] [log] [blame]
tomhudson@google.com2f68e762012-07-17 18:43:21 +00001/*
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 GrTextureDomainEffect_DEFINED
9#define GrTextureDomainEffect_DEFINED
10
11//#include "GrCustomStage.h"
12#include "GrSingleTextureEffect.h"
13#include "GrRect.h"
14
15class GrGLTextureDomainEffect;
16
17/**
18 * Limits a texture's lookup coordinates to a domain.
19 */
20class GrTextureDomainEffect : public GrSingleTextureEffect {
21
22public:
23
24 GrTextureDomainEffect(GrTexture*, GrRect domain);
25 virtual ~GrTextureDomainEffect();
26
27 static const char* Name() { return "TextureDomain"; }
28
29 typedef GrGLTextureDomainEffect GLProgramStage;
30
31 virtual const GrProgramStageFactory& getFactory() const SK_OVERRIDE;
32 virtual bool isEqual(const GrCustomStage&) const SK_OVERRIDE;
33
34 const GrRect& domain() const { return fTextureDomain; }
35
36protected:
37
38 GrRect fTextureDomain;
39
40private:
41
42 typedef GrSingleTextureEffect INHERITED;
43};
44
45#endif