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 <vector> | 10 #include <vector> |
(...skipping 41 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
52 | 52 |
53 typedef base::Callback<void(const std::string& key, | 53 typedef base::Callback<void(const std::string& key, |
54 const std::string& shader)> ShaderCacheCallback; | 54 const std::string& shader)> ShaderCacheCallback; |
55 | 55 |
56 // This class implements the AsyncAPIInterface interface, decoding GLES2 | 56 // This class implements the AsyncAPIInterface interface, decoding GLES2 |
57 // commands and calling GL. | 57 // commands and calling GL. |
58 class GPU_EXPORT GLES2Decoder : public base::SupportsWeakPtr<GLES2Decoder>, | 58 class GPU_EXPORT GLES2Decoder : public base::SupportsWeakPtr<GLES2Decoder>, |
59 public CommonDecoder { | 59 public CommonDecoder { |
60 public: | 60 public: |
61 typedef error::Error Error; | 61 typedef error::Error Error; |
62 typedef base::Callback<bool(uint32 id)> WaitSyncPointCallback; | |
63 | 62 |
64 // The default stencil mask, which has all bits set. This really should be a | 63 // The default stencil mask, which has all bits set. This really should be a |
65 // GLuint, but we can't #include gl_bindings.h in this file without causing | 64 // GLuint, but we can't #include gl_bindings.h in this file without causing |
66 // macro redefinitions. | 65 // macro redefinitions. |
67 static const unsigned int kDefaultStencilMask; | 66 static const unsigned int kDefaultStencilMask; |
68 | 67 |
69 // Creates a decoder. | 68 // Creates a decoder. |
70 static GLES2Decoder* Create(ContextGroup* group); | 69 static GLES2Decoder* Create(ContextGroup* group); |
71 | 70 |
72 ~GLES2Decoder() override; | 71 ~GLES2Decoder() override; |
(...skipping 148 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
221 unsigned type, | 220 unsigned type, |
222 int width, | 221 int width, |
223 int height, | 222 int height, |
224 bool is_texture_immutable) = 0; | 223 bool is_texture_immutable) = 0; |
225 | 224 |
226 virtual ErrorState* GetErrorState() = 0; | 225 virtual ErrorState* GetErrorState() = 0; |
227 | 226 |
228 // A callback for messages from the decoder. | 227 // A callback for messages from the decoder. |
229 virtual void SetShaderCacheCallback(const ShaderCacheCallback& callback) = 0; | 228 virtual void SetShaderCacheCallback(const ShaderCacheCallback& callback) = 0; |
230 | 229 |
231 // Sets the callback for waiting on a sync point. The callback returns the | |
232 // scheduling status (i.e. true if the channel is still scheduled). | |
233 virtual void SetWaitSyncPointCallback( | |
234 const WaitSyncPointCallback& callback) = 0; | |
235 | |
236 virtual void WaitForReadPixels(base::Closure callback) = 0; | 230 virtual void WaitForReadPixels(base::Closure callback) = 0; |
237 virtual uint32 GetTextureUploadCount() = 0; | 231 virtual uint32 GetTextureUploadCount() = 0; |
238 virtual base::TimeDelta GetTotalTextureUploadTime() = 0; | 232 virtual base::TimeDelta GetTotalTextureUploadTime() = 0; |
239 virtual base::TimeDelta GetTotalProcessingCommandsTime() = 0; | 233 virtual base::TimeDelta GetTotalProcessingCommandsTime() = 0; |
240 virtual void AddProcessingCommandsTime(base::TimeDelta) = 0; | 234 virtual void AddProcessingCommandsTime(base::TimeDelta) = 0; |
241 | 235 |
242 // Returns true if the context was lost either by GL_ARB_robustness, forced | 236 // Returns true if the context was lost either by GL_ARB_robustness, forced |
243 // context loss or command buffer parse error. | 237 // context loss or command buffer parse error. |
244 virtual bool WasContextLost() = 0; | 238 virtual bool WasContextLost() = 0; |
245 | 239 |
(...skipping 19 matching lines...) Expand all Loading... |
265 bool log_commands_; | 259 bool log_commands_; |
266 bool unsafe_es3_apis_enabled_; | 260 bool unsafe_es3_apis_enabled_; |
267 | 261 |
268 DISALLOW_COPY_AND_ASSIGN(GLES2Decoder); | 262 DISALLOW_COPY_AND_ASSIGN(GLES2Decoder); |
269 }; | 263 }; |
270 | 264 |
271 } // namespace gles2 | 265 } // namespace gles2 |
272 } // namespace gpu | 266 } // namespace gpu |
273 | 267 |
274 #endif // GPU_COMMAND_BUFFER_SERVICE_GLES2_CMD_DECODER_H_ | 268 #endif // GPU_COMMAND_BUFFER_SERVICE_GLES2_CMD_DECODER_H_ |
OLD | NEW |