| 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 #include "content/common/gpu/gpu_channel_manager.h" | 5 #include "content/common/gpu/gpu_channel_manager.h" |
| 6 | 6 |
| 7 #include "base/bind.h" | 7 #include "base/bind.h" |
| 8 #include "base/command_line.h" | 8 #include "base/command_line.h" |
| 9 #include "content/common/gpu/gpu_channel.h" | 9 #include "content/common/gpu/gpu_channel.h" |
| 10 #include "content/common/gpu/gpu_memory_buffer_factory.h" | 10 #include "content/common/gpu/gpu_memory_buffer_factory.h" |
| (...skipping 38 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 49 IPC_MESSAGE_UNHANDLED(handled = false) | 49 IPC_MESSAGE_UNHANDLED(handled = false) |
| 50 IPC_END_MESSAGE_MAP() | 50 IPC_END_MESSAGE_MAP() |
| 51 return handled; | 51 return handled; |
| 52 } | 52 } |
| 53 | 53 |
| 54 protected: | 54 protected: |
| 55 virtual ~GpuChannelManagerMessageFilter() {} | 55 virtual ~GpuChannelManagerMessageFilter() {} |
| 56 | 56 |
| 57 void OnCreateGpuMemoryBuffer(const gfx::GpuMemoryBufferHandle& handle, | 57 void OnCreateGpuMemoryBuffer(const gfx::GpuMemoryBufferHandle& handle, |
| 58 const gfx::Size& size, | 58 const gfx::Size& size, |
| 59 unsigned internalformat, | 59 gfx::GpuMemoryBuffer::Format format, |
| 60 unsigned usage) { | 60 gfx::GpuMemoryBuffer::Usage usage) { |
| 61 TRACE_EVENT2("gpu", | 61 TRACE_EVENT2("gpu", |
| 62 "GpuChannelManagerMessageFilter::OnCreateGpuMemoryBuffer", | 62 "GpuChannelManagerMessageFilter::OnCreateGpuMemoryBuffer", |
| 63 "primary_id", | 63 "primary_id", |
| 64 handle.global_id.primary_id, | 64 handle.global_id.primary_id, |
| 65 "secondary_id", | 65 "secondary_id", |
| 66 handle.global_id.secondary_id); | 66 handle.global_id.secondary_id); |
| 67 sender_->Send(new GpuHostMsg_GpuMemoryBufferCreated( | 67 sender_->Send(new GpuHostMsg_GpuMemoryBufferCreated( |
| 68 gpu_memory_buffer_factory_->CreateGpuMemoryBuffer( | 68 gpu_memory_buffer_factory_->CreateGpuMemoryBuffer( |
| 69 handle, size, internalformat, usage))); | 69 handle, size, format, usage))); |
| 70 } | 70 } |
| 71 | 71 |
| 72 IPC::Sender* sender_; | 72 IPC::Sender* sender_; |
| 73 GpuMemoryBufferFactory* gpu_memory_buffer_factory_; | 73 GpuMemoryBufferFactory* gpu_memory_buffer_factory_; |
| 74 }; | 74 }; |
| 75 | 75 |
| 76 } // namespace | 76 } // namespace |
| 77 | 77 |
| 78 GpuChannelManager::GpuChannelManager(MessageRouter* router, | 78 GpuChannelManager::GpuChannelManager(MessageRouter* router, |
| 79 GpuWatchdog* watchdog, | 79 GpuWatchdog* watchdog, |
| (...skipping 224 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 304 | 304 |
| 305 gfx::GLSurface* GpuChannelManager::GetDefaultOffscreenSurface() { | 305 gfx::GLSurface* GpuChannelManager::GetDefaultOffscreenSurface() { |
| 306 if (!default_offscreen_surface_.get()) { | 306 if (!default_offscreen_surface_.get()) { |
| 307 default_offscreen_surface_ = | 307 default_offscreen_surface_ = |
| 308 gfx::GLSurface::CreateOffscreenGLSurface(gfx::Size()); | 308 gfx::GLSurface::CreateOffscreenGLSurface(gfx::Size()); |
| 309 } | 309 } |
| 310 return default_offscreen_surface_.get(); | 310 return default_offscreen_surface_.get(); |
| 311 } | 311 } |
| 312 | 312 |
| 313 } // namespace content | 313 } // namespace content |
| OLD | NEW |