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 18 matching lines...) Expand all Loading... |
29 class GLSurface; | 29 class GLSurface; |
30 } | 30 } |
31 | 31 |
32 namespace gfx { | 32 namespace gfx { |
33 class Size; | 33 class Size; |
34 } | 34 } |
35 | 35 |
36 namespace gpu { | 36 namespace gpu { |
37 | 37 |
38 struct Mailbox; | 38 struct Mailbox; |
| 39 struct SyncToken; |
39 | 40 |
40 namespace gles2 { | 41 namespace gles2 { |
41 | 42 |
42 class ContextGroup; | 43 class ContextGroup; |
43 class ErrorState; | 44 class ErrorState; |
44 class FeatureInfo; | 45 class FeatureInfo; |
45 class GLES2Util; | 46 class GLES2Util; |
46 class ImageManager; | 47 class ImageManager; |
47 class Logger; | 48 class Logger; |
48 class QueryManager; | 49 class QueryManager; |
(...skipping 29 matching lines...) Expand all Loading... |
78 typedef base::Callback<void(const std::string& key, | 79 typedef base::Callback<void(const std::string& key, |
79 const std::string& shader)> ShaderCacheCallback; | 80 const std::string& shader)> ShaderCacheCallback; |
80 | 81 |
81 // This class implements the AsyncAPIInterface interface, decoding GLES2 | 82 // This class implements the AsyncAPIInterface interface, decoding GLES2 |
82 // commands and calling GL. | 83 // commands and calling GL. |
83 class GPU_EXPORT GLES2Decoder : public base::SupportsWeakPtr<GLES2Decoder>, | 84 class GPU_EXPORT GLES2Decoder : public base::SupportsWeakPtr<GLES2Decoder>, |
84 public CommonDecoder { | 85 public CommonDecoder { |
85 public: | 86 public: |
86 typedef error::Error Error; | 87 typedef error::Error Error; |
87 typedef base::Callback<void(uint64_t release)> FenceSyncReleaseCallback; | 88 typedef base::Callback<void(uint64_t release)> FenceSyncReleaseCallback; |
88 typedef base::Callback<bool(gpu::CommandBufferNamespace namespace_id, | 89 typedef base::Callback<bool(const gpu::SyncToken&)> WaitSyncTokenCallback; |
89 gpu::CommandBufferId command_buffer_id, | |
90 uint64_t release)> | |
91 WaitFenceSyncCallback; | |
92 typedef base::Callback<void(void)> NoParamCallback; | 90 typedef base::Callback<void(void)> NoParamCallback; |
93 | 91 |
94 // The default stencil mask, which has all bits set. This really should be a | 92 // The default stencil mask, which has all bits set. This really should be a |
95 // GLuint, but we can't #include gl_bindings.h in this file without causing | 93 // GLuint, but we can't #include gl_bindings.h in this file without causing |
96 // macro redefinitions. | 94 // macro redefinitions. |
97 static const unsigned int kDefaultStencilMask; | 95 static const unsigned int kDefaultStencilMask; |
98 | 96 |
99 // Creates a decoder. | 97 // Creates a decoder. |
100 static GLES2Decoder* Create(ContextGroup* group); | 98 static GLES2Decoder* Create(ContextGroup* group); |
101 | 99 |
(...skipping 172 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
274 int width, | 272 int width, |
275 int height, | 273 int height, |
276 int depth) = 0; | 274 int depth) = 0; |
277 | 275 |
278 virtual ErrorState* GetErrorState() = 0; | 276 virtual ErrorState* GetErrorState() = 0; |
279 | 277 |
280 // A callback for messages from the decoder. | 278 // A callback for messages from the decoder. |
281 virtual void SetShaderCacheCallback(const ShaderCacheCallback& callback) = 0; | 279 virtual void SetShaderCacheCallback(const ShaderCacheCallback& callback) = 0; |
282 | 280 |
283 // Sets the callback for fence sync release and wait calls. The wait call | 281 // Sets the callback for fence sync release and wait calls. The wait call |
284 // returns true if the channel is still scheduled. | 282 // returns false if the wait was a nop or invalid and the command buffer is |
| 283 // still scheduled. |
285 virtual void SetFenceSyncReleaseCallback( | 284 virtual void SetFenceSyncReleaseCallback( |
286 const FenceSyncReleaseCallback& callback) = 0; | 285 const FenceSyncReleaseCallback& callback) = 0; |
287 virtual void SetWaitFenceSyncCallback( | 286 virtual void SetWaitSyncTokenCallback( |
288 const WaitFenceSyncCallback& callback) = 0; | 287 const WaitSyncTokenCallback& callback) = 0; |
289 | 288 |
290 // Sets the callback for the DescheduleUntilFinished and | 289 // Sets the callback for the DescheduleUntilFinished and |
291 // RescheduleAfterFinished calls. | 290 // RescheduleAfterFinished calls. |
292 virtual void SetDescheduleUntilFinishedCallback( | 291 virtual void SetDescheduleUntilFinishedCallback( |
293 const NoParamCallback& callback) = 0; | 292 const NoParamCallback& callback) = 0; |
294 virtual void SetRescheduleAfterFinishedCallback( | 293 virtual void SetRescheduleAfterFinishedCallback( |
295 const NoParamCallback& callback) = 0; | 294 const NoParamCallback& callback) = 0; |
296 | 295 |
297 virtual void WaitForReadPixels(base::Closure callback) = 0; | 296 virtual void WaitForReadPixels(base::Closure callback) = 0; |
298 virtual uint32_t GetTextureUploadCount() = 0; | 297 virtual uint32_t GetTextureUploadCount() = 0; |
(...skipping 35 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
334 bool initialized_; | 333 bool initialized_; |
335 bool debug_; | 334 bool debug_; |
336 bool log_commands_; | 335 bool log_commands_; |
337 DISALLOW_COPY_AND_ASSIGN(GLES2Decoder); | 336 DISALLOW_COPY_AND_ASSIGN(GLES2Decoder); |
338 }; | 337 }; |
339 | 338 |
340 } // namespace gles2 | 339 } // namespace gles2 |
341 } // namespace gpu | 340 } // namespace gpu |
342 | 341 |
343 #endif // GPU_COMMAND_BUFFER_SERVICE_GLES2_CMD_DECODER_H_ | 342 #endif // GPU_COMMAND_BUFFER_SERVICE_GLES2_CMD_DECODER_H_ |
OLD | NEW |