blob: c49dac8859098fe9b6690ed90a75a4faf74578f7 [file] [log] [blame]
tomhudson@google.comd0c1a062012-07-12 17:23:52 +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 GrSingleTextureEffect_DEFINED
9#define GrSingleTextureEffect_DEFINED
10
11#include "GrCustomStage.h"
12
tomhudson@google.comaa72eab2012-07-19 18:01:07 +000013class GrGLSingleTextureEffect;
14
15/**
16 * An effect that merely blits a single texture; commonly used as a base class.
17 */
tomhudson@google.comd0c1a062012-07-12 17:23:52 +000018class GrSingleTextureEffect : public GrCustomStage {
19
20public:
21 GrSingleTextureEffect(GrTexture* texture);
22 virtual ~GrSingleTextureEffect();
23
24 virtual unsigned int numTextures() const SK_OVERRIDE;
25 virtual GrTexture* texture(unsigned int index) const SK_OVERRIDE;
26
tomhudson@google.comaa72eab2012-07-19 18:01:07 +000027 static const char* Name() { return "Single Texture"; }
28
29 typedef GrGLSingleTextureEffect GLProgramStage;
30
31 virtual const GrProgramStageFactory& getFactory() const SK_OVERRIDE;
32
tomhudson@google.comd0c1a062012-07-12 17:23:52 +000033private:
34 GrTexture* fTexture;
35
36 typedef GrCustomStage INHERITED;
37};
38
39#endif