tomhudson@google.com | d0c1a06 | 2012-07-12 17:23:52 +0000 | [diff] [blame^] | 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 "effects/GrSingleTextureEffect.h" |
| 9 | #include "GrTexture.h" |
| 10 | |
| 11 | GrSingleTextureEffect::GrSingleTextureEffect(GrTexture* texture) |
| 12 | : fTexture (texture) { |
| 13 | SkSafeRef(fTexture); |
| 14 | } |
| 15 | |
| 16 | GrSingleTextureEffect::~GrSingleTextureEffect() { |
| 17 | SkSafeUnref(fTexture); |
| 18 | } |
| 19 | |
| 20 | unsigned int GrSingleTextureEffect::numTextures() const { |
| 21 | return 1; |
| 22 | } |
| 23 | |
| 24 | GrTexture* GrSingleTextureEffect::texture(unsigned int index) const { |
| 25 | GrAssert(0 == index); |
| 26 | return fTexture; |
| 27 | } |
| 28 | |
| 29 | |