| 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 <string> | 10 #include <string> |
| (...skipping 47 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 58 typedef base::Callback<void(const std::string& key, | 58 typedef base::Callback<void(const std::string& key, |
| 59 const std::string& shader)> ShaderCacheCallback; | 59 const std::string& shader)> ShaderCacheCallback; |
| 60 | 60 |
| 61 // This class implements the AsyncAPIInterface interface, decoding GLES2 | 61 // This class implements the AsyncAPIInterface interface, decoding GLES2 |
| 62 // commands and calling GL. | 62 // commands and calling GL. |
| 63 class GPU_EXPORT GLES2Decoder : public base::SupportsWeakPtr<GLES2Decoder>, | 63 class GPU_EXPORT GLES2Decoder : public base::SupportsWeakPtr<GLES2Decoder>, |
| 64 public CommonDecoder { | 64 public CommonDecoder { |
| 65 public: | 65 public: |
| 66 typedef error::Error Error; | 66 typedef error::Error Error; |
| 67 typedef base::Callback<bool(uint32 id)> WaitSyncPointCallback; | 67 typedef base::Callback<bool(uint32 id)> WaitSyncPointCallback; |
| 68 typedef base::Callback<void(uint32_t release)> FenceSyncReleaseCallback; |
| 69 typedef base::Callback<bool(int channel_client_id, |
| 70 uint32_t route_id, |
| 71 uint32_t release)> WaitFenceSyncCallback; |
| 68 | 72 |
| 69 // The default stencil mask, which has all bits set. This really should be a | 73 // The default stencil mask, which has all bits set. This really should be a |
| 70 // GLuint, but we can't #include gl_bindings.h in this file without causing | 74 // GLuint, but we can't #include gl_bindings.h in this file without causing |
| 71 // macro redefinitions. | 75 // macro redefinitions. |
| 72 static const unsigned int kDefaultStencilMask; | 76 static const unsigned int kDefaultStencilMask; |
| 73 | 77 |
| 74 // Creates a decoder. | 78 // Creates a decoder. |
| 75 static GLES2Decoder* Create(ContextGroup* group); | 79 static GLES2Decoder* Create(ContextGroup* group); |
| 76 | 80 |
| 77 ~GLES2Decoder() override; | 81 ~GLES2Decoder() override; |
| (...skipping 145 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 223 virtual ErrorState* GetErrorState() = 0; | 227 virtual ErrorState* GetErrorState() = 0; |
| 224 | 228 |
| 225 // A callback for messages from the decoder. | 229 // A callback for messages from the decoder. |
| 226 virtual void SetShaderCacheCallback(const ShaderCacheCallback& callback) = 0; | 230 virtual void SetShaderCacheCallback(const ShaderCacheCallback& callback) = 0; |
| 227 | 231 |
| 228 // Sets the callback for waiting on a sync point. The callback returns the | 232 // Sets the callback for waiting on a sync point. The callback returns the |
| 229 // scheduling status (i.e. true if the channel is still scheduled). | 233 // scheduling status (i.e. true if the channel is still scheduled). |
| 230 virtual void SetWaitSyncPointCallback( | 234 virtual void SetWaitSyncPointCallback( |
| 231 const WaitSyncPointCallback& callback) = 0; | 235 const WaitSyncPointCallback& callback) = 0; |
| 232 | 236 |
| 237 // Sets the callback for fence sync release and wait calls. The wait call |
| 238 // returns true if the channel is still scheduled. |
| 239 virtual void SetFenceSyncReleaseCallback( |
| 240 const FenceSyncReleaseCallback& callback) = 0; |
| 241 virtual void SetWaitFenceSyncCallback( |
| 242 const WaitFenceSyncCallback& callback) = 0; |
| 243 |
| 233 virtual void WaitForReadPixels(base::Closure callback) = 0; | 244 virtual void WaitForReadPixels(base::Closure callback) = 0; |
| 234 virtual uint32 GetTextureUploadCount() = 0; | 245 virtual uint32 GetTextureUploadCount() = 0; |
| 235 virtual base::TimeDelta GetTotalTextureUploadTime() = 0; | 246 virtual base::TimeDelta GetTotalTextureUploadTime() = 0; |
| 236 virtual base::TimeDelta GetTotalProcessingCommandsTime() = 0; | 247 virtual base::TimeDelta GetTotalProcessingCommandsTime() = 0; |
| 237 virtual void AddProcessingCommandsTime(base::TimeDelta) = 0; | 248 virtual void AddProcessingCommandsTime(base::TimeDelta) = 0; |
| 238 | 249 |
| 239 // Returns true if the context was lost either by GL_ARB_robustness, forced | 250 // Returns true if the context was lost either by GL_ARB_robustness, forced |
| 240 // context loss or command buffer parse error. | 251 // context loss or command buffer parse error. |
| 241 virtual bool WasContextLost() const = 0; | 252 virtual bool WasContextLost() const = 0; |
| 242 | 253 |
| (...skipping 19 matching lines...) Expand all Loading... |
| 262 bool log_commands_; | 273 bool log_commands_; |
| 263 bool unsafe_es3_apis_enabled_; | 274 bool unsafe_es3_apis_enabled_; |
| 264 | 275 |
| 265 DISALLOW_COPY_AND_ASSIGN(GLES2Decoder); | 276 DISALLOW_COPY_AND_ASSIGN(GLES2Decoder); |
| 266 }; | 277 }; |
| 267 | 278 |
| 268 } // namespace gles2 | 279 } // namespace gles2 |
| 269 } // namespace gpu | 280 } // namespace gpu |
| 270 | 281 |
| 271 #endif // GPU_COMMAND_BUFFER_SERVICE_GLES2_CMD_DECODER_H_ | 282 #endif // GPU_COMMAND_BUFFER_SERVICE_GLES2_CMD_DECODER_H_ |
| OLD | NEW |