| 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> |
| 11 | 11 |
| 12 #include "base/callback.h" | 12 #include "base/callback.h" |
| 13 #include "base/memory/weak_ptr.h" | 13 #include "base/memory/weak_ptr.h" |
| 14 #include "base/time/time.h" | 14 #include "base/time/time.h" |
| 15 #include "build/build_config.h" | 15 #include "build/build_config.h" |
| 16 #include "gpu/command_buffer/common/capabilities.h" | 16 #include "gpu/command_buffer/common/capabilities.h" |
| 17 #include "gpu/command_buffer/service/common_decoder.h" | 17 #include "gpu/command_buffer/service/common_decoder.h" |
| 18 #include "gpu/command_buffer/service/logger.h" | 18 #include "gpu/command_buffer/service/logger.h" |
| 19 #include "gpu/command_buffer/service/shader_translator_cache.h" |
| 19 #include "ui/gfx/size.h" | 20 #include "ui/gfx/size.h" |
| 20 #include "ui/gl/gl_context.h" | 21 #include "ui/gl/gl_context.h" |
| 21 | 22 |
| 22 namespace gfx { | 23 namespace gfx { |
| 23 class GLContext; | 24 class GLContext; |
| 24 class GLSurface; | 25 class GLSurface; |
| 25 } | 26 } |
| 26 | 27 |
| 27 namespace gpu { | 28 namespace gpu { |
| 28 | 29 |
| (...skipping 60 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 89 void set_log_commands(bool log_commands) { | 90 void set_log_commands(bool log_commands) { |
| 90 log_commands_ = log_commands; | 91 log_commands_ = log_commands; |
| 91 } | 92 } |
| 92 | 93 |
| 93 // Initializes the graphics context. Can create an offscreen | 94 // Initializes the graphics context. Can create an offscreen |
| 94 // decoder with a frame buffer that can be referenced from the parent. | 95 // decoder with a frame buffer that can be referenced from the parent. |
| 95 // Takes ownership of GLContext. | 96 // Takes ownership of GLContext. |
| 96 // Parameters: | 97 // Parameters: |
| 97 // surface: the GL surface to render to. | 98 // surface: the GL surface to render to. |
| 98 // context: the GL context to render to. | 99 // context: the GL context to render to. |
| 100 // shader_translator_cache: the translator cache to get retrieve shader |
| 101 // translators. |
| 99 // offscreen: whether to make the context offscreen or not. When FBO 0 is | 102 // offscreen: whether to make the context offscreen or not. When FBO 0 is |
| 100 // bound, offscreen contexts render to an internal buffer, onscreen ones | 103 // bound, offscreen contexts render to an internal buffer, onscreen ones |
| 101 // to the surface. | 104 // to the surface. |
| 102 // size: the size if the GL context is offscreen. | 105 // size: the size if the GL context is offscreen. |
| 103 // Returns: | 106 // Returns: |
| 104 // true if successful. | 107 // true if successful. |
| 105 virtual bool Initialize(const scoped_refptr<gfx::GLSurface>& surface, | 108 virtual bool Initialize( |
| 106 const scoped_refptr<gfx::GLContext>& context, | 109 const scoped_refptr<gfx::GLSurface>& surface, |
| 107 bool offscreen, | 110 const scoped_refptr<gfx::GLContext>& context, |
| 108 const gfx::Size& size, | 111 const scoped_refptr<ShaderTranslatorCache>& shader_translator_cache, |
| 109 const DisallowedFeatures& disallowed_features, | 112 bool offscreen, |
| 110 const std::vector<int32>& attribs) = 0; | 113 const gfx::Size& size, |
| 114 const DisallowedFeatures& disallowed_features, |
| 115 const std::vector<int32>& attribs) = 0; |
| 111 | 116 |
| 112 // Destroys the graphics context. | 117 // Destroys the graphics context. |
| 113 virtual void Destroy(bool have_context) = 0; | 118 virtual void Destroy(bool have_context) = 0; |
| 114 | 119 |
| 115 // Set the surface associated with the default FBO. | 120 // Set the surface associated with the default FBO. |
| 116 virtual void SetSurface(const scoped_refptr<gfx::GLSurface>& surface) = 0; | 121 virtual void SetSurface(const scoped_refptr<gfx::GLSurface>& surface) = 0; |
| 117 | 122 |
| 118 virtual void ProduceFrontBuffer(const Mailbox& mailbox) = 0; | 123 virtual void ProduceFrontBuffer(const Mailbox& mailbox) = 0; |
| 119 | 124 |
| 120 // Resize an offscreen frame buffer. | 125 // Resize an offscreen frame buffer. |
| (...skipping 120 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 241 bool debug_; | 246 bool debug_; |
| 242 bool log_commands_; | 247 bool log_commands_; |
| 243 | 248 |
| 244 DISALLOW_COPY_AND_ASSIGN(GLES2Decoder); | 249 DISALLOW_COPY_AND_ASSIGN(GLES2Decoder); |
| 245 }; | 250 }; |
| 246 | 251 |
| 247 } // namespace gles2 | 252 } // namespace gles2 |
| 248 } // namespace gpu | 253 } // namespace gpu |
| 249 | 254 |
| 250 #endif // GPU_COMMAND_BUFFER_SERVICE_GLES2_CMD_DECODER_H_ | 255 #endif // GPU_COMMAND_BUFFER_SERVICE_GLES2_CMD_DECODER_H_ |
| OLD | NEW |