michael@0: /* michael@0: * Copyright 2012 Google Inc. michael@0: * michael@0: * Use of this source code is governed by a BSD-style license that can be michael@0: * found in the LICENSE file. michael@0: */ michael@0: michael@0: #ifndef GrTextureUnitObj_DEFINED michael@0: #define GrTextureUnitObj_DEFINED michael@0: michael@0: #include "GrFakeRefObj.h" michael@0: class GrTextureObj; michael@0: michael@0: //////////////////////////////////////////////////////////////////////////////// michael@0: // Although texture unit objects are allocated & deallocated like the other michael@0: // GL emulation objects they are derived from GrFakeRefObj to provide some michael@0: // uniformity in how the GrDebugGL class manages resources michael@0: class GrTextureUnitObj : public GrFakeRefObj { michael@0: GR_DEFINE_CREATOR(GrTextureUnitObj); michael@0: michael@0: public: michael@0: GrTextureUnitObj() michael@0: : GrFakeRefObj() michael@0: , fNumber(0) michael@0: , fTexture(NULL) { michael@0: } michael@0: michael@0: void setNumber(GrGLenum number) { michael@0: fNumber = number; michael@0: } michael@0: GrGLenum getNumber() const { return fNumber; } michael@0: michael@0: void setTexture(GrTextureObj *texture); michael@0: GrTextureObj *getTexture() { return fTexture; } michael@0: michael@0: protected: michael@0: private: michael@0: GrGLenum fNumber; michael@0: GrTextureObj *fTexture; michael@0: michael@0: typedef GrFakeRefObj INHERITED; michael@0: }; michael@0: michael@0: #endif // GrTextureUnitObj_DEFINED