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

changeset 0
6474c204b198
     1.1 --- /dev/null	Thu Jan 01 00:00:00 1970 +0000
     1.2 +++ b/gfx/skia/trunk/src/gpu/gl/debug/GrTextureUnitObj.h	Wed Dec 31 06:09:35 2014 +0100
     1.3 @@ -0,0 +1,44 @@
     1.4 +/*
     1.5 + * Copyright 2012 Google Inc.
     1.6 + *
     1.7 + * Use of this source code is governed by a BSD-style license that can be
     1.8 + * found in the LICENSE file.
     1.9 + */
    1.10 +
    1.11 +#ifndef GrTextureUnitObj_DEFINED
    1.12 +#define GrTextureUnitObj_DEFINED
    1.13 +
    1.14 +#include "GrFakeRefObj.h"
    1.15 +class GrTextureObj;
    1.16 +
    1.17 +////////////////////////////////////////////////////////////////////////////////
    1.18 +// Although texture unit objects are allocated & deallocated like the other
    1.19 +// GL emulation objects they are derived from GrFakeRefObj to provide some
    1.20 +// uniformity in how the GrDebugGL class manages resources
    1.21 +class GrTextureUnitObj : public GrFakeRefObj {
    1.22 +    GR_DEFINE_CREATOR(GrTextureUnitObj);
    1.23 +
    1.24 +public:
    1.25 +    GrTextureUnitObj()
    1.26 +        : GrFakeRefObj()
    1.27 +        , fNumber(0)
    1.28 +        , fTexture(NULL) {
    1.29 +    }
    1.30 +
    1.31 +    void setNumber(GrGLenum number) {
    1.32 +        fNumber = number;
    1.33 +    }
    1.34 +    GrGLenum getNumber() const { return fNumber; }
    1.35 +
    1.36 +    void setTexture(GrTextureObj *texture);
    1.37 +    GrTextureObj *getTexture()                  { return fTexture; }
    1.38 +
    1.39 +protected:
    1.40 +private:
    1.41 +    GrGLenum fNumber;
    1.42 +    GrTextureObj *fTexture;
    1.43 +
    1.44 +    typedef GrFakeRefObj INHERITED;
    1.45 +};
    1.46 +
    1.47 +#endif // GrTextureUnitObj_DEFINED

mercurial