aboutsummaryrefslogtreecommitdiffhomepage
path: root/src/gpu/gl/GrGpuGL.cpp
diff options
context:
space:
mode:
authorGravatar bsalomon@google.com <bsalomon@google.com@2bbb7eff-a529-9590-31e7-b0007b416f81>2012-07-31 15:33:25 +0000
committerGravatar bsalomon@google.com <bsalomon@google.com@2bbb7eff-a529-9590-31e7-b0007b416f81>2012-07-31 15:33:25 +0000
commit0982d35187da7e1ed6c0eba5951bbdadca8b33e7 (patch)
tree91635ad9da0506b043a5eaf382d091deb2fce178 /src/gpu/gl/GrGpuGL.cpp
parentbd5fa90dd12faf3aa5fe336907b71f9ad3bee7a6 (diff)
Make 0-texture GrCustomStages work.
Review URL: http://codereview.appspot.com/6448080/ git-svn-id: http://skia.googlecode.com/svn/trunk@4858 2bbb7eff-a529-9590-31e7-b0007b416f81
Diffstat (limited to 'src/gpu/gl/GrGpuGL.cpp')
-rw-r--r--src/gpu/gl/GrGpuGL.cpp12
1 files changed, 7 insertions, 5 deletions
diff --git a/src/gpu/gl/GrGpuGL.cpp b/src/gpu/gl/GrGpuGL.cpp
index 68f7a9a689..26018bf464 100644
--- a/src/gpu/gl/GrGpuGL.cpp
+++ b/src/gpu/gl/GrGpuGL.cpp
@@ -2135,13 +2135,15 @@ const GrGLenum tile_to_gl_wrap(SkShader::TileMode tm) {
void GrGpuGL::flushBoundTextureAndParams(int stage) {
GrDrawState* drawState = this->drawState();
- // FIXME: Assuming one texture maximum per custom stage
+ // FIXME: Assuming at most one texture per custom stage
const GrCustomStage* customStage = drawState->sampler(stage)->getCustomStage();
GrGLTexture* nextTexture = static_cast<GrGLTexture*>(customStage->texture(0));
- // Currently we always use the texture params from the GrSamplerState. Soon custom stages
- // will provide their own params.
- const GrTextureParams& texParams = drawState->getSampler(stage).getTextureParams();
- this->flushBoundTextureAndParams(stage, texParams, nextTexture);
+ if (NULL != nextTexture) {
+ // Currently we always use the texture params from the GrSamplerState. Soon custom stages
+ // will provide their own params.
+ const GrTextureParams& texParams = drawState->getSampler(stage).getTextureParams();
+ this->flushBoundTextureAndParams(stage, texParams, nextTexture);
+ }
}
void GrGpuGL::flushBoundTextureAndParams(int stage,