OLD | NEW |
| (Empty) |
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 */ | |
7 | |
8 #include "GrTextureUnitObj.h" | |
9 #include "GrTextureObj.h" | |
10 | |
11 void GrTextureUnitObj::setTexture(GrTextureObj *texture) { | |
12 | |
13 if (fTexture) { | |
14 GrAlwaysAssert(fTexture->getBound(this)); | |
15 fTexture->resetBound(this); | |
16 | |
17 GrAlwaysAssert(!fTexture->getDeleted()); | |
18 fTexture->unref(); | |
19 } | |
20 | |
21 fTexture = texture; | |
22 | |
23 if (fTexture) { | |
24 GrAlwaysAssert(!fTexture->getDeleted()); | |
25 fTexture->ref(); | |
26 | |
27 GrAlwaysAssert(!fTexture->getBound(this)); | |
28 fTexture->setBound(this); | |
29 } | |
30 } | |
OLD | NEW |