Chromium Code Reviews| 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 CONTENT_COMMON_GPU_GPU_MEMORY_BUFFER_FACTORY_IO_SURFACE_H_ | 5 #ifndef CONTENT_COMMON_GPU_GPU_MEMORY_BUFFER_FACTORY_IO_SURFACE_H_ |
| 6 #define CONTENT_COMMON_GPU_GPU_MEMORY_BUFFER_FACTORY_IO_SURFACE_H_ | 6 #define CONTENT_COMMON_GPU_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> |
| 11 | 11 |
| 12 #include "base/containers/hash_tables.h" | 12 #include "base/containers/hash_tables.h" |
| 13 #include "base/mac/scoped_cftyperef.h" | 13 #include "base/mac/scoped_cftyperef.h" |
| 14 #include "base/memory/ref_counted.h" | 14 #include "base/memory/ref_counted.h" |
| 15 #include "base/synchronization/lock.h" | 15 #include "base/synchronization/lock.h" |
| 16 #include "content/common/content_export.h" | 16 #include "content/common/content_export.h" |
| 17 #include "content/common/gpu/gpu_memory_buffer_factory.h" | 17 #include "content/common/gpu/gpu_memory_buffer_factory.h" |
| 18 #include "gpu/command_buffer/service/image_factory.h" | 18 #include "gpu/command_buffer/service/image_factory.h" |
| 19 #include "ui/gfx/geometry/size.h" | 19 #include "ui/gfx/geometry/size.h" |
| 20 #include "ui/gfx/gpu_memory_buffer.h" | 20 #include "ui/gfx/gpu_memory_buffer.h" |
| 21 #include "ui/gfx/mac/io_surface_manager.h" | 21 #include "ui/gfx/mac/io_surface.h" |
| 22 | 22 |
| 23 namespace gl { | 23 namespace gl { |
| 24 class GLImage; | 24 class GLImage; |
| 25 } | 25 } |
| 26 | 26 |
| 27 namespace content { | 27 namespace content { |
| 28 | 28 |
| 29 class CONTENT_EXPORT GpuMemoryBufferFactoryIOSurface | 29 class CONTENT_EXPORT GpuMemoryBufferFactoryIOSurface |
| 30 : public GpuMemoryBufferFactory, | 30 : public GpuMemoryBufferFactory, |
| 31 public gpu::ImageFactory { | 31 public gpu::ImageFactory { |
| (...skipping 27 matching lines...) Expand all Loading... | |
| 59 const gfx::GpuMemoryBufferHandle& handle, | 59 const gfx::GpuMemoryBufferHandle& handle, |
| 60 const gfx::Size& size, | 60 const gfx::Size& size, |
| 61 gfx::BufferFormat format, | 61 gfx::BufferFormat format, |
| 62 unsigned internalformat, | 62 unsigned internalformat, |
| 63 int client_id) override; | 63 int client_id) override; |
| 64 | 64 |
| 65 private: | 65 private: |
| 66 typedef std::pair<gfx::IOSurfaceId, int> IOSurfaceMapKey; | 66 typedef std::pair<gfx::IOSurfaceId, int> IOSurfaceMapKey; |
| 67 typedef base::hash_map<IOSurfaceMapKey, base::ScopedCFTypeRef<IOSurfaceRef>> | 67 typedef base::hash_map<IOSurfaceMapKey, base::ScopedCFTypeRef<IOSurfaceRef>> |
| 68 IOSurfaceMap; | 68 IOSurfaceMap; |
| 69 IOSurfaceMap io_surfaces_; | 69 IOSurfaceMap io_surfaces_; |
|
reveman
2015/12/21 20:11:16
FYI, this map could now be removed in favor of pas
Robert Sesek
2015/12/23 15:45:13
Done.
| |
| 70 base::Lock io_surfaces_lock_; | 70 base::Lock io_surfaces_lock_; |
| 71 | 71 |
| 72 DISALLOW_COPY_AND_ASSIGN(GpuMemoryBufferFactoryIOSurface); | 72 DISALLOW_COPY_AND_ASSIGN(GpuMemoryBufferFactoryIOSurface); |
| 73 }; | 73 }; |
| 74 | 74 |
| 75 } // namespace content | 75 } // namespace content |
| 76 | 76 |
| 77 #endif // CONTENT_COMMON_GPU_GPU_MEMORY_BUFFER_FACTORY_IO_SURFACE_H_ | 77 #endif // CONTENT_COMMON_GPU_GPU_MEMORY_BUFFER_FACTORY_IO_SURFACE_H_ |
| OLD | NEW |