| OLD | NEW |
| 1 // Copyright (c) 2016 The Chromium Authors. All rights reserved. | 1 // Copyright (c) 2016 The Chromium Authors. All rights reserved. |
| 2 // Use of this source code is governed by a BSD-style license that can be | 2 // Use of this source code is governed by a BSD-style license that can be |
| 3 // found in the LICENSE file. | 3 // found in the LICENSE file. |
| 4 | 4 |
| 5 #ifndef GPU_COMMAND_BUFFER_SERVICE_TRANSFORM_FEEDBACK_MANAGER_H_ | 5 #ifndef GPU_COMMAND_BUFFER_SERVICE_TRANSFORM_FEEDBACK_MANAGER_H_ |
| 6 #define GPU_COMMAND_BUFFER_SERVICE_TRANSFORM_FEEDBACK_MANAGER_H_ | 6 #define GPU_COMMAND_BUFFER_SERVICE_TRANSFORM_FEEDBACK_MANAGER_H_ |
| 7 | 7 |
| 8 #include <vector> | 8 #include <vector> |
| 9 | 9 |
| 10 #include "base/containers/hash_tables.h" | 10 #include "base/containers/hash_tables.h" |
| 11 #include "base/memory/ref_counted.h" | 11 #include "base/memory/ref_counted.h" |
| 12 #include "gpu/command_buffer/service/gl_utils.h" | 12 #include "gpu/command_buffer/service/gl_utils.h" |
| 13 #include "gpu/command_buffer/service/indexed_buffer_binding_host.h" | 13 #include "gpu/command_buffer/service/indexed_buffer_binding_host.h" |
| 14 #include "gpu/gpu_export.h" | 14 #include "gpu/gpu_export.h" |
| 15 | 15 |
| 16 namespace gpu { | 16 namespace gpu { |
| 17 namespace gles2 { | 17 namespace gles2 { |
| 18 | 18 |
| 19 class Buffer; | 19 class Buffer; |
| 20 class TransformFeedbackManager; | 20 class TransformFeedbackManager; |
| 21 | 21 |
| 22 // Info about TransformFeedbacks currently in the system. | 22 // Info about TransformFeedbacks currently in the system. |
| 23 class GPU_EXPORT TransformFeedback : public IndexedBufferBindingHost { | 23 class GPU_EXPORT TransformFeedback : public IndexedBufferBindingHost { |
| 24 public: | 24 public: |
| 25 TransformFeedback(TransformFeedbackManager* manager, GLuint service_id); | 25 TransformFeedback( |
| 26 TransformFeedbackManager* manager, GLuint client_id, GLuint service_id); |
| 26 | 27 |
| 27 // All the following functions do state update and call the underlying GL | 28 // All the following functions do state update and call the underlying GL |
| 28 // function. All validations have been done already and the GL function is | 29 // function. All validations have been done already and the GL function is |
| 29 // guaranteed to succeed. | 30 // guaranteed to succeed. |
| 30 void DoBindTransformFeedback(GLenum target); | 31 void DoBindTransformFeedback(GLenum target); |
| 31 void DoBeginTransformFeedback(GLenum primitive_mode); | 32 void DoBeginTransformFeedback(GLenum primitive_mode); |
| 32 void DoEndTransformFeedback(); | 33 void DoEndTransformFeedback(); |
| 33 void DoPauseTransformFeedback(); | 34 void DoPauseTransformFeedback(); |
| 34 void DoResumeTransformFeedback(); | 35 void DoResumeTransformFeedback(); |
| 35 | 36 |
| 37 GLuint client_id() const { |
| 38 return client_id_; |
| 39 } |
| 40 |
| 36 GLuint service_id() const { | 41 GLuint service_id() const { |
| 37 return service_id_; | 42 return service_id_; |
| 38 } | 43 } |
| 39 | 44 |
| 40 bool has_been_bound() const { | 45 bool has_been_bound() const { |
| 41 return has_been_bound_; | 46 return has_been_bound_; |
| 42 } | 47 } |
| 43 | 48 |
| 44 bool active() const { | 49 bool active() const { |
| 45 return active_; | 50 return active_; |
| 46 } | 51 } |
| 47 | 52 |
| 48 bool paused() const { | 53 bool paused() const { |
| 49 return paused_; | 54 return paused_; |
| 50 } | 55 } |
| 51 | 56 |
| 52 GLenum primitive_mode() const { | 57 GLenum primitive_mode() const { |
| 53 return primitive_mode_; | 58 return primitive_mode_; |
| 54 } | 59 } |
| 55 | 60 |
| 56 private: | 61 private: |
| 57 ~TransformFeedback() override; | 62 ~TransformFeedback() override; |
| 58 | 63 |
| 59 // The manager that owns this Buffer. | 64 // The manager that owns this Buffer. |
| 60 TransformFeedbackManager* manager_; | 65 TransformFeedbackManager* manager_; |
| 61 | 66 |
| 67 GLuint client_id_; |
| 62 GLuint service_id_; | 68 GLuint service_id_; |
| 63 | 69 |
| 64 bool has_been_bound_; | 70 bool has_been_bound_; |
| 65 | 71 |
| 66 bool active_; | 72 bool active_; |
| 67 bool paused_; | 73 bool paused_; |
| 68 | 74 |
| 69 GLenum primitive_mode_; | 75 GLenum primitive_mode_; |
| 70 }; | 76 }; |
| 71 | 77 |
| (...skipping 46 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 118 bool needs_emulation_; | 124 bool needs_emulation_; |
| 119 bool lost_context_; | 125 bool lost_context_; |
| 120 | 126 |
| 121 DISALLOW_COPY_AND_ASSIGN(TransformFeedbackManager); | 127 DISALLOW_COPY_AND_ASSIGN(TransformFeedbackManager); |
| 122 }; | 128 }; |
| 123 | 129 |
| 124 } // namespace gles2 | 130 } // namespace gles2 |
| 125 } // namespace gpu | 131 } // namespace gpu |
| 126 | 132 |
| 127 #endif // GPU_COMMAND_BUFFER_SERVICE_TRANSFORM_FEEDBACK_MANAGER_H_ | 133 #endif // GPU_COMMAND_BUFFER_SERVICE_TRANSFORM_FEEDBACK_MANAGER_H_ |
| OLD | NEW |