1 // Copyright (c) 2012 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.
5 #ifndef GPU_IPC_COMMAND_BUFFER_PROXY_H_
6 #define GPU_IPC_COMMAND_BUFFER_PROXY_H_
10 #include "base/callback.h"
11 #include "gpu/command_buffer/common/command_buffer.h"
12 #include "gpu/command_buffer/common/command_buffer_shared.h"
13 #include "gpu/command_buffer/common/mailbox.h"
15 // Client side proxy that forwards messages synchronously to a
17 class GPU_EXPORT CommandBufferProxy
: public gpu::CommandBuffer
{
19 typedef base::Callback
<void(
20 const std::string
& msg
, int id
)> GpuConsoleMessageCallback
;
22 CommandBufferProxy() { }
24 virtual ~CommandBufferProxy() { }
26 virtual int GetRouteID() const = 0;
28 // Invoke the task when the channel has been flushed. Takes care of deleting
29 // the task whether the echo succeeds or not.
30 virtual bool Echo(const base::Closure
& callback
) = 0;
32 // For offscreen contexts, produces the front buffer into a newly created
34 virtual bool ProduceFrontBuffer(const gpu::Mailbox
& mailbox
) = 0;
36 virtual void SetChannelErrorCallback(const base::Closure
& callback
) = 0;
39 DISALLOW_COPY_AND_ASSIGN(CommandBufferProxy
);
42 #endif // GPU_IPC_COMMAND_BUFFER_PROXY_H_