| 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 <vector> | 7 #include <vector> |
| 8 | 8 |
| 9 #include "base/logging.h" | 9 #include "base/logging.h" |
| 10 #include "ui/gfx/buffer_format_util.h" | 10 #include "ui/gfx/buffer_format_util.h" |
| (...skipping 93 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 104 base::AutoLock lock(io_surfaces_lock_); | 104 base::AutoLock lock(io_surfaces_lock_); |
| 105 | 105 |
| 106 DCHECK_EQ(handle.type, gfx::IO_SURFACE_BUFFER); | 106 DCHECK_EQ(handle.type, gfx::IO_SURFACE_BUFFER); |
| 107 IOSurfaceMapKey key(handle.id, client_id); | 107 IOSurfaceMapKey key(handle.id, client_id); |
| 108 IOSurfaceMap::iterator it = io_surfaces_.find(key); | 108 IOSurfaceMap::iterator it = io_surfaces_.find(key); |
| 109 if (it == io_surfaces_.end()) | 109 if (it == io_surfaces_.end()) |
| 110 return scoped_refptr<gl::GLImage>(); | 110 return scoped_refptr<gl::GLImage>(); |
| 111 | 111 |
| 112 scoped_refptr<gl::GLImageIOSurface> image( | 112 scoped_refptr<gl::GLImageIOSurface> image( |
| 113 new gl::GLImageIOSurface(size, internalformat)); | 113 new gl::GLImageIOSurface(size, internalformat)); |
| 114 if (!image->Initialize(it->second.get(), handle.id, format)) | 114 if (!image->Initialize(it->second.get(), nullptr, handle.id, format)) |
| 115 return scoped_refptr<gl::GLImage>(); | 115 return scoped_refptr<gl::GLImage>(); |
| 116 | 116 |
| 117 return image; | 117 return image; |
| 118 } | 118 } |
| 119 | 119 |
| 120 } // namespace content | 120 } // namespace content |
| OLD | NEW |