| 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 #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 35 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 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) override; |
| 56 scoped_refptr<gl::GLImage> CreateAnonymousImage( |
| 57 const gfx::Size& size, |
| 58 gfx::BufferFormat format, |
| 59 unsigned internalformat) override; |
| 60 unsigned RequiredTextureType() override; |
| 61 bool SupportsFormatRGB() override; |
| 56 | 62 |
| 57 private: | 63 private: |
| 58 typedef std::pair<gfx::IOSurfaceId, int> IOSurfaceMapKey; | 64 typedef std::pair<gfx::IOSurfaceId, int> IOSurfaceMapKey; |
| 59 typedef base::hash_map<IOSurfaceMapKey, base::ScopedCFTypeRef<IOSurfaceRef>> | 65 typedef base::hash_map<IOSurfaceMapKey, base::ScopedCFTypeRef<IOSurfaceRef>> |
| 60 IOSurfaceMap; | 66 IOSurfaceMap; |
| 61 // TOOD(reveman): Remove |io_surfaces_| and allow IOSurface backed GMBs to be | 67 // TOOD(reveman): Remove |io_surfaces_| and allow IOSurface backed GMBs to be |
| 62 // used with any GPU process by passing a mach_port to CreateImageCHROMIUM. | 68 // used with any GPU process by passing a mach_port to CreateImageCHROMIUM. |
| 63 IOSurfaceMap io_surfaces_; | 69 IOSurfaceMap io_surfaces_; |
| 64 base::Lock io_surfaces_lock_; | 70 base::Lock io_surfaces_lock_; |
| 65 | 71 |
| 66 DISALLOW_COPY_AND_ASSIGN(GpuMemoryBufferFactoryIOSurface); | 72 DISALLOW_COPY_AND_ASSIGN(GpuMemoryBufferFactoryIOSurface); |
| 67 }; | 73 }; |
| 68 | 74 |
| 69 } // namespace gpu | 75 } // namespace gpu |
| 70 | 76 |
| 71 #endif // GPU_IPC_SERVICE_GPU_MEMORY_BUFFER_FACTORY_IO_SURFACE_H_ | 77 #endif // GPU_IPC_SERVICE_GPU_MEMORY_BUFFER_FACTORY_IO_SURFACE_H_ |
| OLD | NEW |