| OLD | NEW |
| 1 // Copyright (c) 2012 The Chromium Authors. All rights reserved. | 1 // Copyright (c) 2012 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 // This file contains the GLES2Decoder class. | 5 // This file contains the GLES2Decoder class. |
| 6 | 6 |
| 7 #ifndef GPU_COMMAND_BUFFER_SERVICE_GLES2_CMD_DECODER_H_ | 7 #ifndef GPU_COMMAND_BUFFER_SERVICE_GLES2_CMD_DECODER_H_ |
| 8 #define GPU_COMMAND_BUFFER_SERVICE_GLES2_CMD_DECODER_H_ | 8 #define GPU_COMMAND_BUFFER_SERVICE_GLES2_CMD_DECODER_H_ |
| 9 | 9 |
| 10 #include <vector> | 10 #include <vector> |
| (...skipping 35 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 46 bool gpu_memory_manager; | 46 bool gpu_memory_manager; |
| 47 }; | 47 }; |
| 48 | 48 |
| 49 // This class implements the AsyncAPIInterface interface, decoding GLES2 | 49 // This class implements the AsyncAPIInterface interface, decoding GLES2 |
| 50 // commands and calling GL. | 50 // commands and calling GL. |
| 51 class GPU_EXPORT GLES2Decoder : public base::SupportsWeakPtr<GLES2Decoder>, | 51 class GPU_EXPORT GLES2Decoder : public base::SupportsWeakPtr<GLES2Decoder>, |
| 52 public CommonDecoder { | 52 public CommonDecoder { |
| 53 public: | 53 public: |
| 54 typedef error::Error Error; | 54 typedef error::Error Error; |
| 55 typedef base::Callback<void(int32 id, const std::string& msg)> MsgCallback; | 55 typedef base::Callback<void(int32 id, const std::string& msg)> MsgCallback; |
| 56 typedef base::Callback<bool(uint32 id)> WaitSyncPointCallback; |
| 56 | 57 |
| 57 // Creates a decoder. | 58 // Creates a decoder. |
| 58 static GLES2Decoder* Create(ContextGroup* group); | 59 static GLES2Decoder* Create(ContextGroup* group); |
| 59 | 60 |
| 60 virtual ~GLES2Decoder(); | 61 virtual ~GLES2Decoder(); |
| 61 | 62 |
| 62 bool debug() const { | 63 bool debug() const { |
| 63 return debug_; | 64 return debug_; |
| 64 } | 65 } |
| 65 | 66 |
| (...skipping 117 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 183 int width, | 184 int width, |
| 184 int height, | 185 int height, |
| 185 bool is_texture_immutable) = 0; | 186 bool is_texture_immutable) = 0; |
| 186 | 187 |
| 187 // Gets the GL error for this context. | 188 // Gets the GL error for this context. |
| 188 virtual uint32 GetGLError() = 0; | 189 virtual uint32 GetGLError() = 0; |
| 189 | 190 |
| 190 // A callback for messages from the decoder. | 191 // A callback for messages from the decoder. |
| 191 virtual void SetMsgCallback(const MsgCallback& callback) = 0; | 192 virtual void SetMsgCallback(const MsgCallback& callback) = 0; |
| 192 | 193 |
| 194 // Sets the callback for waiting on a sync point. The callback returns the |
| 195 // scheduling status (i.e. true if the channel is still scheduled). |
| 196 virtual void SetWaitSyncPointCallback( |
| 197 const WaitSyncPointCallback& callback) = 0; |
| 198 |
| 193 virtual uint32 GetTextureUploadCount() = 0; | 199 virtual uint32 GetTextureUploadCount() = 0; |
| 194 virtual base::TimeDelta GetTotalTextureUploadTime() = 0; | 200 virtual base::TimeDelta GetTotalTextureUploadTime() = 0; |
| 195 virtual base::TimeDelta GetTotalProcessingCommandsTime() = 0; | 201 virtual base::TimeDelta GetTotalProcessingCommandsTime() = 0; |
| 196 virtual void AddProcessingCommandsTime(base::TimeDelta) = 0; | 202 virtual void AddProcessingCommandsTime(base::TimeDelta) = 0; |
| 197 | 203 |
| 198 // Returns true if the context was just lost due to e.g. GL_ARB_robustness. | 204 // Returns true if the context was just lost due to e.g. GL_ARB_robustness. |
| 199 virtual bool WasContextLost() = 0; | 205 virtual bool WasContextLost() = 0; |
| 200 | 206 |
| 201 // Lose this context. | 207 // Lose this context. |
| 202 virtual void LoseContext(uint32 reset_status) = 0; | 208 virtual void LoseContext(uint32 reset_status) = 0; |
| (...skipping 11 matching lines...) Expand all Loading... |
| 214 bool log_commands_; | 220 bool log_commands_; |
| 215 bool log_synthesized_gl_errors_; | 221 bool log_synthesized_gl_errors_; |
| 216 static bool testing_force_is_angle_; | 222 static bool testing_force_is_angle_; |
| 217 | 223 |
| 218 DISALLOW_COPY_AND_ASSIGN(GLES2Decoder); | 224 DISALLOW_COPY_AND_ASSIGN(GLES2Decoder); |
| 219 }; | 225 }; |
| 220 | 226 |
| 221 } // namespace gles2 | 227 } // namespace gles2 |
| 222 } // namespace gpu | 228 } // namespace gpu |
| 223 #endif // GPU_COMMAND_BUFFER_SERVICE_GLES2_CMD_DECODER_H_ | 229 #endif // GPU_COMMAND_BUFFER_SERVICE_GLES2_CMD_DECODER_H_ |
| OLD | NEW |