michael@0: michael@0: /* michael@0: * Copyright 2012 Google Inc. michael@0: * michael@0: * Use of this source code is governed by a BSD-style license that can be michael@0: * found in the LICENSE file. michael@0: */ michael@0: michael@0: #include "GrProgramObj.h" michael@0: #include "GrShaderObj.h" michael@0: michael@0: void GrProgramObj::AttachShader(GrShaderObj *shader) { michael@0: shader->ref(); michael@0: fShaders.push_back(shader); michael@0: } michael@0: michael@0: void GrProgramObj::deleteAction() { michael@0: michael@0: // shaders are automatically detached from a deleted program. They will only be michael@0: // deleted if they were marked for deletion by a prior call to glDeleteShader michael@0: for (int i = 0; i < fShaders.count(); ++i) { michael@0: fShaders[i]->unref(); michael@0: } michael@0: fShaders.reset(); michael@0: michael@0: this->INHERITED::deleteAction(); michael@0: }