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

Side by Side Diff: gpu/ipc/service/gpu_memory_buffer_factory_io_surface.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_io_surface.h" 5 #include "gpu/ipc/service/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 "gpu/GLES2/gl2extchromium.h" 10 #include "gpu/GLES2/gl2extchromium.h"
(...skipping 53 matching lines...) Expand 10 before | Expand all | Expand 10 after
64 ImageFactory* GpuMemoryBufferFactoryIOSurface::AsImageFactory() { 64 ImageFactory* GpuMemoryBufferFactoryIOSurface::AsImageFactory() {
65 return this; 65 return this;
66 } 66 }
67 67
68 scoped_refptr<gl::GLImage> 68 scoped_refptr<gl::GLImage>
69 GpuMemoryBufferFactoryIOSurface::CreateImageForGpuMemoryBuffer( 69 GpuMemoryBufferFactoryIOSurface::CreateImageForGpuMemoryBuffer(
70 const gfx::GpuMemoryBufferHandle& handle, 70 const gfx::GpuMemoryBufferHandle& handle,
71 const gfx::Size& size, 71 const gfx::Size& size,
72 gfx::BufferFormat format, 72 gfx::BufferFormat format,
73 unsigned internalformat, 73 unsigned internalformat,
74 int client_id) { 74 int client_id,
75 SurfaceHandle surface_handle) {
75 base::AutoLock lock(io_surfaces_lock_); 76 base::AutoLock lock(io_surfaces_lock_);
76 77
77 DCHECK_EQ(handle.type, gfx::IO_SURFACE_BUFFER); 78 DCHECK_EQ(handle.type, gfx::IO_SURFACE_BUFFER);
78 IOSurfaceMapKey key(handle.id, client_id); 79 IOSurfaceMapKey key(handle.id, client_id);
79 IOSurfaceMap::iterator it = io_surfaces_.find(key); 80 IOSurfaceMap::iterator it = io_surfaces_.find(key);
80 if (it == io_surfaces_.end()) 81 if (it == io_surfaces_.end())
81 return scoped_refptr<gl::GLImage>(); 82 return scoped_refptr<gl::GLImage>();
82 83
83 scoped_refptr<gl::GLImageIOSurface> image( 84 scoped_refptr<gl::GLImageIOSurface> image(
84 new gl::GLImageIOSurface(size, internalformat)); 85 new gl::GLImageIOSurface(size, internalformat));
(...skipping 27 matching lines...) Expand all
112 113
113 unsigned GpuMemoryBufferFactoryIOSurface::RequiredTextureType() { 114 unsigned GpuMemoryBufferFactoryIOSurface::RequiredTextureType() {
114 return GL_TEXTURE_RECTANGLE_ARB; 115 return GL_TEXTURE_RECTANGLE_ARB;
115 } 116 }
116 117
117 bool GpuMemoryBufferFactoryIOSurface::SupportsFormatRGB() { 118 bool GpuMemoryBufferFactoryIOSurface::SupportsFormatRGB() {
118 return false; 119 return false;
119 } 120 }
120 121
121 } // namespace gpu 122 } // namespace gpu
OLDNEW

Powered by Google App Engine
This is Rietveld 408576698