| 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> |
| 11 | 11 |
| 12 #include <string> | 12 #include <string> |
| 13 #include <vector> | 13 #include <vector> |
| 14 | 14 |
| 15 #include "base/callback_forward.h" | 15 #include "base/callback_forward.h" |
| 16 #include "base/macros.h" | 16 #include "base/macros.h" |
| 17 #include "base/memory/ref_counted.h" | 17 #include "base/memory/ref_counted.h" |
| 18 #include "base/memory/weak_ptr.h" | 18 #include "base/memory/weak_ptr.h" |
| 19 #include "base/time/time.h" | 19 #include "base/time/time.h" |
| 20 #include "build/build_config.h" | 20 #include "build/build_config.h" |
| 21 #include "gpu/command_buffer/common/capabilities.h" | 21 #include "gpu/command_buffer/common/capabilities.h" |
| 22 #include "gpu/command_buffer/common/command_buffer_id.h" | 22 #include "gpu/command_buffer/common/command_buffer_id.h" |
| 23 #include "gpu/command_buffer/common/constants.h" | 23 #include "gpu/command_buffer/common/constants.h" |
| 24 #include "gpu/command_buffer/service/common_decoder.h" | 24 #include "gpu/command_buffer/service/common_decoder.h" |
| 25 #include "gpu/gpu_export.h" | 25 #include "gpu/gpu_export.h" |
| 26 | 26 |
| 27 namespace gfx { | 27 namespace gl { |
| 28 class GLContext; | 28 class GLContext; |
| 29 class GLSurface; | 29 class GLSurface; |
| 30 } |
| 31 |
| 32 namespace gfx { |
| 30 class Size; | 33 class Size; |
| 31 } | 34 } |
| 32 | 35 |
| 33 namespace gpu { | 36 namespace gpu { |
| 34 | 37 |
| 35 struct Mailbox; | 38 struct Mailbox; |
| 36 | 39 |
| 37 namespace gles2 { | 40 namespace gles2 { |
| 38 | 41 |
| 39 class ContextGroup; | 42 class ContextGroup; |
| (...skipping 100 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 140 // Takes ownership of GLContext. | 143 // Takes ownership of GLContext. |
| 141 // Parameters: | 144 // Parameters: |
| 142 // surface: the GL surface to render to. | 145 // surface: the GL surface to render to. |
| 143 // context: the GL context to render to. | 146 // context: the GL context to render to. |
| 144 // offscreen: whether to make the context offscreen or not. When FBO 0 is | 147 // offscreen: whether to make the context offscreen or not. When FBO 0 is |
| 145 // bound, offscreen contexts render to an internal buffer, onscreen ones | 148 // bound, offscreen contexts render to an internal buffer, onscreen ones |
| 146 // to the surface. | 149 // to the surface. |
| 147 // offscreen_size: the size if the GL context is offscreen. | 150 // offscreen_size: the size if the GL context is offscreen. |
| 148 // Returns: | 151 // Returns: |
| 149 // true if successful. | 152 // true if successful. |
| 150 virtual bool Initialize(const scoped_refptr<gfx::GLSurface>& surface, | 153 virtual bool Initialize(const scoped_refptr<gl::GLSurface>& surface, |
| 151 const scoped_refptr<gfx::GLContext>& context, | 154 const scoped_refptr<gl::GLContext>& context, |
| 152 bool offscreen, | 155 bool offscreen, |
| 153 const gfx::Size& offscreen_size, | 156 const gfx::Size& offscreen_size, |
| 154 const DisallowedFeatures& disallowed_features, | 157 const DisallowedFeatures& disallowed_features, |
| 155 const ContextCreationAttribHelper& attrib_helper) = 0; | 158 const ContextCreationAttribHelper& attrib_helper) = 0; |
| 156 | 159 |
| 157 // Destroys the graphics context. | 160 // Destroys the graphics context. |
| 158 virtual void Destroy(bool have_context) = 0; | 161 virtual void Destroy(bool have_context) = 0; |
| 159 | 162 |
| 160 // Set the surface associated with the default FBO. | 163 // Set the surface associated with the default FBO. |
| 161 virtual void SetSurface(const scoped_refptr<gfx::GLSurface>& surface) = 0; | 164 virtual void SetSurface(const scoped_refptr<gl::GLSurface>& surface) = 0; |
| 162 // Releases the surface associated with the GL context. | 165 // Releases the surface associated with the GL context. |
| 163 // The decoder should not be used until a new surface is set. | 166 // The decoder should not be used until a new surface is set. |
| 164 virtual void ReleaseSurface() = 0; | 167 virtual void ReleaseSurface() = 0; |
| 165 | 168 |
| 166 virtual void TakeFrontBuffer(const Mailbox& mailbox) = 0; | 169 virtual void TakeFrontBuffer(const Mailbox& mailbox) = 0; |
| 167 virtual void ReturnFrontBuffer(const Mailbox& mailbox, bool is_lost) = 0; | 170 virtual void ReturnFrontBuffer(const Mailbox& mailbox, bool is_lost) = 0; |
| 168 | 171 |
| 169 // Resize an offscreen frame buffer. | 172 // Resize an offscreen frame buffer. |
| 170 virtual bool ResizeOffscreenFrameBuffer(const gfx::Size& size) = 0; | 173 virtual bool ResizeOffscreenFrameBuffer(const gfx::Size& size) = 0; |
| 171 | 174 |
| 172 // Make this decoder's GL context current. | 175 // Make this decoder's GL context current. |
| 173 virtual bool MakeCurrent() = 0; | 176 virtual bool MakeCurrent() = 0; |
| 174 | 177 |
| 175 // Gets the GLES2 Util which holds info. | 178 // Gets the GLES2 Util which holds info. |
| 176 virtual GLES2Util* GetGLES2Util() = 0; | 179 virtual GLES2Util* GetGLES2Util() = 0; |
| 177 | 180 |
| 178 // Gets the associated GLContext. | 181 // Gets the associated GLContext. |
| 179 virtual gfx::GLContext* GetGLContext() = 0; | 182 virtual gl::GLContext* GetGLContext() = 0; |
| 180 | 183 |
| 181 // Gets the associated ContextGroup | 184 // Gets the associated ContextGroup |
| 182 virtual ContextGroup* GetContextGroup() = 0; | 185 virtual ContextGroup* GetContextGroup() = 0; |
| 183 | 186 |
| 184 virtual Capabilities GetCapabilities() = 0; | 187 virtual Capabilities GetCapabilities() = 0; |
| 185 | 188 |
| 186 // Restores all of the decoder GL state. | 189 // Restores all of the decoder GL state. |
| 187 virtual void RestoreState(const ContextState* prev_state) = 0; | 190 virtual void RestoreState(const ContextState* prev_state) = 0; |
| 188 | 191 |
| 189 // Restore States. | 192 // Restore States. |
| (...skipping 138 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 328 bool debug_; | 331 bool debug_; |
| 329 bool log_commands_; | 332 bool log_commands_; |
| 330 bool unsafe_es3_apis_enabled_; | 333 bool unsafe_es3_apis_enabled_; |
| 331 DISALLOW_COPY_AND_ASSIGN(GLES2Decoder); | 334 DISALLOW_COPY_AND_ASSIGN(GLES2Decoder); |
| 332 }; | 335 }; |
| 333 | 336 |
| 334 } // namespace gles2 | 337 } // namespace gles2 |
| 335 } // namespace gpu | 338 } // namespace gpu |
| 336 | 339 |
| 337 #endif // GPU_COMMAND_BUFFER_SERVICE_GLES2_CMD_DECODER_H_ | 340 #endif // GPU_COMMAND_BUFFER_SERVICE_GLES2_CMD_DECODER_H_ |
| OLD | NEW |