| 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/profiler/scoped_tracker.h" | 10 #include "base/profiler/scoped_tracker.h" |
| (...skipping 226 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 237 | 237 |
| 238 void BrowserGpuChannelHostFactory::Terminate() { | 238 void BrowserGpuChannelHostFactory::Terminate() { |
| 239 DCHECK(instance_); | 239 DCHECK(instance_); |
| 240 delete instance_; | 240 delete instance_; |
| 241 instance_ = NULL; | 241 instance_ = NULL; |
| 242 } | 242 } |
| 243 | 243 |
| 244 // static | 244 // static |
| 245 void BrowserGpuChannelHostFactory::EnableGpuMemoryBufferFactoryUsage( | 245 void BrowserGpuChannelHostFactory::EnableGpuMemoryBufferFactoryUsage( |
| 246 gfx::GpuMemoryBuffer::Usage usage) { | 246 gfx::GpuMemoryBuffer::Usage usage) { |
| 247 DCHECK_EQ(g_enabled_gpu_memory_buffer_usages.Get().count(usage), 0u); |
| 247 g_enabled_gpu_memory_buffer_usages.Get().insert(usage); | 248 g_enabled_gpu_memory_buffer_usages.Get().insert(usage); |
| 248 } | 249 } |
| 249 | 250 |
| 250 // static | 251 // static |
| 251 bool BrowserGpuChannelHostFactory::IsGpuMemoryBufferFactoryUsageEnabled( | 252 bool BrowserGpuChannelHostFactory::IsGpuMemoryBufferFactoryUsageEnabled( |
| 252 gfx::GpuMemoryBuffer::Usage usage) { | 253 gfx::GpuMemoryBuffer::Usage usage) { |
| 253 return g_enabled_gpu_memory_buffer_usages.Get().count(usage) != 0; | 254 return g_enabled_gpu_memory_buffer_usages.Get().count(usage) != 0; |
| 254 } | 255 } |
| 255 | 256 |
| 256 // static | 257 // static |
| (...skipping 302 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 559 DCHECK_CURRENTLY_ON(BrowserThread::IO); | 560 DCHECK_CURRENTLY_ON(BrowserThread::IO); |
| 560 | 561 |
| 561 CreateGpuMemoryBufferCallbackMap::iterator iter = | 562 CreateGpuMemoryBufferCallbackMap::iterator iter = |
| 562 create_gpu_memory_buffer_requests_.find(request_id); | 563 create_gpu_memory_buffer_requests_.find(request_id); |
| 563 DCHECK(iter != create_gpu_memory_buffer_requests_.end()); | 564 DCHECK(iter != create_gpu_memory_buffer_requests_.end()); |
| 564 iter->second.Run(handle); | 565 iter->second.Run(handle); |
| 565 create_gpu_memory_buffer_requests_.erase(iter); | 566 create_gpu_memory_buffer_requests_.erase(iter); |
| 566 } | 567 } |
| 567 | 568 |
| 568 } // namespace content | 569 } // namespace content |
| OLD | NEW |