blob: 0b888fa0b2673b436bc7b17dcbd6dee88b751312 [file] [log] [blame]
robertphillips@google.comdd743fe2012-04-05 14:40:53 +00001
2/*
3 * Copyright 2012 Google Inc.
4 *
5 * Use of this source code is governed by a BSD-style license that can be
6 * found in the LICENSE file.
7 */
8
9#ifndef GrShaderObj_DEFINED
10#define GrShaderObj_DEFINED
11
12#include "GrFakeRefObj.h"
bsalomon@google.com91bcc942012-05-07 17:28:41 +000013#include "../GrGLDefines.h"
robertphillips@google.comdd743fe2012-04-05 14:40:53 +000014
15////////////////////////////////////////////////////////////////////////////////
16class GrShaderObj : public GrFakeRefObj {
17 GR_DEFINE_CREATOR(GrShaderObj);
18
19public:
rmistry@google.comfbfcd562012-08-23 18:09:54 +000020 GrShaderObj()
robertphillips@google.comdd743fe2012-04-05 14:40:53 +000021 : GrFakeRefObj()
robertphillips@google.com0dd84a32012-04-16 16:24:35 +000022 , fType(GR_GL_VERTEX_SHADER) {}
robertphillips@google.comdd743fe2012-04-05 14:40:53 +000023
robertphillips@google.com0dd84a32012-04-16 16:24:35 +000024 void setType(GrGLenum type) { fType = type; }
25 GrGLenum getType() { return fType; }
robertphillips@google.comdd743fe2012-04-05 14:40:53 +000026
robertphillips@google.com0dd84a32012-04-16 16:24:35 +000027 virtual void deleteAction() SK_OVERRIDE;
robertphillips@google.comdd743fe2012-04-05 14:40:53 +000028
29protected:
30private:
31 GrGLenum fType; // either GR_GL_VERTEX_SHADER or GR_GL_FRAGMENT_SHADER
32
33 typedef GrFakeRefObj INHERITED;
34};
35
36#endif // GrShaderObj_DEFINED