summaryrefslogtreecommitdiffstats
path: root/gpu
diff options
context:
space:
mode:
authorfsamuel@chromium.org <fsamuel@chromium.org@0039d316-1c4b-4281-b951-d872f2087c98>2012-04-02 23:32:37 +0000
committerfsamuel@chromium.org <fsamuel@chromium.org@0039d316-1c4b-4281-b951-d872f2087c98>2012-04-02 23:32:37 +0000
commit9e5fffaf9c926e87ca84747984b70f20e5b4fced (patch)
tree715d85bf4fb14dec4656b39ae40ef8eb457c1573 /gpu
parentffc2b7ad2bb716f232b7d48fc88e840baf2f4afe (diff)
downloadchromium_src-9e5fffaf9c926e87ca84747984b70f20e5b4fced.zip
chromium_src-9e5fffaf9c926e87ca84747984b70f20e5b4fced.tar.gz
chromium_src-9e5fffaf9c926e87ca84747984b70f20e5b4fced.tar.bz2
PpapiCommandBufferProxy implements CommandBufferProxy.
That way once the refactoring of WebGraphicsContext3DCommandBufferImpl is complete, the guest renderers will be able to use the same class. BUG=120664 TEST=manually Review URL: http://codereview.chromium.org/9904005 git-svn-id: svn://svn.chromium.org/chrome/trunk/src@130252 0039d316-1c4b-4281-b951-d872f2087c98
Diffstat (limited to 'gpu')
-rw-r--r--gpu/gpu_ipc.gypi2
-rw-r--r--gpu/ipc/command_buffer_proxy.cc5
-rw-r--r--gpu/ipc/command_buffer_proxy.h65
3 files changed, 72 insertions, 0 deletions
diff --git a/gpu/gpu_ipc.gypi b/gpu/gpu_ipc.gypi
index 9e583d0..33845f23 100644
--- a/gpu/gpu_ipc.gypi
+++ b/gpu/gpu_ipc.gypi
@@ -11,6 +11,8 @@
'<(DEPTH)/third_party/khronos',
],
'sources': [
+ 'ipc/command_buffer_proxy.h',
+ 'ipc/command_buffer_proxy.cc',
'ipc/gpu_command_buffer_traits.cc',
'ipc/gpu_command_buffer_traits.h',
],
diff --git a/gpu/ipc/command_buffer_proxy.cc b/gpu/ipc/command_buffer_proxy.cc
new file mode 100644
index 0000000..7ed6b0b
--- /dev/null
+++ b/gpu/ipc/command_buffer_proxy.cc
@@ -0,0 +1,5 @@
+// Copyright (c) 2012 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/ipc/command_buffer_proxy.h"
diff --git a/gpu/ipc/command_buffer_proxy.h b/gpu/ipc/command_buffer_proxy.h
new file mode 100644
index 0000000..4f53fb0
--- /dev/null
+++ b/gpu/ipc/command_buffer_proxy.h
@@ -0,0 +1,65 @@
+// Copyright (c) 2012 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_IPC_COMMAND_BUFFER_PROXY_H_
+#define GPU_IPC_COMMAND_BUFFER_PROXY_H_
+#pragma once
+
+#include <string>
+
+#include "base/callback.h"
+#include "gpu/command_buffer/common/command_buffer.h"
+#include "gpu/command_buffer/common/command_buffer_shared.h"
+
+struct GpuMemoryAllocationForRenderer;
+
+// Client side proxy that forwards messages synchronously to a
+// CommandBufferStub.
+class GPU_EXPORT CommandBufferProxy : public gpu::CommandBuffer {
+ public:
+ typedef base::Callback<void(
+ const std::string& msg, int id)> GpuConsoleMessageCallback;
+
+ CommandBufferProxy() { }
+
+ virtual ~CommandBufferProxy() { }
+
+ virtual int GetRouteID() const = 0;
+
+ // Invoke the task when the channel has been flushed. Takes care of deleting
+ // the task whether the echo succeeds or not.
+ virtual bool Echo(const base::Closure& callback) = 0;
+
+ // Sends an IPC message with the new state of surface visibility.
+ virtual bool SetSurfaceVisible(bool visible) = 0;
+
+ virtual bool DiscardBackbuffer() = 0;
+ virtual bool EnsureBackbuffer() = 0;
+
+ // Register a callback to invoke whenever we recieve a new memory allocation.
+ virtual void SetMemoryAllocationChangedCallback(
+ const base::Callback<void(const GpuMemoryAllocationForRenderer&)>&
+ callback) = 0;
+
+ // Reparent a command buffer. TODO(apatrick): going forward, the notion of
+ // the parent / child relationship between command buffers is going away in
+ // favor of the notion of surfaces that can be drawn to in one command buffer
+ // and bound as a texture in any other.
+ virtual bool SetParent(CommandBufferProxy* parent_command_buffer,
+ uint32 parent_texture_id) = 0;
+
+ virtual void SetChannelErrorCallback(const base::Closure& callback) = 0;
+
+ // Set a task that will be invoked the next time the window becomes invalid
+ // and needs to be repainted. Takes ownership of task.
+ virtual void SetNotifyRepaintTask(const base::Closure& callback) = 0;
+
+ virtual void SetOnConsoleMessageCallback(
+ const GpuConsoleMessageCallback& callback) = 0;
+
+ private:
+ DISALLOW_COPY_AND_ASSIGN(CommandBufferProxy);
+};
+
+#endif // GPU_IPC_COMMAND_BUFFER_PROXY_H_