OLD | NEW |
1 // Copyright (c) 2009 The Chromium Authors. All rights reserved. | 1 // Copyright (c) 2009 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 "build/build_config.h" | 13 #include "build/build_config.h" |
14 #include "gpu/command_buffer/service/common_decoder.h" | 14 #include "gpu/command_buffer/service/common_decoder.h" |
15 #include "ui/gfx/size.h" | 15 #include "ui/gfx/size.h" |
16 | 16 |
17 namespace gfx { | 17 namespace gfx { |
18 class GLContext; | 18 class GLContext; |
19 } | 19 } |
20 | 20 |
21 namespace gpu { | 21 namespace gpu { |
22 | 22 |
23 namespace gles2 { | 23 namespace gles2 { |
24 | 24 |
25 class ContextGroup; | 25 class ContextGroup; |
26 class GLES2Util; | 26 class GLES2Util; |
27 | 27 |
| 28 struct DisallowedExtensions { |
| 29 bool multisampling; |
| 30 }; |
| 31 |
28 // This class implements the AsyncAPIInterface interface, decoding GLES2 | 32 // This class implements the AsyncAPIInterface interface, decoding GLES2 |
29 // commands and calling GL. | 33 // commands and calling GL. |
30 class GLES2Decoder : public CommonDecoder { | 34 class GLES2Decoder : public CommonDecoder { |
31 public: | 35 public: |
32 typedef error::Error Error; | 36 typedef error::Error Error; |
33 | 37 |
34 // Creates a decoder. | 38 // Creates a decoder. |
35 static GLES2Decoder* Create(ContextGroup* group); | 39 static GLES2Decoder* Create(ContextGroup* group); |
36 | 40 |
37 virtual ~GLES2Decoder(); | 41 virtual ~GLES2Decoder(); |
(...skipping 16 matching lines...) Expand all Loading... |
54 // glGetString(GL_EXTENSIONS) that lists the extensions this context | 58 // glGetString(GL_EXTENSIONS) that lists the extensions this context |
55 // should allow. Passing NULL or "*" means allow all extensions. | 59 // should allow. Passing NULL or "*" means allow all extensions. |
56 // parent: the GLES2 decoder that can access this decoder's front buffer | 60 // parent: the GLES2 decoder that can access this decoder's front buffer |
57 // through a texture ID in its namespace. | 61 // through a texture ID in its namespace. |
58 // parent_client_texture_id: the texture ID of the front buffer in the | 62 // parent_client_texture_id: the texture ID of the front buffer in the |
59 // parent's namespace. | 63 // parent's namespace. |
60 // Returns: | 64 // Returns: |
61 // true if successful. | 65 // true if successful. |
62 virtual bool Initialize(gfx::GLContext* context, | 66 virtual bool Initialize(gfx::GLContext* context, |
63 const gfx::Size& size, | 67 const gfx::Size& size, |
| 68 const DisallowedExtensions& disallowed_extensions, |
64 const char* allowed_extensions, | 69 const char* allowed_extensions, |
65 const std::vector<int32>& attribs, | 70 const std::vector<int32>& attribs, |
66 GLES2Decoder* parent, | 71 GLES2Decoder* parent, |
67 uint32 parent_client_texture_id) = 0; | 72 uint32 parent_client_texture_id) = 0; |
68 | 73 |
69 // Destroys the graphics context. | 74 // Destroys the graphics context. |
70 virtual void Destroy() = 0; | 75 virtual void Destroy() = 0; |
71 | 76 |
72 // Resize an offscreen frame buffer. | 77 // Resize an offscreen frame buffer. |
73 virtual void ResizeOffscreenFrameBuffer(const gfx::Size& size) = 0; | 78 virtual void ResizeOffscreenFrameBuffer(const gfx::Size& size) = 0; |
(...skipping 33 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
107 private: | 112 private: |
108 bool debug_; | 113 bool debug_; |
109 | 114 |
110 DISALLOW_COPY_AND_ASSIGN(GLES2Decoder); | 115 DISALLOW_COPY_AND_ASSIGN(GLES2Decoder); |
111 }; | 116 }; |
112 | 117 |
113 } // namespace gles2 | 118 } // namespace gles2 |
114 } // namespace gpu | 119 } // namespace gpu |
115 | 120 |
116 #endif // GPU_COMMAND_BUFFER_SERVICE_GLES2_CMD_DECODER_H_ | 121 #endif // GPU_COMMAND_BUFFER_SERVICE_GLES2_CMD_DECODER_H_ |
OLD | NEW |