summaryrefslogtreecommitdiffstats
path: root/gpu/command_buffer/client/program_info_manager.h
blob: 099f182184bd95eecdd6f75f9e3485cd2e342b29 (plain)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
// Copyright (c) 2012 The Chromium Authors. All rights reserved.
// Use of this source code is governed by a BSD-style license that can be
// found in the LICENSE file.

#ifndef GPU_COMMAND_BUFFER_CLIENT_PROGRAM_INFO_MANAGER_H_
#define GPU_COMMAND_BUFFER_CLIENT_PROGRAM_INFO_MANAGER_H_

#include <GLES2/gl2.h>
#include "gles2_impl_export.h"

namespace gpu {
namespace gles2 {

class GLES2Implementation;

// Manages info about OpenGL ES Programs.
class GLES2_IMPL_EXPORT ProgramInfoManager {
 public:
  virtual ~ProgramInfoManager();

  static ProgramInfoManager* Create(bool shared_resources_across_processes);

  virtual void CreateInfo(GLuint program) = 0;

  virtual void DeleteInfo(GLuint program) = 0;

  virtual bool GetProgramiv(
      GLES2Implementation* gl, GLuint program, GLenum pname, GLint* params) = 0;

  virtual GLint GetAttribLocation(
      GLES2Implementation* gl, GLuint program, const char* name) = 0;

  virtual GLint GetUniformLocation(
      GLES2Implementation* gl, GLuint program, const char* name) = 0;

  virtual bool GetActiveAttrib(
      GLES2Implementation* gl,
      GLuint program, GLuint index, GLsizei bufsize, GLsizei* length,
      GLint* size, GLenum* type, char* name) = 0;

  virtual bool GetActiveUniform(
      GLES2Implementation* gl,
      GLuint program, GLuint index, GLsizei bufsize, GLsizei* length,
      GLint* size, GLenum* type, char* name) = 0;

 protected:
  ProgramInfoManager();
};

}  // namespace gles2
}  // namespace gpu

#endif  // GPU_COMMAND_BUFFER_CLIENT_PROGRAM_INFO_MANAGER_H_