| OLD | NEW |
| 1 // Copyright 2014 The Chromium Authors. All rights reserved. | 1 // Copyright 2014 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_memory_buffer_factory_io_surface.h" | 5 #include "content/common/gpu/gpu_memory_buffer_factory_io_surface.h" |
| 6 | 6 |
| 7 #include <CoreFoundation/CoreFoundation.h> | 7 #include <CoreFoundation/CoreFoundation.h> |
| 8 | 8 |
| 9 #include <vector> | 9 #include <vector> |
| 10 | 10 |
| (...skipping 200 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 211 io_surfaces_.erase(key); | 211 io_surfaces_.erase(key); |
| 212 } | 212 } |
| 213 | 213 |
| 214 IOSurfaceManager::GetInstance()->UnregisterIOSurface(id, client_id); | 214 IOSurfaceManager::GetInstance()->UnregisterIOSurface(id, client_id); |
| 215 } | 215 } |
| 216 | 216 |
| 217 gpu::ImageFactory* GpuMemoryBufferFactoryIOSurface::AsImageFactory() { | 217 gpu::ImageFactory* GpuMemoryBufferFactoryIOSurface::AsImageFactory() { |
| 218 return this; | 218 return this; |
| 219 } | 219 } |
| 220 | 220 |
| 221 scoped_refptr<gfx::GLImage> | 221 scoped_refptr<gl::GLImage> |
| 222 GpuMemoryBufferFactoryIOSurface::CreateImageForGpuMemoryBuffer( | 222 GpuMemoryBufferFactoryIOSurface::CreateImageForGpuMemoryBuffer( |
| 223 const gfx::GpuMemoryBufferHandle& handle, | 223 const gfx::GpuMemoryBufferHandle& handle, |
| 224 const gfx::Size& size, | 224 const gfx::Size& size, |
| 225 gfx::BufferFormat format, | 225 gfx::BufferFormat format, |
| 226 unsigned internalformat, | 226 unsigned internalformat, |
| 227 int client_id) { | 227 int client_id) { |
| 228 base::AutoLock lock(io_surfaces_lock_); | 228 base::AutoLock lock(io_surfaces_lock_); |
| 229 | 229 |
| 230 DCHECK_EQ(handle.type, gfx::IO_SURFACE_BUFFER); | 230 DCHECK_EQ(handle.type, gfx::IO_SURFACE_BUFFER); |
| 231 IOSurfaceMapKey key(handle.id, client_id); | 231 IOSurfaceMapKey key(handle.id, client_id); |
| 232 IOSurfaceMap::iterator it = io_surfaces_.find(key); | 232 IOSurfaceMap::iterator it = io_surfaces_.find(key); |
| 233 if (it == io_surfaces_.end()) | 233 if (it == io_surfaces_.end()) |
| 234 return scoped_refptr<gfx::GLImage>(); | 234 return scoped_refptr<gl::GLImage>(); |
| 235 | 235 |
| 236 scoped_refptr<gfx::GLImageIOSurface> image( | 236 scoped_refptr<gl::GLImageIOSurface> image( |
| 237 new gfx::GLImageIOSurface(size, internalformat)); | 237 new gl::GLImageIOSurface(size, internalformat)); |
| 238 if (!image->Initialize(it->second.get(), handle.id, format)) | 238 if (!image->Initialize(it->second.get(), handle.id, format)) |
| 239 return scoped_refptr<gfx::GLImage>(); | 239 return scoped_refptr<gl::GLImage>(); |
| 240 | 240 |
| 241 return image; | 241 return image; |
| 242 } | 242 } |
| 243 | 243 |
| 244 } // namespace content | 244 } // namespace content |
| OLD | NEW |