Chromium Code Reviews| OLD | NEW |
|---|---|
| 1 // Copyright (c) 2010 The Chromium Authors. All rights reserved. | 1 // Copyright (c) 2010 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 #if defined(ENABLE_GPU) | 5 #if defined(ENABLE_GPU) |
| 6 | 6 |
| 7 #include "base/process_util.h" | 7 #include "base/process_util.h" |
| 8 #include "base/shared_memory.h" | 8 #include "base/shared_memory.h" |
| 9 #include "build/build_config.h" | 9 #include "build/build_config.h" |
| 10 #include "chrome/common/child_thread.h" | 10 #include "chrome/common/child_thread.h" |
| (...skipping 96 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... | |
| 107 if (handle_) { | 107 if (handle_) { |
| 108 // This context conceptually puts its output directly on the | 108 // This context conceptually puts its output directly on the |
| 109 // screen, rendered by the accelerated plugin layer in | 109 // screen, rendered by the accelerated plugin layer in |
| 110 // RenderWidgetHostViewMac. Set up a pathway to notify the | 110 // RenderWidgetHostViewMac. Set up a pathway to notify the |
| 111 // browser process when its contents change. | 111 // browser process when its contents change. |
| 112 processor_->SetSwapBuffersCallback( | 112 processor_->SetSwapBuffersCallback( |
| 113 NewCallback(this, | 113 NewCallback(this, |
| 114 &GpuCommandBufferStub::SwapBuffersCallback)); | 114 &GpuCommandBufferStub::SwapBuffersCallback)); |
| 115 } | 115 } |
| 116 #endif | 116 #endif |
| 117 #if defined(OS_LINUX) | |
|
nduca
2010/11/23 21:03:51
hmm, elif?
| |
| 118 if (handle_) { | |
| 119 // Set up a pathway to allow the Gpu process to ask the browser | |
| 120 // for a window resize. | |
| 121 processor_->SetResizeCallback( | |
| 122 NewCallback(this, | |
| 123 &GpuCommandBufferStub::ResizeCallback)); | |
| 124 } | |
| 125 #endif | |
| 117 } else { | 126 } else { |
| 118 processor_.reset(); | 127 processor_.reset(); |
| 119 command_buffer_.reset(); | 128 command_buffer_.reset(); |
| 120 } | 129 } |
| 121 } | 130 } |
| 122 } | 131 } |
| 123 } | 132 } |
| 124 | 133 |
| 125 void GpuCommandBufferStub::OnGetState(gpu::CommandBuffer::State* state) { | 134 void GpuCommandBufferStub::OnGetState(gpu::CommandBuffer::State* state) { |
| 126 *state = command_buffer_->GetState(); | 135 *state = command_buffer_->GetState(); |
| (...skipping 69 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... | |
| 196 } | 205 } |
| 197 } | 206 } |
| 198 | 207 |
| 199 void GpuCommandBufferStub::SwapBuffersCallback() { | 208 void GpuCommandBufferStub::SwapBuffersCallback() { |
| 200 ChildThread* gpu_thread = ChildThread::current(); | 209 ChildThread* gpu_thread = ChildThread::current(); |
| 201 gpu_thread->Send(new GpuHostMsg_AcceleratedSurfaceBuffersSwapped( | 210 gpu_thread->Send(new GpuHostMsg_AcceleratedSurfaceBuffersSwapped( |
| 202 renderer_id_, render_view_id_, handle_, processor_->GetSurfaceId())); | 211 renderer_id_, render_view_id_, handle_, processor_->GetSurfaceId())); |
| 203 } | 212 } |
| 204 #endif // defined(OS_MACOSX) | 213 #endif // defined(OS_MACOSX) |
| 205 | 214 |
| 215 #if defined(OS_LINUX) | |
| 216 void GpuCommandBufferStub::ResizeCallback(gfx::Size size) { | |
| 217 ChildThread* gpu_thread = ChildThread::current(); | |
| 218 bool result = false; | |
| 219 gpu_thread->Send( | |
| 220 new GpuHostMsg_ResizeXID(handle_, size, &result)); | |
| 221 } | |
| 222 #endif // defined(OS_LINUX) | |
| 223 | |
| 206 #endif // ENABLE_GPU | 224 #endif // ENABLE_GPU |
| OLD | NEW |