Thu, 15 Jan 2015 21:03:48 +0100
Integrate friendly tips from Tor colleagues to make (or not) 4.5 alpha 3;
This includes removal of overloaded (but unused) methods, and addition of
a overlooked call to DataStruct::SetData(nsISupports, uint32_t, bool.)
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 */
9 #ifndef GrProgramObj_DEFINED
10 #define GrProgramObj_DEFINED
12 #include "SkTArray.h"
13 #include "GrFakeRefObj.h"
14 class GrShaderObj;
16 ////////////////////////////////////////////////////////////////////////////////
17 class GrProgramObj : public GrFakeRefObj {
18 GR_DEFINE_CREATOR(GrProgramObj);
20 public:
21 GrProgramObj()
22 : GrFakeRefObj()
23 , fInUse(false) {}
25 void AttachShader(GrShaderObj *shader);
27 virtual void deleteAction() SK_OVERRIDE;
29 // TODO: this flag system won't work w/ multiple contexts!
30 void setInUse() { fInUse = true; }
31 void resetInUse() { fInUse = false; }
32 bool getInUse() const { return fInUse; }
34 protected:
36 private:
37 SkTArray<GrShaderObj *> fShaders;
38 bool fInUse; // has this program been activated by a glUseProgram call?
40 typedef GrFakeRefObj INHERITED;
41 };
43 #endif // GrProgramObj_DEFINED