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& disallowed_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 44 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
109 // Sets a callback which is called when a SwapBuffers command is processed. | 110 // Sets a callback which is called when a SwapBuffers command is processed. |
110 // Must be called after Initialize(). | 111 // Must be called after Initialize(). |
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( |
120 const gfx::Size& size, | 121 gfx::GLContext* context, |
121 const char* allowed_extensions, | 122 const gfx::Size& size, |
122 const std::vector<int32>& attribs, | 123 const gles2::DisallowedExtensions& disallowed_extensions, |
123 gles2::GLES2Decoder* parent_decoder, | 124 const char* allowed_extensions, |
124 uint32 parent_texture_id); | 125 const std::vector<int32>& attribs, |
| 126 gles2::GLES2Decoder* parent_decoder, |
| 127 uint32 parent_texture_id); |
125 | 128 |
126 | 129 |
127 private: | 130 private: |
128 // Called via a callback just before we are supposed to call the | 131 // Called via a callback just before we are supposed to call the |
129 // user's swap buffers callback. | 132 // user's swap buffers callback. |
130 virtual void WillSwapBuffers(); | 133 virtual void WillSwapBuffers(); |
131 | 134 |
132 // The GPUProcessor holds a weak reference to the CommandBuffer. The | 135 // The GPUProcessor holds a weak reference to the CommandBuffer. The |
133 // CommandBuffer owns the GPUProcessor and holds a strong reference to it | 136 // CommandBuffer owns the GPUProcessor and holds a strong reference to it |
134 // through the ProcessCommands callback. | 137 // through the ProcessCommands callback. |
(...skipping 13 matching lines...) Expand all Loading... |
148 uint64 acknowledged_swap_buffers_count_; | 151 uint64 acknowledged_swap_buffers_count_; |
149 #endif | 152 #endif |
150 | 153 |
151 ScopedRunnableMethodFactory<GPUProcessor> method_factory_; | 154 ScopedRunnableMethodFactory<GPUProcessor> method_factory_; |
152 scoped_ptr<Callback0::Type> wrapped_swap_buffers_callback_; | 155 scoped_ptr<Callback0::Type> wrapped_swap_buffers_callback_; |
153 }; | 156 }; |
154 | 157 |
155 } // namespace gpu | 158 } // namespace gpu |
156 | 159 |
157 #endif // GPU_COMMAND_BUFFER_SERVICE_GPU_PROCESSOR_H_ | 160 #endif // GPU_COMMAND_BUFFER_SERVICE_GPU_PROCESSOR_H_ |
OLD | NEW |