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 157 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
168 DCHECK(io_surfaces_.find(key) == io_surfaces_.end()); | 168 DCHECK(io_surfaces_.find(key) == io_surfaces_.end()); |
169 io_surfaces_[key] = io_surface; | 169 io_surfaces_[key] = io_surface; |
170 } | 170 } |
171 | 171 |
172 gfx::GpuMemoryBufferHandle handle; | 172 gfx::GpuMemoryBufferHandle handle; |
173 handle.type = gfx::IO_SURFACE_BUFFER; | 173 handle.type = gfx::IO_SURFACE_BUFFER; |
174 handle.id = id; | 174 handle.id = id; |
175 return handle; | 175 return handle; |
176 } | 176 } |
177 | 177 |
| 178 gfx::GpuMemoryBufferHandle |
| 179 GpuMemoryBufferFactoryIOSurface::CreateGpuMemoryBufferFromHandle( |
| 180 const gfx::GpuMemoryBufferHandle& handle, |
| 181 gfx::GpuMemoryBufferId id, |
| 182 const gfx::Size& size, |
| 183 gfx::BufferFormat format, |
| 184 int client_id) { |
| 185 NOTIMPLEMENTED(); |
| 186 return gfx::GpuMemoryBufferHandle(); |
| 187 } |
| 188 |
178 void GpuMemoryBufferFactoryIOSurface::DestroyGpuMemoryBuffer( | 189 void GpuMemoryBufferFactoryIOSurface::DestroyGpuMemoryBuffer( |
179 gfx::GpuMemoryBufferId id, | 190 gfx::GpuMemoryBufferId id, |
180 int client_id) { | 191 int client_id) { |
181 { | 192 { |
182 base::AutoLock lock(io_surfaces_lock_); | 193 base::AutoLock lock(io_surfaces_lock_); |
183 | 194 |
184 IOSurfaceMapKey key(id, client_id); | 195 IOSurfaceMapKey key(id, client_id); |
185 DCHECK(io_surfaces_.find(key) != io_surfaces_.end()); | 196 DCHECK(io_surfaces_.find(key) != io_surfaces_.end()); |
186 io_surfaces_.erase(key); | 197 io_surfaces_.erase(key); |
187 } | 198 } |
(...skipping 22 matching lines...) Expand all Loading... |
210 | 221 |
211 scoped_refptr<gfx::GLImageIOSurface> image( | 222 scoped_refptr<gfx::GLImageIOSurface> image( |
212 new gfx::GLImageIOSurface(handle.id, size, internalformat)); | 223 new gfx::GLImageIOSurface(handle.id, size, internalformat)); |
213 if (!image->Initialize(it->second.get(), format)) | 224 if (!image->Initialize(it->second.get(), format)) |
214 return scoped_refptr<gfx::GLImage>(); | 225 return scoped_refptr<gfx::GLImage>(); |
215 | 226 |
216 return image; | 227 return image; |
217 } | 228 } |
218 | 229 |
219 } // namespace content | 230 } // namespace content |
OLD | NEW |