diff options
Diffstat (limited to 'src/gpu/effects/GrSingleTextureEffect.cpp')
-rw-r--r-- | src/gpu/effects/GrSingleTextureEffect.cpp | 29 |
1 files changed, 29 insertions, 0 deletions
diff --git a/src/gpu/effects/GrSingleTextureEffect.cpp b/src/gpu/effects/GrSingleTextureEffect.cpp new file mode 100644 index 0000000000..a373ebe4e1 --- /dev/null +++ b/src/gpu/effects/GrSingleTextureEffect.cpp @@ -0,0 +1,29 @@ +/* + * Copyright 2012 Google Inc. + * + * Use of this source code is governed by a BSD-style license that can be + * found in the LICENSE file. + */ + +#include "effects/GrSingleTextureEffect.h" +#include "GrTexture.h" + +GrSingleTextureEffect::GrSingleTextureEffect(GrTexture* texture) + : fTexture (texture) { + SkSafeRef(fTexture); +} + +GrSingleTextureEffect::~GrSingleTextureEffect() { + SkSafeUnref(fTexture); +} + +unsigned int GrSingleTextureEffect::numTextures() const { + return 1; +} + +GrTexture* GrSingleTextureEffect::texture(unsigned int index) const { + GrAssert(0 == index); + return fTexture; +} + + |