| 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 249 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 260 | 260 |
| 261 std::vector<gfx::GpuMemoryBufferType> supported_types; | 261 std::vector<gfx::GpuMemoryBufferType> supported_types; |
| 262 GpuMemoryBufferFactory::GetSupportedTypes(&supported_types); | 262 GpuMemoryBufferFactory::GetSupportedTypes(&supported_types); |
| 263 DCHECK(!supported_types.empty()); | 263 DCHECK(!supported_types.empty()); |
| 264 | 264 |
| 265 // The GPU service will always use the preferred type. | 265 // The GPU service will always use the preferred type. |
| 266 gfx::GpuMemoryBufferType type = supported_types[0]; | 266 gfx::GpuMemoryBufferType type = supported_types[0]; |
| 267 | 267 |
| 268 switch (type) { | 268 switch (type) { |
| 269 case gfx::SURFACE_TEXTURE_BUFFER: | 269 case gfx::SURFACE_TEXTURE_BUFFER: |
| 270 // Surface texture backed GPU memory buffers require | 270 case gfx::OZONE_NATIVE_BUFFER: |
| 271 // GPU memory buffers that are shared with the GL using EGLImages require |
| 271 // TEXTURE_EXTERNAL_OES. | 272 // TEXTURE_EXTERNAL_OES. |
| 272 return GL_TEXTURE_EXTERNAL_OES; | 273 return GL_TEXTURE_EXTERNAL_OES; |
| 273 case gfx::IO_SURFACE_BUFFER: | 274 case gfx::IO_SURFACE_BUFFER: |
| 274 // IOSurface backed images require GL_TEXTURE_RECTANGLE_ARB. | 275 // IOSurface backed images require GL_TEXTURE_RECTANGLE_ARB. |
| 275 return GL_TEXTURE_RECTANGLE_ARB; | 276 return GL_TEXTURE_RECTANGLE_ARB; |
| 276 default: | 277 default: |
| 277 return GL_TEXTURE_2D; | 278 return GL_TEXTURE_2D; |
| 278 } | 279 } |
| 279 } | 280 } |
| 280 | 281 |
| (...skipping 277 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 558 DCHECK_CURRENTLY_ON(BrowserThread::IO); | 559 DCHECK_CURRENTLY_ON(BrowserThread::IO); |
| 559 | 560 |
| 560 CreateGpuMemoryBufferCallbackMap::iterator iter = | 561 CreateGpuMemoryBufferCallbackMap::iterator iter = |
| 561 create_gpu_memory_buffer_requests_.find(request_id); | 562 create_gpu_memory_buffer_requests_.find(request_id); |
| 562 DCHECK(iter != create_gpu_memory_buffer_requests_.end()); | 563 DCHECK(iter != create_gpu_memory_buffer_requests_.end()); |
| 563 iter->second.Run(handle); | 564 iter->second.Run(handle); |
| 564 create_gpu_memory_buffer_requests_.erase(iter); | 565 create_gpu_memory_buffer_requests_.erase(iter); |
| 565 } | 566 } |
| 566 | 567 |
| 567 } // namespace content | 568 } // namespace content |
| OLD | NEW |