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

Side by Side Diff: gpu/ipc/service/gpu_memory_buffer_factory_io_surface.h

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 #ifndef GPU_IPC_SERVICE_GPU_MEMORY_BUFFER_FACTORY_IO_SURFACE_H_ 5 #ifndef GPU_IPC_SERVICE_GPU_MEMORY_BUFFER_FACTORY_IO_SURFACE_H_
6 #define GPU_IPC_SERVICE_GPU_MEMORY_BUFFER_FACTORY_IO_SURFACE_H_ 6 #define GPU_IPC_SERVICE_GPU_MEMORY_BUFFER_FACTORY_IO_SURFACE_H_
7 7
8 #include <utility> 8 #include <utility>
9 9
10 #include <IOSurface/IOSurface.h> 10 #include <IOSurface/IOSurface.h>
(...skipping 34 matching lines...) Expand 10 before | Expand all | Expand 10 after
45 void DestroyGpuMemoryBuffer(gfx::GpuMemoryBufferId id, 45 void DestroyGpuMemoryBuffer(gfx::GpuMemoryBufferId id,
46 int client_id) override; 46 int client_id) override;
47 ImageFactory* AsImageFactory() override; 47 ImageFactory* AsImageFactory() override;
48 48
49 // Overridden from ImageFactory: 49 // Overridden from ImageFactory:
50 scoped_refptr<gl::GLImage> CreateImageForGpuMemoryBuffer( 50 scoped_refptr<gl::GLImage> CreateImageForGpuMemoryBuffer(
51 const gfx::GpuMemoryBufferHandle& handle, 51 const gfx::GpuMemoryBufferHandle& handle,
52 const gfx::Size& size, 52 const gfx::Size& size,
53 gfx::BufferFormat format, 53 gfx::BufferFormat format,
54 unsigned internalformat, 54 unsigned internalformat,
55 int client_id) override; 55 int client_id,
56 SurfaceHandle surface_handle) override;
56 scoped_refptr<gl::GLImage> CreateAnonymousImage( 57 scoped_refptr<gl::GLImage> CreateAnonymousImage(
57 const gfx::Size& size, 58 const gfx::Size& size,
58 gfx::BufferFormat format, 59 gfx::BufferFormat format,
59 unsigned internalformat) override; 60 unsigned internalformat) override;
60 unsigned RequiredTextureType() override; 61 unsigned RequiredTextureType() override;
61 bool SupportsFormatRGB() override; 62 bool SupportsFormatRGB() override;
62 63
63 private: 64 private:
64 typedef std::pair<gfx::IOSurfaceId, int> IOSurfaceMapKey; 65 typedef std::pair<gfx::IOSurfaceId, int> IOSurfaceMapKey;
65 typedef base::hash_map<IOSurfaceMapKey, base::ScopedCFTypeRef<IOSurfaceRef>> 66 typedef base::hash_map<IOSurfaceMapKey, base::ScopedCFTypeRef<IOSurfaceRef>>
66 IOSurfaceMap; 67 IOSurfaceMap;
67 // TOOD(reveman): Remove |io_surfaces_| and allow IOSurface backed GMBs to be 68 // TOOD(reveman): Remove |io_surfaces_| and allow IOSurface backed GMBs to be
68 // used with any GPU process by passing a mach_port to CreateImageCHROMIUM. 69 // used with any GPU process by passing a mach_port to CreateImageCHROMIUM.
69 IOSurfaceMap io_surfaces_; 70 IOSurfaceMap io_surfaces_;
70 base::Lock io_surfaces_lock_; 71 base::Lock io_surfaces_lock_;
71 72
72 DISALLOW_COPY_AND_ASSIGN(GpuMemoryBufferFactoryIOSurface); 73 DISALLOW_COPY_AND_ASSIGN(GpuMemoryBufferFactoryIOSurface);
73 }; 74 };
74 75
75 } // namespace gpu 76 } // namespace gpu
76 77
77 #endif // GPU_IPC_SERVICE_GPU_MEMORY_BUFFER_FACTORY_IO_SURFACE_H_ 78 #endif // GPU_IPC_SERVICE_GPU_MEMORY_BUFFER_FACTORY_IO_SURFACE_H_
OLDNEW
« no previous file with comments | « gpu/ipc/service/gpu_command_buffer_stub.cc ('k') | gpu/ipc/service/gpu_memory_buffer_factory_io_surface.cc » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698