Chromium Code Reviews| 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 244 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... | |
| 255 | 255 |
| 256 std::vector<gfx::GpuMemoryBufferType> supported_types; | 256 std::vector<gfx::GpuMemoryBufferType> supported_types; |
| 257 GpuMemoryBufferFactory::GetSupportedTypes(&supported_types); | 257 GpuMemoryBufferFactory::GetSupportedTypes(&supported_types); |
| 258 DCHECK(!supported_types.empty()); | 258 DCHECK(!supported_types.empty()); |
| 259 | 259 |
| 260 // The GPU service will always use the preferred type. | 260 // The GPU service will always use the preferred type. |
| 261 gfx::GpuMemoryBufferType type = supported_types[0]; | 261 gfx::GpuMemoryBufferType type = supported_types[0]; |
| 262 | 262 |
| 263 switch (type) { | 263 switch (type) { |
| 264 case gfx::SURFACE_TEXTURE_BUFFER: | 264 case gfx::SURFACE_TEXTURE_BUFFER: |
| 265 // Surface texture backed GPU memory buffers require | 265 case gfx::OZONE_NATIVE_BUFFER: |
| 266 // TEXTURE_EXTERNAL_OES. | 266 // EGLImage backed GPU memory buffers require TEXTURE_EXTERNAL_OES. |
|
reveman
2015/04/16 19:39:20
nit: These buffers are not technically backed by E
| |
| 267 return GL_TEXTURE_EXTERNAL_OES; | 267 return GL_TEXTURE_EXTERNAL_OES; |
| 268 case gfx::IO_SURFACE_BUFFER: | 268 case gfx::IO_SURFACE_BUFFER: |
| 269 // IOSurface backed images require GL_TEXTURE_RECTANGLE_ARB. | 269 // IOSurface backed images require GL_TEXTURE_RECTANGLE_ARB. |
| 270 return GL_TEXTURE_RECTANGLE_ARB; | 270 return GL_TEXTURE_RECTANGLE_ARB; |
| 271 default: | 271 default: |
| 272 return GL_TEXTURE_2D; | 272 return GL_TEXTURE_2D; |
| 273 } | 273 } |
| 274 } | 274 } |
| 275 | 275 |
| 276 BrowserGpuChannelHostFactory::BrowserGpuChannelHostFactory() | 276 BrowserGpuChannelHostFactory::BrowserGpuChannelHostFactory() |
| (...skipping 276 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... | |
| 553 DCHECK_CURRENTLY_ON(BrowserThread::IO); | 553 DCHECK_CURRENTLY_ON(BrowserThread::IO); |
| 554 | 554 |
| 555 CreateGpuMemoryBufferCallbackMap::iterator iter = | 555 CreateGpuMemoryBufferCallbackMap::iterator iter = |
| 556 create_gpu_memory_buffer_requests_.find(request_id); | 556 create_gpu_memory_buffer_requests_.find(request_id); |
| 557 DCHECK(iter != create_gpu_memory_buffer_requests_.end()); | 557 DCHECK(iter != create_gpu_memory_buffer_requests_.end()); |
| 558 iter->second.Run(handle); | 558 iter->second.Run(handle); |
| 559 create_gpu_memory_buffer_requests_.erase(iter); | 559 create_gpu_memory_buffer_requests_.erase(iter); |
| 560 } | 560 } |
| 561 | 561 |
| 562 } // namespace content | 562 } // namespace content |
| OLD | NEW |