| 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_NATIVE_PIXMAP_H_ | 5 #ifndef GPU_IPC_SERVICE_GPU_MEMORY_BUFFER_FACTORY_NATIVE_PIXMAP_H_ |
| 6 #define GPU_IPC_SERVICE_GPU_MEMORY_BUFFER_FACTORY_NATIVE_PIXMAP_H_ | 6 #define GPU_IPC_SERVICE_GPU_MEMORY_BUFFER_FACTORY_NATIVE_PIXMAP_H_ |
| 7 | 7 |
| 8 #include <unordered_map> | 8 #include <unordered_map> |
| 9 #include <utility> | 9 #include <utility> |
| 10 | 10 |
| (...skipping 34 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 45 scoped_refptr<gl::GLImage> CreateImageForGpuMemoryBuffer( | 45 scoped_refptr<gl::GLImage> CreateImageForGpuMemoryBuffer( |
| 46 const gfx::GpuMemoryBufferHandle& handle, | 46 const gfx::GpuMemoryBufferHandle& handle, |
| 47 const gfx::Size& size, | 47 const gfx::Size& size, |
| 48 gfx::BufferFormat format, | 48 gfx::BufferFormat format, |
| 49 unsigned internalformat, | 49 unsigned internalformat, |
| 50 int client_id, | 50 int client_id, |
| 51 SurfaceHandle surface_handle) override; | 51 SurfaceHandle surface_handle) override; |
| 52 scoped_refptr<gl::GLImage> CreateAnonymousImage( | 52 scoped_refptr<gl::GLImage> CreateAnonymousImage( |
| 53 const gfx::Size& size, | 53 const gfx::Size& size, |
| 54 gfx::BufferFormat format, | 54 gfx::BufferFormat format, |
| 55 gfx::BufferUsage usage, |
| 55 unsigned internalformat) override; | 56 unsigned internalformat) override; |
| 56 unsigned RequiredTextureType() override; | 57 unsigned RequiredTextureType() override; |
| 57 | 58 |
| 58 private: | 59 private: |
| 59 using NativePixmapMapKey = std::pair<int, int>; | 60 using NativePixmapMapKey = std::pair<int, int>; |
| 60 using NativePixmapMapKeyHash = base::IntPairHash<NativePixmapMapKey>; | 61 using NativePixmapMapKeyHash = base::IntPairHash<NativePixmapMapKey>; |
| 61 using NativePixmapMap = std::unordered_map<NativePixmapMapKey, | 62 using NativePixmapMap = std::unordered_map<NativePixmapMapKey, |
| 62 scoped_refptr<gfx::NativePixmap>, | 63 scoped_refptr<gfx::NativePixmap>, |
| 63 NativePixmapMapKeyHash>; | 64 NativePixmapMapKeyHash>; |
| 64 NativePixmapMap native_pixmaps_; | 65 NativePixmapMap native_pixmaps_; |
| 65 base::Lock native_pixmaps_lock_; | 66 base::Lock native_pixmaps_lock_; |
| 66 | 67 |
| 67 DISALLOW_COPY_AND_ASSIGN(GpuMemoryBufferFactoryNativePixmap); | 68 DISALLOW_COPY_AND_ASSIGN(GpuMemoryBufferFactoryNativePixmap); |
| 68 }; | 69 }; |
| 69 | 70 |
| 70 } // namespace gpu | 71 } // namespace gpu |
| 71 | 72 |
| 72 #endif // GPU_IPC_SERVICE_GPU_MEMORY_BUFFER_FACTORY_NATIVE_PIXMAP_H_ | 73 #endif // GPU_IPC_SERVICE_GPU_MEMORY_BUFFER_FACTORY_NATIVE_PIXMAP_H_ |
| OLD | NEW |