OLD | NEW |
---|---|
(Empty) | |
1 // Copyright (c) 2014 The Chromium Authors. All rights reserved. | |
2 // Use of this source code is governed by a BSD-style license that can be | |
3 // found in the LICENSE file. | |
4 | |
5 #ifndef GPU_COMMAND_BUFFER_SERVICE_UNIFORM_SUBSCRIPTION_MANAGER_H_ | |
6 #define GPU_COMMAND_BUFFER_SERVICE_UNIFORM_SUBSCRIPTION_MANAGER_H_ | |
7 | |
8 #include <string> | |
9 #include <vector> | |
10 | |
11 #include "base/containers/hash_tables.h" | |
12 #include "base/memory/ref_counted.h" | |
13 #include "gpu/command_buffer/service/gl_utils.h" | |
14 #include "gpu/command_buffer/service/program_manager.h" | |
15 #include "gpu/gpu_export.h" | |
16 | |
17 namespace gpu { | |
18 namespace gles2 { | |
19 | |
20 // This class keeps track of the mapping of uniform locations to types, | |
21 // along with the current uniform state | |
22 class GPU_EXPORT UniformSubscriptionManager { | |
23 public: | |
24 typedef std::vector<std::pair<GLenum, GLint>> ProgramSubscriptions; | |
piman
2014/10/21 20:00:41
Please define a real struct for the pair. At the c
orglofch
2014/10/22 23:10:21
I've changed this to be a map to enforce 1:1 mappi
| |
25 | |
26 UniformSubscriptionManager(); | |
27 ~UniformSubscriptionManager(); | |
28 | |
29 void Destroy(bool have_context); | |
30 | |
31 // Subscribe uniform |location| in program specified by |client_id| | |
32 // to |target| | |
33 void AddSubscription(GLuint client_id, GLint location, GLenum target); | |
34 | |
35 // Update the active_state of the subscriptions | |
36 void ActivateUniformSubscriptionState(); | |
37 | |
38 const ProgramSubscriptions* SubscriptionsForProgram(GLuint client_id); | |
39 | |
40 static Program::UniformApiType ApiTypeForTarget(GLenum target); | |
41 | |
42 private: | |
43 typedef base::hash_map<GLint, ProgramSubscriptions> SubscriptionMap; | |
44 | |
45 SubscriptionMap subscriptions_; | |
46 | |
47 DISALLOW_COPY_AND_ASSIGN(UniformSubscriptionManager); | |
48 }; | |
49 | |
50 } // namespage gles2 | |
51 } // namespace gpu | |
52 | |
53 #endif // GPU_COMMAND_BUFFER_SERVICE_UNIFORM_SUBSCRIPTION_MANAGER_H_ | |
OLD | NEW |