| 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, | |
| 56 unsigned internalformat) override; | 55 unsigned internalformat) override; |
| 57 unsigned RequiredTextureType() override; | 56 unsigned RequiredTextureType() override; |
| 58 | 57 |
| 59 private: | 58 private: |
| 60 using NativePixmapMapKey = std::pair<int, int>; | 59 using NativePixmapMapKey = std::pair<int, int>; |
| 61 using NativePixmapMapKeyHash = base::IntPairHash<NativePixmapMapKey>; | 60 using NativePixmapMapKeyHash = base::IntPairHash<NativePixmapMapKey>; |
| 62 using NativePixmapMap = std::unordered_map<NativePixmapMapKey, | 61 using NativePixmapMap = std::unordered_map<NativePixmapMapKey, |
| 63 scoped_refptr<gfx::NativePixmap>, | 62 scoped_refptr<gfx::NativePixmap>, |
| 64 NativePixmapMapKeyHash>; | 63 NativePixmapMapKeyHash>; |
| 65 NativePixmapMap native_pixmaps_; | 64 NativePixmapMap native_pixmaps_; |
| 66 base::Lock native_pixmaps_lock_; | 65 base::Lock native_pixmaps_lock_; |
| 67 | 66 |
| 68 DISALLOW_COPY_AND_ASSIGN(GpuMemoryBufferFactoryNativePixmap); | 67 DISALLOW_COPY_AND_ASSIGN(GpuMemoryBufferFactoryNativePixmap); |
| 69 }; | 68 }; |
| 70 | 69 |
| 71 } // namespace gpu | 70 } // namespace gpu |
| 72 | 71 |
| 73 #endif // GPU_IPC_SERVICE_GPU_MEMORY_BUFFER_FACTORY_NATIVE_PIXMAP_H_ | 72 #endif // GPU_IPC_SERVICE_GPU_MEMORY_BUFFER_FACTORY_NATIVE_PIXMAP_H_ |
| OLD | NEW |