OLD | NEW |
1 // Copyright (c) 2009 The Chromium Authors. All rights reserved. | 1 // Copyright (c) 2009 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 CHROME_RENDERER_COMMAND_BUFFER_PROXY_H_ | 5 #ifndef CHROME_RENDERER_COMMAND_BUFFER_PROXY_H_ |
6 #define CHROME_RENDERER_COMMAND_BUFFER_PROXY_H_ | 6 #define CHROME_RENDERER_COMMAND_BUFFER_PROXY_H_ |
7 | 7 |
8 #if defined(ENABLE_GPU) | 8 #if defined(ENABLE_GPU) |
9 | 9 |
10 #include <map> | 10 #include <map> |
(...skipping 15 matching lines...) Expand all Loading... |
26 public: | 26 public: |
27 explicit CommandBufferProxy( | 27 explicit CommandBufferProxy( |
28 PluginChannelHost* channel, | 28 PluginChannelHost* channel, |
29 int route_id); | 29 int route_id); |
30 virtual ~CommandBufferProxy(); | 30 virtual ~CommandBufferProxy(); |
31 | 31 |
32 // IPC::Message::Sender implementation: | 32 // IPC::Message::Sender implementation: |
33 virtual bool Send(IPC::Message* msg); | 33 virtual bool Send(IPC::Message* msg); |
34 | 34 |
35 // CommandBuffer implementation: | 35 // CommandBuffer implementation: |
36 virtual base::SharedMemory* Initialize(int32 size); | 36 virtual bool Initialize(int32 size); |
37 virtual base::SharedMemory* GetRingBuffer(); | 37 virtual gpu::Buffer GetRingBuffer(); |
38 virtual int32 GetSize(); | 38 virtual int32 GetSize(); |
39 virtual int32 SyncOffsets(int32 put_offset); | 39 virtual int32 SyncOffsets(int32 put_offset); |
40 virtual int32 GetGetOffset(); | 40 virtual int32 GetGetOffset(); |
41 virtual void SetGetOffset(int32 get_offset); | 41 virtual void SetGetOffset(int32 get_offset); |
42 virtual int32 GetPutOffset(); | 42 virtual int32 GetPutOffset(); |
43 virtual void SetPutOffsetChangeCallback(Callback0::Type* callback); | 43 virtual void SetPutOffsetChangeCallback(Callback0::Type* callback); |
44 virtual int32 CreateTransferBuffer(size_t size); | 44 virtual int32 CreateTransferBuffer(size_t size); |
45 virtual void DestroyTransferBuffer(int32 id); | 45 virtual void DestroyTransferBuffer(int32 id); |
46 virtual base::SharedMemory* GetTransferBuffer(int32 handle); | 46 virtual gpu::Buffer GetTransferBuffer(int32 handle); |
47 virtual int32 GetToken(); | 47 virtual int32 GetToken(); |
48 virtual void SetToken(int32 token); | 48 virtual void SetToken(int32 token); |
49 virtual int32 ResetParseError(); | 49 virtual int32 ResetParseError(); |
50 virtual void SetParseError(int32 parse_error); | 50 virtual void SetParseError(int32 parse_error); |
51 virtual bool GetErrorStatus(); | 51 virtual bool GetErrorStatus(); |
52 virtual void RaiseErrorStatus(); | 52 virtual void RaiseErrorStatus(); |
53 | 53 |
54 private: | 54 private: |
55 // As with the service, the client takes ownership of the ring buffer. | 55 // As with the service, the client takes ownership of the ring buffer. |
56 int32 size_; | 56 int32 size_; |
57 scoped_ptr<base::SharedMemory> ring_buffer_; | 57 scoped_ptr<base::SharedMemory> ring_buffer_; |
58 | 58 |
59 // Local cache of id to transfer buffer mapping. | 59 // Local cache of id to transfer buffer mapping. |
60 typedef std::map<int32, linked_ptr<base::SharedMemory> > TransferBufferMap; | 60 typedef std::map<int32, gpu::Buffer> TransferBufferMap; |
61 TransferBufferMap transfer_buffers_; | 61 TransferBufferMap transfer_buffers_; |
62 | 62 |
63 scoped_refptr<PluginChannelHost> channel_; | 63 scoped_refptr<PluginChannelHost> channel_; |
64 int route_id_; | 64 int route_id_; |
65 | 65 |
66 DISALLOW_COPY_AND_ASSIGN(CommandBufferProxy); | 66 DISALLOW_COPY_AND_ASSIGN(CommandBufferProxy); |
67 }; | 67 }; |
68 | 68 |
69 #endif // ENABLE_GPU | 69 #endif // ENABLE_GPU |
70 | 70 |
71 #endif // CHROME_RENDERER_COMMAND_BUFFER_PROXY_H_ | 71 #endif // CHROME_RENDERER_COMMAND_BUFFER_PROXY_H_ |
OLD | NEW |