| 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 #if defined(OS_WIN) | 5 #if defined(OS_WIN) |
| 6 #include <windows.h> | 6 #include <windows.h> |
| 7 #endif | 7 #endif |
| 8 | 8 |
| 9 #include "content/common/gpu/gpu_channel.h" | 9 #include "content/common/gpu/gpu_channel.h" |
| 10 | 10 |
| (...skipping 216 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 227 if (stub == NULL) | 227 if (stub == NULL) |
| 228 return; | 228 return; |
| 229 | 229 |
| 230 stub->ViewResized(); | 230 stub->ViewResized(); |
| 231 } | 231 } |
| 232 | 232 |
| 233 GpuCommandBufferStub* GpuChannel::LookupCommandBuffer(int32 route_id) { | 233 GpuCommandBufferStub* GpuChannel::LookupCommandBuffer(int32 route_id) { |
| 234 return stubs_.Lookup(route_id); | 234 return stubs_.Lookup(route_id); |
| 235 } | 235 } |
| 236 | 236 |
| 237 #if defined(TOUCH_UI) | 237 #if defined(OS_MACOSX) |
| 238 void GpuChannel::AcceleratedSurfaceIOSurfaceSet( | |
| 239 int32 route_id, uint64 surface_id) { | |
| 240 GpuCommandBufferStub* stub = stubs_.Lookup(route_id); | |
| 241 if (stub == NULL) | |
| 242 return; | |
| 243 stub->AcceleratedSurfaceIOSurfaceSet(surface_id); | |
| 244 } | |
| 245 | |
| 246 void GpuChannel::AcceleratedSurfaceReleased( | |
| 247 int32 route_id, uint64 surface_id) { | |
| 248 GpuCommandBufferStub* stub = stubs_.Lookup(route_id); | |
| 249 if (stub == NULL) | |
| 250 return; | |
| 251 stub->AcceleratedSurfaceReleased(surface_id); | |
| 252 } | |
| 253 #endif | |
| 254 | |
| 255 #if defined(OS_MACOSX) || defined(TOUCH_UI) | |
| 256 void GpuChannel::AcceleratedSurfaceBuffersSwapped( | 238 void GpuChannel::AcceleratedSurfaceBuffersSwapped( |
| 257 int32 route_id, uint64 swap_buffers_count) { | 239 int32 route_id, uint64 swap_buffers_count) { |
| 258 GpuCommandBufferStub* stub = stubs_.Lookup(route_id); | 240 GpuCommandBufferStub* stub = stubs_.Lookup(route_id); |
| 259 if (stub == NULL) | 241 if (stub == NULL) |
| 260 return; | 242 return; |
| 261 stub->AcceleratedSurfaceBuffersSwapped(swap_buffers_count); | 243 stub->AcceleratedSurfaceBuffersSwapped(swap_buffers_count); |
| 262 } | 244 } |
| 263 #endif | |
| 264 | 245 |
| 265 #if defined(OS_MACOSX) | |
| 266 void GpuChannel::DestroyCommandBufferByViewId(int32 render_view_id) { | 246 void GpuChannel::DestroyCommandBufferByViewId(int32 render_view_id) { |
| 267 // This responds to a message from the browser process to destroy the command | 247 // This responds to a message from the browser process to destroy the command |
| 268 // buffer when the window with a GpuScheduler is closed (see | 248 // buffer when the window with a GpuScheduler is closed (see |
| 269 // RenderWidgetHostViewMac::DeallocFakePluginWindowHandle). Find the route id | 249 // RenderWidgetHostViewMac::DeallocFakePluginWindowHandle). Find the route id |
| 270 // that matches the given render_view_id and delete the route. | 250 // that matches the given render_view_id and delete the route. |
| 271 for (StubMap::const_iterator iter(&stubs_); !iter.IsAtEnd(); iter.Advance()) { | 251 for (StubMap::const_iterator iter(&stubs_); !iter.IsAtEnd(); iter.Advance()) { |
| 272 if (iter.GetCurrentValue()->render_view_id() == render_view_id) { | 252 if (iter.GetCurrentValue()->render_view_id() == render_view_id) { |
| 273 OnDestroyCommandBuffer(iter.GetCurrentKey(), NULL); | 253 OnDestroyCommandBuffer(iter.GetCurrentKey(), NULL); |
| 274 return; | 254 return; |
| 275 } | 255 } |
| (...skipping 175 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 451 | 431 |
| 452 #if defined(OS_POSIX) | 432 #if defined(OS_POSIX) |
| 453 int GpuChannel::GetRendererFileDescriptor() { | 433 int GpuChannel::GetRendererFileDescriptor() { |
| 454 int fd = -1; | 434 int fd = -1; |
| 455 if (channel_.get()) { | 435 if (channel_.get()) { |
| 456 fd = channel_->GetClientFileDescriptor(); | 436 fd = channel_->GetClientFileDescriptor(); |
| 457 } | 437 } |
| 458 return fd; | 438 return fd; |
| 459 } | 439 } |
| 460 #endif // defined(OS_POSIX) | 440 #endif // defined(OS_POSIX) |
| OLD | NEW |