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

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

Issue 2945673002: Allow creating GLImage-backed textures with glTexStorage2D. (Closed)
Patch Set: rebase Created 3 years, 4 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 39 matching lines...) Expand 10 before | Expand all | Expand 10 after
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, 55 int client_id,
56 SurfaceHandle surface_handle) override; 56 SurfaceHandle surface_handle) override;
57 scoped_refptr<gl::GLImage> CreateAnonymousImage( 57 scoped_refptr<gl::GLImage> CreateAnonymousImage(
58 const gfx::Size& size, 58 const gfx::Size& size,
59 gfx::BufferFormat format, 59 gfx::BufferFormat format,
60 gfx::BufferUsage usage,
60 unsigned internalformat) override; 61 unsigned internalformat) override;
61 unsigned RequiredTextureType() override; 62 unsigned RequiredTextureType() override;
62 bool SupportsFormatRGB() override; 63 bool SupportsFormatRGB() override;
63 64
64 private: 65 private:
65 typedef std::pair<gfx::IOSurfaceId, int> IOSurfaceMapKey; 66 typedef std::pair<gfx::IOSurfaceId, int> IOSurfaceMapKey;
66 typedef base::hash_map<IOSurfaceMapKey, base::ScopedCFTypeRef<IOSurfaceRef>> 67 typedef base::hash_map<IOSurfaceMapKey, base::ScopedCFTypeRef<IOSurfaceRef>>
67 IOSurfaceMap; 68 IOSurfaceMap;
68 // TOOD(reveman): Remove |io_surfaces_| and allow IOSurface backed GMBs to be 69 // TOOD(reveman): Remove |io_surfaces_| and allow IOSurface backed GMBs to be
69 // used with any GPU process by passing a mach_port to CreateImageCHROMIUM. 70 // used with any GPU process by passing a mach_port to CreateImageCHROMIUM.
70 IOSurfaceMap io_surfaces_; 71 IOSurfaceMap io_surfaces_;
71 base::Lock io_surfaces_lock_; 72 base::Lock io_surfaces_lock_;
72 73
73 DISALLOW_COPY_AND_ASSIGN(GpuMemoryBufferFactoryIOSurface); 74 DISALLOW_COPY_AND_ASSIGN(GpuMemoryBufferFactoryIOSurface);
74 }; 75 };
75 76
76 } // namespace gpu 77 } // namespace gpu
77 78
78 #endif // GPU_IPC_SERVICE_GPU_MEMORY_BUFFER_FACTORY_IO_SURFACE_H_ 79 #endif // GPU_IPC_SERVICE_GPU_MEMORY_BUFFER_FACTORY_IO_SURFACE_H_
OLDNEW
« no previous file with comments | « gpu/ipc/common/gpu_command_buffer_traits_multi.h ('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