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 69 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
80 void set_log_synthesized_gl_errors(bool enabled) { | 80 void set_log_synthesized_gl_errors(bool enabled) { |
81 log_synthesized_gl_errors_ = enabled; | 81 log_synthesized_gl_errors_ = enabled; |
82 } | 82 } |
83 | 83 |
84 // Initializes the graphics context. Can create an offscreen | 84 // Initializes the graphics context. Can create an offscreen |
85 // decoder with a frame buffer that can be referenced from the parent. | 85 // decoder with a frame buffer that can be referenced from the parent. |
86 // Takes ownership of GLContext. | 86 // Takes ownership of GLContext. |
87 // Parameters: | 87 // Parameters: |
88 // surface: the GL surface to render to. | 88 // surface: the GL surface to render to. |
89 // context: the GL context to render to. | 89 // context: the GL context to render to. |
90 // offscreen: whether to make the context offscreen or not. When FBO 0 is | |
91 // bound, offscreen contexts render to an internal buffer, onscreen ones | |
92 // to the surface. | |
93 // size: the size if the GL context is offscreen. | 90 // size: the size if the GL context is offscreen. |
94 // allowed_extensions: A string in the same format as | 91 // allowed_extensions: A string in the same format as |
95 // glGetString(GL_EXTENSIONS) that lists the extensions this context | 92 // glGetString(GL_EXTENSIONS) that lists the extensions this context |
96 // should allow. Passing NULL or "*" means allow all extensions. | 93 // should allow. Passing NULL or "*" means allow all extensions. |
97 // Returns: | 94 // Returns: |
98 // true if successful. | 95 // true if successful. |
99 virtual bool Initialize(const scoped_refptr<gfx::GLSurface>& surface, | 96 virtual bool Initialize(const scoped_refptr<gfx::GLSurface>& surface, |
100 const scoped_refptr<gfx::GLContext>& context, | 97 const scoped_refptr<gfx::GLContext>& context, |
101 bool offscreen, | |
102 const gfx::Size& size, | 98 const gfx::Size& size, |
103 const DisallowedFeatures& disallowed_features, | 99 const DisallowedFeatures& disallowed_features, |
104 const char* allowed_extensions, | 100 const char* allowed_extensions, |
105 const std::vector<int32>& attribs) = 0; | 101 const std::vector<int32>& attribs) = 0; |
106 | 102 |
107 // Destroys the graphics context. | 103 // Destroys the graphics context. |
108 virtual void Destroy() = 0; | 104 virtual void Destroy() = 0; |
109 | 105 |
110 virtual bool SetParent(GLES2Decoder* parent_decoder, | 106 virtual bool SetParent(GLES2Decoder* parent_decoder, |
111 uint32 parent_texture_id) = 0; | 107 uint32 parent_texture_id) = 0; |
(...skipping 70 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
182 bool log_synthesized_gl_errors_; | 178 bool log_synthesized_gl_errors_; |
183 static bool testing_force_is_angle_; | 179 static bool testing_force_is_angle_; |
184 | 180 |
185 DISALLOW_COPY_AND_ASSIGN(GLES2Decoder); | 181 DISALLOW_COPY_AND_ASSIGN(GLES2Decoder); |
186 }; | 182 }; |
187 | 183 |
188 } // namespace gles2 | 184 } // namespace gles2 |
189 } // namespace gpu | 185 } // namespace gpu |
190 | 186 |
191 #endif // GPU_COMMAND_BUFFER_SERVICE_GLES2_CMD_DECODER_H_ | 187 #endif // GPU_COMMAND_BUFFER_SERVICE_GLES2_CMD_DECODER_H_ |
OLD | NEW |