Home | History | Annotate | Download | only in gl
      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 
     11 GrGLEffect::GrGLEffect(const GrBackendEffectFactory& factory)
     12     : fFactory(factory) {
     13 }
     14 
     15 GrGLEffect::~GrGLEffect() {
     16 }
     17 
     18 ///////////////////////////////////////////////////////////////////////////////
     19 
     20 void GrGLEffect::setData(const GrGLUniformManager&, const GrEffectStage&) {
     21 }
     22 
     23 GrGLEffect::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