blob: 209019623c6e8740b638e596c7e1d2dfef3aaa05 [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
bsalomon@google.com6d003d12012-09-11 15:45:20 +000024 virtual int numTextures() const SK_OVERRIDE;
25 virtual const GrTextureAccess& textureAccess(int index) const SK_OVERRIDE;
tomhudson@google.comd0c1a062012-07-12 17:23:52 +000026
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:
bsalomon@google.com0a7672f2012-08-03 18:12:20 +000034 GR_DECLARE_CUSTOM_STAGE_TEST;
35
bsalomon@google.com6d003d12012-09-11 15:45:20 +000036 GrTextureAccess fTextureAccess;
tomhudson@google.comd0c1a062012-07-12 17:23:52 +000037
38 typedef GrCustomStage INHERITED;
39};
40
41#endif