OLD | NEW |
1 // Copyright (c) 2011 The Chromium Authors. All rights reserved. | 1 // Copyright (c) 2011 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 CONTENT_RENDERER_GPU_COMMAND_BUFFER_PROXY_H_ | 5 #ifndef CONTENT_RENDERER_GPU_COMMAND_BUFFER_PROXY_H_ |
6 #define CONTENT_RENDERER_GPU_COMMAND_BUFFER_PROXY_H_ | 6 #define CONTENT_RENDERER_GPU_COMMAND_BUFFER_PROXY_H_ |
7 #pragma once | 7 #pragma once |
8 | 8 |
9 #if defined(ENABLE_GPU) | 9 #if defined(ENABLE_GPU) |
10 | 10 |
11 #include <map> | 11 #include <map> |
12 #include <queue> | 12 #include <queue> |
13 | 13 |
14 #include "base/callback.h" | 14 #include "base/callback.h" |
15 #include "base/memory/linked_ptr.h" | 15 #include "base/memory/linked_ptr.h" |
16 #include "base/memory/scoped_ptr.h" | 16 #include "base/memory/scoped_ptr.h" |
17 #include "base/memory/weak_ptr.h" | 17 #include "base/memory/weak_ptr.h" |
18 #include "content/renderer/gpu/gpu_video_decode_accelerator_host.h" | 18 #include "content/renderer/gpu/gpu_video_decode_accelerator_host.h" |
19 #include "gpu/command_buffer/common/command_buffer.h" | 19 #include "gpu/command_buffer/common/command_buffer.h" |
20 #include "ipc/ipc_channel.h" | 20 #include "ipc/ipc_channel.h" |
21 #include "ipc/ipc_message.h" | 21 #include "ipc/ipc_message.h" |
| 22 #include "ui/gfx/gl/gl_surface.h" |
22 | 23 |
23 class GpuChannelHost; | 24 class GpuChannelHost; |
24 struct GPUCommandBufferConsoleMessage; | 25 struct GPUCommandBufferConsoleMessage; |
25 | 26 |
26 namespace base { | 27 namespace base { |
27 class SharedMemory; | 28 class SharedMemory; |
28 } | 29 } |
29 | 30 |
30 // Client side proxy that forwards messages synchronously to a | 31 // Client side proxy that forwards messages synchronously to a |
31 // CommandBufferStub. | 32 // CommandBufferStub. |
(...skipping 26 matching lines...) Expand all Loading... |
58 virtual gpu::Buffer GetTransferBuffer(int32 handle) OVERRIDE; | 59 virtual gpu::Buffer GetTransferBuffer(int32 handle) OVERRIDE; |
59 virtual void SetToken(int32 token) OVERRIDE; | 60 virtual void SetToken(int32 token) OVERRIDE; |
60 virtual void SetParseError(gpu::error::Error error) OVERRIDE; | 61 virtual void SetParseError(gpu::error::Error error) OVERRIDE; |
61 virtual void SetContextLostReason( | 62 virtual void SetContextLostReason( |
62 gpu::error::ContextLostReason reason) OVERRIDE; | 63 gpu::error::ContextLostReason reason) OVERRIDE; |
63 | 64 |
64 // Invoke the task when the channel has been flushed. Takes care of deleting | 65 // Invoke the task when the channel has been flushed. Takes care of deleting |
65 // the task whether the echo succeeds or not. | 66 // the task whether the echo succeeds or not. |
66 bool Echo(const base::Closure& callback); | 67 bool Echo(const base::Closure& callback); |
67 | 68 |
68 // Sends an IPC message with the new state of surface visibility | 69 // Sends an IPC message with the new state of resource usage |
69 bool SetSurfaceVisible(bool visible); | 70 bool SetResourceUsage(gfx::GLSurface::ResourceUsage resourceUsage); |
70 | 71 |
71 // Reparent a command buffer. TODO(apatrick): going forward, the notion of | 72 // Reparent a command buffer. TODO(apatrick): going forward, the notion of |
72 // the parent / child relationship between command buffers is going away in | 73 // the parent / child relationship between command buffers is going away in |
73 // favor of the notion of surfaces that can be drawn to in one command buffer | 74 // favor of the notion of surfaces that can be drawn to in one command buffer |
74 // and bound as a texture in any other. | 75 // and bound as a texture in any other. |
75 virtual bool SetParent(CommandBufferProxy* parent_command_buffer, | 76 virtual bool SetParent(CommandBufferProxy* parent_command_buffer, |
76 uint32 parent_texture_id); | 77 uint32 parent_texture_id); |
77 | 78 |
78 void SetChannelErrorCallback(const base::Closure& callback); | 79 void SetChannelErrorCallback(const base::Closure& callback); |
79 | 80 |
(...skipping 48 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
128 base::Closure notify_repaint_task_; | 129 base::Closure notify_repaint_task_; |
129 | 130 |
130 base::Closure channel_error_callback_; | 131 base::Closure channel_error_callback_; |
131 | 132 |
132 DISALLOW_COPY_AND_ASSIGN(CommandBufferProxy); | 133 DISALLOW_COPY_AND_ASSIGN(CommandBufferProxy); |
133 }; | 134 }; |
134 | 135 |
135 #endif // ENABLE_GPU | 136 #endif // ENABLE_GPU |
136 | 137 |
137 #endif // CONTENT_RENDERER_GPU_COMMAND_BUFFER_PROXY_H_ | 138 #endif // CONTENT_RENDERER_GPU_COMMAND_BUFFER_PROXY_H_ |
OLD | NEW |