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 79 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
90 } | 90 } |
91 | 91 |
92 SurfaceTextureManager::GetInstance()->UnregisterSurfaceTexture(id.id, | 92 SurfaceTextureManager::GetInstance()->UnregisterSurfaceTexture(id.id, |
93 client_id); | 93 client_id); |
94 } | 94 } |
95 | 95 |
96 gpu::ImageFactory* GpuMemoryBufferFactorySurfaceTexture::AsImageFactory() { | 96 gpu::ImageFactory* GpuMemoryBufferFactorySurfaceTexture::AsImageFactory() { |
97 return this; | 97 return this; |
98 } | 98 } |
99 | 99 |
100 scoped_refptr<gfx::GLImage> | 100 scoped_refptr<gl::GLImage> |
101 GpuMemoryBufferFactorySurfaceTexture::CreateImageForGpuMemoryBuffer( | 101 GpuMemoryBufferFactorySurfaceTexture::CreateImageForGpuMemoryBuffer( |
102 const gfx::GpuMemoryBufferHandle& handle, | 102 const gfx::GpuMemoryBufferHandle& handle, |
103 const gfx::Size& size, | 103 const gfx::Size& size, |
104 gfx::BufferFormat format, | 104 gfx::BufferFormat format, |
105 unsigned internalformat, | 105 unsigned internalformat, |
106 int client_id) { | 106 int client_id) { |
107 base::AutoLock lock(surface_textures_lock_); | 107 base::AutoLock lock(surface_textures_lock_); |
108 | 108 |
109 DCHECK_EQ(handle.type, gfx::SURFACE_TEXTURE_BUFFER); | 109 DCHECK_EQ(handle.type, gfx::SURFACE_TEXTURE_BUFFER); |
110 | 110 |
111 SurfaceTextureMapKey key(handle.id.id, client_id); | 111 SurfaceTextureMapKey key(handle.id.id, client_id); |
112 SurfaceTextureMap::iterator it = surface_textures_.find(key); | 112 SurfaceTextureMap::iterator it = surface_textures_.find(key); |
113 if (it == surface_textures_.end()) | 113 if (it == surface_textures_.end()) |
114 return scoped_refptr<gfx::GLImage>(); | 114 return scoped_refptr<gl::GLImage>(); |
115 | 115 |
116 scoped_refptr<gfx::GLImageSurfaceTexture> image( | 116 scoped_refptr<gl::GLImageSurfaceTexture> image( |
117 new gfx::GLImageSurfaceTexture(size)); | 117 new gl::GLImageSurfaceTexture(size)); |
118 if (!image->Initialize(it->second.get())) | 118 if (!image->Initialize(it->second.get())) |
119 return scoped_refptr<gfx::GLImage>(); | 119 return scoped_refptr<gl::GLImage>(); |
120 | 120 |
121 return image; | 121 return image; |
122 } | 122 } |
123 | 123 |
124 } // namespace content | 124 } // namespace content |
OLD | NEW |