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 PPAPI_PROXY_COMMAND_BUFFER_PROXY_H_ | 5 #ifndef PPAPI_PROXY_COMMAND_BUFFER_PROXY_H_ |
6 #define PPAPI_PROXY_COMMAND_BUFFER_PROXY_H_ | 6 #define PPAPI_PROXY_COMMAND_BUFFER_PROXY_H_ |
7 | 7 |
8 #include "base/callback.h" | 8 #include "base/callback.h" |
9 #include "base/containers/hash_tables.h" | 9 #include "base/containers/hash_tables.h" |
10 #include "gpu/command_buffer/common/command_buffer.h" | 10 #include "gpu/command_buffer/common/command_buffer.h" |
(...skipping 19 matching lines...) Expand all Loading... |
30 | 30 |
31 // gpu::CommandBuffer implementation: | 31 // gpu::CommandBuffer implementation: |
32 virtual bool Initialize() OVERRIDE; | 32 virtual bool Initialize() OVERRIDE; |
33 virtual State GetState() OVERRIDE; | 33 virtual State GetState() OVERRIDE; |
34 virtual State GetLastState() OVERRIDE; | 34 virtual State GetLastState() OVERRIDE; |
35 virtual int32 GetLastToken() OVERRIDE; | 35 virtual int32 GetLastToken() OVERRIDE; |
36 virtual void Flush(int32 put_offset) OVERRIDE; | 36 virtual void Flush(int32 put_offset) OVERRIDE; |
37 virtual void WaitForTokenInRange(int32 start, int32 end) OVERRIDE; | 37 virtual void WaitForTokenInRange(int32 start, int32 end) OVERRIDE; |
38 virtual void WaitForGetOffsetInRange(int32 start, int32 end) OVERRIDE; | 38 virtual void WaitForGetOffsetInRange(int32 start, int32 end) OVERRIDE; |
39 virtual void SetGetBuffer(int32 transfer_buffer_id) OVERRIDE; | 39 virtual void SetGetBuffer(int32 transfer_buffer_id) OVERRIDE; |
40 virtual void SetGetOffset(int32 get_offset) OVERRIDE; | |
41 virtual scoped_refptr<gpu::Buffer> CreateTransferBuffer(size_t size, | 40 virtual scoped_refptr<gpu::Buffer> CreateTransferBuffer(size_t size, |
42 int32* id) OVERRIDE; | 41 int32* id) OVERRIDE; |
43 virtual void DestroyTransferBuffer(int32 id) OVERRIDE; | 42 virtual void DestroyTransferBuffer(int32 id) OVERRIDE; |
44 virtual scoped_refptr<gpu::Buffer> GetTransferBuffer(int32 id) OVERRIDE; | |
45 virtual void SetToken(int32 token) OVERRIDE; | |
46 virtual void SetParseError(gpu::error::Error error) OVERRIDE; | |
47 virtual void SetContextLostReason(gpu::error::ContextLostReason reason) | |
48 OVERRIDE; | |
49 | 43 |
50 // gpu::GpuControl implementation: | 44 // gpu::GpuControl implementation: |
51 virtual gpu::Capabilities GetCapabilities() OVERRIDE; | 45 virtual gpu::Capabilities GetCapabilities() OVERRIDE; |
52 virtual gfx::GpuMemoryBuffer* CreateGpuMemoryBuffer( | 46 virtual gfx::GpuMemoryBuffer* CreateGpuMemoryBuffer( |
53 size_t width, | 47 size_t width, |
54 size_t height, | 48 size_t height, |
55 unsigned internalformat, | 49 unsigned internalformat, |
56 int32* id) OVERRIDE; | 50 int32* id) OVERRIDE; |
57 virtual void DestroyGpuMemoryBuffer(int32 id) OVERRIDE; | 51 virtual void DestroyGpuMemoryBuffer(int32 id) OVERRIDE; |
58 virtual uint32 InsertSyncPoint() OVERRIDE; | 52 virtual uint32 InsertSyncPoint() OVERRIDE; |
59 virtual void SignalSyncPoint(uint32 sync_point, | 53 virtual void SignalSyncPoint(uint32 sync_point, |
60 const base::Closure& callback) OVERRIDE; | 54 const base::Closure& callback) OVERRIDE; |
61 virtual void SignalQuery(uint32 query, | 55 virtual void SignalQuery(uint32 query, |
62 const base::Closure& callback) OVERRIDE; | 56 const base::Closure& callback) OVERRIDE; |
63 virtual void SetSurfaceVisible(bool visible) OVERRIDE; | 57 virtual void SetSurfaceVisible(bool visible) OVERRIDE; |
64 virtual void SendManagedMemoryStats(const gpu::ManagedMemoryStats& stats) | 58 virtual void SendManagedMemoryStats(const gpu::ManagedMemoryStats& stats) |
65 OVERRIDE; | 59 OVERRIDE; |
66 virtual void Echo(const base::Closure& callback) OVERRIDE; | 60 virtual void Echo(const base::Closure& callback) OVERRIDE; |
67 virtual uint32 CreateStreamTexture(uint32 texture_id) OVERRIDE; | 61 virtual uint32 CreateStreamTexture(uint32 texture_id) OVERRIDE; |
68 | 62 |
69 private: | 63 private: |
70 bool Send(IPC::Message* msg); | 64 bool Send(IPC::Message* msg); |
71 void UpdateState(const gpu::CommandBuffer::State& state, bool success); | 65 void UpdateState(const gpu::CommandBuffer::State& state, bool success); |
72 | 66 |
73 typedef base::hash_map<int32, scoped_refptr<gpu::Buffer> > TransferBufferMap; | |
74 TransferBufferMap transfer_buffers_; | |
75 | |
76 State last_state_; | 67 State last_state_; |
77 | 68 |
78 HostResource resource_; | 69 HostResource resource_; |
79 ProxyChannel* channel_; | 70 ProxyChannel* channel_; |
80 | 71 |
81 base::Closure channel_error_callback_; | 72 base::Closure channel_error_callback_; |
82 | 73 |
83 DISALLOW_COPY_AND_ASSIGN(PpapiCommandBufferProxy); | 74 DISALLOW_COPY_AND_ASSIGN(PpapiCommandBufferProxy); |
84 }; | 75 }; |
85 | 76 |
86 } // namespace proxy | 77 } // namespace proxy |
87 } // namespace ppapi | 78 } // namespace ppapi |
88 | 79 |
89 #endif // PPAPI_PROXY_COMMAND_BUFFER_PROXY_H_ | 80 #endif // PPAPI_PROXY_COMMAND_BUFFER_PROXY_H_ |
OLD | NEW |