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 64 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
75 bool ext_color_buffer_half_float = false; | 75 bool ext_color_buffer_half_float = false; |
76 bool oes_texture_float_linear = false; | 76 bool oes_texture_float_linear = false; |
77 bool oes_texture_half_float_linear = false; | 77 bool oes_texture_half_float_linear = false; |
78 }; | 78 }; |
79 | 79 |
80 typedef base::Callback<void(const std::string& key, | 80 typedef base::Callback<void(const std::string& key, |
81 const std::string& shader)> ShaderCacheCallback; | 81 const std::string& shader)> ShaderCacheCallback; |
82 | 82 |
83 // This class implements the AsyncAPIInterface interface, decoding GLES2 | 83 // This class implements the AsyncAPIInterface interface, decoding GLES2 |
84 // commands and calling GL. | 84 // commands and calling GL. |
85 class GPU_EXPORT GLES2Decoder : public base::SupportsWeakPtr<GLES2Decoder>, | 85 class GPU_EXPORT GLES2Decoder : public CommonDecoder { |
86 public CommonDecoder { | |
87 public: | 86 public: |
88 typedef error::Error Error; | 87 typedef error::Error Error; |
89 typedef base::Callback<void(uint64_t release)> FenceSyncReleaseCallback; | 88 typedef base::Callback<void(uint64_t release)> FenceSyncReleaseCallback; |
90 typedef base::Callback<bool(const gpu::SyncToken&)> WaitSyncTokenCallback; | 89 typedef base::Callback<bool(const gpu::SyncToken&)> WaitSyncTokenCallback; |
91 typedef base::Callback<void(void)> NoParamCallback; | 90 typedef base::Callback<void(void)> NoParamCallback; |
92 | 91 |
93 // 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 |
94 // 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 |
95 // macro redefinitions. | 94 // macro redefinitions. |
96 static const unsigned int kDefaultStencilMask; | 95 static const unsigned int kDefaultStencilMask; |
(...skipping 22 matching lines...) Expand all Loading... |
119 | 118 |
120 bool log_commands() const { | 119 bool log_commands() const { |
121 return log_commands_; | 120 return log_commands_; |
122 } | 121 } |
123 | 122 |
124 // Set to true to LOG every command. | 123 // Set to true to LOG every command. |
125 void set_log_commands(bool log_commands) { | 124 void set_log_commands(bool log_commands) { |
126 log_commands_ = log_commands; | 125 log_commands_ = log_commands; |
127 } | 126 } |
128 | 127 |
| 128 virtual base::WeakPtr<GLES2Decoder> AsWeakPtr() = 0; |
| 129 |
129 // Initializes the graphics context. Can create an offscreen | 130 // Initializes the graphics context. Can create an offscreen |
130 // decoder with a frame buffer that can be referenced from the parent. | 131 // decoder with a frame buffer that can be referenced from the parent. |
131 // Takes ownership of GLContext. | 132 // Takes ownership of GLContext. |
132 // Parameters: | 133 // Parameters: |
133 // surface: the GL surface to render to. | 134 // surface: the GL surface to render to. |
134 // context: the GL context to render to. | 135 // context: the GL context to render to. |
135 // offscreen: whether to make the context offscreen or not. When FBO 0 is | 136 // offscreen: whether to make the context offscreen or not. When FBO 0 is |
136 // bound, offscreen contexts render to an internal buffer, onscreen ones | 137 // bound, offscreen contexts render to an internal buffer, onscreen ones |
137 // to the surface. | 138 // to the surface. |
138 // offscreen_size: the size if the GL context is offscreen. | 139 // offscreen_size: the size if the GL context is offscreen. |
(...skipping 196 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
335 bool initialized_; | 336 bool initialized_; |
336 bool debug_; | 337 bool debug_; |
337 bool log_commands_; | 338 bool log_commands_; |
338 DISALLOW_COPY_AND_ASSIGN(GLES2Decoder); | 339 DISALLOW_COPY_AND_ASSIGN(GLES2Decoder); |
339 }; | 340 }; |
340 | 341 |
341 } // namespace gles2 | 342 } // namespace gles2 |
342 } // namespace gpu | 343 } // namespace gpu |
343 | 344 |
344 #endif // GPU_COMMAND_BUFFER_SERVICE_GLES2_CMD_DECODER_H_ | 345 #endif // GPU_COMMAND_BUFFER_SERVICE_GLES2_CMD_DECODER_H_ |
OLD | NEW |