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 | 13 |
| 14 // TODO(fsamuel): this is a layering violation. http://crbug.com/157175 |
| 15 namespace content { |
14 struct GpuMemoryAllocationForRenderer; | 16 struct GpuMemoryAllocationForRenderer; |
| 17 } |
15 | 18 |
16 // Client side proxy that forwards messages synchronously to a | 19 // Client side proxy that forwards messages synchronously to a |
17 // CommandBufferStub. | 20 // CommandBufferStub. |
18 class GPU_EXPORT CommandBufferProxy : public gpu::CommandBuffer { | 21 class GPU_EXPORT CommandBufferProxy : public gpu::CommandBuffer { |
19 public: | 22 public: |
20 typedef base::Callback<void( | 23 typedef base::Callback<void( |
21 const std::string& msg, int id)> GpuConsoleMessageCallback; | 24 const std::string& msg, int id)> GpuConsoleMessageCallback; |
22 | 25 |
23 CommandBufferProxy() { } | 26 CommandBufferProxy() { } |
24 | 27 |
(...skipping 22 matching lines...) Expand all Loading... |
47 // it, or gets destroyed. | 50 // it, or gets destroyed. |
48 virtual void WaitSyncPoint(uint32) = 0; | 51 virtual void WaitSyncPoint(uint32) = 0; |
49 | 52 |
50 // Makes this command buffer invoke a task when a sync point is reached, or | 53 // Makes this command buffer invoke a task when a sync point is reached, or |
51 // the command buffer that inserted that sync point is destroyed. | 54 // the command buffer that inserted that sync point is destroyed. |
52 virtual bool SignalSyncPoint(uint32 sync_point, | 55 virtual bool SignalSyncPoint(uint32 sync_point, |
53 const base::Closure& callback) = 0; | 56 const base::Closure& callback) = 0; |
54 | 57 |
55 // Register a callback to invoke whenever we recieve a new memory allocation. | 58 // Register a callback to invoke whenever we recieve a new memory allocation. |
56 virtual void SetMemoryAllocationChangedCallback( | 59 virtual void SetMemoryAllocationChangedCallback( |
57 const base::Callback<void(const GpuMemoryAllocationForRenderer&)>& | 60 const base::Callback<void( |
58 callback) = 0; | 61 const content::GpuMemoryAllocationForRenderer&)>& callback) = 0; |
59 | 62 |
60 // Reparent a command buffer. TODO(apatrick): going forward, the notion of | 63 // Reparent a command buffer. TODO(apatrick): going forward, the notion of |
61 // the parent / child relationship between command buffers is going away in | 64 // the parent / child relationship between command buffers is going away in |
62 // favor of the notion of surfaces that can be drawn to in one command buffer | 65 // favor of the notion of surfaces that can be drawn to in one command buffer |
63 // and bound as a texture in any other. | 66 // and bound as a texture in any other. |
64 virtual bool SetParent(CommandBufferProxy* parent_command_buffer, | 67 virtual bool SetParent(CommandBufferProxy* parent_command_buffer, |
65 uint32 parent_texture_id) = 0; | 68 uint32 parent_texture_id) = 0; |
66 | 69 |
67 virtual void SetChannelErrorCallback(const base::Closure& callback) = 0; | 70 virtual void SetChannelErrorCallback(const base::Closure& callback) = 0; |
68 | 71 |
69 // Set a task that will be invoked the next time the window becomes invalid | 72 // Set a task that will be invoked the next time the window becomes invalid |
70 // and needs to be repainted. Takes ownership of task. | 73 // and needs to be repainted. Takes ownership of task. |
71 virtual void SetNotifyRepaintTask(const base::Closure& callback) = 0; | 74 virtual void SetNotifyRepaintTask(const base::Closure& callback) = 0; |
72 | 75 |
73 virtual void SetOnConsoleMessageCallback( | 76 virtual void SetOnConsoleMessageCallback( |
74 const GpuConsoleMessageCallback& callback) = 0; | 77 const GpuConsoleMessageCallback& callback) = 0; |
75 | 78 |
76 private: | 79 private: |
77 DISALLOW_COPY_AND_ASSIGN(CommandBufferProxy); | 80 DISALLOW_COPY_AND_ASSIGN(CommandBufferProxy); |
78 }; | 81 }; |
79 | 82 |
80 #endif // GPU_IPC_COMMAND_BUFFER_PROXY_H_ | 83 #endif // GPU_IPC_COMMAND_BUFFER_PROXY_H_ |
OLD | NEW |