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