gfx/angle/src/libGLESv2/HandleAllocator.h

changeset 0
6474c204b198
     1.1 --- /dev/null	Thu Jan 01 00:00:00 1970 +0000
     1.2 +++ b/gfx/angle/src/libGLESv2/HandleAllocator.h	Wed Dec 31 06:09:35 2014 +0100
     1.3 @@ -0,0 +1,45 @@
     1.4 +//
     1.5 +// Copyright (c) 2002-2011 The ANGLE Project Authors. All rights reserved.
     1.6 +// Use of this source code is governed by a BSD-style license that can be
     1.7 +// found in the LICENSE file.
     1.8 +//
     1.9 +
    1.10 +// HandleAllocator.h: Defines the gl::HandleAllocator class, which is used to
    1.11 +// allocate GL handles.
    1.12 +
    1.13 +#ifndef LIBGLESV2_HANDLEALLOCATOR_H_
    1.14 +#define LIBGLESV2_HANDLEALLOCATOR_H_
    1.15 +
    1.16 +#define GL_APICALL
    1.17 +#include <GLES2/gl2.h>
    1.18 +
    1.19 +#include <vector>
    1.20 +
    1.21 +#include "common/angleutils.h"
    1.22 +
    1.23 +namespace gl
    1.24 +{
    1.25 +
    1.26 +class HandleAllocator
    1.27 +{
    1.28 +  public:
    1.29 +    HandleAllocator();
    1.30 +    virtual ~HandleAllocator();
    1.31 +
    1.32 +    void setBaseHandle(GLuint value);
    1.33 +
    1.34 +    GLuint allocate();
    1.35 +    void release(GLuint handle);
    1.36 +
    1.37 +  private:
    1.38 +    DISALLOW_COPY_AND_ASSIGN(HandleAllocator);
    1.39 +
    1.40 +    GLuint mBaseValue;
    1.41 +    GLuint mNextValue;
    1.42 +    typedef std::vector<GLuint> HandleList;
    1.43 +    HandleList mFreeValues;
    1.44 +};
    1.45 +
    1.46 +}
    1.47 +
    1.48 +#endif   // LIBGLESV2_HANDLEALLOCATOR_H_

mercurial