180bacfeb4bda06541e8695bd502229727bccfeaJean-Baptiste Queru
280bacfeb4bda06541e8695bd502229727bccfeaJean-Baptiste Queru/*
380bacfeb4bda06541e8695bd502229727bccfeaJean-Baptiste Queru * Copyright 2012 Google Inc.
480bacfeb4bda06541e8695bd502229727bccfeaJean-Baptiste Queru *
580bacfeb4bda06541e8695bd502229727bccfeaJean-Baptiste Queru * Use of this source code is governed by a BSD-style license that can be
680bacfeb4bda06541e8695bd502229727bccfeaJean-Baptiste Queru * found in the LICENSE file.
780bacfeb4bda06541e8695bd502229727bccfeaJean-Baptiste Queru */
880bacfeb4bda06541e8695bd502229727bccfeaJean-Baptiste Queru
980bacfeb4bda06541e8695bd502229727bccfeaJean-Baptiste Queru#ifndef GrShaderObj_DEFINED
1080bacfeb4bda06541e8695bd502229727bccfeaJean-Baptiste Queru#define GrShaderObj_DEFINED
1180bacfeb4bda06541e8695bd502229727bccfeaJean-Baptiste Queru
1280bacfeb4bda06541e8695bd502229727bccfeaJean-Baptiste Queru#include "GrFakeRefObj.h"
1380bacfeb4bda06541e8695bd502229727bccfeaJean-Baptiste Queru#include "../GrGLDefines.h"
1480bacfeb4bda06541e8695bd502229727bccfeaJean-Baptiste Queru
1580bacfeb4bda06541e8695bd502229727bccfeaJean-Baptiste Queru////////////////////////////////////////////////////////////////////////////////
1680bacfeb4bda06541e8695bd502229727bccfeaJean-Baptiste Queruclass GrShaderObj : public GrFakeRefObj {
1780bacfeb4bda06541e8695bd502229727bccfeaJean-Baptiste Queru    GR_DEFINE_CREATOR(GrShaderObj);
1880bacfeb4bda06541e8695bd502229727bccfeaJean-Baptiste Queru
1980bacfeb4bda06541e8695bd502229727bccfeaJean-Baptiste Querupublic:
2080bacfeb4bda06541e8695bd502229727bccfeaJean-Baptiste Queru    GrShaderObj()
2180bacfeb4bda06541e8695bd502229727bccfeaJean-Baptiste Queru        : GrFakeRefObj()
2280bacfeb4bda06541e8695bd502229727bccfeaJean-Baptiste Queru        , fType(GR_GL_VERTEX_SHADER)    {}
2380bacfeb4bda06541e8695bd502229727bccfeaJean-Baptiste Queru
2480bacfeb4bda06541e8695bd502229727bccfeaJean-Baptiste Queru    void setType(GrGLenum type)         { fType = type; }
2580bacfeb4bda06541e8695bd502229727bccfeaJean-Baptiste Queru    GrGLenum getType()                  { return fType; }
2680bacfeb4bda06541e8695bd502229727bccfeaJean-Baptiste Queru
2780bacfeb4bda06541e8695bd502229727bccfeaJean-Baptiste Queru    virtual void deleteAction() SK_OVERRIDE;
2880bacfeb4bda06541e8695bd502229727bccfeaJean-Baptiste Queru
2980bacfeb4bda06541e8695bd502229727bccfeaJean-Baptiste Queruprotected:
3080bacfeb4bda06541e8695bd502229727bccfeaJean-Baptiste Queruprivate:
3180bacfeb4bda06541e8695bd502229727bccfeaJean-Baptiste Queru    GrGLenum fType;  // either GR_GL_VERTEX_SHADER or GR_GL_FRAGMENT_SHADER
3280bacfeb4bda06541e8695bd502229727bccfeaJean-Baptiste Queru
3380bacfeb4bda06541e8695bd502229727bccfeaJean-Baptiste Queru    typedef GrFakeRefObj INHERITED;
3480bacfeb4bda06541e8695bd502229727bccfeaJean-Baptiste Queru};
3580bacfeb4bda06541e8695bd502229727bccfeaJean-Baptiste Queru
3680bacfeb4bda06541e8695bd502229727bccfeaJean-Baptiste Queru#endif // GrShaderObj_DEFINED
37