Thu, 22 Jan 2015 13:21:57 +0100
Incorporate requested changes from Mozilla in review:
https://bugzilla.mozilla.org/show_bug.cgi?id=1123480#c6
1 /*
2 * Copyright 2012 Google Inc.
3 *
4 * Use of this source code is governed by a BSD-style license that can be
5 * found in the LICENSE file.
6 */
8 #ifndef GrTextureUnitObj_DEFINED
9 #define GrTextureUnitObj_DEFINED
11 #include "GrFakeRefObj.h"
12 class GrTextureObj;
14 ////////////////////////////////////////////////////////////////////////////////
15 // Although texture unit objects are allocated & deallocated like the other
16 // GL emulation objects they are derived from GrFakeRefObj to provide some
17 // uniformity in how the GrDebugGL class manages resources
18 class GrTextureUnitObj : public GrFakeRefObj {
19 GR_DEFINE_CREATOR(GrTextureUnitObj);
21 public:
22 GrTextureUnitObj()
23 : GrFakeRefObj()
24 , fNumber(0)
25 , fTexture(NULL) {
26 }
28 void setNumber(GrGLenum number) {
29 fNumber = number;
30 }
31 GrGLenum getNumber() const { return fNumber; }
33 void setTexture(GrTextureObj *texture);
34 GrTextureObj *getTexture() { return fTexture; }
36 protected:
37 private:
38 GrGLenum fNumber;
39 GrTextureObj *fTexture;
41 typedef GrFakeRefObj INHERITED;
42 };
44 #endif // GrTextureUnitObj_DEFINED