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_old.h" | 14 #include "base/callback_old.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 "content/renderer/gpu/gpu_video_decode_accelerator_host.h" | 17 #include "content/renderer/gpu/gpu_video_decode_accelerator_host.h" |
18 #include "gpu/command_buffer/common/constants.h" | |
19 #include "gpu/command_buffer/common/command_buffer.h" | 18 #include "gpu/command_buffer/common/command_buffer.h" |
20 #include "ipc/ipc_channel.h" | 19 #include "ipc/ipc_channel.h" |
21 #include "ipc/ipc_message.h" | 20 #include "ipc/ipc_message.h" |
22 | 21 |
23 namespace base { | 22 namespace base { |
24 class SharedMemory; | 23 class SharedMemory; |
25 } | 24 } |
26 | 25 |
27 namespace gfx { | 26 namespace gfx { |
28 class Size; | 27 class Size; |
(...skipping 29 matching lines...) Expand all Loading... |
58 virtual int32 RegisterTransferBuffer(base::SharedMemory* shared_memory, | 57 virtual int32 RegisterTransferBuffer(base::SharedMemory* shared_memory, |
59 size_t size, | 58 size_t size, |
60 int32 id_request); | 59 int32 id_request); |
61 virtual void DestroyTransferBuffer(int32 id); | 60 virtual void DestroyTransferBuffer(int32 id); |
62 virtual gpu::Buffer GetTransferBuffer(int32 handle); | 61 virtual gpu::Buffer GetTransferBuffer(int32 handle); |
63 virtual void SetToken(int32 token); | 62 virtual void SetToken(int32 token); |
64 virtual void SetParseError(gpu::error::Error error); | 63 virtual void SetParseError(gpu::error::Error error); |
65 virtual void SetContextLostReason(gpu::error::ContextLostReason reason); | 64 virtual void SetContextLostReason(gpu::error::ContextLostReason reason); |
66 virtual void OnSwapBuffers(); | 65 virtual void OnSwapBuffers(); |
67 | 66 |
68 bool MapExternalResource(gpu::resource_type::ResourceType resource_type, | |
69 uint32 resource_source_id, | |
70 CommandBufferProxy* source_command_buffer, | |
71 uint32 resource_dest_id); | |
72 | |
73 // Reparent a command buffer. TODO(apatrick): going forward, the notion of | 67 // Reparent a command buffer. TODO(apatrick): going forward, the notion of |
74 // the parent / child relationship between command buffers is going away in | 68 // the parent / child relationship between command buffers is going away in |
75 // favor of the notion of surfaces that can be drawn to in one command buffer | 69 // favor of the notion of surfaces that can be drawn to in one command buffer |
76 // and bound as a texture in any other. | 70 // and bound as a texture in any other. |
77 virtual bool SetParent(CommandBufferProxy* parent_command_buffer, | 71 virtual bool SetParent(CommandBufferProxy* parent_command_buffer, |
78 uint32 parent_texture_id); | 72 uint32 parent_texture_id); |
79 | 73 |
80 // Set a callback that will be invoked when the SwapBuffers call has been | 74 // Set a callback that will be invoked when the SwapBuffers call has been |
81 // issued. | 75 // issued. |
82 void SetSwapBuffersCallback(Callback0::Type* callback); | 76 void SetSwapBuffersCallback(Callback0::Type* callback); |
(...skipping 55 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
138 | 132 |
139 scoped_ptr<Callback0::Type> swap_buffers_callback_; | 133 scoped_ptr<Callback0::Type> swap_buffers_callback_; |
140 scoped_ptr<Callback0::Type> channel_error_callback_; | 134 scoped_ptr<Callback0::Type> channel_error_callback_; |
141 | 135 |
142 DISALLOW_COPY_AND_ASSIGN(CommandBufferProxy); | 136 DISALLOW_COPY_AND_ASSIGN(CommandBufferProxy); |
143 }; | 137 }; |
144 | 138 |
145 #endif // ENABLE_GPU | 139 #endif // ENABLE_GPU |
146 | 140 |
147 #endif // CONTENT_RENDERER_GPU_COMMAND_BUFFER_PROXY_H_ | 141 #endif // CONTENT_RENDERER_GPU_COMMAND_BUFFER_PROXY_H_ |
OLD | NEW |