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 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 48 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
59 | 59 |
60 // IPC::Channel::Listener implementation: | 60 // IPC::Channel::Listener implementation: |
61 virtual bool OnMessageReceived(const IPC::Message& message) OVERRIDE; | 61 virtual bool OnMessageReceived(const IPC::Message& message) OVERRIDE; |
62 | 62 |
63 // IPC::Message::Sender implementation: | 63 // IPC::Message::Sender implementation: |
64 virtual bool Send(IPC::Message* msg) OVERRIDE; | 64 virtual bool Send(IPC::Message* msg) OVERRIDE; |
65 | 65 |
66 // Whether this command buffer can currently handle IPC messages. | 66 // Whether this command buffer can currently handle IPC messages. |
67 bool IsScheduled(); | 67 bool IsScheduled(); |
68 | 68 |
69 // Set the swap interval according to the command line. | |
70 void SetSwapInterval(); | |
71 | |
72 gpu::gles2::GLES2Decoder* decoder() const { return decoder_.get(); } | 69 gpu::gles2::GLES2Decoder* decoder() const { return decoder_.get(); } |
73 gpu::GpuScheduler* scheduler() const { return scheduler_.get(); } | 70 gpu::GpuScheduler* scheduler() const { return scheduler_.get(); } |
74 | 71 |
75 // Identifies the renderer process. | 72 // Identifies the renderer process. |
76 int32 renderer_id() const { return renderer_id_; } | 73 int32 renderer_id() const { return renderer_id_; } |
77 | 74 |
78 // Identifies a particular renderer belonging to the same renderer process. | 75 // Identifies a particular renderer belonging to the same renderer process. |
79 int32 render_view_id() const { return render_view_id_; } | 76 int32 render_view_id() const { return render_view_id_; } |
80 | 77 |
81 // Identifies the various GpuCommandBufferStubs in the GPU process belonging | 78 // Identifies the various GpuCommandBufferStubs in the GPU process belonging |
82 // to the same renderer process. | 79 // to the same renderer process. |
83 int32 route_id() const { return route_id_; } | 80 int32 route_id() const { return route_id_; } |
84 | 81 |
| 82 void ViewResized(); |
| 83 |
85 gfx::GpuPreference gpu_preference() { return gpu_preference_; } | 84 gfx::GpuPreference gpu_preference() { return gpu_preference_; } |
86 | 85 |
87 private: | 86 private: |
88 void Destroy(); | 87 void Destroy(); |
89 | 88 |
90 // Cleans up and sends reply if OnInitialize failed. | 89 // Cleans up and sends reply if OnInitialize failed. |
91 void OnInitializeFailed(IPC::Message* reply_message); | 90 void OnInitializeFailed(IPC::Message* reply_message); |
92 | 91 |
93 // Message handlers: | 92 // Message handlers: |
94 void OnInitialize(base::SharedMemoryHandle ring_buffer, | 93 void OnInitialize(base::SharedMemoryHandle ring_buffer, |
(...skipping 17 matching lines...) Expand all Loading... |
112 void OnDestroyTransferBuffer(int32 id, IPC::Message* reply_message); | 111 void OnDestroyTransferBuffer(int32 id, IPC::Message* reply_message); |
113 void OnGetTransferBuffer(int32 id, IPC::Message* reply_message); | 112 void OnGetTransferBuffer(int32 id, IPC::Message* reply_message); |
114 | 113 |
115 void OnCreateVideoDecoder( | 114 void OnCreateVideoDecoder( |
116 media::VideoDecodeAccelerator::Profile profile, | 115 media::VideoDecodeAccelerator::Profile profile, |
117 IPC::Message* reply_message); | 116 IPC::Message* reply_message); |
118 void OnDestroyVideoDecoder(int32 decoder_route_id); | 117 void OnDestroyVideoDecoder(int32 decoder_route_id); |
119 | 118 |
120 void OnSetSurfaceVisible(bool visible); | 119 void OnSetSurfaceVisible(bool visible); |
121 | 120 |
| 121 #if defined(OS_MACOSX) |
| 122 void OnSwapBuffers(); |
| 123 |
| 124 // Returns the id of the current surface that is being rendered to |
| 125 // (or 0 if no such surface has been created). |
| 126 uint64 GetSurfaceId(); |
| 127 #endif |
| 128 |
122 void OnCommandProcessed(); | 129 void OnCommandProcessed(); |
123 void OnParseError(); | 130 void OnParseError(); |
124 | 131 |
| 132 void OnResize(gfx::Size size); |
125 void ReportState(); | 133 void ReportState(); |
126 | 134 |
| 135 void SetSwapInterval(); |
| 136 |
127 // The lifetime of objects of this class is managed by a GpuChannel. The | 137 // The lifetime of objects of this class is managed by a GpuChannel. The |
128 // GpuChannels destroy all the GpuCommandBufferStubs that they own when they | 138 // GpuChannels destroy all the GpuCommandBufferStubs that they own when they |
129 // are destroyed. So a raw pointer is safe. | 139 // are destroyed. So a raw pointer is safe. |
130 GpuChannel* channel_; | 140 GpuChannel* channel_; |
131 | 141 |
132 // The group of contexts that share namespaces with this context. | 142 // The group of contexts that share namespaces with this context. |
133 scoped_refptr<gpu::gles2::ContextGroup> context_group_; | 143 scoped_refptr<gpu::gles2::ContextGroup> context_group_; |
134 | 144 |
135 gfx::PluginWindowHandle handle_; | 145 gfx::PluginWindowHandle handle_; |
136 gfx::Size initial_size_; | 146 gfx::Size initial_size_; |
(...skipping 28 matching lines...) Expand all Loading... |
165 IDMap<GpuVideoDecodeAccelerator, IDMapOwnPointer> video_decoders_; | 175 IDMap<GpuVideoDecodeAccelerator, IDMapOwnPointer> video_decoders_; |
166 | 176 |
167 ScopedRunnableMethodFactory<GpuCommandBufferStub> task_factory_; | 177 ScopedRunnableMethodFactory<GpuCommandBufferStub> task_factory_; |
168 | 178 |
169 DISALLOW_COPY_AND_ASSIGN(GpuCommandBufferStub); | 179 DISALLOW_COPY_AND_ASSIGN(GpuCommandBufferStub); |
170 }; | 180 }; |
171 | 181 |
172 #endif // defined(ENABLE_GPU) | 182 #endif // defined(ENABLE_GPU) |
173 | 183 |
174 #endif // CONTENT_COMMON_GPU_GPU_COMMAND_BUFFER_STUB_H_ | 184 #endif // CONTENT_COMMON_GPU_GPU_COMMAND_BUFFER_STUB_H_ |
OLD | NEW |