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

Side by Side Diff: gpu/ipc/service/gpu_memory_buffer_factory.h

Issue 1846253003: Revert of Refactor content/common/gpu into gpu/ipc/service (Closed) Base URL: https://chromium.googlesource.com/chromium/src.git@master
Patch Set: Created 4 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 | « gpu/ipc/service/gpu_config.h ('k') | gpu/ipc/service/gpu_memory_buffer_factory.cc » ('j') | no next file with comments »
Toggle Intra-line Diffs ('i') | Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
OLDNEW
(Empty)
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
3 // found in the LICENSE file.
4
5 #ifndef GPU_IPC_SERVICE_GPU_MEMORY_BUFFER_FACTORY_H_
6 #define GPU_IPC_SERVICE_GPU_MEMORY_BUFFER_FACTORY_H_
7
8 #include <vector>
9
10 #include "base/macros.h"
11 #include "base/memory/ref_counted.h"
12 #include "base/memory/scoped_ptr.h"
13 #include "gpu/gpu_export.h"
14 #include "gpu/ipc/common/surface_handle.h"
15 #include "ui/gfx/geometry/size.h"
16 #include "ui/gfx/gpu_memory_buffer.h"
17
18 namespace gpu {
19
20 class ImageFactory;
21
22 class GPU_EXPORT GpuMemoryBufferFactory {
23 public:
24 virtual ~GpuMemoryBufferFactory() {}
25
26 // Creates a new factory instance for native GPU memory buffers.
27 static scoped_ptr<GpuMemoryBufferFactory> CreateNativeType();
28
29 // Creates a new GPU memory buffer instance. A valid handle is returned on
30 // success. It can be called on any thread.
31 virtual gfx::GpuMemoryBufferHandle CreateGpuMemoryBuffer(
32 gfx::GpuMemoryBufferId id,
33 const gfx::Size& size,
34 gfx::BufferFormat format,
35 gfx::BufferUsage usage,
36 int client_id,
37 SurfaceHandle surface_handle) = 0;
38
39 // Creates a new GPU memory buffer instance from an existing handle. A valid
40 // handle is returned on success. It can be called on any thread.
41 virtual gfx::GpuMemoryBufferHandle CreateGpuMemoryBufferFromHandle(
42 const gfx::GpuMemoryBufferHandle& handle,
43 gfx::GpuMemoryBufferId id,
44 const gfx::Size& size,
45 gfx::BufferFormat format,
46 int client_id) = 0;
47
48 // Destroys GPU memory buffer identified by |id|.
49 // It can be called on any thread.
50 virtual void DestroyGpuMemoryBuffer(gfx::GpuMemoryBufferId id,
51 int client_id) = 0;
52
53 // Type-checking downcast routine.
54 virtual ImageFactory* AsImageFactory() = 0;
55
56 protected:
57 GpuMemoryBufferFactory() {}
58
59 private:
60 DISALLOW_COPY_AND_ASSIGN(GpuMemoryBufferFactory);
61 };
62
63 } // namespace gpu
64
65 #endif // GPU_IPC_SERVICE_GPU_MEMORY_BUFFER_FACTORY_H_
OLDNEW
« no previous file with comments | « gpu/ipc/service/gpu_config.h ('k') | gpu/ipc/service/gpu_memory_buffer_factory.cc » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698