Chromium Code Reviews
chromiumcodereview-hr@appspot.gserviceaccount.com (chromiumcodereview-hr) | Please choose your nickname with Settings | Help | Chromium Project | Gerrit Changes | Sign out
(285)

Side by Side Diff: content/common/gpu/gpu_memory_buffer_factory_io_surface.h

Issue 1269503007: Unify graphics buffer format & usage enums for GpuMemoryBuffer & SurfaceFactoryOzone (Closed) Base URL: https://chromium.googlesource.com/chromium/src.git@master
Patch Set: add header to BUILD.gn Created 5 years, 4 months ago
Use n/p to move between diff chunks; N/P to move between comments. Draft comments are only viewable by you.
Jump to:
View unified diff | Download patch
OLDNEW
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 <IOSurface/IOSurface.h> 8 #include <IOSurface/IOSurface.h>
9 9
10 #include "base/containers/hash_tables.h" 10 #include "base/containers/hash_tables.h"
(...skipping 10 matching lines...) Expand all
21 } 21 }
22 22
23 namespace content { 23 namespace content {
24 24
25 class GpuMemoryBufferFactoryIOSurface : public GpuMemoryBufferFactory, 25 class GpuMemoryBufferFactoryIOSurface : public GpuMemoryBufferFactory,
26 public gpu::ImageFactory { 26 public gpu::ImageFactory {
27 public: 27 public:
28 GpuMemoryBufferFactoryIOSurface(); 28 GpuMemoryBufferFactoryIOSurface();
29 ~GpuMemoryBufferFactoryIOSurface() override; 29 ~GpuMemoryBufferFactoryIOSurface() override;
30 30
31 static bool IsGpuMemoryBufferConfigurationSupported( 31 static bool IsGpuMemoryBufferConfigurationSupported(gfx::BufferFormat format,
32 gfx::GpuMemoryBuffer::Format format, 32 gfx::BufferUsage usage);
33 gfx::GpuMemoryBuffer::Usage usage);
34 33
35 // Overridden from GpuMemoryBufferFactory: 34 // Overridden from GpuMemoryBufferFactory:
36 void GetSupportedGpuMemoryBufferConfigurations( 35 void GetSupportedGpuMemoryBufferConfigurations(
37 std::vector<Configuration>* configurations) override; 36 std::vector<Configuration>* configurations) override;
38 gfx::GpuMemoryBufferHandle CreateGpuMemoryBuffer( 37 gfx::GpuMemoryBufferHandle CreateGpuMemoryBuffer(
39 gfx::GpuMemoryBufferId id, 38 gfx::GpuMemoryBufferId id,
40 const gfx::Size& size, 39 const gfx::Size& size,
41 gfx::GpuMemoryBuffer::Format format, 40 gfx::BufferFormat format,
42 gfx::GpuMemoryBuffer::Usage usage, 41 gfx::BufferUsage usage,
43 int client_id, 42 int client_id,
44 gfx::PluginWindowHandle surface_handle) override; 43 gfx::PluginWindowHandle surface_handle) override;
45 void DestroyGpuMemoryBuffer(gfx::GpuMemoryBufferId id, 44 void DestroyGpuMemoryBuffer(gfx::GpuMemoryBufferId id,
46 int client_id) override; 45 int client_id) override;
47 gpu::ImageFactory* AsImageFactory() override; 46 gpu::ImageFactory* AsImageFactory() override;
48 47
49 // Overridden from gpu::ImageFactory: 48 // Overridden from gpu::ImageFactory:
50 scoped_refptr<gfx::GLImage> CreateImageForGpuMemoryBuffer( 49 scoped_refptr<gfx::GLImage> CreateImageForGpuMemoryBuffer(
51 const gfx::GpuMemoryBufferHandle& handle, 50 const gfx::GpuMemoryBufferHandle& handle,
52 const gfx::Size& size, 51 const gfx::Size& size,
53 gfx::GpuMemoryBuffer::Format format, 52 gfx::BufferFormat format,
54 unsigned internalformat, 53 unsigned internalformat,
55 int client_id) override; 54 int client_id) override;
56 55
57 private: 56 private:
58 typedef std::pair<int, int> IOSurfaceMapKey; 57 typedef std::pair<int, int> IOSurfaceMapKey;
59 typedef base::hash_map<IOSurfaceMapKey, base::ScopedCFTypeRef<IOSurfaceRef>> 58 typedef base::hash_map<IOSurfaceMapKey, base::ScopedCFTypeRef<IOSurfaceRef>>
60 IOSurfaceMap; 59 IOSurfaceMap;
61 IOSurfaceMap io_surfaces_; 60 IOSurfaceMap io_surfaces_;
62 base::Lock io_surfaces_lock_; 61 base::Lock io_surfaces_lock_;
63 62
64 DISALLOW_COPY_AND_ASSIGN(GpuMemoryBufferFactoryIOSurface); 63 DISALLOW_COPY_AND_ASSIGN(GpuMemoryBufferFactoryIOSurface);
65 }; 64 };
66 65
67 } // namespace content 66 } // namespace content
68 67
69 #endif // CONTENT_COMMON_GPU_GPU_MEMORY_BUFFER_FACTORY_IO_SURFACE_H_ 68 #endif // CONTENT_COMMON_GPU_GPU_MEMORY_BUFFER_FACTORY_IO_SURFACE_H_
OLDNEW
« no previous file with comments | « content/common/gpu/gpu_memory_buffer_factory.h ('k') | content/common/gpu/gpu_memory_buffer_factory_io_surface.cc » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698