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 |
(...skipping 31 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
42 virtual bool OnMessageReceived(const IPC::Message& message); | 42 virtual bool OnMessageReceived(const IPC::Message& message); |
43 virtual void OnChannelError(); | 43 virtual void OnChannelError(); |
44 | 44 |
45 int route_id() const { return route_id_; } | 45 int route_id() const { return route_id_; } |
46 | 46 |
47 // CommandBuffer implementation: | 47 // CommandBuffer implementation: |
48 virtual bool Initialize(int32 size); | 48 virtual bool Initialize(int32 size); |
49 virtual bool Initialize(base::SharedMemory* buffer, int32 size); | 49 virtual bool Initialize(base::SharedMemory* buffer, int32 size); |
50 virtual gpu::Buffer GetRingBuffer(); | 50 virtual gpu::Buffer GetRingBuffer(); |
51 virtual State GetState(); | 51 virtual State GetState(); |
| 52 virtual State GetLastState(); |
52 virtual void Flush(int32 put_offset); | 53 virtual void Flush(int32 put_offset); |
53 virtual State FlushSync(int32 put_offset, int32 last_known_get); | 54 virtual State FlushSync(int32 put_offset, int32 last_known_get); |
54 virtual void SetGetOffset(int32 get_offset); | 55 virtual void SetGetOffset(int32 get_offset); |
55 virtual int32 CreateTransferBuffer(size_t size, int32 id_request); | 56 virtual int32 CreateTransferBuffer(size_t size, int32 id_request); |
56 virtual int32 RegisterTransferBuffer(base::SharedMemory* shared_memory, | 57 virtual int32 RegisterTransferBuffer(base::SharedMemory* shared_memory, |
57 size_t size, | 58 size_t size, |
58 int32 id_request); | 59 int32 id_request); |
59 virtual void DestroyTransferBuffer(int32 id); | 60 virtual void DestroyTransferBuffer(int32 id); |
60 virtual gpu::Buffer GetTransferBuffer(int32 handle); | 61 virtual gpu::Buffer GetTransferBuffer(int32 handle); |
61 virtual void SetToken(int32 token); | 62 virtual void SetToken(int32 token); |
(...skipping 28 matching lines...) Expand all Loading... |
90 // notified of an error later. | 91 // notified of an error later. |
91 scoped_refptr<GpuVideoDecodeAcceleratorHost> CreateVideoDecoder( | 92 scoped_refptr<GpuVideoDecodeAcceleratorHost> CreateVideoDecoder( |
92 const std::vector<uint32>& configs, | 93 const std::vector<uint32>& configs, |
93 gpu::CommandBufferHelper* cmd_buffer_helper, | 94 gpu::CommandBufferHelper* cmd_buffer_helper, |
94 media::VideoDecodeAccelerator::Client* client); | 95 media::VideoDecodeAccelerator::Client* client); |
95 | 96 |
96 #if defined(OS_MACOSX) | 97 #if defined(OS_MACOSX) |
97 virtual void SetWindowSize(const gfx::Size& size); | 98 virtual void SetWindowSize(const gfx::Size& size); |
98 #endif | 99 #endif |
99 | 100 |
100 // Get the last state received from the service without synchronizing. | |
101 State GetLastState() { | |
102 return last_state_; | |
103 } | |
104 | |
105 private: | 101 private: |
106 | 102 |
107 // Send an IPC message over the GPU channel. This is private to fully | 103 // Send an IPC message over the GPU channel. This is private to fully |
108 // encapsulate the channel; all callers of this function must explicitly | 104 // encapsulate the channel; all callers of this function must explicitly |
109 // verify that the context has not been lost. | 105 // verify that the context has not been lost. |
110 bool Send(IPC::Message* msg); | 106 bool Send(IPC::Message* msg); |
111 | 107 |
112 // Message handlers: | 108 // Message handlers: |
113 void OnUpdateState(const gpu::CommandBuffer::State& state); | 109 void OnUpdateState(const gpu::CommandBuffer::State& state); |
114 void OnNotifyRepaint(); | 110 void OnNotifyRepaint(); |
(...skipping 22 matching lines...) Expand all Loading... |
137 | 133 |
138 scoped_ptr<Callback0::Type> swap_buffers_callback_; | 134 scoped_ptr<Callback0::Type> swap_buffers_callback_; |
139 scoped_ptr<Callback0::Type> channel_error_callback_; | 135 scoped_ptr<Callback0::Type> channel_error_callback_; |
140 | 136 |
141 DISALLOW_COPY_AND_ASSIGN(CommandBufferProxy); | 137 DISALLOW_COPY_AND_ASSIGN(CommandBufferProxy); |
142 }; | 138 }; |
143 | 139 |
144 #endif // ENABLE_GPU | 140 #endif // ENABLE_GPU |
145 | 141 |
146 #endif // CONTENT_RENDERER_GPU_COMMAND_BUFFER_PROXY_H_ | 142 #endif // CONTENT_RENDERER_GPU_COMMAND_BUFFER_PROXY_H_ |
OLD | NEW |