summaryrefslogtreecommitdiffstats
path: root/gpu/command_buffer
diff options
context:
space:
mode:
authorreveman <reveman@chromium.org>2014-10-28 10:54:52 -0700
committerCommit bot <commit-bot@chromium.org>2014-10-28 17:55:17 +0000
commitf9a8a234ccc2a487f49efd060cade85bc8c56cda (patch)
tree4211cfbe1909c60a797ac2d267a41ce6326cb811 /gpu/command_buffer
parentdffd2c3baf37de25009a2abb6a92d66f32926b71 (diff)
downloadchromium_src-f9a8a234ccc2a487f49efd060cade85bc8c56cda.zip
chromium_src-f9a8a234ccc2a487f49efd060cade85bc8c56cda.tar.gz
chromium_src-f9a8a234ccc2a487f49efd060cade85bc8c56cda.tar.bz2
cc: Move GpuMemoryBufferManager interface to gpu namespace.
This is necessary for in-process command buffer to be able to use this interface. BUG=423533 Review URL: https://codereview.chromium.org/656263003 Cr-Commit-Position: refs/heads/master@{#301662}
Diffstat (limited to 'gpu/command_buffer')
-rw-r--r--gpu/command_buffer/client/BUILD.gn11
-rw-r--r--gpu/command_buffer/client/gpu_memory_buffer_manager.cc15
-rw-r--r--gpu/command_buffer/client/gpu_memory_buffer_manager.h36
3 files changed, 62 insertions, 0 deletions
diff --git a/gpu/command_buffer/client/BUILD.gn b/gpu/command_buffer/client/BUILD.gn
index 9b4749f..9d8db96 100644
--- a/gpu/command_buffer/client/BUILD.gn
+++ b/gpu/command_buffer/client/BUILD.gn
@@ -104,6 +104,16 @@ source_set("gles2_interface") {
]
}
+source_set("gpu_memory_buffer_manager") {
+ sources = [
+ "gpu_memory_buffer_manager.cc",
+ "gpu_memory_buffer_manager.h",
+ ]
+ deps = [
+ "//ui/gfx",
+ ]
+}
+
# Library emulates GLES2 using command_buffers.
component("gles2_implementation") {
sources = gles2_implementation_source_files
@@ -161,6 +171,7 @@ component("gl_in_process_context") {
deps = [
":gles2_implementation",
+ ":gpu_memory_buffer_manager",
"//gpu",
"//gpu/command_buffer/common:gles2_utils",
"//base",
diff --git a/gpu/command_buffer/client/gpu_memory_buffer_manager.cc b/gpu/command_buffer/client/gpu_memory_buffer_manager.cc
new file mode 100644
index 0000000..dbfa593
--- /dev/null
+++ b/gpu/command_buffer/client/gpu_memory_buffer_manager.cc
@@ -0,0 +1,15 @@
+// Copyright 2014 The Chromium Authors. All rights reserved.
+// Use of this source code is governed by a BSD-style license that can be
+// found in the LICENSE file.
+
+#include "gpu/command_buffer/client/gpu_memory_buffer_manager.h"
+
+namespace gpu {
+
+GpuMemoryBufferManager::GpuMemoryBufferManager() {
+}
+
+GpuMemoryBufferManager::~GpuMemoryBufferManager() {
+}
+
+} // namespace gpu
diff --git a/gpu/command_buffer/client/gpu_memory_buffer_manager.h b/gpu/command_buffer/client/gpu_memory_buffer_manager.h
new file mode 100644
index 0000000..cc422bf
--- /dev/null
+++ b/gpu/command_buffer/client/gpu_memory_buffer_manager.h
@@ -0,0 +1,36 @@
+// Copyright 2014 The Chromium Authors. All rights reserved.
+// Use of this source code is governed by a BSD-style license that can be
+// found in the LICENSE file.
+
+#ifndef GPU_COMMAND_BUFFER_CLIENT_GPU_MEMORY_BUFFER_MANAGER_H_
+#define GPU_COMMAND_BUFFER_CLIENT_GPU_MEMORY_BUFFER_MANAGER_H_
+
+#include "base/memory/scoped_ptr.h"
+#include "gpu/gpu_export.h"
+#include "ui/gfx/geometry/size.h"
+#include "ui/gfx/gpu_memory_buffer.h"
+
+namespace gpu {
+
+class GPU_EXPORT GpuMemoryBufferManager {
+ public:
+ GpuMemoryBufferManager();
+
+ // Allocates a GpuMemoryBuffer that can be shared with another process.
+ virtual scoped_ptr<gfx::GpuMemoryBuffer> AllocateGpuMemoryBuffer(
+ const gfx::Size& size,
+ gfx::GpuMemoryBuffer::Format format,
+ gfx::GpuMemoryBuffer::Usage usage) = 0;
+
+ // Returns a GpuMemoryBuffer instance given a ClientBuffer. Returns NULL on
+ // failure.
+ virtual gfx::GpuMemoryBuffer* GpuMemoryBufferFromClientBuffer(
+ ClientBuffer buffer) = 0;
+
+ protected:
+ virtual ~GpuMemoryBufferManager();
+};
+
+} // namespace gpu
+
+#endif // GPU_COMMAND_BUFFER_CLIENT_GPU_MEMORY_BUFFER_MANAGER_H_