Chromium Code Reviews
chromiumcodereview-hr@appspot.gserviceaccount.com (chromiumcodereview-hr) | Please choose your nickname with Settings | Help | Chromium Project | Gerrit Changes | Sign out
(51)

Side by Side Diff: gpu/ipc/service/gpu_memory_buffer_factory_surface_texture.cc

Issue 2148983002: gpu: Take surface handle into account when importing buffers. (Closed) Base URL: https://chromium.googlesource.com/chromium/src.git@master
Patch Set: avoid crash in DrmDeviceManager::GetDrmDevice when passed invalid widget Created 4 years, 5 months ago
Use n/p to move between diff chunks; N/P to move between comments. Draft comments are only viewable by you.
Jump to:
View unified diff | Download patch
OLDNEW
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 "gpu/ipc/service/gpu_memory_buffer_factory_surface_texture.h" 5 #include "gpu/ipc/service/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 58 matching lines...) Expand 10 before | Expand all | Expand 10 after
69 ImageFactory* GpuMemoryBufferFactorySurfaceTexture::AsImageFactory() { 69 ImageFactory* GpuMemoryBufferFactorySurfaceTexture::AsImageFactory() {
70 return this; 70 return this;
71 } 71 }
72 72
73 scoped_refptr<gl::GLImage> 73 scoped_refptr<gl::GLImage>
74 GpuMemoryBufferFactorySurfaceTexture::CreateImageForGpuMemoryBuffer( 74 GpuMemoryBufferFactorySurfaceTexture::CreateImageForGpuMemoryBuffer(
75 const gfx::GpuMemoryBufferHandle& handle, 75 const gfx::GpuMemoryBufferHandle& handle,
76 const gfx::Size& size, 76 const gfx::Size& size,
77 gfx::BufferFormat format, 77 gfx::BufferFormat format,
78 unsigned internalformat, 78 unsigned internalformat,
79 int client_id) { 79 int client_id,
80 SurfaceHandle surface_handle) {
80 base::AutoLock lock(surface_textures_lock_); 81 base::AutoLock lock(surface_textures_lock_);
81 82
82 DCHECK_EQ(handle.type, gfx::SURFACE_TEXTURE_BUFFER); 83 DCHECK_EQ(handle.type, gfx::SURFACE_TEXTURE_BUFFER);
83 84
84 SurfaceTextureMapKey key(handle.id.id, client_id); 85 SurfaceTextureMapKey key(handle.id.id, client_id);
85 SurfaceTextureMap::iterator it = surface_textures_.find(key); 86 SurfaceTextureMap::iterator it = surface_textures_.find(key);
86 if (it == surface_textures_.end()) 87 if (it == surface_textures_.end())
87 return scoped_refptr<gl::GLImage>(); 88 return scoped_refptr<gl::GLImage>();
88 89
89 scoped_refptr<gl::GLImageSurfaceTexture> image( 90 scoped_refptr<gl::GLImageSurfaceTexture> image(
90 new gl::GLImageSurfaceTexture(size)); 91 new gl::GLImageSurfaceTexture(size));
91 if (!image->Initialize(it->second.get())) 92 if (!image->Initialize(it->second.get()))
92 return scoped_refptr<gl::GLImage>(); 93 return scoped_refptr<gl::GLImage>();
93 94
94 return image; 95 return image;
95 } 96 }
96 97
97 } // namespace gpu 98 } // namespace gpu
OLDNEW
« no previous file with comments | « gpu/ipc/service/gpu_memory_buffer_factory_surface_texture.h ('k') | media/gpu/vaapi_drm_picture.cc » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698