gfx/angle/src/libGLESv2/Program.h

Sat, 03 Jan 2015 20:18:00 +0100

author
Michael Schloh von Bennewitz <michael@schloh.com>
date
Sat, 03 Jan 2015 20:18:00 +0100
branch
TOR_BUG_3246
changeset 7
129ffea94266
permissions
-rw-r--r--

Conditionally enable double key logic according to:
private browsing mode or privacy.thirdparty.isolate preference and
implement in GetCookieStringCommon and FindCookie where it counts...
With some reservations of how to convince FindCookie users to test
condition and pass a nullptr when disabling double key logic.

     1 //
     2 // Copyright (c) 2002-2012 The ANGLE Project Authors. All rights reserved.
     3 // Use of this source code is governed by a BSD-style license that can be
     4 // found in the LICENSE file.
     5 //
     7 // Program.h: Defines the gl::Program class. Implements GL program objects
     8 // and related functionality. [OpenGL ES 2.0.24] section 2.10.3 page 28.
    10 #ifndef LIBGLESV2_PROGRAM_H_
    11 #define LIBGLESV2_PROGRAM_H_
    13 #include <string>
    14 #include <set>
    16 #include "common/angleutils.h"
    17 #include "common/RefCountObject.h"
    18 #include "libGLESv2/Constants.h"
    20 namespace rx
    21 {
    22 class Renderer;
    23 }
    25 namespace gl
    26 {
    27 class ResourceManager;
    28 class FragmentShader;
    29 class VertexShader;
    30 class ProgramBinary;
    31 class Shader;
    33 extern const char * const g_fakepath;
    35 class AttributeBindings
    36 {
    37   public:
    38     AttributeBindings();
    39     ~AttributeBindings();
    41     void bindAttributeLocation(GLuint index, const char *name);
    42     int getAttributeBinding(const std::string &name) const;
    44   private:
    45     std::set<std::string> mAttributeBinding[MAX_VERTEX_ATTRIBS];
    46 };
    48 class InfoLog
    49 {
    50   public:
    51     InfoLog();
    52     ~InfoLog();
    54     int getLength() const;
    55     void getLog(GLsizei bufSize, GLsizei *length, char *infoLog);
    57     void appendSanitized(const char *message);
    58     void append(const char *info, ...);
    59     void reset();
    60   private:
    61     DISALLOW_COPY_AND_ASSIGN(InfoLog);
    62     char *mInfoLog;
    63 };
    65 class Program
    66 {
    67   public:
    68     Program(rx::Renderer *renderer, ResourceManager *manager, GLuint handle);
    70     ~Program();
    72     bool attachShader(Shader *shader);
    73     bool detachShader(Shader *shader);
    74     int getAttachedShadersCount() const;
    76     void bindAttributeLocation(GLuint index, const char *name);
    78     bool link();
    79     bool isLinked();
    80     bool setProgramBinary(const void *binary, GLsizei length);
    81     ProgramBinary *getProgramBinary();
    83     int getInfoLogLength() const;
    84     void getInfoLog(GLsizei bufSize, GLsizei *length, char *infoLog);
    85     void getAttachedShaders(GLsizei maxCount, GLsizei *count, GLuint *shaders);
    87     void getActiveAttribute(GLuint index, GLsizei bufsize, GLsizei *length, GLint *size, GLenum *type, GLchar *name);
    88     GLint getActiveAttributeCount();
    89     GLint getActiveAttributeMaxLength();
    91     void getActiveUniform(GLuint index, GLsizei bufsize, GLsizei *length, GLint *size, GLenum *type, GLchar *name);
    92     GLint getActiveUniformCount();
    93     GLint getActiveUniformMaxLength();
    95     void addRef();
    96     void release();
    97     unsigned int getRefCount() const;
    98     void flagForDeletion();
    99     bool isFlaggedForDeletion() const;
   101     void validate();
   102     bool isValidated() const;
   104     GLint getProgramBinaryLength() const;
   106   private:
   107     DISALLOW_COPY_AND_ASSIGN(Program);
   109     void unlink(bool destroy = false);
   111     FragmentShader *mFragmentShader;
   112     VertexShader *mVertexShader;
   114     AttributeBindings mAttributeBindings;
   116     BindingPointer<ProgramBinary> mProgramBinary;
   117     bool mLinked;
   118     bool mDeleteStatus;   // Flag to indicate that the program can be deleted when no longer in use
   120     unsigned int mRefCount;
   122     ResourceManager *mResourceManager;
   123     rx::Renderer *mRenderer;
   124     const GLuint mHandle;
   126     InfoLog mInfoLog;
   127 };
   128 }
   130 #endif   // LIBGLESV2_PROGRAM_H_

mercurial