Under normal circumstances, there will always be a passed texture. However, when running in the unit tests, CustomStages are constructed without a texture input.
Review URL: https://codereview.appspot.com/6450083
git-svn-id: http://skia.googlecode.com/svn/trunk@4924
2bbb7eff-a529-9590-31e7-
b0007b416f81
GrCustomStage::StageKey GrGLShaderBuilder::KeyForTextureAccess(const GrTextureAccess& access,
const GrGLCaps& caps) {
GrCustomStage::StageKey key = 0;
+
+ if (!access.getTexture()) {
+ return key;
+ }
+
// Assume that swizzle support implies that we never have to modify a shader to adjust
// for texture format/swizzle settings.
if (caps.textureSwizzleSupport()) {