gfx/skia/trunk/src/gpu/gl/debug/GrProgramObj.h

Thu, 22 Jan 2015 13:21:57 +0100

author
Michael Schloh von Bennewitz <michael@schloh.com>
date
Thu, 22 Jan 2015 13:21:57 +0100
branch
TOR_BUG_9701
changeset 15
b8a032363ba2
permissions
-rw-r--r--

Incorporate requested changes from Mozilla in review:
https://bugzilla.mozilla.org/show_bug.cgi?id=1123480#c6

     2 /*
     3  * Copyright 2012 Google Inc.
     4  *
     5  * Use of this source code is governed by a BSD-style license that can be
     6  * found in the LICENSE file.
     7  */
     9 #ifndef GrProgramObj_DEFINED
    10 #define GrProgramObj_DEFINED
    12 #include "SkTArray.h"
    13 #include "GrFakeRefObj.h"
    14 class GrShaderObj;
    16 ////////////////////////////////////////////////////////////////////////////////
    17 class GrProgramObj : public GrFakeRefObj {
    18     GR_DEFINE_CREATOR(GrProgramObj);
    20 public:
    21     GrProgramObj()
    22         : GrFakeRefObj()
    23         , fInUse(false) {}
    25     void AttachShader(GrShaderObj *shader);
    27     virtual void deleteAction() SK_OVERRIDE;
    29     // TODO: this flag system won't work w/ multiple contexts!
    30     void setInUse()         { fInUse = true; }
    31     void resetInUse()       { fInUse = false; }
    32     bool getInUse() const   { return fInUse; }
    34 protected:
    36 private:
    37     SkTArray<GrShaderObj *> fShaders;
    38     bool fInUse;            // has this program been activated by a glUseProgram call?
    40     typedef GrFakeRefObj INHERITED;
    41 };
    43 #endif // GrProgramObj_DEFINED

mercurial