tomhudson@google.com | 168e634 | 2012-04-18 17:49:20 +0000 | [diff] [blame] | 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 GrCustomStage_DEFINED |
| 9 | #define GrCustomStage_DEFINED |
| 10 | |
tomhudson@google.com | 07eecdc | 2012-04-20 18:35:38 +0000 | [diff] [blame^] | 11 | #include "GrRefCnt.h" |
| 12 | |
tomhudson@google.com | 168e634 | 2012-04-18 17:49:20 +0000 | [diff] [blame] | 13 | class GrContext; |
| 14 | class GrGLProgramStageFactory; |
| 15 | |
| 16 | /** Provides custom vertex shader, fragment shader, uniform data for a |
| 17 | particular stage of the Ganesh shading pipeline. |
| 18 | TODO: may want to refcount these? */ |
tomhudson@google.com | 07eecdc | 2012-04-20 18:35:38 +0000 | [diff] [blame^] | 19 | class GrCustomStage : public GrRefCnt { |
tomhudson@google.com | 168e634 | 2012-04-18 17:49:20 +0000 | [diff] [blame] | 20 | |
| 21 | public: |
| 22 | |
| 23 | GrCustomStage(); |
| 24 | virtual ~GrCustomStage(); |
| 25 | |
| 26 | /** If given an input texture that is/is not opaque, is this |
| 27 | stage guaranteed to produce an opaque output? */ |
| 28 | virtual bool isOpaque(bool inputTextureIsOpaque) const; |
| 29 | |
| 30 | virtual GrGLProgramStageFactory* getGLFactory() = 0; |
| 31 | |
| 32 | protected: |
| 33 | |
| 34 | }; |
| 35 | |
| 36 | #endif |