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 #ifndef GPU_COMMAND_BUFFER_SERVICE_GPU_PROCESSOR_H_ | 5 #ifndef GPU_COMMAND_BUFFER_SERVICE_GPU_PROCESSOR_H_ |
6 #define GPU_COMMAND_BUFFER_SERVICE_GPU_PROCESSOR_H_ | 6 #define GPU_COMMAND_BUFFER_SERVICE_GPU_PROCESSOR_H_ |
7 | 7 |
8 #include <queue> | 8 #include <queue> |
9 #include <vector> | 9 #include <vector> |
10 | 10 |
(...skipping 34 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
45 GPUProcessor(CommandBuffer* command_buffer, | 45 GPUProcessor(CommandBuffer* command_buffer, |
46 gles2::GLES2Decoder* decoder, | 46 gles2::GLES2Decoder* decoder, |
47 CommandParser* parser, | 47 CommandParser* parser, |
48 int commands_per_update); | 48 int commands_per_update); |
49 | 49 |
50 virtual ~GPUProcessor(); | 50 virtual ~GPUProcessor(); |
51 | 51 |
52 // Perform platform specific and common initialization. | 52 // Perform platform specific and common initialization. |
53 bool Initialize(gfx::PluginWindowHandle hwnd, | 53 bool Initialize(gfx::PluginWindowHandle hwnd, |
54 const gfx::Size& size, | 54 const gfx::Size& size, |
| 55 const gles2::DisallowedExtensions& extensions, |
55 const char* allowed_extensions, | 56 const char* allowed_extensions, |
56 const std::vector<int32>& attribs, | 57 const std::vector<int32>& attribs, |
57 GPUProcessor* parent, | 58 GPUProcessor* parent, |
58 uint32 parent_texture_id); | 59 uint32 parent_texture_id); |
59 | 60 |
60 void Destroy(); | 61 void Destroy(); |
61 void DestroyCommon(); | 62 void DestroyCommon(); |
62 | 63 |
63 virtual void ProcessCommands(); | 64 virtual void ProcessCommands(); |
64 | 65 |
(...skipping 46 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
111 // It is not defined on which thread this callback is called. | 112 // It is not defined on which thread this callback is called. |
112 virtual void SetSwapBuffersCallback(Callback0::Type* callback); | 113 virtual void SetSwapBuffersCallback(Callback0::Type* callback); |
113 | 114 |
114 // Get the GLES2Decoder associated with this processor. | 115 // Get the GLES2Decoder associated with this processor. |
115 gles2::GLES2Decoder* decoder() const { return decoder_.get(); } | 116 gles2::GLES2Decoder* decoder() const { return decoder_.get(); } |
116 | 117 |
117 protected: | 118 protected: |
118 // Perform common initialization. Takes ownership of GLContext. | 119 // Perform common initialization. Takes ownership of GLContext. |
119 bool InitializeCommon(gfx::GLContext* context, | 120 bool InitializeCommon(gfx::GLContext* context, |
120 const gfx::Size& size, | 121 const gfx::Size& size, |
| 122 const gles2::DisallowedExtensions& extensions, |
121 const char* allowed_extensions, | 123 const char* allowed_extensions, |
122 const std::vector<int32>& attribs, | 124 const std::vector<int32>& attribs, |
123 gles2::GLES2Decoder* parent_decoder, | 125 gles2::GLES2Decoder* parent_decoder, |
124 uint32 parent_texture_id); | 126 uint32 parent_texture_id); |
125 | 127 |
126 | 128 |
127 private: | 129 private: |
128 // Called via a callback just before we are supposed to call the | 130 // Called via a callback just before we are supposed to call the |
129 // user's swap buffers callback. | 131 // user's swap buffers callback. |
130 virtual void WillSwapBuffers(); | 132 virtual void WillSwapBuffers(); |
(...skipping 17 matching lines...) Expand all Loading... |
148 uint64 acknowledged_swap_buffers_count_; | 150 uint64 acknowledged_swap_buffers_count_; |
149 #endif | 151 #endif |
150 | 152 |
151 ScopedRunnableMethodFactory<GPUProcessor> method_factory_; | 153 ScopedRunnableMethodFactory<GPUProcessor> method_factory_; |
152 scoped_ptr<Callback0::Type> wrapped_swap_buffers_callback_; | 154 scoped_ptr<Callback0::Type> wrapped_swap_buffers_callback_; |
153 }; | 155 }; |
154 | 156 |
155 } // namespace gpu | 157 } // namespace gpu |
156 | 158 |
157 #endif // GPU_COMMAND_BUFFER_SERVICE_GPU_PROCESSOR_H_ | 159 #endif // GPU_COMMAND_BUFFER_SERVICE_GPU_PROCESSOR_H_ |
OLD | NEW |