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 "GrGLSL.h" 9 #include "GrGLEffect.h" 10 GrGLEffect(const GrBackendEffectFactory & factory)11GrGLEffect::GrGLEffect(const GrBackendEffectFactory& factory) 12 : fFactory(factory) { 13 } 14 ~GrGLEffect()15GrGLEffect::~GrGLEffect() { 16 } 17 18 /////////////////////////////////////////////////////////////////////////////// 19 setData(const GrGLUniformManager &,const GrEffectStage &)20void GrGLEffect::setData(const GrGLUniformManager&, const GrEffectStage&) { 21 } 22 GenTextureKey(const GrEffectRef * effect,const GrGLCaps & caps)23GrGLEffect::EffectKey GrGLEffect::GenTextureKey(const GrEffectRef* effect, 24 const GrGLCaps& caps) { 25 EffectKey key = 0; 26 for (int index = 0; index < (*effect)->numTextures(); ++index) { 27 const GrTextureAccess& access = (*effect)->textureAccess(index); 28 EffectKey value = GrGLShaderBuilder::KeyForTextureAccess(access, caps) << index; 29 GrAssert(0 == (value & key)); // keys for each access ought not to overlap 30 key |= value; 31 } 32 return key; 33 } 34