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 "content/common/android/surface_texture_manager.h" | 7 #include "content/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 48 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
59 DCHECK(surface_textures_.find(key) == surface_textures_.end()); | 59 DCHECK(surface_textures_.find(key) == surface_textures_.end()); |
60 surface_textures_[key] = surface_texture; | 60 surface_textures_[key] = surface_texture; |
61 } | 61 } |
62 | 62 |
63 gfx::GpuMemoryBufferHandle handle; | 63 gfx::GpuMemoryBufferHandle handle; |
64 handle.type = gfx::SURFACE_TEXTURE_BUFFER; | 64 handle.type = gfx::SURFACE_TEXTURE_BUFFER; |
65 handle.id = id; | 65 handle.id = id; |
66 return handle; | 66 return handle; |
67 } | 67 } |
68 | 68 |
| 69 gfx::GpuMemoryBufferHandle |
| 70 GpuMemoryBufferFactorySurfaceTexture::CreateGpuMemoryBufferFromHandle( |
| 71 const gfx::GpuMemoryBufferHandle& handle, |
| 72 gfx::GpuMemoryBufferId id, |
| 73 const gfx::Size& size, |
| 74 gfx::BufferFormat format, |
| 75 int client_id) { |
| 76 NOTIMPLEMENTED(); |
| 77 return gfx::GpuMemoryBufferHandle(); |
| 78 } |
| 79 |
69 void GpuMemoryBufferFactorySurfaceTexture::DestroyGpuMemoryBuffer( | 80 void GpuMemoryBufferFactorySurfaceTexture::DestroyGpuMemoryBuffer( |
70 gfx::GpuMemoryBufferId id, | 81 gfx::GpuMemoryBufferId id, |
71 int client_id) { | 82 int client_id) { |
72 { | 83 { |
73 base::AutoLock lock(surface_textures_lock_); | 84 base::AutoLock lock(surface_textures_lock_); |
74 | 85 |
75 SurfaceTextureMapKey key(id.id, client_id); | 86 SurfaceTextureMapKey key(id.id, client_id); |
76 DCHECK(surface_textures_.find(key) != surface_textures_.end()); | 87 DCHECK(surface_textures_.find(key) != surface_textures_.end()); |
77 surface_textures_.erase(key); | 88 surface_textures_.erase(key); |
78 } | 89 } |
(...skipping 24 matching lines...) Expand all Loading... |
103 | 114 |
104 scoped_refptr<gfx::GLImageSurfaceTexture> image( | 115 scoped_refptr<gfx::GLImageSurfaceTexture> image( |
105 new gfx::GLImageSurfaceTexture(size)); | 116 new gfx::GLImageSurfaceTexture(size)); |
106 if (!image->Initialize(it->second.get())) | 117 if (!image->Initialize(it->second.get())) |
107 return scoped_refptr<gfx::GLImage>(); | 118 return scoped_refptr<gfx::GLImage>(); |
108 | 119 |
109 return image; | 120 return image; |
110 } | 121 } |
111 | 122 |
112 } // namespace content | 123 } // namespace content |
OLD | NEW |