| 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_surface_texture.h" | 5 #include "content/common/gpu/gpu_memory_buffer_factory_surface_texture.h" |
| 6 | 6 |
| 7 #include "gpu/ipc/common/android/surface_texture_manager.h" | 7 #include "gpu/ipc/common/android/surface_texture_manager.h" |
| 8 #include "ui/gl/android/surface_texture.h" | 8 #include "ui/gl/android/surface_texture.h" |
| 9 #include "ui/gl/gl_image_surface_texture.h" | 9 #include "ui/gl/gl_image_surface_texture.h" |
| 10 | 10 |
| (...skipping 33 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 44 DCHECK(surface_textures_.find(key) == surface_textures_.end()); | 44 DCHECK(surface_textures_.find(key) == surface_textures_.end()); |
| 45 surface_textures_[key] = surface_texture; | 45 surface_textures_[key] = surface_texture; |
| 46 } | 46 } |
| 47 | 47 |
| 48 gfx::GpuMemoryBufferHandle handle; | 48 gfx::GpuMemoryBufferHandle handle; |
| 49 handle.type = gfx::SURFACE_TEXTURE_BUFFER; | 49 handle.type = gfx::SURFACE_TEXTURE_BUFFER; |
| 50 handle.id = id; | 50 handle.id = id; |
| 51 return handle; | 51 return handle; |
| 52 } | 52 } |
| 53 | 53 |
| 54 gfx::GpuMemoryBufferHandle | |
| 55 GpuMemoryBufferFactorySurfaceTexture::CreateGpuMemoryBufferFromHandle( | |
| 56 const gfx::GpuMemoryBufferHandle& handle, | |
| 57 gfx::GpuMemoryBufferId id, | |
| 58 const gfx::Size& size, | |
| 59 gfx::BufferFormat format, | |
| 60 int client_id) { | |
| 61 NOTIMPLEMENTED(); | |
| 62 return gfx::GpuMemoryBufferHandle(); | |
| 63 } | |
| 64 | |
| 65 void GpuMemoryBufferFactorySurfaceTexture::DestroyGpuMemoryBuffer( | 54 void GpuMemoryBufferFactorySurfaceTexture::DestroyGpuMemoryBuffer( |
| 66 gfx::GpuMemoryBufferId id, | 55 gfx::GpuMemoryBufferId id, |
| 67 int client_id) { | 56 int client_id) { |
| 68 { | 57 { |
| 69 base::AutoLock lock(surface_textures_lock_); | 58 base::AutoLock lock(surface_textures_lock_); |
| 70 | 59 |
| 71 SurfaceTextureMapKey key(id.id, client_id); | 60 SurfaceTextureMapKey key(id.id, client_id); |
| 72 DCHECK(surface_textures_.find(key) != surface_textures_.end()); | 61 DCHECK(surface_textures_.find(key) != surface_textures_.end()); |
| 73 surface_textures_.erase(key); | 62 surface_textures_.erase(key); |
| 74 } | 63 } |
| (...skipping 24 matching lines...) Expand all Loading... |
| 99 | 88 |
| 100 scoped_refptr<gl::GLImageSurfaceTexture> image( | 89 scoped_refptr<gl::GLImageSurfaceTexture> image( |
| 101 new gl::GLImageSurfaceTexture(size)); | 90 new gl::GLImageSurfaceTexture(size)); |
| 102 if (!image->Initialize(it->second.get())) | 91 if (!image->Initialize(it->second.get())) |
| 103 return scoped_refptr<gl::GLImage>(); | 92 return scoped_refptr<gl::GLImage>(); |
| 104 | 93 |
| 105 return image; | 94 return image; |
| 106 } | 95 } |
| 107 | 96 |
| 108 } // namespace content | 97 } // namespace content |
| OLD | NEW |