blob: 82ad3ab9f81d23e413831e2694f496a946517c56 [file] [log] [blame]
tomhudson@google.com168e6342012-04-18 17:49:20 +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 GrCustomStage_DEFINED
9#define GrCustomStage_DEFINED
10
tomhudson@google.com07eecdc2012-04-20 18:35:38 +000011#include "GrRefCnt.h"
12
tomhudson@google.com168e6342012-04-18 17:49:20 +000013class GrContext;
14class 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.com07eecdc2012-04-20 18:35:38 +000019class GrCustomStage : public GrRefCnt {
tomhudson@google.com168e6342012-04-18 17:49:20 +000020
21public:
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
tomhudson@google.com02b1ea22012-04-30 20:19:07 +000030 /** This pointer, besides creating back-end-specific helper
31 objects, is used for run-time-type-identification. Every
32 subclass must return a consistent unique value for it. */
tomhudson@google.com168e6342012-04-18 17:49:20 +000033 virtual GrGLProgramStageFactory* getGLFactory() = 0;
34
tomhudson@google.com168e6342012-04-18 17:49:20 +000035};
36
37#endif