| 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/browser/gpu/browser_gpu_channel_host_factory.h" | 5 #include "content/browser/gpu/browser_gpu_channel_host_factory.h" |
| 6 | 6 |
| 7 #include <set> | 7 #include <set> |
| 8 | 8 |
| 9 #include "base/bind.h" | 9 #include "base/bind.h" |
| 10 #include "base/location.h" | 10 #include "base/location.h" |
| (...skipping 362 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 373 host->CreateViewCommandBuffer( | 373 host->CreateViewCommandBuffer( |
| 374 surface, | 374 surface, |
| 375 surface_id, | 375 surface_id, |
| 376 gpu_client_id_, | 376 gpu_client_id_, |
| 377 init_params, | 377 init_params, |
| 378 request->route_id, | 378 request->route_id, |
| 379 base::Bind(&BrowserGpuChannelHostFactory::CommandBufferCreatedOnIO, | 379 base::Bind(&BrowserGpuChannelHostFactory::CommandBufferCreatedOnIO, |
| 380 request)); | 380 request)); |
| 381 } | 381 } |
| 382 | 382 |
| 383 IPC::AttachmentBroker* BrowserGpuChannelHostFactory::GetAttachmentBroker() { |
| 384 return content::ChildProcessHost::GetAttachmentBroker(); |
| 385 } |
| 386 |
| 383 // static | 387 // static |
| 384 void BrowserGpuChannelHostFactory::CommandBufferCreatedOnIO( | 388 void BrowserGpuChannelHostFactory::CommandBufferCreatedOnIO( |
| 385 CreateRequest* request, CreateCommandBufferResult result) { | 389 CreateRequest* request, CreateCommandBufferResult result) { |
| 386 request->result = result; | 390 request->result = result; |
| 387 request->event.Signal(); | 391 request->event.Signal(); |
| 388 } | 392 } |
| 389 | 393 |
| 390 CreateCommandBufferResult BrowserGpuChannelHostFactory::CreateViewCommandBuffer( | 394 CreateCommandBufferResult BrowserGpuChannelHostFactory::CreateViewCommandBuffer( |
| 391 int32 surface_id, | 395 int32 surface_id, |
| 392 const GPUCreateCommandBufferConfig& init_params, | 396 const GPUCreateCommandBufferConfig& init_params, |
| (...skipping 186 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 579 DCHECK_CURRENTLY_ON(BrowserThread::IO); | 583 DCHECK_CURRENTLY_ON(BrowserThread::IO); |
| 580 | 584 |
| 581 CreateGpuMemoryBufferCallbackMap::iterator iter = | 585 CreateGpuMemoryBufferCallbackMap::iterator iter = |
| 582 create_gpu_memory_buffer_requests_.find(request_id); | 586 create_gpu_memory_buffer_requests_.find(request_id); |
| 583 DCHECK(iter != create_gpu_memory_buffer_requests_.end()); | 587 DCHECK(iter != create_gpu_memory_buffer_requests_.end()); |
| 584 iter->second.Run(handle); | 588 iter->second.Run(handle); |
| 585 create_gpu_memory_buffer_requests_.erase(iter); | 589 create_gpu_memory_buffer_requests_.erase(iter); |
| 586 } | 590 } |
| 587 | 591 |
| 588 } // namespace content | 592 } // namespace content |
| OLD | NEW |