• Home
  • Line#
  • Scopes#
  • Navigate#
  • Raw
  • Download
1 
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 GrTextreUnitObj_DEFINED
10 #define GrTextureUnitObj_DEFINED
11 
12 #include "GrFakeRefObj.h"
13 class GrTextureObj;
14 
15 ////////////////////////////////////////////////////////////////////////////////
16 // Although texture unit objects are allocated & deallocated like the other
17 // GL emulation objects they are derived from GrFakeRefObj to provide some
18 // uniformity in how the GrDebugGL class manages resources
19 class GrTextureUnitObj : public GrFakeRefObj {
20     GR_DEFINE_CREATOR(GrTextureUnitObj);
21 
22 public:
GrTextureUnitObj()23     GrTextureUnitObj()
24         : GrFakeRefObj()
25         , fNumber(0)
26         , fTexture(NULL) {
27     }
28 
setNumber(GrGLenum number)29     void setNumber(GrGLenum number) {
30         fNumber = number;
31     }
getNumber()32     GrGLenum getNumber() const { return fNumber; }
33 
34     void setTexture(GrTextureObj *texture);
getTexture()35     GrTextureObj *getTexture()                  { return fTexture; }
36 
37 protected:
38 private:
39     GrGLenum fNumber;
40     GrTextureObj *fTexture;
41 
42     typedef GrFakeRefObj INHERITED;
43 };
44 
45 #endif // GrTextureUnitObj_DEFINED
46