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