2016-03-31 01:56:19 +00:00
|
|
|
|
2012-04-05 14:40:53 +00:00
|
|
|
/*
|
|
|
|
* Copyright 2012 Google Inc.
|
|
|
|
*
|
|
|
|
* Use of this source code is governed by a BSD-style license that can be
|
|
|
|
* found in the LICENSE file.
|
|
|
|
*/
|
|
|
|
|
|
|
|
#ifndef GrShaderObj_DEFINED
|
|
|
|
#define GrShaderObj_DEFINED
|
|
|
|
|
|
|
|
#include "GrFakeRefObj.h"
|
2016-03-31 01:56:19 +00:00
|
|
|
#include "gl/GrGLDefines.h"
|
2012-04-05 14:40:53 +00:00
|
|
|
|
|
|
|
////////////////////////////////////////////////////////////////////////////////
|
|
|
|
class GrShaderObj : public GrFakeRefObj {
|
|
|
|
GR_DEFINE_CREATOR(GrShaderObj);
|
|
|
|
|
|
|
|
public:
|
2012-08-23 18:09:54 +00:00
|
|
|
GrShaderObj()
|
2012-04-05 14:40:53 +00:00
|
|
|
: GrFakeRefObj()
|
2012-04-16 16:24:35 +00:00
|
|
|
, fType(GR_GL_VERTEX_SHADER) {}
|
2012-04-05 14:40:53 +00:00
|
|
|
|
2012-04-16 16:24:35 +00:00
|
|
|
void setType(GrGLenum type) { fType = type; }
|
|
|
|
GrGLenum getType() { return fType; }
|
2012-04-05 14:40:53 +00:00
|
|
|
|
2015-03-26 01:17:31 +00:00
|
|
|
void deleteAction() override;
|
2012-04-05 14:40:53 +00:00
|
|
|
|
|
|
|
protected:
|
|
|
|
private:
|
|
|
|
GrGLenum fType; // either GR_GL_VERTEX_SHADER or GR_GL_FRAGMENT_SHADER
|
|
|
|
|
|
|
|
typedef GrFakeRefObj INHERITED;
|
|
|
|
};
|
|
|
|
|
|
|
|
#endif // GrShaderObj_DEFINED
|