| 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 <stdint.h> | 10 #include <stdint.h> |
| (...skipping 75 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 86 // commands and calling GL. | 86 // commands and calling GL. |
| 87 class GPU_EXPORT GLES2Decoder : public base::SupportsWeakPtr<GLES2Decoder>, | 87 class GPU_EXPORT GLES2Decoder : public base::SupportsWeakPtr<GLES2Decoder>, |
| 88 public CommonDecoder { | 88 public CommonDecoder { |
| 89 public: | 89 public: |
| 90 typedef error::Error Error; | 90 typedef error::Error Error; |
| 91 typedef base::Callback<void(uint64_t release)> FenceSyncReleaseCallback; | 91 typedef base::Callback<void(uint64_t release)> FenceSyncReleaseCallback; |
| 92 typedef base::Callback<bool(gpu::CommandBufferNamespace namespace_id, | 92 typedef base::Callback<bool(gpu::CommandBufferNamespace namespace_id, |
| 93 gpu::CommandBufferId command_buffer_id, | 93 gpu::CommandBufferId command_buffer_id, |
| 94 uint64_t release)> | 94 uint64_t release)> |
| 95 WaitFenceSyncCallback; | 95 WaitFenceSyncCallback; |
| 96 typedef base::Callback<void(void)> NoParamCallback; |
| 96 | 97 |
| 97 // The default stencil mask, which has all bits set. This really should be a | 98 // The default stencil mask, which has all bits set. This really should be a |
| 98 // GLuint, but we can't #include gl_bindings.h in this file without causing | 99 // GLuint, but we can't #include gl_bindings.h in this file without causing |
| 99 // macro redefinitions. | 100 // macro redefinitions. |
| 100 static const unsigned int kDefaultStencilMask; | 101 static const unsigned int kDefaultStencilMask; |
| 101 | 102 |
| 102 // Creates a decoder. | 103 // Creates a decoder. |
| 103 static GLES2Decoder* Create(ContextGroup* group); | 104 static GLES2Decoder* Create(ContextGroup* group); |
| 104 | 105 |
| 105 ~GLES2Decoder() override; | 106 ~GLES2Decoder() override; |
| (...skipping 179 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 285 // A callback for messages from the decoder. | 286 // A callback for messages from the decoder. |
| 286 virtual void SetShaderCacheCallback(const ShaderCacheCallback& callback) = 0; | 287 virtual void SetShaderCacheCallback(const ShaderCacheCallback& callback) = 0; |
| 287 | 288 |
| 288 // Sets the callback for fence sync release and wait calls. The wait call | 289 // Sets the callback for fence sync release and wait calls. The wait call |
| 289 // returns true if the channel is still scheduled. | 290 // returns true if the channel is still scheduled. |
| 290 virtual void SetFenceSyncReleaseCallback( | 291 virtual void SetFenceSyncReleaseCallback( |
| 291 const FenceSyncReleaseCallback& callback) = 0; | 292 const FenceSyncReleaseCallback& callback) = 0; |
| 292 virtual void SetWaitFenceSyncCallback( | 293 virtual void SetWaitFenceSyncCallback( |
| 293 const WaitFenceSyncCallback& callback) = 0; | 294 const WaitFenceSyncCallback& callback) = 0; |
| 294 | 295 |
| 296 // Sets the callback for the DescheduleUntilFinished and |
| 297 // RescheduleAfterFinished calls. |
| 298 virtual void SetDescheduleUntilFinishedCallback( |
| 299 const NoParamCallback& callback) = 0; |
| 300 virtual void SetRescheduleAfterFinishedCallback( |
| 301 const NoParamCallback& callback) = 0; |
| 302 |
| 295 virtual void WaitForReadPixels(base::Closure callback) = 0; | 303 virtual void WaitForReadPixels(base::Closure callback) = 0; |
| 296 virtual uint32_t GetTextureUploadCount() = 0; | 304 virtual uint32_t GetTextureUploadCount() = 0; |
| 297 virtual base::TimeDelta GetTotalTextureUploadTime() = 0; | 305 virtual base::TimeDelta GetTotalTextureUploadTime() = 0; |
| 298 virtual base::TimeDelta GetTotalProcessingCommandsTime() = 0; | 306 virtual base::TimeDelta GetTotalProcessingCommandsTime() = 0; |
| 299 virtual void AddProcessingCommandsTime(base::TimeDelta) = 0; | 307 virtual void AddProcessingCommandsTime(base::TimeDelta) = 0; |
| 300 | 308 |
| 301 // Returns true if the context was lost either by GL_ARB_robustness, forced | 309 // Returns true if the context was lost either by GL_ARB_robustness, forced |
| 302 // context loss or command buffer parse error. | 310 // context loss or command buffer parse error. |
| 303 virtual bool WasContextLost() const = 0; | 311 virtual bool WasContextLost() const = 0; |
| 304 | 312 |
| (...skipping 26 matching lines...) Expand all Loading... |
| 331 bool debug_; | 339 bool debug_; |
| 332 bool log_commands_; | 340 bool log_commands_; |
| 333 bool unsafe_es3_apis_enabled_; | 341 bool unsafe_es3_apis_enabled_; |
| 334 DISALLOW_COPY_AND_ASSIGN(GLES2Decoder); | 342 DISALLOW_COPY_AND_ASSIGN(GLES2Decoder); |
| 335 }; | 343 }; |
| 336 | 344 |
| 337 } // namespace gles2 | 345 } // namespace gles2 |
| 338 } // namespace gpu | 346 } // namespace gpu |
| 339 | 347 |
| 340 #endif // GPU_COMMAND_BUFFER_SERVICE_GLES2_CMD_DECODER_H_ | 348 #endif // GPU_COMMAND_BUFFER_SERVICE_GLES2_CMD_DECODER_H_ |
| OLD | NEW |