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 #ifndef CONTENT_COMMON_GPU_GPU_COMMAND_BUFFER_STUB_H_ | 5 #ifndef CONTENT_COMMON_GPU_GPU_COMMAND_BUFFER_STUB_H_ |
6 #define CONTENT_COMMON_GPU_GPU_COMMAND_BUFFER_STUB_H_ | 6 #define CONTENT_COMMON_GPU_GPU_COMMAND_BUFFER_STUB_H_ |
7 #pragma once | 7 #pragma once |
8 | 8 |
9 #if defined(ENABLE_GPU) | 9 #if defined(ENABLE_GPU) |
10 | 10 |
(...skipping 31 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
42 GpuCommandBufferStub( | 42 GpuCommandBufferStub( |
43 GpuChannel* channel, | 43 GpuChannel* channel, |
44 GpuCommandBufferStub* share_group, | 44 GpuCommandBufferStub* share_group, |
45 gfx::PluginWindowHandle handle, | 45 gfx::PluginWindowHandle handle, |
46 const gfx::Size& size, | 46 const gfx::Size& size, |
47 const gpu::gles2::DisallowedFeatures& disallowed_features, | 47 const gpu::gles2::DisallowedFeatures& disallowed_features, |
48 const std::string& allowed_extensions, | 48 const std::string& allowed_extensions, |
49 const std::vector<int32>& attribs, | 49 const std::vector<int32>& attribs, |
50 gfx::GpuPreference gpu_preference, | 50 gfx::GpuPreference gpu_preference, |
51 int32 route_id, | 51 int32 route_id, |
52 int32 client_id, | 52 int32 surface_id, |
53 int32 render_view_id, | |
54 GpuWatchdog* watchdog, | 53 GpuWatchdog* watchdog, |
55 bool software); | 54 bool software); |
56 | 55 |
57 virtual ~GpuCommandBufferStub(); | 56 virtual ~GpuCommandBufferStub(); |
58 | 57 |
59 // IPC::Channel::Listener implementation: | 58 // IPC::Channel::Listener implementation: |
60 virtual bool OnMessageReceived(const IPC::Message& message) OVERRIDE; | 59 virtual bool OnMessageReceived(const IPC::Message& message) OVERRIDE; |
61 | 60 |
62 // IPC::Message::Sender implementation: | 61 // IPC::Message::Sender implementation: |
63 virtual bool Send(IPC::Message* msg) OVERRIDE; | 62 virtual bool Send(IPC::Message* msg) OVERRIDE; |
64 | 63 |
65 // Whether this command buffer can currently handle IPC messages. | 64 // Whether this command buffer can currently handle IPC messages. |
66 bool IsScheduled(); | 65 bool IsScheduled(); |
67 | 66 |
68 // Whether this command buffer needs to be polled again in the future. | 67 // Whether this command buffer needs to be polled again in the future. |
69 bool HasMoreWork(); | 68 bool HasMoreWork(); |
70 | 69 |
71 // Set the swap interval according to the command line. | 70 // Set the swap interval according to the command line. |
72 void SetSwapInterval(); | 71 void SetSwapInterval(); |
73 | 72 |
74 gpu::gles2::GLES2Decoder* decoder() const { return decoder_.get(); } | 73 gpu::gles2::GLES2Decoder* decoder() const { return decoder_.get(); } |
75 gpu::GpuScheduler* scheduler() const { return scheduler_.get(); } | 74 gpu::GpuScheduler* scheduler() const { return scheduler_.get(); } |
76 | 75 |
77 // Identifies the renderer process. | 76 // Identifies the target surface. |
78 int32 client_id() const { return client_id_; } | 77 int32 surface_id() const { return surface_id_; } |
79 | |
80 // Identifies a particular renderer belonging to the same renderer process. | |
81 int32 render_view_id() const { return render_view_id_; } | |
82 | 78 |
83 // Identifies the various GpuCommandBufferStubs in the GPU process belonging | 79 // Identifies the various GpuCommandBufferStubs in the GPU process belonging |
84 // to the same renderer process. | 80 // to the same renderer process. |
85 int32 route_id() const { return route_id_; } | 81 int32 route_id() const { return route_id_; } |
86 | 82 |
87 gfx::GpuPreference gpu_preference() { return gpu_preference_; } | 83 gfx::GpuPreference gpu_preference() { return gpu_preference_; } |
88 | 84 |
89 // Sends a message to the console. | 85 // Sends a message to the console. |
90 void SendConsoleMessage(int32 id, const std::string& message); | 86 void SendConsoleMessage(int32 id, const std::string& message); |
91 | 87 |
(...skipping 47 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
139 gfx::PluginWindowHandle handle_; | 135 gfx::PluginWindowHandle handle_; |
140 gfx::Size initial_size_; | 136 gfx::Size initial_size_; |
141 gpu::gles2::DisallowedFeatures disallowed_features_; | 137 gpu::gles2::DisallowedFeatures disallowed_features_; |
142 std::string allowed_extensions_; | 138 std::string allowed_extensions_; |
143 std::vector<int32> requested_attribs_; | 139 std::vector<int32> requested_attribs_; |
144 gfx::GpuPreference gpu_preference_; | 140 gfx::GpuPreference gpu_preference_; |
145 int32 route_id_; | 141 int32 route_id_; |
146 bool software_; | 142 bool software_; |
147 uint32 last_flush_count_; | 143 uint32 last_flush_count_; |
148 | 144 |
149 // The following two fields are used on Mac OS X to identify the window | 145 // Identifies the window for the rendering results on the browser side. |
150 // for the rendering results on the browser side. | 146 int32 surface_id_; |
151 int32 client_id_; | |
152 int32 render_view_id_; | |
153 | 147 |
154 scoped_ptr<gpu::CommandBufferService> command_buffer_; | 148 scoped_ptr<gpu::CommandBufferService> command_buffer_; |
155 scoped_ptr<gpu::gles2::GLES2Decoder> decoder_; | 149 scoped_ptr<gpu::gles2::GLES2Decoder> decoder_; |
156 scoped_ptr<gpu::GpuScheduler> scheduler_; | 150 scoped_ptr<gpu::GpuScheduler> scheduler_; |
157 scoped_refptr<gfx::GLContext> context_; | 151 scoped_refptr<gfx::GLContext> context_; |
158 scoped_refptr<gfx::GLSurface> surface_; | 152 scoped_refptr<gfx::GLSurface> surface_; |
159 | 153 |
160 // SetParent may be called before Initialize, in which case we need to keep | 154 // SetParent may be called before Initialize, in which case we need to keep |
161 // around the parent stub, so that Initialize can set the parent correctly. | 155 // around the parent stub, so that Initialize can set the parent correctly. |
162 base::WeakPtr<GpuCommandBufferStub> parent_stub_for_initialization_; | 156 base::WeakPtr<GpuCommandBufferStub> parent_stub_for_initialization_; |
163 uint32 parent_texture_for_initialization_; | 157 uint32 parent_texture_for_initialization_; |
164 | 158 |
165 GpuWatchdog* watchdog_; | 159 GpuWatchdog* watchdog_; |
166 | 160 |
167 // Zero or more video decoders owned by this stub, keyed by their | 161 // Zero or more video decoders owned by this stub, keyed by their |
168 // decoder_route_id. | 162 // decoder_route_id. |
169 IDMap<GpuVideoDecodeAccelerator, IDMapOwnPointer> video_decoders_; | 163 IDMap<GpuVideoDecodeAccelerator, IDMapOwnPointer> video_decoders_; |
170 | 164 |
171 DISALLOW_COPY_AND_ASSIGN(GpuCommandBufferStub); | 165 DISALLOW_COPY_AND_ASSIGN(GpuCommandBufferStub); |
172 }; | 166 }; |
173 | 167 |
174 #endif // defined(ENABLE_GPU) | 168 #endif // defined(ENABLE_GPU) |
175 | 169 |
176 #endif // CONTENT_COMMON_GPU_GPU_COMMAND_BUFFER_STUB_H_ | 170 #endif // CONTENT_COMMON_GPU_GPU_COMMAND_BUFFER_STUB_H_ |
OLD | NEW |