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 47 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
58 | 58 |
59 typedef base::Callback<void(const std::string& key, | 59 typedef base::Callback<void(const std::string& key, |
60 const std::string& shader)> ShaderCacheCallback; | 60 const std::string& shader)> ShaderCacheCallback; |
61 | 61 |
62 // This class implements the AsyncAPIInterface interface, decoding GLES2 | 62 // This class implements the AsyncAPIInterface interface, decoding GLES2 |
63 // commands and calling GL. | 63 // commands and calling GL. |
64 class GPU_EXPORT GLES2Decoder : public base::SupportsWeakPtr<GLES2Decoder>, | 64 class GPU_EXPORT GLES2Decoder : public base::SupportsWeakPtr<GLES2Decoder>, |
65 public CommonDecoder { | 65 public CommonDecoder { |
66 public: | 66 public: |
67 typedef error::Error Error; | 67 typedef error::Error Error; |
68 typedef base::Callback<bool(uint32_t id)> WaitSyncPointCallback; | |
69 typedef base::Callback<void(uint64_t release)> FenceSyncReleaseCallback; | 68 typedef base::Callback<void(uint64_t release)> FenceSyncReleaseCallback; |
70 typedef base::Callback<bool(gpu::CommandBufferNamespace namespace_id, | 69 typedef base::Callback<bool(gpu::CommandBufferNamespace namespace_id, |
71 uint64_t command_buffer_id, | 70 uint64_t command_buffer_id, |
72 uint64_t release)> WaitFenceSyncCallback; | 71 uint64_t release)> WaitFenceSyncCallback; |
73 | 72 |
74 // 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 |
75 // 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 |
76 // macro redefinitions. | 75 // macro redefinitions. |
77 static const unsigned int kDefaultStencilMask; | 76 static const unsigned int kDefaultStencilMask; |
78 | 77 |
(...skipping 146 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
225 int xoffset, | 224 int xoffset, |
226 int yoffset, | 225 int yoffset, |
227 int width, | 226 int width, |
228 int height) = 0; | 227 int height) = 0; |
229 | 228 |
230 virtual ErrorState* GetErrorState() = 0; | 229 virtual ErrorState* GetErrorState() = 0; |
231 | 230 |
232 // A callback for messages from the decoder. | 231 // A callback for messages from the decoder. |
233 virtual void SetShaderCacheCallback(const ShaderCacheCallback& callback) = 0; | 232 virtual void SetShaderCacheCallback(const ShaderCacheCallback& callback) = 0; |
234 | 233 |
235 // Sets the callback for waiting on a sync point. The callback returns the | |
236 // scheduling status (i.e. true if the channel is still scheduled). | |
237 virtual void SetWaitSyncPointCallback( | |
238 const WaitSyncPointCallback& callback) = 0; | |
239 | |
240 // Sets the callback for fence sync release and wait calls. The wait call | 234 // Sets the callback for fence sync release and wait calls. The wait call |
241 // returns true if the channel is still scheduled. | 235 // returns true if the channel is still scheduled. |
242 virtual void SetFenceSyncReleaseCallback( | 236 virtual void SetFenceSyncReleaseCallback( |
243 const FenceSyncReleaseCallback& callback) = 0; | 237 const FenceSyncReleaseCallback& callback) = 0; |
244 virtual void SetWaitFenceSyncCallback( | 238 virtual void SetWaitFenceSyncCallback( |
245 const WaitFenceSyncCallback& callback) = 0; | 239 const WaitFenceSyncCallback& callback) = 0; |
246 | 240 |
247 virtual void WaitForReadPixels(base::Closure callback) = 0; | 241 virtual void WaitForReadPixels(base::Closure callback) = 0; |
248 virtual uint32_t GetTextureUploadCount() = 0; | 242 virtual uint32_t GetTextureUploadCount() = 0; |
249 virtual base::TimeDelta GetTotalTextureUploadTime() = 0; | 243 virtual base::TimeDelta GetTotalTextureUploadTime() = 0; |
(...skipping 26 matching lines...) Expand all Loading... |
276 bool log_commands_; | 270 bool log_commands_; |
277 bool unsafe_es3_apis_enabled_; | 271 bool unsafe_es3_apis_enabled_; |
278 bool force_shader_name_hashing_for_test_; | 272 bool force_shader_name_hashing_for_test_; |
279 DISALLOW_COPY_AND_ASSIGN(GLES2Decoder); | 273 DISALLOW_COPY_AND_ASSIGN(GLES2Decoder); |
280 }; | 274 }; |
281 | 275 |
282 } // namespace gles2 | 276 } // namespace gles2 |
283 } // namespace gpu | 277 } // namespace gpu |
284 | 278 |
285 #endif // GPU_COMMAND_BUFFER_SERVICE_GLES2_CMD_DECODER_H_ | 279 #endif // GPU_COMMAND_BUFFER_SERVICE_GLES2_CMD_DECODER_H_ |
OLD | NEW |