| 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_OZONE_NATIVE_PIXMAP_H_ | 5 #ifndef GPU_IPC_SERVICE_GPU_MEMORY_BUFFER_FACTORY_NATIVE_PIXMAP_H_ |
| 6 #define GPU_IPC_SERVICE_GPU_MEMORY_BUFFER_FACTORY_OZONE_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 |
| 11 #include "base/hash.h" | 11 #include "base/hash.h" |
| 12 #include "base/macros.h" | 12 #include "base/macros.h" |
| 13 #include "base/synchronization/lock.h" | 13 #include "base/synchronization/lock.h" |
| 14 #include "gpu/command_buffer/service/image_factory.h" | 14 #include "gpu/command_buffer/service/image_factory.h" |
| 15 #include "gpu/gpu_export.h" | 15 #include "gpu/gpu_export.h" |
| 16 #include "gpu/ipc/service/gpu_memory_buffer_factory.h" | 16 #include "gpu/ipc/service/gpu_memory_buffer_factory.h" |
| 17 #include "ui/gfx/native_pixmap.h" | 17 #include "ui/gfx/native_pixmap.h" |
| 18 | 18 |
| 19 namespace gl { | 19 namespace gl { |
| 20 class GLImage; | 20 class GLImage; |
| 21 } | 21 } |
| 22 | 22 |
| 23 namespace gpu { | 23 namespace gpu { |
| 24 | 24 |
| 25 class GPU_EXPORT GpuMemoryBufferFactoryOzoneNativePixmap | 25 class GPU_EXPORT GpuMemoryBufferFactoryNativePixmap |
| 26 : public GpuMemoryBufferFactory, | 26 : public GpuMemoryBufferFactory, |
| 27 public ImageFactory { | 27 public ImageFactory { |
| 28 public: | 28 public: |
| 29 GpuMemoryBufferFactoryOzoneNativePixmap(); | 29 GpuMemoryBufferFactoryNativePixmap(); |
| 30 ~GpuMemoryBufferFactoryOzoneNativePixmap() override; | 30 ~GpuMemoryBufferFactoryNativePixmap() override; |
| 31 | 31 |
| 32 // Overridden from GpuMemoryBufferFactory: | 32 // Overridden from GpuMemoryBufferFactory: |
| 33 gfx::GpuMemoryBufferHandle CreateGpuMemoryBuffer( | 33 gfx::GpuMemoryBufferHandle CreateGpuMemoryBuffer( |
| 34 gfx::GpuMemoryBufferId id, | 34 gfx::GpuMemoryBufferId id, |
| 35 const gfx::Size& size, | 35 const gfx::Size& size, |
| 36 gfx::BufferFormat format, | 36 gfx::BufferFormat format, |
| 37 gfx::BufferUsage usage, | 37 gfx::BufferUsage usage, |
| 38 int client_id, | 38 int client_id, |
| 39 SurfaceHandle surface_handle) override; | 39 SurfaceHandle surface_handle) override; |
| 40 void DestroyGpuMemoryBuffer(gfx::GpuMemoryBufferId id, | 40 void DestroyGpuMemoryBuffer(gfx::GpuMemoryBufferId id, |
| (...skipping 16 matching lines...) Expand all Loading... |
| 57 | 57 |
| 58 private: | 58 private: |
| 59 using NativePixmapMapKey = std::pair<int, int>; | 59 using NativePixmapMapKey = std::pair<int, int>; |
| 60 using NativePixmapMapKeyHash = base::IntPairHash<NativePixmapMapKey>; | 60 using NativePixmapMapKeyHash = base::IntPairHash<NativePixmapMapKey>; |
| 61 using NativePixmapMap = std::unordered_map<NativePixmapMapKey, | 61 using NativePixmapMap = std::unordered_map<NativePixmapMapKey, |
| 62 scoped_refptr<gfx::NativePixmap>, | 62 scoped_refptr<gfx::NativePixmap>, |
| 63 NativePixmapMapKeyHash>; | 63 NativePixmapMapKeyHash>; |
| 64 NativePixmapMap native_pixmaps_; | 64 NativePixmapMap native_pixmaps_; |
| 65 base::Lock native_pixmaps_lock_; | 65 base::Lock native_pixmaps_lock_; |
| 66 | 66 |
| 67 DISALLOW_COPY_AND_ASSIGN(GpuMemoryBufferFactoryOzoneNativePixmap); | 67 DISALLOW_COPY_AND_ASSIGN(GpuMemoryBufferFactoryNativePixmap); |
| 68 }; | 68 }; |
| 69 | 69 |
| 70 } // namespace gpu | 70 } // namespace gpu |
| 71 | 71 |
| 72 #endif // GPU_IPC_SERVICE_GPU_MEMORY_BUFFER_FACTORY_OZONE_NATIVE_PIXMAP_H_ | 72 #endif // GPU_IPC_SERVICE_GPU_MEMORY_BUFFER_FACTORY_NATIVE_PIXMAP_H_ |
| OLD | NEW |