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_OZONE_NATIVE_PIXMAP_H_ | 5 #ifndef CONTENT_COMMON_GPU_GPU_MEMORY_BUFFER_FACTORY_OZONE_NATIVE_PIXMAP_H_ |
6 #define CONTENT_COMMON_GPU_GPU_MEMORY_BUFFER_FACTORY_OZONE_NATIVE_PIXMAP_H_ | 6 #define CONTENT_COMMON_GPU_GPU_MEMORY_BUFFER_FACTORY_OZONE_NATIVE_PIXMAP_H_ |
7 | 7 |
8 #include "base/memory/ref_counted.h" | 8 #include "base/synchronization/lock.h" |
9 #include "content/common/gpu/gpu_memory_buffer_factory.h" | 9 #include "content/common/gpu/gpu_memory_buffer_factory.h" |
10 #include "gpu/command_buffer/service/image_factory.h" | 10 #include "gpu/command_buffer/service/image_factory.h" |
11 #include "ui/gfx/geometry/size.h" | 11 #include "ui/ozone/public/native_pixmap.h" |
12 #include "ui/gfx/gpu_memory_buffer.h" | |
13 #include "ui/ozone/gpu/gpu_memory_buffer_factory_ozone_native_pixmap.h" | |
14 | 12 |
15 namespace gfx { | 13 namespace gfx { |
16 class GLImage; | 14 class GLImage; |
17 } | 15 } |
18 | 16 |
19 namespace content { | 17 namespace content { |
20 | 18 |
21 class GpuMemoryBufferFactoryOzoneNativePixmap : public GpuMemoryBufferFactory, | 19 class GpuMemoryBufferFactoryOzoneNativePixmap : public GpuMemoryBufferFactory, |
22 public gpu::ImageFactory { | 20 public gpu::ImageFactory { |
23 public: | 21 public: |
(...skipping 20 matching lines...) Expand all Loading... | |
44 | 42 |
45 // Overridden from gpu::ImageFactory: | 43 // Overridden from gpu::ImageFactory: |
46 scoped_refptr<gfx::GLImage> CreateImageForGpuMemoryBuffer( | 44 scoped_refptr<gfx::GLImage> CreateImageForGpuMemoryBuffer( |
47 const gfx::GpuMemoryBufferHandle& handle, | 45 const gfx::GpuMemoryBufferHandle& handle, |
48 const gfx::Size& size, | 46 const gfx::Size& size, |
49 gfx::GpuMemoryBuffer::Format format, | 47 gfx::GpuMemoryBuffer::Format format, |
50 unsigned internalformat, | 48 unsigned internalformat, |
51 int client_id) override; | 49 int client_id) override; |
52 | 50 |
53 private: | 51 private: |
54 ui::GpuMemoryBufferFactoryOzoneNativePixmap ozone_native_pixmap_factory_; | 52 typedef std::map<std::pair<uint32_t, uint32_t>, |
piman
2015/07/24 18:41:25
nit: hash_map.
dshwang
2015/07/24 19:57:20
Done.
| |
53 scoped_refptr<ui::NativePixmap>> BufferToPixmapMap; | |
54 BufferToPixmapMap native_pixmap_map_; | |
55 base::Lock native_pixmap_map_lock_; | |
reveman
2015/07/24 19:13:17
nit: make all this consistent with GpuMemoryBuffer
dshwang
2015/07/24 19:57:20
cool. Done.
| |
55 | 56 |
56 DISALLOW_COPY_AND_ASSIGN(GpuMemoryBufferFactoryOzoneNativePixmap); | 57 DISALLOW_COPY_AND_ASSIGN(GpuMemoryBufferFactoryOzoneNativePixmap); |
57 }; | 58 }; |
58 | 59 |
59 } // namespace content | 60 } // namespace content |
60 | 61 |
61 #endif // CONTENT_COMMON_GPU_GPU_MEMORY_BUFFER_FACTORY_OZONE_NATIVE_PIXMAP_H_ | 62 #endif // CONTENT_COMMON_GPU_GPU_MEMORY_BUFFER_FACTORY_OZONE_NATIVE_PIXMAP_H_ |
OLD | NEW |