| OLD | NEW |
| 1 // Copyright (c) 2011 The Chromium Authors. All rights reserved. | 1 // Copyright (c) 2011 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 47 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 58 // Initializes the graphics context. Can create an offscreen | 58 // Initializes the graphics context. Can create an offscreen |
| 59 // decoder with a frame buffer that can be referenced from the parent. | 59 // decoder with a frame buffer that can be referenced from the parent. |
| 60 // Takes ownership of GLContext. | 60 // Takes ownership of GLContext. |
| 61 // Parameters: | 61 // Parameters: |
| 62 // surface: the GL surface to render to. | 62 // surface: the GL surface to render to. |
| 63 // context: the GL context to render to. | 63 // context: the GL context to render to. |
| 64 // size: the size if the GL context is offscreen. | 64 // size: the size if the GL context is offscreen. |
| 65 // allowed_extensions: A string in the same format as | 65 // allowed_extensions: A string in the same format as |
| 66 // glGetString(GL_EXTENSIONS) that lists the extensions this context | 66 // glGetString(GL_EXTENSIONS) that lists the extensions this context |
| 67 // should allow. Passing NULL or "*" means allow all extensions. | 67 // should allow. Passing NULL or "*" means allow all extensions. |
| 68 // parent: the GLES2 decoder that can access this decoder's front buffer | |
| 69 // through a texture ID in its namespace. | |
| 70 // parent_client_texture_id: the texture ID of the front buffer in the | |
| 71 // parent's namespace. | |
| 72 // Returns: | 68 // Returns: |
| 73 // true if successful. | 69 // true if successful. |
| 74 virtual bool Initialize(const scoped_refptr<gfx::GLSurface>& surface, | 70 virtual bool Initialize(const scoped_refptr<gfx::GLSurface>& surface, |
| 75 const scoped_refptr<gfx::GLContext>& context, | 71 const scoped_refptr<gfx::GLContext>& context, |
| 76 const gfx::Size& size, | 72 const gfx::Size& size, |
| 77 const DisallowedExtensions& disallowed_extensions, | 73 const DisallowedExtensions& disallowed_extensions, |
| 78 const char* allowed_extensions, | 74 const char* allowed_extensions, |
| 79 const std::vector<int32>& attribs, | 75 const std::vector<int32>& attribs) = 0; |
| 80 GLES2Decoder* parent, | |
| 81 uint32 parent_client_texture_id) = 0; | |
| 82 | 76 |
| 83 // Destroys the graphics context. | 77 // Destroys the graphics context. |
| 84 virtual void Destroy() = 0; | 78 virtual void Destroy() = 0; |
| 85 | 79 |
| 80 virtual bool SetParent(GLES2Decoder* parent_decoder, |
| 81 uint32 parent_texture_id) = 0; |
| 82 |
| 86 // Resize an offscreen frame buffer. | 83 // Resize an offscreen frame buffer. |
| 87 virtual void ResizeOffscreenFrameBuffer(const gfx::Size& size) = 0; | 84 virtual void ResizeOffscreenFrameBuffer(const gfx::Size& size) = 0; |
| 88 | 85 |
| 89 // Force the offscreen frame buffer's size to be updated. This | 86 // Force the offscreen frame buffer's size to be updated. This |
| 90 // usually occurs lazily, during SwapBuffers, but on some platforms | 87 // usually occurs lazily, during SwapBuffers, but on some platforms |
| 91 // (Mac OS X in particular) it must be done immediately. | 88 // (Mac OS X in particular) it must be done immediately. |
| 92 virtual bool UpdateOffscreenFrameBufferSize() = 0; | 89 virtual bool UpdateOffscreenFrameBufferSize() = 0; |
| 93 | 90 |
| 94 // Make this decoder's GL context current. | 91 // Make this decoder's GL context current. |
| 95 virtual bool MakeCurrent() = 0; | 92 virtual bool MakeCurrent() = 0; |
| (...skipping 33 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 129 private: | 126 private: |
| 130 bool debug_; | 127 bool debug_; |
| 131 | 128 |
| 132 DISALLOW_COPY_AND_ASSIGN(GLES2Decoder); | 129 DISALLOW_COPY_AND_ASSIGN(GLES2Decoder); |
| 133 }; | 130 }; |
| 134 | 131 |
| 135 } // namespace gles2 | 132 } // namespace gles2 |
| 136 } // namespace gpu | 133 } // namespace gpu |
| 137 | 134 |
| 138 #endif // GPU_COMMAND_BUFFER_SERVICE_GLES2_CMD_DECODER_H_ | 135 #endif // GPU_COMMAND_BUFFER_SERVICE_GLES2_CMD_DECODER_H_ |
| OLD | NEW |