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(uint64_t release)> FenceSyncReleaseCallback; |
| 69 typedef base::Callback<bool(gpu::CommandBufferNamespace namespace_id, |
| 70 uint64_t command_buffer_id, |
| 71 uint64_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 149 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
227 virtual ErrorState* GetErrorState() = 0; | 231 virtual ErrorState* GetErrorState() = 0; |
228 | 232 |
229 // A callback for messages from the decoder. | 233 // A callback for messages from the decoder. |
230 virtual void SetShaderCacheCallback(const ShaderCacheCallback& callback) = 0; | 234 virtual void SetShaderCacheCallback(const ShaderCacheCallback& callback) = 0; |
231 | 235 |
232 // Sets the callback for waiting on a sync point. The callback returns the | 236 // Sets the callback for waiting on a sync point. The callback returns the |
233 // scheduling status (i.e. true if the channel is still scheduled). | 237 // scheduling status (i.e. true if the channel is still scheduled). |
234 virtual void SetWaitSyncPointCallback( | 238 virtual void SetWaitSyncPointCallback( |
235 const WaitSyncPointCallback& callback) = 0; | 239 const WaitSyncPointCallback& callback) = 0; |
236 | 240 |
| 241 // Sets the callback for fence sync release and wait calls. The wait call |
| 242 // returns true if the channel is still scheduled. |
| 243 virtual void SetFenceSyncReleaseCallback( |
| 244 const FenceSyncReleaseCallback& callback) = 0; |
| 245 virtual void SetWaitFenceSyncCallback( |
| 246 const WaitFenceSyncCallback& callback) = 0; |
| 247 |
237 virtual void WaitForReadPixels(base::Closure callback) = 0; | 248 virtual void WaitForReadPixels(base::Closure callback) = 0; |
238 virtual uint32 GetTextureUploadCount() = 0; | 249 virtual uint32 GetTextureUploadCount() = 0; |
239 virtual base::TimeDelta GetTotalTextureUploadTime() = 0; | 250 virtual base::TimeDelta GetTotalTextureUploadTime() = 0; |
240 virtual base::TimeDelta GetTotalProcessingCommandsTime() = 0; | 251 virtual base::TimeDelta GetTotalProcessingCommandsTime() = 0; |
241 virtual void AddProcessingCommandsTime(base::TimeDelta) = 0; | 252 virtual void AddProcessingCommandsTime(base::TimeDelta) = 0; |
242 | 253 |
243 // Returns true if the context was lost either by GL_ARB_robustness, forced | 254 // Returns true if the context was lost either by GL_ARB_robustness, forced |
244 // context loss or command buffer parse error. | 255 // context loss or command buffer parse error. |
245 virtual bool WasContextLost() const = 0; | 256 virtual bool WasContextLost() const = 0; |
246 | 257 |
(...skipping 19 matching lines...) Expand all Loading... |
266 bool log_commands_; | 277 bool log_commands_; |
267 bool unsafe_es3_apis_enabled_; | 278 bool unsafe_es3_apis_enabled_; |
268 | 279 |
269 DISALLOW_COPY_AND_ASSIGN(GLES2Decoder); | 280 DISALLOW_COPY_AND_ASSIGN(GLES2Decoder); |
270 }; | 281 }; |
271 | 282 |
272 } // namespace gles2 | 283 } // namespace gles2 |
273 } // namespace gpu | 284 } // namespace gpu |
274 | 285 |
275 #endif // GPU_COMMAND_BUFFER_SERVICE_GLES2_CMD_DECODER_H_ | 286 #endif // GPU_COMMAND_BUFFER_SERVICE_GLES2_CMD_DECODER_H_ |
OLD | NEW |