OLD | NEW |
1 // Copyright (c) 2011 The Chromium Authors. All rights reserved. | 1 // Copyright (c) 2011 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_SCHEDULER_H_ | 5 #ifndef GPU_COMMAND_BUFFER_SERVICE_GPU_SCHEDULER_H_ |
6 #define GPU_COMMAND_BUFFER_SERVICE_GPU_SCHEDULER_H_ | 6 #define GPU_COMMAND_BUFFER_SERVICE_GPU_SCHEDULER_H_ |
7 | 7 |
8 #include <map> | 8 #include <map> |
9 #include <queue> | 9 #include <queue> |
10 #include <vector> | 10 #include <vector> |
11 | 11 |
12 #include "base/callback.h" | 12 #include "base/callback.h" |
13 #include "base/memory/ref_counted.h" | 13 #include "base/memory/ref_counted.h" |
14 #include "base/memory/scoped_ptr.h" | 14 #include "base/memory/scoped_ptr.h" |
15 #include "base/shared_memory.h" | 15 #include "base/shared_memory.h" |
16 #include "base/task.h" | 16 #include "base/task.h" |
17 #include "gpu/command_buffer/common/command_buffer.h" | 17 #include "gpu/command_buffer/common/command_buffer.h" |
| 18 #include "gpu/command_buffer/common/constants.h" |
18 #include "gpu/command_buffer/service/cmd_buffer_engine.h" | 19 #include "gpu/command_buffer/service/cmd_buffer_engine.h" |
19 #include "gpu/command_buffer/service/cmd_parser.h" | 20 #include "gpu/command_buffer/service/cmd_parser.h" |
20 #include "gpu/command_buffer/service/gles2_cmd_decoder.h" | 21 #include "gpu/command_buffer/service/gles2_cmd_decoder.h" |
21 #include "ui/gfx/native_widget_types.h" | 22 #include "ui/gfx/native_widget_types.h" |
22 #include "ui/gfx/size.h" | 23 #include "ui/gfx/size.h" |
23 #include "ui/gfx/surface/transport_dib.h" | 24 #include "ui/gfx/surface/transport_dib.h" |
24 | 25 |
25 #if defined(OS_MACOSX) | 26 #if defined(OS_MACOSX) |
26 #include "ui/gfx/surface/accelerated_surface_mac.h" | 27 #include "ui/gfx/surface/accelerated_surface_mac.h" |
27 #endif | 28 #endif |
(...skipping 40 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
68 const scoped_refptr<gfx::GLSurface>& surface, | 69 const scoped_refptr<gfx::GLSurface>& surface, |
69 const scoped_refptr<gfx::GLContext>& context, | 70 const scoped_refptr<gfx::GLContext>& context, |
70 const gfx::Size& size, | 71 const gfx::Size& size, |
71 const gles2::DisallowedExtensions& disallowed_extensions, | 72 const gles2::DisallowedExtensions& disallowed_extensions, |
72 const char* allowed_extensions, | 73 const char* allowed_extensions, |
73 const std::vector<int32>& attribs); | 74 const std::vector<int32>& attribs); |
74 | 75 |
75 void Destroy(); | 76 void Destroy(); |
76 void DestroyCommon(); | 77 void DestroyCommon(); |
77 | 78 |
| 79 bool MapExternalResource(resource_type::ResourceType resource_type, |
| 80 uint32 resource_source_id, |
| 81 GpuScheduler* source_scheduler, |
| 82 uint32 resource_dest_id); |
| 83 |
78 bool SetParent(GpuScheduler* parent_scheduler, uint32 parent_texture_id); | 84 bool SetParent(GpuScheduler* parent_scheduler, uint32 parent_texture_id); |
79 | 85 |
80 void PutChanged(); | 86 void PutChanged(); |
81 | 87 |
82 // Sets whether commands should be processed by this scheduler. Setting to | 88 // Sets whether commands should be processed by this scheduler. Setting to |
83 // false unschedules. Setting to true reschedules. Whether or not the | 89 // false unschedules. Setting to true reschedules. Whether or not the |
84 // scheduler is currently scheduled is "reference counted". Every call with | 90 // scheduler is currently scheduled is "reference counted". Every call with |
85 // false must eventually be paired by a call with true. | 91 // false must eventually be paired by a call with true. |
86 void SetScheduled(bool is_scheduled); | 92 void SetScheduled(bool is_scheduled); |
87 | 93 |
(...skipping 88 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
176 #endif | 182 #endif |
177 | 183 |
178 ScopedRunnableMethodFactory<GpuScheduler> method_factory_; | 184 ScopedRunnableMethodFactory<GpuScheduler> method_factory_; |
179 scoped_ptr<Callback0::Type> wrapped_swap_buffers_callback_; | 185 scoped_ptr<Callback0::Type> wrapped_swap_buffers_callback_; |
180 scoped_ptr<Callback0::Type> command_processed_callback_; | 186 scoped_ptr<Callback0::Type> command_processed_callback_; |
181 }; | 187 }; |
182 | 188 |
183 } // namespace gpu | 189 } // namespace gpu |
184 | 190 |
185 #endif // GPU_COMMAND_BUFFER_SERVICE_GPU_SCHEDULER_H_ | 191 #endif // GPU_COMMAND_BUFFER_SERVICE_GPU_SCHEDULER_H_ |
OLD | NEW |