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

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

Issue 1050923003: zero-copy: Clarify to allocate/destroy GpuMemoryBuffer on any thread and use it on the main thread o (Closed) Base URL: https://chromium.googlesource.com/chromium/src.git@master
Patch Set: rephrase comment in gpu_channel_manager.cc Created 5 years, 8 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
« no previous file with comments | « content/common/gpu/gpu_channel_manager.cc ('k') | ui/gl/gl_image_egl.h » ('j') | no next file with comments »
Toggle Intra-line Diffs ('i') | Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
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_H_ 5 #ifndef CONTENT_COMMON_GPU_GPU_MEMORY_BUFFER_FACTORY_H_
6 #define CONTENT_COMMON_GPU_GPU_MEMORY_BUFFER_FACTORY_H_ 6 #define CONTENT_COMMON_GPU_GPU_MEMORY_BUFFER_FACTORY_H_
7 7
8 #include <vector> 8 #include <vector>
9 9
10 #include "base/memory/ref_counted.h" 10 #include "base/memory/ref_counted.h"
(...skipping 13 matching lines...) Expand all
24 24
25 namespace content { 25 namespace content {
26 26
27 class CONTENT_EXPORT GpuMemoryBufferFactory { 27 class CONTENT_EXPORT GpuMemoryBufferFactory {
28 public: 28 public:
29 struct Configuration { 29 struct Configuration {
30 gfx::GpuMemoryBuffer::Format format; 30 gfx::GpuMemoryBuffer::Format format;
31 gfx::GpuMemoryBuffer::Usage usage; 31 gfx::GpuMemoryBuffer::Usage usage;
32 }; 32 };
33 33
34 GpuMemoryBufferFactory() {}
35 virtual ~GpuMemoryBufferFactory() {} 34 virtual ~GpuMemoryBufferFactory() {}
36 35
37 // Gets system supported GPU memory buffer factory types. Preferred type at 36 // Gets system supported GPU memory buffer factory types. Preferred type at
38 // the front of vector. 37 // the front of vector.
39 static void GetSupportedTypes(std::vector<gfx::GpuMemoryBufferType>* types); 38 static void GetSupportedTypes(std::vector<gfx::GpuMemoryBufferType>* types);
40 39
41 // Creates a new factory instance for |type|. 40 // Creates a new factory instance for |type|.
42 static scoped_ptr<GpuMemoryBufferFactory> Create( 41 static scoped_ptr<GpuMemoryBufferFactory> Create(
43 gfx::GpuMemoryBufferType type); 42 gfx::GpuMemoryBufferType type);
44 43
45 // Gets supported format/usage configurations. 44 // Gets supported format/usage configurations.
46 virtual void GetSupportedGpuMemoryBufferConfigurations( 45 virtual void GetSupportedGpuMemoryBufferConfigurations(
47 std::vector<Configuration>* configurations) = 0; 46 std::vector<Configuration>* configurations) = 0;
48 47
49 // Creates a new GPU memory buffer instance. A valid handle is returned on 48 // Creates a new GPU memory buffer instance. A valid handle is returned on
50 // success. 49 // success. It can be called on any thread.
51 virtual gfx::GpuMemoryBufferHandle CreateGpuMemoryBuffer( 50 virtual gfx::GpuMemoryBufferHandle CreateGpuMemoryBuffer(
52 gfx::GpuMemoryBufferId id, 51 gfx::GpuMemoryBufferId id,
53 const gfx::Size& size, 52 const gfx::Size& size,
54 gfx::GpuMemoryBuffer::Format format, 53 gfx::GpuMemoryBuffer::Format format,
55 gfx::GpuMemoryBuffer::Usage usage, 54 gfx::GpuMemoryBuffer::Usage usage,
56 int client_id, 55 int client_id,
57 gfx::PluginWindowHandle surface_handle) = 0; 56 gfx::PluginWindowHandle surface_handle) = 0;
58 57
59 // Destroys GPU memory buffer identified by |id|. 58 // Destroys GPU memory buffer identified by |id|.
59 // It can be called on any thread.
60 virtual void DestroyGpuMemoryBuffer(gfx::GpuMemoryBufferId id, 60 virtual void DestroyGpuMemoryBuffer(gfx::GpuMemoryBufferId id,
61 int client_id) = 0; 61 int client_id) = 0;
62 62
63 // Type-checking downcast routine. 63 // Type-checking downcast routine.
64 virtual gpu::ImageFactory* AsImageFactory() = 0; 64 virtual gpu::ImageFactory* AsImageFactory() = 0;
65 65
66 protected:
67 GpuMemoryBufferFactory() {}
68
66 private: 69 private:
67 DISALLOW_COPY_AND_ASSIGN(GpuMemoryBufferFactory); 70 DISALLOW_COPY_AND_ASSIGN(GpuMemoryBufferFactory);
68 }; 71 };
69 72
70 } // namespace content 73 } // namespace content
71 74
72 #endif // CONTENT_COMMON_GPU_GPU_MEMORY_BUFFER_FACTORY_H_ 75 #endif // CONTENT_COMMON_GPU_GPU_MEMORY_BUFFER_FACTORY_H_
OLDNEW
« no previous file with comments | « content/common/gpu/gpu_channel_manager.cc ('k') | ui/gl/gl_image_egl.h » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698