michael@0: 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: #include "GrTextureUnitObj.h" michael@0: #include "GrTextureObj.h" michael@0: michael@0: void GrTextureUnitObj::setTexture(GrTextureObj *texture) { michael@0: michael@0: if (fTexture) { michael@0: GrAlwaysAssert(fTexture->getBound(this)); michael@0: fTexture->resetBound(this); michael@0: michael@0: GrAlwaysAssert(!fTexture->getDeleted()); michael@0: fTexture->unref(); michael@0: } michael@0: michael@0: fTexture = texture; michael@0: michael@0: if (fTexture) { michael@0: GrAlwaysAssert(!fTexture->getDeleted()); michael@0: fTexture->ref(); michael@0: michael@0: GrAlwaysAssert(!fTexture->getBound(this)); michael@0: fTexture->setBound(this); michael@0: } michael@0: }