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

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

Issue 1845563005: Refactor content/common/gpu into gpu/ipc/service (Closed) Base URL: https://chromium.googlesource.com/chromium/src.git@master
Patch Set: Drop ref to deleted content_tests_gypi_values.content_unittests_ozone_sources 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 | « content/common/gpu/gpu_config.h ('k') | content/common/gpu/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 CONTENT_COMMON_GPU_GPU_MEMORY_BUFFER_FACTORY_H_
6 #define CONTENT_COMMON_GPU_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 "content/common/content_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 class ImageFactory;
20 }
21
22 namespace content {
23
24 class CONTENT_EXPORT GpuMemoryBufferFactory {
25 public:
26 virtual ~GpuMemoryBufferFactory() {}
27
28 // Creates a new factory instance for native GPU memory buffers.
29 static scoped_ptr<GpuMemoryBufferFactory> CreateNativeType();
30
31 // Creates a new GPU memory buffer instance. A valid handle is returned on
32 // success. It can be called on any thread.
33 virtual gfx::GpuMemoryBufferHandle CreateGpuMemoryBuffer(
34 gfx::GpuMemoryBufferId id,
35 const gfx::Size& size,
36 gfx::BufferFormat format,
37 gfx::BufferUsage usage,
38 int client_id,
39 gpu::SurfaceHandle surface_handle) = 0;
40
41 // Creates a new GPU memory buffer instance from an existing handle. A valid
42 // handle is returned on success. It can be called on any thread.
43 virtual gfx::GpuMemoryBufferHandle CreateGpuMemoryBufferFromHandle(
44 const gfx::GpuMemoryBufferHandle& handle,
45 gfx::GpuMemoryBufferId id,
46 const gfx::Size& size,
47 gfx::BufferFormat format,
48 int client_id) = 0;
49
50 // Destroys GPU memory buffer identified by |id|.
51 // It can be called on any thread.
52 virtual void DestroyGpuMemoryBuffer(gfx::GpuMemoryBufferId id,
53 int client_id) = 0;
54
55 // Type-checking downcast routine.
56 virtual gpu::ImageFactory* AsImageFactory() = 0;
57
58 protected:
59 GpuMemoryBufferFactory() {}
60
61 private:
62 DISALLOW_COPY_AND_ASSIGN(GpuMemoryBufferFactory);
63 };
64
65 } // namespace content
66
67 #endif // CONTENT_COMMON_GPU_GPU_MEMORY_BUFFER_FACTORY_H_
OLDNEW
« no previous file with comments | « content/common/gpu/gpu_config.h ('k') | content/common/gpu/gpu_memory_buffer_factory.cc » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698