OLD | NEW |
1 // Copyright (c) 2012 The Chromium Authors. All rights reserved. | 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 | 2 // Use of this source code is governed by a BSD-style license that can be |
3 // found in the LICENSE file. | 3 // found in the LICENSE file. |
4 | 4 |
5 #ifndef GPU_IPC_COMMAND_BUFFER_PROXY_H_ | 5 #ifndef GPU_IPC_COMMAND_BUFFER_PROXY_H_ |
6 #define GPU_IPC_COMMAND_BUFFER_PROXY_H_ | 6 #define GPU_IPC_COMMAND_BUFFER_PROXY_H_ |
7 | 7 |
8 #include <string> | 8 #include <string> |
9 | 9 |
10 #include "base/callback.h" | 10 #include "base/callback.h" |
11 #include "gpu/command_buffer/common/command_buffer.h" | 11 #include "gpu/command_buffer/common/command_buffer.h" |
12 #include "gpu/command_buffer/common/command_buffer_shared.h" | 12 #include "gpu/command_buffer/common/command_buffer_shared.h" |
| 13 #include "gpu/command_buffer/common/mailbox.h" |
13 | 14 |
14 // Client side proxy that forwards messages synchronously to a | 15 // Client side proxy that forwards messages synchronously to a |
15 // CommandBufferStub. | 16 // CommandBufferStub. |
16 class GPU_EXPORT CommandBufferProxy : public gpu::CommandBuffer { | 17 class GPU_EXPORT CommandBufferProxy : public gpu::CommandBuffer { |
17 public: | 18 public: |
18 typedef base::Callback<void( | 19 typedef base::Callback<void( |
19 const std::string& msg, int id)> GpuConsoleMessageCallback; | 20 const std::string& msg, int id)> GpuConsoleMessageCallback; |
20 | 21 |
21 CommandBufferProxy() { } | 22 CommandBufferProxy() { } |
22 | 23 |
23 virtual ~CommandBufferProxy() { } | 24 virtual ~CommandBufferProxy() { } |
24 | 25 |
25 virtual int GetRouteID() const = 0; | 26 virtual int GetRouteID() const = 0; |
26 | 27 |
27 // Invoke the task when the channel has been flushed. Takes care of deleting | 28 // Invoke the task when the channel has been flushed. Takes care of deleting |
28 // the task whether the echo succeeds or not. | 29 // the task whether the echo succeeds or not. |
29 virtual bool Echo(const base::Closure& callback) = 0; | 30 virtual bool Echo(const base::Closure& callback) = 0; |
30 | 31 |
31 // Reparent a command buffer. TODO(apatrick): going forward, the notion of | 32 // For offscreen contexts, produces the front buffer into a newly created |
32 // the parent / child relationship between command buffers is going away in | 33 // mailbox. |
33 // favor of the notion of surfaces that can be drawn to in one command buffer | 34 virtual bool ProduceFrontBuffer(const gpu::Mailbox& mailbox) = 0; |
34 // and bound as a texture in any other. | |
35 virtual bool SetParent(CommandBufferProxy* parent_command_buffer, | |
36 uint32 parent_texture_id) = 0; | |
37 | 35 |
38 virtual void SetChannelErrorCallback(const base::Closure& callback) = 0; | 36 virtual void SetChannelErrorCallback(const base::Closure& callback) = 0; |
39 | 37 |
40 private: | 38 private: |
41 DISALLOW_COPY_AND_ASSIGN(CommandBufferProxy); | 39 DISALLOW_COPY_AND_ASSIGN(CommandBufferProxy); |
42 }; | 40 }; |
43 | 41 |
44 #endif // GPU_IPC_COMMAND_BUFFER_PROXY_H_ | 42 #endif // GPU_IPC_COMMAND_BUFFER_PROXY_H_ |
OLD | NEW |