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 66 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
77 | 77 |
78 bool debug() const { | 78 bool debug() const { |
79 return debug_; | 79 return debug_; |
80 } | 80 } |
81 | 81 |
82 // Set to true to call glGetError after every command. | 82 // Set to true to call glGetError after every command. |
83 void set_debug(bool debug) { | 83 void set_debug(bool debug) { |
84 debug_ = debug; | 84 debug_ = debug; |
85 } | 85 } |
86 | 86 |
87 bool log_commands() const { | |
88 return log_commands_; | |
89 } | |
90 | |
91 // Set to true to LOG every command. | |
92 void set_log_commands(bool log_commands) { | |
93 log_commands_ = log_commands; | |
94 } | |
95 | |
96 // Initializes the graphics context. Can create an offscreen | 87 // Initializes the graphics context. Can create an offscreen |
97 // decoder with a frame buffer that can be referenced from the parent. | 88 // decoder with a frame buffer that can be referenced from the parent. |
98 // Takes ownership of GLContext. | 89 // Takes ownership of GLContext. |
99 // Parameters: | 90 // Parameters: |
100 // surface: the GL surface to render to. | 91 // surface: the GL surface to render to. |
101 // context: the GL context to render to. | 92 // context: the GL context to render to. |
102 // offscreen: whether to make the context offscreen or not. When FBO 0 is | 93 // offscreen: whether to make the context offscreen or not. When FBO 0 is |
103 // bound, offscreen contexts render to an internal buffer, onscreen ones | 94 // bound, offscreen contexts render to an internal buffer, onscreen ones |
104 // to the surface. | 95 // to the surface. |
105 // size: the size if the GL context is offscreen. | 96 // size: the size if the GL context is offscreen. |
(...skipping 120 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
226 virtual void LoseContext(uint32 reset_status) = 0; | 217 virtual void LoseContext(uint32 reset_status) = 0; |
227 | 218 |
228 virtual Logger* GetLogger() = 0; | 219 virtual Logger* GetLogger() = 0; |
229 | 220 |
230 protected: | 221 protected: |
231 GLES2Decoder(); | 222 GLES2Decoder(); |
232 | 223 |
233 private: | 224 private: |
234 bool initialized_; | 225 bool initialized_; |
235 bool debug_; | 226 bool debug_; |
236 bool log_commands_; | |
237 | 227 |
238 DISALLOW_COPY_AND_ASSIGN(GLES2Decoder); | 228 DISALLOW_COPY_AND_ASSIGN(GLES2Decoder); |
239 }; | 229 }; |
240 | 230 |
241 } // namespace gles2 | 231 } // namespace gles2 |
242 } // namespace gpu | 232 } // namespace gpu |
243 #endif // GPU_COMMAND_BUFFER_SERVICE_GLES2_CMD_DECODER_H_ | 233 #endif // GPU_COMMAND_BUFFER_SERVICE_GLES2_CMD_DECODER_H_ |
OLD | NEW |