diff options
author | 2012-07-12 17:23:52 +0000 | |
---|---|---|
committer | 2012-07-12 17:23:52 +0000 | |
commit | d0c1a06cb98dd4a009dfa79e37ba6ca23a8c180b (patch) | |
tree | 8da05f518d09f633dfd00f94b45593182089deac /src/gpu/gl/GrGpuGL.cpp | |
parent | d7727ceb82e271f8b5580c51571c57b09c5e3ced (diff) |
Introduces new SingleTextureEffect base class for GrCustomStage objects.
This class tracks the texture that the object uses. A future commit will get rid of the
GrTexture pointer currenty stored in the GrDrawState, allowing us to have CustomStages
*without* textures.
Requires gyp change on next roll.
http://codereview.appspot.com/6306097/
git-svn-id: http://skia.googlecode.com/svn/trunk@4576 2bbb7eff-a529-9590-31e7-b0007b416f81
Diffstat (limited to 'src/gpu/gl/GrGpuGL.cpp')
-rw-r--r-- | src/gpu/gl/GrGpuGL.cpp | 15 |
1 files changed, 15 insertions, 0 deletions
diff --git a/src/gpu/gl/GrGpuGL.cpp b/src/gpu/gl/GrGpuGL.cpp index 7ebe9d7f06..edabb9c108 100644 --- a/src/gpu/gl/GrGpuGL.cpp +++ b/src/gpu/gl/GrGpuGL.cpp @@ -2140,6 +2140,21 @@ void GrGpuGL::flushBoundTextureAndParams(int stage) { GrGLTexture* nextTexture = static_cast<GrGLTexture*>(drawState->getTexture(stage)); + // HACK - if we're using a new SingleTextureEffect, override + // the old texture pointer + const GrSamplerState& sampler = drawState->getSampler(stage); + GrCustomStage* customStage = sampler.getCustomStage(); + if (customStage && customStage->numTextures()) { + nextTexture = + static_cast<GrGLTexture*>(customStage->texture(0)); + } + + flushBoundTextureAndParams(stage, nextTexture); +} + +void GrGpuGL::flushBoundTextureAndParams(int stage, GrGLTexture* nextTexture) { + GrDrawState* drawState = this->drawState(); + // true for now, but maybe not with GrEffect. GrAssert(NULL != nextTexture); // if we created a rt/tex and rendered to it without using a |