summaryrefslogtreecommitdiffstats
path: root/ppapi/proxy
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 /ppapi/proxy
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 'ppapi/proxy')
-rw-r--r--ppapi/proxy/ppapi_command_buffer_proxy.cc60
-rw-r--r--ppapi/proxy/ppapi_command_buffer_proxy.h20
2 files changed, 73 insertions, 7 deletions
diff --git a/ppapi/proxy/ppapi_command_buffer_proxy.cc b/ppapi/proxy/ppapi_command_buffer_proxy.cc
index 07f7aae..24ce88a 100644
--- a/ppapi/proxy/ppapi_command_buffer_proxy.cc
+++ b/ppapi/proxy/ppapi_command_buffer_proxy.cc
@@ -29,11 +29,6 @@ PpapiCommandBufferProxy::~PpapiCommandBufferProxy() {
}
}
-void PpapiCommandBufferProxy::SetChannelErrorCallback(
- const base::Closure& callback) {
- channel_error_callback_ = callback;
-}
-
void PpapiCommandBufferProxy::ReportChannelError() {
if (!channel_error_callback_.is_null()) {
channel_error_callback_.Run();
@@ -41,6 +36,61 @@ void PpapiCommandBufferProxy::ReportChannelError() {
}
}
+int PpapiCommandBufferProxy::GetRouteID() const {
+ NOTIMPLEMENTED();
+ return 0;
+}
+
+bool PpapiCommandBufferProxy::Echo(const base::Closure& callback) {
+ NOTIMPLEMENTED();
+ return false;
+}
+
+bool PpapiCommandBufferProxy::SetSurfaceVisible(bool visible) {
+ NOTIMPLEMENTED();
+ return true;
+}
+
+bool PpapiCommandBufferProxy::DiscardBackbuffer() {
+ NOTIMPLEMENTED();
+ return true;
+}
+
+bool PpapiCommandBufferProxy::EnsureBackbuffer() {
+ NOTIMPLEMENTED();
+ return true;
+}
+
+void PpapiCommandBufferProxy::SetMemoryAllocationChangedCallback(
+ const base::Callback<void(const GpuMemoryAllocationForRenderer&)>&
+ callback) {
+ NOTIMPLEMENTED();
+}
+
+bool PpapiCommandBufferProxy::SetParent(
+ CommandBufferProxy* parent_command_buffer,
+ uint32 parent_texture_id) {
+ // TODO(fsamuel): Need a proper implementation of this to support offscreen
+ // contexts in the guest renderer (WebGL, canvas, etc).
+ NOTIMPLEMENTED();
+ return false;
+}
+
+void PpapiCommandBufferProxy::SetChannelErrorCallback(
+ const base::Closure& callback) {
+ channel_error_callback_ = callback;
+}
+
+void PpapiCommandBufferProxy::SetNotifyRepaintTask(
+ const base::Closure& callback) {
+ NOTIMPLEMENTED();
+}
+
+void PpapiCommandBufferProxy::SetOnConsoleMessageCallback(
+ const GpuConsoleMessageCallback& callback) {
+ NOTIMPLEMENTED();
+}
+
bool PpapiCommandBufferProxy::Initialize() {
return Send(new PpapiHostMsg_PPBGraphics3D_InitCommandBuffer(
ppapi::API_ID_PPB_GRAPHICS_3D, resource_));
diff --git a/ppapi/proxy/ppapi_command_buffer_proxy.h b/ppapi/proxy/ppapi_command_buffer_proxy.h
index 41b7ba9..389ca35 100644
--- a/ppapi/proxy/ppapi_command_buffer_proxy.h
+++ b/ppapi/proxy/ppapi_command_buffer_proxy.h
@@ -11,6 +11,7 @@
#include "gpu/command_buffer/common/command_buffer.h"
#include "ppapi/proxy/ppapi_proxy_export.h"
#include "ppapi/shared_impl/host_resource.h"
+#include "gpu/ipc/command_buffer_proxy.h"
namespace IPC {
class Message;
@@ -21,15 +22,30 @@ namespace proxy {
class ProxyChannel;
-class PPAPI_PROXY_EXPORT PpapiCommandBufferProxy : public gpu::CommandBuffer {
+class PPAPI_PROXY_EXPORT PpapiCommandBufferProxy : public CommandBufferProxy {
public:
PpapiCommandBufferProxy(const HostResource& resource,
ProxyChannel* channel);
virtual ~PpapiCommandBufferProxy();
- void SetChannelErrorCallback(const base::Closure& callback);
void ReportChannelError();
+ // CommandBufferProxy implementation:
+ virtual int GetRouteID() const OVERRIDE;
+ virtual bool Echo(const base::Closure& callback) OVERRIDE;
+ virtual bool SetSurfaceVisible(bool visible) OVERRIDE;
+ virtual bool DiscardBackbuffer() OVERRIDE;
+ virtual bool EnsureBackbuffer() OVERRIDE;
+ virtual void SetMemoryAllocationChangedCallback(
+ const base::Callback<void(const GpuMemoryAllocationForRenderer&)>&
+ callback) OVERRIDE;
+ virtual bool SetParent(CommandBufferProxy* parent_command_buffer,
+ uint32 parent_texture_id) OVERRIDE;
+ virtual void SetChannelErrorCallback(const base::Closure& callback) OVERRIDE;
+ virtual void SetNotifyRepaintTask(const base::Closure& callback) OVERRIDE;
+ virtual void SetOnConsoleMessageCallback(
+ const GpuConsoleMessageCallback& callback) OVERRIDE;
+
// gpu::CommandBuffer implementation:
virtual bool Initialize();
virtual State GetState();